-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Open
Copy link
Labels
kind:bugA bug in the code. Does not apply to documentation, specs, etc.A bug in the code. Does not apply to documentation, specs, etc.topic:compiler:parser
Description
f(foo x: 123)
below reports the incorrect end column number, which coincides with the )
of the outer macro call:
macro f(x)
{% p x.end_column_number %}
end
f(foo()) # => 7
f(foo) # => 5
f(foo(123)) # => 10
f(foo 123) # => 9
f(foo(x: 123)) # => 13
f(foo x: 123) # => 13
f(foo(x: 123, &.bar)) # => 20
f(foo x: 123, &.bar) # => 19
If f
itself has no parentheses, the end location advances to one character before the next node:
macro f(x)
{% p [x.end_line_number, x.end_column_number] %}
end
f foo(x: 123) # => [5, 13]
f foo x: 123 # => [8, 0]
f foo(x: 123, &.bar) # => [8, 20]
f foo x: 123, &.bar # => [9, 19]
Metadata
Metadata
Assignees
Labels
kind:bugA bug in the code. Does not apply to documentation, specs, etc.A bug in the code. Does not apply to documentation, specs, etc.topic:compiler:parser