aboutsummaryrefslogtreecommitdiff
path: root/nomsu_tree.moon
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-04-19 17:27:42 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-04-19 17:28:02 -0700
commitecb4341bdc62dac64b487ac6c67882da51e5205e (patch)
treea16390f35308ba776804686f9e114dd54261f7fe /nomsu_tree.moon
parentda33269c307c8a045e548cb1df2a3281a7a0f99e (diff)
Switched last char check to first char so foo[x] doesn't get mixed up
with [[foo]].
Diffstat (limited to 'nomsu_tree.moon')
-rw-r--r--nomsu_tree.moon4
1 files 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