diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-05-26 15:58:32 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-05-26 15:59:03 -0700 |
| commit | 0c7c06beabc5a2ef4f89923cc8cf59331e2c32cf (patch) | |
| tree | dd7cd63e52dc4d2c3bf33b9adf7eda87997f76aa /nomsu_tree.lua | |
| parent | 8cb2788e0dc514e6d6436a7a03e87e414327ec94 (diff) | |
Moving back to capturing tables in LPEG and everything is a Source, not
string.
Diffstat (limited to 'nomsu_tree.lua')
| -rw-r--r-- | nomsu_tree.lua | 7 |
1 files changed, 5 insertions, 2 deletions
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 |
