File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -132,15 +132,6 @@ grammar QRegex::P6Regex::Grammar is HLL::Grammar {
132
132
for $ OLDRX { % * RX {$ _ . key } := $ _ . value ; }
133
133
}
134
134
<.ws >
135
- [
136
- <!rxstopper >
137
- [
138
- | '||' { $ * SEQ := 1 ; }
139
- | '|'
140
- | '&&'
141
- | '&'
142
- ] <.ws >
143
- ]?
144
135
<termseq >
145
136
[
146
137
|| <?infixstopper >
@@ -168,21 +159,25 @@ grammar QRegex::P6Regex::Grammar is HLL::Grammar {
168
159
}
169
160
170
161
token termaltseq {
162
+ [ <!rxstopper > '||' { $ * SEQ := 1 ; } <.ws > ]?
171
163
<termconjseq >
172
164
[ <!infixstopper > '||' <.ws > { $ * SEQ := 1 ; } <termconjseq > ]*
173
165
}
174
166
175
167
token termconjseq {
168
+ [ <!rxstopper > '&&' { $ * SEQ := 0 ; } <.ws > ]?
176
169
<termalt >
177
170
[ <!infixstopper > '&&' <.ws > { $ * SEQ := 0 ; } <termalt > ]*
178
171
}
179
172
180
173
token termalt {
174
+ [ <!rxstopper > '|' <.ws > ]?
181
175
<termconj >
182
176
[ <!infixstopper > '|' <![ | ] > <.ws > { $ * SEQ := 0 ; } <termconj > ]*
183
177
}
184
178
185
179
token termconj {
180
+ [ <!rxstopper > '&' <.ws > ]?
186
181
<termish >
187
182
[ <!infixstopper > '&' <![ & ] > <.ws > { $ * SEQ := 0 ; } <termish > ]*
188
183
}
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ b& bcd [Null regex] conjunction (&) - null right arg illegal
102
102
& & [Null regex] conjunction (&) - literal must be escaped
103
103
a&|b a&|b [Null regex] alternation and conjunction (&|) - parse error
104
104
& & [Null regex] conjunction (&) - literal must be escaped
105
- a|&b a|&b [Null regex] alternation and conjunction (|&) - parse error
105
+ a|&b a|&b y alternation and conjunction (|&) - leading & inside | is okay
106
106
|d|b abc y leading alternation ignored
107
107
|d|b abc y leading alternation ignored
108
108
|d |b abc y leading alternation ignored
You can’t perform that action at this time.
0 commit comments