From b652feaff6907d219e3ea96063719e8457ba6519 Mon Sep 17 00:00:00 2001 From: sorear Date: Sat, 19 Jun 2010 08:21:04 +0000 Subject: [PATCH] [STD] A first wild cut at attaching pads to the syntax tree [viv] Include full symbol tables in store files git-svn-id: http://svn.pugscode.org/pugs@31375 c213334d-75ef-0310-aa23-eaa082d1ae64 --- src/perl6/STD.pm6 | 2 ++ src/perl6/viv | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/perl6/STD.pm6 b/src/perl6/STD.pm6 index e30f73920..ad873a1bf 100644 --- a/src/perl6/STD.pm6 +++ b/src/perl6/STD.pm6 @@ -1303,6 +1303,7 @@ grammar P6 is STD { # "CHECK" time... {{ $¢.explain_mystery(); + $¢. = $*CURPAD; if @*WORRIES { note "Potential difficulties:\n " ~ join( "\n ", @*WORRIES) ~ "\n"; } @@ -5208,6 +5209,7 @@ method newpad ($needsig = 0) { $*CURPAD. = 1 if $needsig; $*CURPAD. = $*IN_DECL if $*IN_DECL; $ALL.{$id} = $*CURPAD; + self. = $*CURPAD; self; } diff --git a/src/perl6/viv b/src/perl6/viv index 84541f65a..ae70e991b 100755 --- a/src/perl6/viv +++ b/src/perl6/viv @@ -189,6 +189,7 @@ sub MAIN { my $raw = retrieve($_[0]); $ORIG = $raw->{ORIG}; $r = $raw->{AST}; + $STD::ALL = $raw->{STABS}; for my $cl (keys %{$raw->{GENCLASS}}) { Actions::gen_class($cl, $raw->{GENCLASS}->{$cl}); } @@ -208,10 +209,10 @@ sub MAIN { } unless ($OPT_thaw) { $ORIG =~ s/\n;\z//; - if ($OPT_stab) { - no warnings; - $r->{stabs} = $STD::ALL; - } + } + if ($OPT_stab) { + no warnings; + $r->{stabs} = $STD::ALL; } if ($output eq 'yaml') { my $x = Dump($r); @@ -231,8 +232,9 @@ sub MAIN { spew fixpod($r->p5); } elsif ($output eq 'store') { + delete $r->{stabs}; my $data = { AST => $r, GENCLASS => \%Actions::GENCLASS, - ORIG => $ORIG }; + ORIG => $ORIG, STABS => $STD::ALL }; defined($OPT_output_file) ? store($data, $OPT_output_file) : Storable::store_fd($data, \*STDOUT); } -- 2.11.4.GIT