lz.n: generate less code

This commit is contained in:
Ching Pei Yang 2024-08-03 19:48:13 +02:00
parent e086dc02fe
commit c7df5c97f3

View file

@ -40,7 +40,12 @@
end
''
else null;
after = mkLuaInline ''
after =
if spec.setupModule == null && spec.after == null
then null
else
mkLuaInline ''
function()
${
optionalString (spec.setupModule != null)
@ -49,6 +54,7 @@
${optionalString (spec.after != null) spec.after}
end
'';
keys =
if typeOf spec.keys == "list" && length spec.keys > 0 && typeOf (head spec.keys) == "set"
then map toLuzLznKeySpec spec.keys