Commit bbf6880
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 #721, it is not desired that a 'reserved-body' starts with a whitespace
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-in-statement' is introduced, referenced
once. Its purpose is to clarify that the two parts belong together.
- A new nonterminal 'reserved-body-in-statement-start' is introduced,
in order to follow the common *-start / *-part idiom.1 parent 1009ea9 commit bbf6880
2 files changed
+10
-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 | + | |
| 63 | + | |
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
| |||
67 | 69 | | |
68 | 70 | | |
69 | 71 | | |
70 | | - | |
| 72 | + | |
| 73 | + | |
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
| 225 | + | |
226 | 226 | | |
| 227 | + | |
| 228 | + | |
227 | 229 | | |
228 | 230 | | |
229 | 231 | | |
| |||
656 | 658 | | |
657 | 659 | | |
658 | 660 | | |
659 | | - | |
| 661 | + | |
| 662 | + | |
660 | 663 | | |
661 | 664 | | |
662 | 665 | | |
| |||
0 commit comments