summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2014-08-21 15:16:59 +0100
committerDaniel Kolesa <d.kolesa@samsung.com>2014-08-21 15:17:19 +0100
commitefa40a5bb2b553fd4dd0a49237ada5ee2143fafd (patch)
treedea2bf631d8dede4c00388bfe94819763b96993a /src
parent41fab84f83044303af0fb579e6188cfd25ba4461 (diff)
elua: first namespace is root module name, remove -M
Diffstat (limited to 'src')
-rw-r--r--src/bin/elua/apps/lualian.lua3
-rw-r--r--src/bin/elua/modules/lualian.lua18
2 files changed, 7 insertions, 14 deletions
diff --git a/src/bin/elua/apps/lualian.lua b/src/bin/elua/apps/lualian.lua
index ea1743287d..d32ec27a7a 100644
--- a/src/bin/elua/apps/lualian.lua
+++ b/src/bin/elua/apps/lualian.lua
@@ -18,7 +18,7 @@ local gen_file = function(opts, i, fname)
18 else 18 else
19 printv(" Output file: printing to stdout...") 19 printv(" Output file: printing to stdout...")
20 end 20 end
21 lualian.generate(fname, opts["M"], opts["L"], fstream) 21 lualian.generate(fname, opts["L"], fstream)
22end 22end
23 23
24getopt.parse { 24getopt.parse {
@@ -38,7 +38,6 @@ getopt.parse {
38 list = {} 38 list = {}
39 }, 39 },
40 { "L", "library", true, help = "Specify a C library name." }, 40 { "L", "library", true, help = "Specify a C library name." },
41 { "M", "module", true, help = "Specify a module name." },
42 { "o", "output", true, help = "Specify output file name(s), by " 41 { "o", "output", true, help = "Specify output file name(s), by "
43 .. "default goes to stdout.", 42 .. "default goes to stdout.",
44 list = {} 43 list = {}
diff --git a/src/bin/elua/modules/lualian.lua b/src/bin/elua/modules/lualian.lua
index ed6913311c..86cc9abdcf 100644
--- a/src/bin/elua/modules/lualian.lua
+++ b/src/bin/elua/modules/lualian.lua
@@ -535,10 +535,9 @@ local Parent = eo.class_get("%s")
535} 535}
536 536
537local File = Node:clone { 537local File = Node:clone {
538 __ctor = function(self, fname, klass, modname, libname, ch) 538 __ctor = function(self, fname, klass, libname, ch)
539 self.fname = fname:match(".+/(.+)") or fname 539 self.fname = fname:match(".+/(.+)") or fname
540 self.klass = klass 540 self.klass = klass
541 self.modname = (modname and #modname > 0) and modname or nil
542 self.libname = libname 541 self.libname = libname
543 self.children = ch 542 self.children = ch
544 end, 543 end,
@@ -548,12 +547,8 @@ local File = Node:clone {
548 dom:log(log.level.INFO, " Class : " 547 dom:log(log.level.INFO, " Class : "
549 .. self.klass:full_name_get()) 548 .. self.klass:full_name_get())
550 549
551 local modn = self.modname 550 local modn = ("require(\"%s\")"):format(self.klass:namespaces_get()()
552 if modn then 551 :lower())
553 modn = ("require(\"%s\")"):format(modn)
554 else
555 modn = "{}"
556 end
557 552
558 s:write(([[ 553 s:write(([[
559-- EFL LuaJIT bindings: %s (class %s) 554-- EFL LuaJIT bindings: %s (class %s)
@@ -640,7 +635,7 @@ local gen_contents = function(klass)
640 return cnt, evs 635 return cnt, evs
641end 636end
642 637
643local gen_mixin = function(klass) 638local gen_mixin = function(kliass)
644 return Mixin(klass, gen_contents(klass)) 639 return Mixin(klass, gen_contents(klass))
645end 640end
646 641
@@ -679,7 +674,7 @@ M.system_directory_scan = function()
679 return eolian.system_directory_scan() 674 return eolian.system_directory_scan()
680end 675end
681 676
682M.generate = function(fname, modname, libname, fstream) 677M.generate = function(fname, libname, fstream)
683 if not eolian.eo_file_parse(fname) then 678 if not eolian.eo_file_parse(fname) then
684 error("Failed parsing file: " .. fname) 679 error("Failed parsing file: " .. fname)
685 end 680 end
@@ -695,8 +690,7 @@ M.generate = function(fname, modname, libname, fstream)
695 else 690 else
696 error(klass:full_name_get() .. ": unknown type") 691 error(klass:full_name_get() .. ": unknown type")
697 end 692 end
698 File(fname, klass, modname, libname, { cl }) 693 File(fname, klass, libname, { cl }):generate(fstream or io.stdout)
699 :generate(fstream or io.stdout)
700end 694end
701 695
702return M 696return M