File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -197,16 +197,18 @@ local pattern = re.compile([[
197197 (ws 'else' ws {:else: rstatement :})?
198198 |}
199199
200+ function_call_first <-
201+ variable ws
202+ ({:has_self: ':' ws {name / r} :} ws)?
203+ function_call_name <-
204+ (& ('.' variable / ':'))
205+ '.'? ws variable? ws
206+ ({:has_self: ':' ws {name / r} :} ws)?
200207 function_call <- {| {:type: '' -> 'function_call' :}
201- ((& '@') {:is_method: '' -> true :})? (
202- (variable / literal) ({:has_self: ':' {name / r} :} ws
203- {:index_class: ws '<' ws {expression} ws '>' :}? )?
204- ) ws '(' ws function_call_body? ws ')'
208+ ((& '@') {:is_self: '' -> true :})? -- the @ at the beginning
209+ {| function_call_first ws '(' ws function_args? ws ')' ws |} -- first call
210+ {| (function_call_name ws '(' ws function_args? ws ')' ws) |}* -- chained
205211 |}
206- function_call_body <- {:generator: {|
207- expression_list ws 'for' ws (variable_list / r) ws 'in' ws expression /
208- variable_list ws 'in' ws expression
209- |} :} / function_args
210212 function_args <- expression_list?
211213
212214 assignment <- {| {:type: '' -> 'assignment' :}
You can’t perform that action at this time.
0 commit comments