File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -165,12 +165,12 @@ local function flatten_or_mark(name)
165165end
166166
167167-- makes sure the last item in a chain is an index
168- local _assignable = { index = true , dot = true , slice = true }
168+ local _chain_assignable = { index = true , dot = true , slice = true }
169169
170170local function is_assignable (node )
171171 local t = ntype (node )
172- return t == " self" or t == " value" or
173- t == " chain" and _assignable [ntype (node [# node ])]
172+ return t == " self" or t == " value" or t == " self_class " or
173+ t == " chain" and _chain_assignable [ntype (node [# node ])]
174174end
175175
176176local function check_assignable (str , pos , value )
@@ -188,7 +188,6 @@ local function format_assign(lhs_exps, assign)
188188
189189 for _ , assign_exp in ipairs (lhs_exps ) do
190190 if not is_assignable (assign_exp ) then
191- print (util .dump (assign_exp ))
192191 error {assign_exp , " left hand expression is not assignable" }
193192 end
194193 end
Original file line number Diff line number Diff line change @@ -142,6 +142,9 @@ y /= 100
142142m %= 2
143143hello ..= " world"
144144
145+ @@something += 10
146+ @something += 10
147+
145148x = 0
146149( if ntype( v) == " fndef" then x += 1 ) for v in * values
147150
Original file line number Diff line number Diff line change @@ -149,6 +149,8 @@ y = y * 2
149149y = y / 100
150150local m = m % 2
151151local hello = hello .. " world"
152+ self .__class .something = self .__class .something + 10
153+ self .something = self .something + 10
152154x = 0
153155local _list_0 = values
154156for _index_0 = 1 , # _list_0 do
You can’t perform that action at this time.
0 commit comments