Commit e418a4e
committed
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.1 parent afc7ff8 commit e418a4e
2 files changed
+8
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
70 | | - | |
| 71 | + | |
| 72 | + | |
71 | 73 | | |
72 | 74 | | |
73 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
| 225 | + | |
226 | 226 | | |
| 227 | + | |
227 | 228 | | |
228 | 229 | | |
229 | 230 | | |
| |||
655 | 656 | | |
656 | 657 | | |
657 | 658 | | |
658 | | - | |
| 659 | + | |
| 660 | + | |
659 | 661 | | |
660 | 662 | | |
661 | 663 | | |
| |||
0 commit comments