From 8ca7749b5509a40256195563fa52d3ede4bd1a34 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 16 Jan 2019 16:31:49 -0800 Subject: Better error messaging (using pretty_error in more places) --- syntax_tree.moon | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'syntax_tree.moon') diff --git a/syntax_tree.moon b/syntax_tree.moon index 6347be8..b8c0b9d 100644 --- a/syntax_tree.moon +++ b/syntax_tree.moon @@ -14,8 +14,6 @@ as_lua = => return @as_lua! if @as_lua error("Not supported: #{@}") ---types = {"Number", "Var", "Block", "EscapedNomsu", "Text", "List", "Dict", "DictEntry", --- "IndexChain", "Action", "FileChunks", "Error", "Comment"} class SyntaxTree __tostring: => bits = [type(b) == 'string' and b\as_lua! or tostring(b) for b in *@] @@ -45,7 +43,7 @@ class SyntaxTree __mode: "k" }) get_source_file: => @@source_code_for_tree[@] - get_source_code: => @@source_code_for_tree[@]\sub(@source.start, @source.stop) + get_source_code: => @@source_code_for_tree[@]\sub(@source.start, @source.stop-1) map: (fn)=> replacement = fn(@) if replacement == false then return nil -- cgit v1.2.3