@@ -2335,18 +2335,10 @@ function fix_macro_name_kind!(ps::ParseState, macro_name_position, name_kind=not
2335
2335
if k == K " var"
2336
2336
macro_name_position = first_child_position (ps, macro_name_position)
2337
2337
k = peek_behind (ps, macro_name_position). kind
2338
- elseif k == K " )"
2339
- # @(A) x => (macrocall @A x)
2340
- # TODO : Clean this up when K"parens" is implemented
2341
- while true
2342
- macro_name_position = ParseStreamPosition (macro_name_position. token_index- 1 ,
2343
- macro_name_position. range_index- 1 )
2344
- b = peek_behind (ps, macro_name_position)
2345
- k = b. kind
2346
- if ! has_flags (b. flags, TRIVIA_FLAG)
2347
- break
2348
- end
2349
- end
2338
+ elseif k == K " parens"
2339
+ # @(A) x ==> (macrocall (parens @A) x)
2340
+ macro_name_position = first_child_position (ps, macro_name_position)
2341
+ k = peek_behind (ps, macro_name_position). kind
2350
2342
elseif k == K " error"
2351
2343
# Error already reported in parse_macro_name
2352
2344
return
@@ -2373,12 +2365,12 @@ function parse_macro_name(ps::ParseState)
2373
2365
# @var"#" x ==> (macrocall (var #) @$ x)
2374
2366
bump_disallowed_space (ps)
2375
2367
mark = position (ps)
2376
- k = peek (ps)
2377
2368
parse_atom (ps, false )
2378
- if k == K " ("
2369
+ kb = peek_behind (ps, position (ps)). kind
2370
+ if kb == K " parens"
2379
2371
emit_diagnostic (ps, mark,
2380
2372
warning= " parenthesizing macro names is unnecessary" )
2381
- elseif ! (peek_behind (ps) . kind in KSet " Identifier var" )
2373
+ elseif ! (kb in KSet " Identifier var" )
2382
2374
# @[x] y z ==> (macrocall (error (vect x)) y z)
2383
2375
emit (ps, mark, K " error" , error= " invalid macro name" )
2384
2376
end
0 commit comments