You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sigils record their opening and closing delimiters so that the delimiters themselves could be nested in the sigil body. Sigils inside macros are no exception:
```crystal
macro foo
%w(four (five) six) # okay, second element is "(five)"
end
```
However, it turns out the lexer uses the sigil name itself as the start delimiter, instead of its next character. This leads to some rather strange behavior:
```crystal
# okay, second `(` does not start a nested region
# errors on macro expansion instead
macro foo
%w(four (five) %w(six)
end
```
```crystal
# error, `w` inside `two` starts a nested region but only one `)` found
macro foo
%w(one two three)
end
```
```crystal
# okay, every `w` is "matched" by a closing `)`
# errors on expansion
macro foo
%w(www))))
end
```
This PR ensures the correct start delimiters are used.
0 commit comments