Skip to content

Instantly share code, notes, and snippets.

@ungrim97
Created November 1, 2015 14:56
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 ungrim97/47b970ed15ed629d9a49 to your computer and use it in GitHub Desktop.
Save ungrim97/47b970ed15ed629d9a49 to your computer and use it in GitHub Desktop.
diff --git a/src/QRegex/P6Regex/Actions.nqp b/src/QRegex/P6Regex/Actions.nqp
index 2eb8131..e76098e 100644
--- a/src/QRegex/P6Regex/Actions.nqp
+++ b/src/QRegex/P6Regex/Actions.nqp
@@ -162,6 +162,7 @@ class QRegex::P6Regex::Actions is HLL::Actions {
}
else {
my $min := $<min>.ast;
+ if $min eq '^' { $min := 0 }
my $max := -1;
if ! $<max> { $max := $min }
elsif $<max> ne '*' {
diff --git a/src/QRegex/P6Regex/Grammar.nqp b/src/QRegex/P6Regex/Grammar.nqp
index 924d586..1abc959 100644
--- a/src/QRegex/P6Regex/Grammar.nqp
+++ b/src/QRegex/P6Regex/Grammar.nqp
@@ -256,6 +256,7 @@ grammar QRegex::P6Regex::Grammar is HLL::Grammar {
token quantifier:sym<**> {
<sym> <.normspace>? <backmod> <.normspace>?
[
+ | $<min>=['^'] <max=.integer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment