Skip to content

Commit

Permalink
make ltm work on regex modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
TimToady committed Nov 17, 2014
1 parent f4c6cbc commit 4f1b3f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/QRegex/Cursor.nqp
Expand Up @@ -325,7 +325,7 @@ role NQPCursorRole is export {
my $rxname;
while @fates {
$rxname := nqp::atpos(@rxfate, nqp::pop_i(@fates));
#nqp::say("invoking $rxname");
# nqp::printfh(nqp::getstderr(), "invoking $rxname\n");
$cur := self."$rxname"();
@fates := @EMPTY if nqp::getattr_i($cur, $?CLASS, '$!pos') >= 0;
}
Expand Down
8 changes: 5 additions & 3 deletions src/QRegex/P6Regex/Grammar.nqp
Expand Up @@ -408,9 +408,11 @@ grammar QRegex::P6Regex::Grammar is HLL::Grammar {
}

token mod_internal {
':'
[
| ':' $<n>=('!' | \d+)**1 <mod_ident> »
| ':' <mod_ident>
| <?before '!'> $<n>=('!')**1 <mod_ident> »
| <?before \d> $<n>=(\d+)**1 <mod_ident> »
| <mod_ident>
[
'('
[
Expand All @@ -434,5 +436,5 @@ grammar QRegex::P6Regex::Grammar is HLL::Grammar {
token mod_ident:sym<ratchet> { $<sym>=[r] 'atchet'? » }
token mod_ident:sym<sigspace> { $<sym>=[s] 'igspace'? » }
token mod_ident:sym<dba> { <sym> » }
token mod_ident:sym<oops> { {} (\w+) { $/.CURSOR.panic('Unrecognized regex modifier :' ~ $/[0].Str) } }
token mod_ident:sym<oops> { {} (\D+) { $/.CURSOR.panic('Unrecognized regex modifier :' ~ $/[0].Str) } }
}

0 comments on commit 4f1b3f0

Please sign in to comment.