diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-01-16 16:31:49 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-01-16 16:32:02 -0800 |
| commit | 8ca7749b5509a40256195563fa52d3ede4bd1a34 (patch) | |
| tree | a3e597668b6a53048e440d9630b48f3a2efb3926 /syntax_tree.moon | |
| parent | 25e1ccc025e27d5ef7f1cc23e82e4836aa5a07f4 (diff) | |
Better error messaging (using pretty_error in more places)
Diffstat (limited to 'syntax_tree.moon')
| -rw-r--r-- | syntax_tree.moon | 4 |
1 files changed, 1 insertions, 3 deletions
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 |
