Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/p5rx' into nom
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Aug 24, 2012
2 parents 9429d1c + 1431c3e commit ca7637a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
4 changes: 3 additions & 1 deletion src/Perl6/Actions.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use NQPP6QRegex;
use NQPP5QRegex;
use Perl6::Pod;
use Perl6::ConstantFolder;
use Perl6::Ops;
Expand Down Expand Up @@ -4643,9 +4644,10 @@ class Perl6::Actions is HLL::Actions {
global => 'g',
overlap => 'ov',
exhaustive => 'ex',
Perl5 => 'P5',
);
INIT {
my $mods := 'i ignorecase s sigspace r ratchet';
my $mods := 'i ignorecase s sigspace r ratchet Perl5 P5';
for nqp::split(' ', $mods) {
%SHARED_ALLOWED_ADVERBS{$_} := 1;
}
Expand Down
25 changes: 14 additions & 11 deletions src/Perl6/Grammar.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use NQPP6QRegex;
use NQPP5QRegex;
use QRegex;
use Perl6::World;
use Perl6::Pod;
Expand All @@ -7,10 +8,12 @@ grammar Perl6::Grammar is HLL::Grammar {
method TOP() {
# Language braid.
my %*LANG;
%*LANG<Regex> := Perl6::RegexGrammar;
%*LANG<Regex-actions> := Perl6::RegexActions;
%*LANG<MAIN> := Perl6::Grammar;
%*LANG<MAIN-actions> := Perl6::Actions;
%*LANG<Regex> := Perl6::RegexGrammar;
%*LANG<Regex-actions> := Perl6::RegexActions;
%*LANG<P5Regex> := QRegex::P5Regex::Grammar;
%*LANG<P5Regex-actions> := QRegex::P5Regex::Actions;
%*LANG<MAIN> := Perl6::Grammar;
%*LANG<MAIN-actions> := Perl6::Actions;

# Package declarator to meta-package mapping. Starts pretty much empty;
# we get the mappings either imported or supplied by the setting. One
Expand Down Expand Up @@ -1890,7 +1893,7 @@ grammar Perl6::Grammar is HLL::Grammar {
[ [ ':'?'(' <signature> ')'] | <trait> ]*
'{'[
| ['*'|'<...>'|'<*>'] <?{ $*MULTINESS eq 'proto' }> $<onlystar>={1}
|<p6regex=.LANG('Regex','nibbler')>]'}'<?ENDSTMT>
| <p6regex=.LANG(%*RX<P5> ?? 'P5Regex' !! 'Regex','nibbler')>]'}'<?ENDSTMT>
{ $*CURPAD := $*W.pop_lexpad() }
] || <.malformed('regex')>
] }
Expand Down Expand Up @@ -2214,8 +2217,8 @@ grammar Perl6::Grammar is HLL::Grammar {
:my %*RX;
<rx_adverbs>
[
| '/'<p6regex=.LANG('Regex','nibbler')>'/' <.old_rx_mods>?
| '{'<p6regex=.LANG('Regex','nibbler')>'}' <.old_rx_mods>?
| '/'<p6regex=.LANG(%*RX<P5> ?? 'P5Regex' !! 'Regex','nibbler')>'/' <.old_rx_mods>?
| '{'<p6regex=.LANG(%*RX<P5> ?? 'P5Regex' !! 'Regex','nibbler')>'}' <.old_rx_mods>?
]
}

Expand All @@ -2231,8 +2234,8 @@ grammar Perl6::Grammar is HLL::Grammar {
{ %*RX<s> := 1 if $/[0] }
<rx_adverbs>
[
| '/'<p6regex=.LANG('Regex','nibbler')>'/' <.old_rx_mods>?
| '{'<p6regex=.LANG('Regex','nibbler')>'}'
| '/'<p6regex=.LANG(%*RX<P5> ?? 'P5Regex' !! 'Regex','nibbler')>'/' <.old_rx_mods>?
| '{'<p6regex=.LANG(%*RX<P5> ?? 'P5Regex' !! 'Regex','nibbler')>'}'
]
}

Expand All @@ -2250,8 +2253,8 @@ grammar Perl6::Grammar is HLL::Grammar {
}
<rx_adverbs>
[
| '/' <p6regex=.LANG('Regex','nibbler')> <?[/]> <quote_EXPR: ':qq'> <.old_rx_mods>?
| '[' <p6regex=.LANG('Regex','nibbler')> ']'
| '/' <p6regex=.LANG(%*RX<P5> ?? 'P5Regex' !! 'Regex','nibbler')> <?[/]> <quote_EXPR: ':qq'> <.old_rx_mods>?
| '[' <p6regex=.LANG(%*RX<P5> ?? 'P5Regex' !! 'Regex','nibbler')> ']'
<.ws> [ '=' || <.missing: "assignment operator"> ]
<.ws> <EXPR('i')>
]
Expand Down

0 comments on commit ca7637a

Please sign in to comment.