Skip to content

Commit d78bdec

Browse files
committed
Allow hyphens at the start of a character class
1 parent f0ea1c3 commit d78bdec

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

src/QRegex/P6Regex/Grammar.nqp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ grammar QRegex::P6Regex::Grammar is HLL::Grammar {
347347
<.normspace>?
348348
[
349349
| '[' $<charspec>=(
350-
|| \s* '-' <!before \s* ']'> <.obs: '- as character range','.. for range, for explicit - in character class, escape it or place as last thing'>
350+
|| [ <!after '[' > \s* '-' <!before \s* ']'> ] <.obs: '- as character range','.. for range, for explicit - in character class, escape it or place it as the first or last thing'>
351351
|| \s* ( '\\' <cclass_backslash> || (<-[\]\\]>) )
352352
[
353353
\s* '..' \s*

t/qregex/rx_charclass

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@
2929
<[ - ]> ab-def y unescaped hyphen, the only thing w spaces
3030
<[x-]> ab-def y unescaped hyphen, at the end
3131
<[x - ]> ab-def y unescaped hyphen, at the end w spaces
32-
# todo :pge<feature>
3332
<[-x]> ab-def y unescaped hyphen, at the beginning
34-
# todo :pge<feature>
3533
<[ -x]> ab-def y unescaped hyphen, at the beginning w spaces
3634
<[\-]> ab-def y escaped hyphen
3735
<[\-]> abcdef n escaped hyphen

0 commit comments

Comments
 (0)