Skip to content

Commit

Permalink
allow the use of $(...) in P6Regex
Browse files Browse the repository at this point in the history
  • Loading branch information
FROGGS committed Jan 24, 2013
1 parent 82c2a06 commit b8a381e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/QRegex/P6Regex/Actions.nqp
Expand Up @@ -178,6 +178,10 @@ class QRegex::P6Regex::Actions is HLL::Actions {
make QAST::Regex.new( :rxtype<anchor>, :subtype<bol>, :node($/) );
}

method metachar:sym<$( )>($/) {
make $<nibbler>.ast
}

method metachar:sym<$>($/) {
make QAST::Regex.new( :rxtype<anchor>, :subtype<eos>, :node($/) );
}
Expand Down
1 change: 1 addition & 0 deletions src/QRegex/P6Regex/Grammar.nqp
Expand Up @@ -178,6 +178,7 @@ grammar QRegex::P6Regex::Grammar is HLL::Grammar {
token metachar:sym<ws> { <.normspace> }
token metachar:sym<[ ]> { '[' <nibbler> ']' }
token metachar:sym<( )> { '(' <nibbler> ')' }
token metachar:sym<$( )> { '$(' <nibbler> ')' }
token metachar:sym<'> { <?[']> <quote_EXPR: ':q'> }
token metachar:sym<"> { <?["]> <quote_EXPR: ':qq'> }
token metachar:sym<.> { <sym> }
Expand Down

0 comments on commit b8a381e

Please sign in to comment.