Skip to content

Commit

Permalink
Parse a couple more types of regex quoting constructs. We now get to …
Browse files Browse the repository at this point in the history
…pass another 3 tests from S05.
  • Loading branch information
jnthn committed Feb 9, 2010
1 parent fcb9e3c commit f456c24
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
8 changes: 8 additions & 0 deletions src/Perl6/Actions.pm
Expand Up @@ -1734,6 +1734,14 @@ method quote:sym</ />($/) {
my $past := Regex::P6Regex::Actions::buildsub($<p6regex>.ast);
make create_code_object($past, 'Regex', 0, '');
}
method quote:sym<rx>($/) {
my $past := Regex::P6Regex::Actions::buildsub($<p6regex>.ast);
make create_code_object($past, 'Regex', 0, '');
}
method quote:sym<m>($/) {
my $past := Regex::P6Regex::Actions::buildsub($<p6regex>.ast);
make create_code_object($past, 'Regex', 0, '');
}

method quote_escape:sym<$>($/) { make $<variable>.ast; }
method quote_escape:sym<{ }>($/) {
Expand Down
9 changes: 9 additions & 0 deletions src/Perl6/Grammar.pm
Expand Up @@ -865,6 +865,15 @@ token quote:sym<Q> { 'Q' <![(]> <.ws> <quote_EXPR> }
token quote:sym<Q:PIR> { 'Q:PIR' <.ws> <quote_EXPR> }
token quote:sym</null/> { '/' \s* '/' <.panic: "Null regex not allowed"> }
token quote:sym</ /> { '/'<p6regex=.LANG('Regex','nibbler')>'/' }
token quote:sym<rx> { <sym> >> '/'<p6regex=.LANG('Regex','nibbler')>'/' }
token quote:sym<m> {
<sym> >>
[
| '/'<p6regex=.LANG('Regex','nibbler')>'/'
| '{'<p6regex=.LANG('Regex','nibbler')>'}'
]
}


token quote_escape:sym<$> { <?[$]> <?quotemod_check('s')> <variable> }
token quote_escape:sym<{ }> { <?[{]> <?quotemod_check('c')> <block> }
Expand Down
8 changes: 4 additions & 4 deletions t/spectest.data
Expand Up @@ -237,17 +237,17 @@ S04-statements/until.t
# S05-match/non-capturing.t
# S05-match/perl.t
# S05-match/positions.t
# S05-metachars/line-anchors.t
# S05-metachars/newline.t
S05-metachars/line-anchors.t
S05-metachars/newline.t
# S05-metachars/tilde.t
# S05-metasyntax/angle-brackets.t
S05-metasyntax/changed.t
# S05-metasyntax/charset.t
# S05-metasyntax/lookaround.t
# S05-metasyntax/null.t
S05-metasyntax/null.t
# S05-metasyntax/regex.t
# S05-metasyntax/repeat.t
# S05-metasyntax/single-quotes.t
S05-metasyntax/single-quotes.t
# S05-metasyntax/unknown.t
# S05-modifier/ignorecase.t
# S05-modifier/perl5_1.t
Expand Down

0 comments on commit f456c24

Please sign in to comment.