Permalink
Browse files

checkpoint STD_P5 mods in case of a bus

currently parsing 831 lines of viv
  • Loading branch information...
TimToady committed Aug 26, 2012
1 parent 235f71b commit d93fffe32b7fb5e1ed908c4e4b65ca0d381077a5
Showing with 622 additions and 305 deletions.
  1. +5 −5 Actions.pm
  2. +1 −1 CursorBase.pmc
  3. +21 −7 STD.pm6
  4. +589 −289 STD_P5.pm6
  5. +6 −3 viv
View
@@ -236,7 +236,7 @@ sub LIST {
my $class =
$match->{delims}[0]{_ast}{infix}{_op} //
$match->{delims}[0]{_ast}{regex_infix}{_op} //
- warn ::Dump($match);
+ warn ref($match);
gen_class($class, $base);
$r = bless $r, $class;
$match->{'_ast'} = $r;
@@ -267,7 +267,7 @@ sub POSTFIX {
$match->{_ast}{postop}{postfix}{_op} //
$match->{_ast}{postop}{postcircumfix}{_op} //
$match->{_ast}{dotty}{_op} //
- warn ::Dump($match);
+ warn ref($match);
}
gen_class($class, $base);
@@ -301,7 +301,7 @@ sub PREFIX {
$match->{_ast}{prefix}{_op} //
$match->{_ast}{prefix_postfix_meta_operator}{_op} //
$match->{_ast}{prefix_circumfix_meta_operator}{_op} //
- warn ::Dump($match);
+ warn ref($match);
}
gen_class($class,$base);
@@ -340,7 +340,7 @@ sub INFIX {
$class =
$match->{_ast}{infix}{_op} //
$match->{_ast}{regex_infix}{_op} //
- warn ::Dump($match);
+ warn ref($match);
}
gen_class($class, $base);
@@ -371,7 +371,7 @@ sub nibbler {
push @dot, $n->{EXPR}->{_ast};
}
else {
- warn "Oops", ::Dump($n);
+ warn "Oops", ref($n);
exit;
}
}
View
@@ -558,7 +558,7 @@ sub cursor_herelang { my $self = shift;
$self->deb("cursor_herelang") if DEBUG & DEBUG::cursors;
my %r = %$self;
$r{_herelang} = $self;
- bless \%r, 'STD::Q';
+ bless \%r, $::LANG{Q};
}
sub prepbind {
View
28 STD.pm6
@@ -1124,8 +1124,8 @@ grammar P6 is STD {
%*LANG<Q> = ::STD::Q ;
%*LANG<Quasi> = ::STD::Quasi ;
%*LANG<Regex> = ::STD::Regex ;
- %*LANG<P5> = ::STD::P5 ;
- %*LANG<P5Regex> = ::STD::P5::Regex ;
+ %*LANG<P5> = ::STD5 ;
+ %*LANG<P5Regex> = ::STD5::Regex ;
@*WORRIES = ();
self.load_setting($*SETTINGNAME);
@@ -1432,10 +1432,22 @@ grammar P6 is STD {
:my $*SCOPE = 'use';
:my $*HAS_SELF = '';
:my %*MYSTERY;
- <sym> <.ws>
+ <sym> :: <.ws>
[
- | <version>
- | <module_name>
+ || <version> <?{ substr($<version>.Str,0,2) eq 'v6' }>
+ || <version> <?{ substr($<version>.Str,0,2) eq 'v5' }>
+ :my %*LANG;
+ {
+ self.require_P5;
+ %*LANG<MAIN> = ::STD5 ;
+ %*LANG<Regex> = ::STD5::Regex ;
+ %*LANG<Q> = ::STD5::Q ;
+ %*LANG<Trans> = ::STD5::Trans ;
+ $¢ = %*LANG<MAIN>.bless($¢);
+ }
+ <.ws> ';'
+ [ <statementlist> || <.panic: "Bad P5 code"> ]
+ || <module_name>
{
$longname = $<module_name><longname>;
if $longname.Str eq 'MONKEY_TYPING' {
@@ -1449,9 +1461,9 @@ grammar P6 is STD {
}
|| {.do_use($longname<name>, ''); }
]
+ <.ws>
+ <.explain_mystery>
]
- <.ws>
- <.explain_mystery>
}
@@ -4038,6 +4050,8 @@ grammar P6 is STD {
:any(2), :all(2), :none(2), :one(2),
);
+# token term:funspace { <longname> \h* <?before '('> <args(0)> }
+
# force identifier(), identifier.(), etc. to be a function call always
token term:identifier
{
Oops, something went wrong.

0 comments on commit d93fffe

Please sign in to comment.