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.moon | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'nomsu_tree.moon') 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)=> -- cgit v1.2.3