From ecb4341bdc62dac64b487ac6c67882da51e5205e Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 19 Apr 2018 17:27:42 -0700 Subject: Switched last char check to first char so foo[x] doesn't get mixed up with [[foo]]. --- nomsu_tree.moon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nomsu_tree.moon b/nomsu_tree.moon index 1c41906..c3f33bc 100644 --- a/nomsu_tree.moon +++ b/nomsu_tree.moon @@ -236,8 +236,8 @@ Tree "IndexChain", unless lua.is_value line, src = @value[1].source\get_line!, @value[1].source\get_text! error "#{line}: Cannot index #{colored.yellow src}, since it's not an expression.", 0 - last_char = tostring(lua)\sub(-1,-1) - if last_char == "}" or last_char == '"' or last_char == "]" + first_char = tostring(lua)\sub(1,1) + if first_char == "{" or first_char == '"' or first_char == "[" lua\parenthesize! for i=2,#@value -- cgit v1.2.3