Skip to content

Commit d93fffe

Browse files
committed
checkpoint STD_P5 mods in case of a bus
currently parsing 831 lines of viv
1 parent 235f71b commit d93fffe

File tree

5 files changed

+622
-305
lines changed

5 files changed

+622
-305
lines changed

Actions.pm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ sub LIST {
236236
my $class =
237237
$match->{delims}[0]{_ast}{infix}{_op} //
238238
$match->{delims}[0]{_ast}{regex_infix}{_op} //
239-
warn ::Dump($match);
239+
warn ref($match);
240240
gen_class($class, $base);
241241
$r = bless $r, $class;
242242
$match->{'_ast'} = $r;
@@ -267,7 +267,7 @@ sub POSTFIX {
267267
$match->{_ast}{postop}{postfix}{_op} //
268268
$match->{_ast}{postop}{postcircumfix}{_op} //
269269
$match->{_ast}{dotty}{_op} //
270-
warn ::Dump($match);
270+
warn ref($match);
271271
}
272272

273273
gen_class($class, $base);
@@ -301,7 +301,7 @@ sub PREFIX {
301301
$match->{_ast}{prefix}{_op} //
302302
$match->{_ast}{prefix_postfix_meta_operator}{_op} //
303303
$match->{_ast}{prefix_circumfix_meta_operator}{_op} //
304-
warn ::Dump($match);
304+
warn ref($match);
305305
}
306306

307307
gen_class($class,$base);
@@ -340,7 +340,7 @@ sub INFIX {
340340
$class =
341341
$match->{_ast}{infix}{_op} //
342342
$match->{_ast}{regex_infix}{_op} //
343-
warn ::Dump($match);
343+
warn ref($match);
344344
}
345345

346346
gen_class($class, $base);
@@ -371,7 +371,7 @@ sub nibbler {
371371
push @dot, $n->{EXPR}->{_ast};
372372
}
373373
else {
374-
warn "Oops", ::Dump($n);
374+
warn "Oops", ref($n);
375375
exit;
376376
}
377377
}

CursorBase.pmc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ sub cursor_herelang { my $self = shift;
558558
$self->deb("cursor_herelang") if DEBUG & DEBUG::cursors;
559559
my %r = %$self;
560560
$r{_herelang} = $self;
561-
bless \%r, 'STD::Q';
561+
bless \%r, $::LANG{Q};
562562
}
563563

564564
sub prepbind {

STD.pm6

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,8 +1124,8 @@ grammar P6 is STD {
11241124
%*LANG<Q> = ::STD::Q ;
11251125
%*LANG<Quasi> = ::STD::Quasi ;
11261126
%*LANG<Regex> = ::STD::Regex ;
1127-
%*LANG<P5> = ::STD::P5 ;
1128-
%*LANG<P5Regex> = ::STD::P5::Regex ;
1127+
%*LANG<P5> = ::STD5 ;
1128+
%*LANG<P5Regex> = ::STD5::Regex ;
11291129

11301130
@*WORRIES = ();
11311131
self.load_setting($*SETTINGNAME);
@@ -1432,10 +1432,22 @@ grammar P6 is STD {
14321432
:my $*SCOPE = 'use';
14331433
:my $*HAS_SELF = '';
14341434
:my %*MYSTERY;
1435-
<sym> <.ws>
1435+
<sym> :: <.ws>
14361436
[
1437-
| <version>
1438-
| <module_name>
1437+
|| <version> <?{ substr($<version>.Str,0,2) eq 'v6' }>
1438+
|| <version> <?{ substr($<version>.Str,0,2) eq 'v5' }>
1439+
:my %*LANG;
1440+
{
1441+
self.require_P5;
1442+
%*LANG<MAIN> = ::STD5 ;
1443+
%*LANG<Regex> = ::STD5::Regex ;
1444+
%*LANG<Q> = ::STD5::Q ;
1445+
%*LANG<Trans> = ::STD5::Trans ;
1446+
= %*LANG<MAIN>.bless($¢);
1447+
}
1448+
<.ws> ';'
1449+
[ <statementlist> || <.panic: "Bad P5 code"> ]
1450+
|| <module_name>
14391451
{
14401452
$longname = $<module_name><longname>;
14411453
if $longname.Str eq 'MONKEY_TYPING' {
@@ -1449,9 +1461,9 @@ grammar P6 is STD {
14491461
}
14501462
|| {.do_use($longname<name>, ''); }
14511463
]
1464+
<.ws>
1465+
<.explain_mystery>
14521466
]
1453-
<.ws>
1454-
<.explain_mystery>
14551467
}
14561468

14571469

@@ -4038,6 +4050,8 @@ grammar P6 is STD {
40384050
:any(2), :all(2), :none(2), :one(2),
40394051
);
40404052

4053+
# token term:funspace { <longname> \h* <?before '('> <args(0)> }
4054+
40414055
# force identifier(), identifier.(), etc. to be a function call always
40424056
token term:identifier
40434057
{

0 commit comments

Comments
 (0)