aboutsummaryrefslogtreecommitdiff
path: root/nomsu_tree.moon
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-05-26 15:58:32 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-05-26 15:59:03 -0700
commit0c7c06beabc5a2ef4f89923cc8cf59331e2c32cf (patch)
treedd7cd63e52dc4d2c3bf33b9adf7eda87997f76aa /nomsu_tree.moon
parent8cb2788e0dc514e6d6436a7a03e87e414327ec94 (diff)
Moving back to capturing tables in LPEG and everything is a Source, not
string.
Diffstat (limited to 'nomsu_tree.moon')
-rw-r--r--nomsu_tree.moon4
1 files changed, 3 insertions, 1 deletions
diff --git a/nomsu_tree.moon b/nomsu_tree.moon
index ac82cc0..2d30486 100644
--- a/nomsu_tree.moon
+++ b/nomsu_tree.moon
@@ -4,7 +4,7 @@ utils = require 'utils'
{:repr, :stringify, :min, :max, :equivalent, :set, :is_list, :sum} = utils
immutable = require 'immutable'
{:insert, :remove, :concat} = table
-{:Lua, :Nomsu, :Location} = require "code_obj"
+{:Lua, :Nomsu, :Source} = require "code_obj"
MAX_LINE = 80 -- For beautification purposes, try not to make lines much longer than this value
@@ -22,6 +22,8 @@ Tree = (name, kind, methods)->
.name = name
.__new = (value, source)=>
assert source
+ if type(source) == 'string'
+ source = Source\from_string(source)
return value, source
.is_multi = is_multi
.map = (fn)=>