mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-30 00:26:45 +00:00
lz.n: generate less code
This commit is contained in:
parent
5002e25c1d
commit
118f33f1fc
1 changed files with 15 additions and 9 deletions
|
@ -40,15 +40,21 @@
|
||||||
end
|
end
|
||||||
''
|
''
|
||||||
else null;
|
else null;
|
||||||
after = mkLuaInline ''
|
|
||||||
function()
|
after =
|
||||||
${
|
if spec.setupModule == null && spec.after == null
|
||||||
optionalString (spec.setupModule != null)
|
then null
|
||||||
"require(${toJSON spec.setupModule}).setup(${toLuaObject spec.setupOpts})"
|
else
|
||||||
}
|
mkLuaInline ''
|
||||||
${optionalString (spec.after != null) spec.after}
|
function()
|
||||||
end
|
${
|
||||||
'';
|
optionalString (spec.setupModule != null)
|
||||||
|
"require(${toJSON spec.setupModule}).setup(${toLuaObject spec.setupOpts})"
|
||||||
|
}
|
||||||
|
${optionalString (spec.after != null) spec.after}
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
|
||||||
keys =
|
keys =
|
||||||
if typeOf spec.keys == "list" && length spec.keys > 0 && typeOf (head spec.keys) == "set"
|
if typeOf spec.keys == "list" && length spec.keys > 0 && typeOf (head spec.keys) == "set"
|
||||||
then map toLuzLznKeySpec spec.keys
|
then map toLuzLznKeySpec spec.keys
|
||||||
|
|
Loading…
Reference in a new issue