@@ -132,7 +132,7 @@ function _to_expr(node::SyntaxNode; iteration_spec=false, need_linenodes=true,
132132 ((headsym == :call || headsym == :dotcall ) && is_prefix_call (node)) ||
133133 headsym == :ref
134134 eq_to_kw_all = headsym == :parameters && ! map_kw_in_params
135- in_vbr = headsym == :vect || headsym == :braces || headsym == :ref
135+ in_vcbr = headsym == :vect || headsym == :curly || headsym == :braces || headsym == :ref
136136 if insert_linenums && isempty (node_args)
137137 push! (args, source_location (LineNumberNode, node. source, node. position))
138138 else
@@ -144,7 +144,7 @@ function _to_expr(node::SyntaxNode; iteration_spec=false, need_linenodes=true,
144144 eq_to_kw = eq_to_kw_in_call && i > 1 || eq_to_kw_all
145145 args[insert_linenums ? 2 * i : i] =
146146 _to_expr (n, eq_to_kw= eq_to_kw,
147- map_kw_in_params= in_vbr )
147+ map_kw_in_params= in_vcbr )
148148 end
149149 end
150150 end
@@ -157,7 +157,7 @@ function _to_expr(node::SyntaxNode; iteration_spec=false, need_linenodes=true,
157157 end
158158 reorder_parameters! (args, 2 )
159159 insert! (args, 2 , loc)
160- elseif headsym in (:dotcall , :call , :ref )
160+ elseif headsym in (:dotcall , :call )
161161 # Julia's standard `Expr` ASTs have children stored in a canonical
162162 # order which is often not always source order. We permute the children
163163 # here as necessary to get the canonical order.
@@ -180,15 +180,18 @@ function _to_expr(node::SyntaxNode; iteration_spec=false, need_linenodes=true,
180180 args[1 ] = Symbol (" ." , args[1 ])
181181 end
182182 end
183+ elseif headsym in (:ref , :curly )
184+ # Move parameters blocks to args[2]
185+ reorder_parameters! (args, 2 )
186+ elseif headsym in (:tuple , :vect , :braces )
187+ # Move parameters blocks to args[1]
188+ reorder_parameters! (args, 1 )
183189 elseif headsym === :comparison
184190 for i in 1 : length (args)
185191 if Meta. isexpr (args[i], :., 1 )
186192 args[i] = Symbol (" ." ,args[i]. args[1 ])
187193 end
188194 end
189- elseif headsym in (:tuple , :vect , :braces )
190- # Move parameters blocks to args[1]
191- reorder_parameters! (args, 1 )
192195 elseif headsym === :where
193196 reorder_parameters! (args, 2 )
194197 elseif headsym in (:try , :try_finally_catch )
0 commit comments