Skip to content

Commit 10db957

Browse files
committed
whitespace is literal in P5 regexes
1 parent 777fb17 commit 10db957

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/QRegex/P5Regex/Grammar.nqp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,14 @@ grammar QRegex::P5Regex::Grammar is HLL::Grammar {
108108
$<sign>=['^'|<?>]
109109
[
110110
|| $<charspec>=(
111-
\s* ( '\\' <backslash=p5backslash> || (<?{ $pastfirst == 0 }> <-[\\]> || <-[\]\\]>) )
111+
( '\\' <backslash=p5backslash> || (<?{ $pastfirst == 0 }> <-[\\]> || <-[\]\\]>) )
112112
[
113113
\s* '-' \s*
114114
( '\\' <backslash=p5backslash> || (<-[\]\\]>) )
115115
]**0..1
116116
{ $pastfirst++ }
117117
)+
118-
\s* ']'
118+
']'
119119
|| <.panic: "failed to parse character class; unescaped ']'?">
120120
]
121121
}

0 commit comments

Comments
 (0)