This commit is contained in:
Bruce Hill 2017-12-15 15:30:05 -08:00
parent 340714635a
commit 3c303018bb
3 changed files with 8 additions and 2 deletions

View File

@ -72,6 +72,10 @@ rule [%tree as value] =:
=lua "nomsu:tree_to_value(\(%tree), vars)"
compile [repr %obj] to:
"nomsu:repr(\(%obj as lua))"
compile [indented %obj] to:
"nomsu:indent(\(%obj as lua))"
compile [dedented %obj] to:
"nomsu:dedent(\(%obj as lua))"
compile [type %obj, type of %obj] to:
"type(\(%obj as lua))"

View File

@ -353,8 +353,9 @@ do
scope = nil
end
if after == nil then
after = 0
after = nil
end
after = after or (self.core_defs or 0)
scope = scope or self.defs
local defs_by_num = { }
for stub, def in pairs(scope) do

View File

@ -277,7 +277,8 @@ class NomsuCompiler
if not ok then @error(ret1)
return ret1, ret2
serialize_defs: (scope=nil, after=0)=>
serialize_defs: (scope=nil, after=nil)=>
after or= @core_defs or 0
scope or= @defs
defs_by_num = {}
for stub, def in pairs(scope)