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
Disallow whitespace as the first character of a reserved-body in a reserved-statement.
In the 'reserved-statement' nonterminal, there is an ambiguity if there is more
than one whitespace character between the 'reserved-keyword' and the first
non-whitespace character of the 'reserved-body', because these whitespace
characters can be seen as part of the 's' nonterminal or as part of the
'reserved-body' nonterminal.
According to the principles explained in #725 and the proposed resolution of
character; rather, such a whitespace character is meant to be interpreted
as part of the preceding 's' nonterminal.
Test case:
```
.regex /foo/{xyz}{{hello}}
```
This patch removes this ambiguity, by disallowing whitespace as the first
character of a 'reserved-body' in a reserved-statement.
It thus fixes the first part of #721.
Details:
- Other occurrences of 'resolved-body' (after a 'reserved-annotation' or
'private-use-annotation') are not affected.
- A new nonterminal 'resolved-body-part' is introduced, referenced twice.
- A new nonterminal 'reserved-body-trimmed' is introduced, referenced once.
Its purpose is to clarify that the two parts ('reserved-body-part' and
'reserved-body') belong together.
0 commit comments