Skip to content

Instantly share code, notes, and snippets.

@perlpilot
Created May 16, 2012 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perlpilot/2710781 to your computer and use it in GitHub Desktop.
Save perlpilot/2710781 to your computer and use it in GitHub Desktop.
Patch to remove **<sep>
diff --git a/src/QRegex/P6Regex/Actions.nqp b/src/QRegex/P6Regex/Actions.nqp
index a310ec7..42d9d60 100755
--- a/src/QRegex/P6Regex/Actions.nqp
+++ b/src/QRegex/P6Regex/Actions.nqp
@@ -116,15 +116,9 @@ class QRegex::P6Regex::Actions is HLL::Actions {
method quantifier:sym<**>($/) {
my $qast;
- if $<quantified_atom> {
- my $ast := $<quantified_atom>.ast;
- $qast := QAST::Regex.new( :rxtype<quant>, :min(1), $ast);
- }
- else {
- $qast := QAST::Regex.new( :rxtype<quant>, :min(+$<min>), :node($/) );
- if ! $<max> { $qast.max(+$<min>) }
- elsif $<max>[0] ne '*' { $qast.max(+$<max>[0]); }
- }
+ $qast := QAST::Regex.new( :rxtype<quant>, :min(+$<min>), :node($/) );
+ if ! $<max> { $qast.max(+$<min>) }
+ elsif $<max>[0] ne '*' { $qast.max(+$<max>[0]); }
make backmod($qast, $<backmod>);
}
diff --git a/src/QRegex/P6Regex/Grammar.nqp b/src/QRegex/P6Regex/Grammar.nqp
index e08b845..2344058 100755
--- a/src/QRegex/P6Regex/Grammar.nqp
+++ b/src/QRegex/P6Regex/Grammar.nqp
@@ -98,7 +98,6 @@ grammar QRegex::P6Regex::Grammar is HLL::Grammar {
|| <.panic: "Only integers or '*' allowed as range quantifier endpoint">
]
]?
- || <quantified_atom>
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment