From 0c7c06beabc5a2ef4f89923cc8cf59331e2c32cf Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 26 May 2018 15:58:32 -0700 Subject: Moving back to capturing tables in LPEG and everything is a Source, not string. --- nomsu_tree.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'nomsu_tree.lua') diff --git a/nomsu_tree.lua b/nomsu_tree.lua index ccbc34a..5b7a463 100644 --- a/nomsu_tree.lua +++ b/nomsu_tree.lua @@ -7,10 +7,10 @@ do local _obj_0 = table insert, remove, concat = _obj_0.insert, _obj_0.remove, _obj_0.concat end -local Lua, Nomsu, Location +local Lua, Nomsu, Source do local _obj_0 = require("code_obj") - Lua, Nomsu, Location = _obj_0.Lua, _obj_0.Nomsu, _obj_0.Location + Lua, Nomsu, Source = _obj_0.Lua, _obj_0.Nomsu, _obj_0.Source end local MAX_LINE = 80 local Types = { } @@ -27,6 +27,9 @@ Tree = function(name, kind, methods) methods.name = name methods.__new = function(self, value, source) assert(source) + if type(source) == 'string' then + source = Source:from_string(source) + end return value, source end methods.is_multi = is_multi -- cgit v1.2.3