Skip to content

Commit

Permalink
suppress rest of "unused" warnings in viv
Browse files Browse the repository at this point in the history
Some of the warnings were bugs, and others were correct.
  • Loading branch information
TimToady committed Sep 1, 2012
1 parent 1748dc5 commit b178d5b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 37 deletions.
14 changes: 7 additions & 7 deletions STD_P5.pm6
Expand Up @@ -364,7 +364,7 @@ token xblock {

token sblock {
:temp $*CURLEX;
:dba('scoped block')
:dba('statement block')
[ <?before '{' > || <.panic: "Missing block"> ]
<.newlex>
<blockoid>
Expand Down Expand Up @@ -799,10 +799,7 @@ token termish {
:dba('postfix')
[
|| <?{ $*QSIGIL }>
[
|| [ <?before '[' | '{' > <POST> ]*!
|| { $*VAR = 0; }
]
[ <?before '[' | '{' > <POST> ]*!
|| <!{ $*QSIGIL }>
<POST>*
]
Expand All @@ -820,7 +817,7 @@ token p5term:variable { <variable>
|| <?before '['> { $<variable><really> = '@' }
|| <?before '{'> { $<variable><really> = '%' }
]?
{ $*VAR = $<variable> }
{ $*VAR ||= $<variable> }
}

token p5term:package_declarator { <package_declarator=p5package_declarator> }
Expand Down Expand Up @@ -1006,7 +1003,7 @@ token p5special_variable:sym<$?> {

token desigilname {
[
| <?before '$' > <variable> { $*VAR = $<variable> }
| <?before '$' > <variable> { $*VAR = $<variable>; }
| <longname>
]
}
Expand Down Expand Up @@ -1856,6 +1853,9 @@ token p5prefix:sym<->
token p5prefix:sym<~>
{ <sym> <O(|%symbolic_unary)> }

token p5prefix:sym<\\>
{ <sym> <O(|%symbolic_unary)> }


## binding
token p5infix:sym<!~>
Expand Down
54 changes: 24 additions & 30 deletions viv
Expand Up @@ -136,6 +136,7 @@ if (defined $symlroot) {

require Actions;
require STD;
require STD_P5;

sub spew {
my $bits = shift;
Expand Down Expand Up @@ -766,7 +767,6 @@ TEMPLATE

{ package VAST::colonpair; our @ISA = 'VAST::Base';
sub adverbs { my $self = shift;
my $val;
if (Scalar::Util::blessed $self->{v} &&
$self->{v}->isa('VAST::coloncircumfix')) {
my $s = $self->{v}->Str;
Expand Down Expand Up @@ -1287,15 +1287,15 @@ TEMPLATE


{ package VAST::sigmaybe__S_sigwhite; our @ISA = 'VAST::Base';
sub re_ast { my $self = shift;
sub re_ast { # my $self = shift;
$::SIGSPACE ?
RE_method->new(name => 'ws', nobind => 1) :
RE_noop->new;
}
}

{ package VAST::sigmaybe__S_normspace; our @ISA = 'VAST::Base';
sub re_ast { my $self = shift;
sub re_ast { # my $self = shift;
$::SIGSPACE ?
RE_method->new(name => 'ws', nobind => 1) :
RE_noop->new;
Expand Down Expand Up @@ -1427,14 +1427,14 @@ BODY
}

{ package VAST::mod_internal__S_Coloni; our @ISA = 'VAST::Base';
sub re_ast { my $self = shift;
sub re_ast { # my $self = shift;
$::IGNORECASE = 1;
RE_noop->new;
}
}

{ package VAST::mod_internal__S_Colonr; our @ISA = 'VAST::Base';
sub re_ast { my $self = shift;
sub re_ast { # my $self = shift;
$::RATCHET = 1;
RE_noop->new;
}
Expand All @@ -1454,15 +1454,15 @@ BODY


{ package VAST::mod_internal__S_Colons; our @ISA = 'VAST::Base';
sub re_ast { my $self = shift;
sub re_ast { # my $self = shift;
$::SIGSPACE = 1;
RE_noop->new;
}
}


{ package VAST::mod_internal__S_ColonBangs; our @ISA = 'VAST::Base';
sub re_ast { my $self = shift;
sub re_ast { # my $self = shift;
$::SIGSPACE = 0;
RE_noop->new;
}
Expand Down Expand Up @@ -1647,7 +1647,7 @@ BODY
}
sub emit_p5_header { my $self = shift;
my $header = "";
my $name = $::PKG;
#my $name = $::PKG;

my $meta = $::PKGDECL eq 'role' ? 'Moose::Role' : 'Moose';

Expand Down Expand Up @@ -1753,15 +1753,15 @@ EOFINAL
"{ $body $finalmulti 1; }";
}

sub psq_finish_multis { my $self = shift;
sub psq_finish_multis { # my $self = shift;
die "multis not yet implemented for psq";
}

sub psq_retree { my $self = shift;
sub psq_retree { # my $self = shift;
die "LTM not yet implemented for psq";
}

sub psq_parameterized { my $self = shift;
sub psq_parameterized { # my $self = shift;
die "roles not yet implemented for psq";
}

Expand Down Expand Up @@ -1927,7 +1927,7 @@ EOFINAL
}

{ package VAST::SYM_prefix__S_Vert; our @ISA = 'VAST::Symbolic_unary';
sub emit_p5 { my $self = shift;
sub emit_p5 { # my $self = shift;
('');
}
}
Expand Down Expand Up @@ -2312,7 +2312,7 @@ TEXT
grep { $::BINDINGS{$_} > 1 }
sort keys %::BINDINGS)
. ($::SYM ? '$C->{sym} = "' . ::rd($::SYM) . "\";\n" : '')
. <<END
. <<"END"
\$self->_MATCHIFY$ratchet(\$S, "$p5name", ${\ $body->p5expr });
END
, 1) . "}\n";
Expand Down Expand Up @@ -2806,8 +2806,7 @@ END


{ package VAST::terminator; our @ISA = 'VAST::Base';
sub emit_p6 { my $self = shift;
my @t = $self->SUPER::emit_p6;
sub emit_p6 { # my $self = shift;
'';
}
}
Expand Down Expand Up @@ -3111,7 +3110,7 @@ END
return DEEP::raw($result);
}

sub bind { my $self = shift; my $re = shift;
sub bind { shift; my $re = shift;
return $re unless @_;
DEEP::bind($re, @_);
}
Expand Down Expand Up @@ -3154,8 +3153,8 @@ END
$class->SUPER::new(zyg => \@zyg);
}

sub wrapone {
my ($self, $outer, $inner) = @_;
sub wrapone { shift;
my ($outer, $inner) = @_;
my ($out1, $outr) = $outer->uncut;
if ($outr) {
DEEP::ratchet($inner, $out1);
Expand Down Expand Up @@ -3548,7 +3547,6 @@ END
}
sub _walk {
my $self = shift;
my $result;
local $::PLURALITY = 2;
my $quant = "";
my $rep = "_REP";
Expand All @@ -3559,8 +3557,8 @@ END
if ($bind) { #XXX STD
$atom = $self->bind($atom, $bind);
}
my $atom_is_cut = !$atom->maybacktrack;
my ($qfer,$how,$rest) = @{$$self{quant}};
# my $atom_is_cut = !$atom->maybacktrack;
my ($qfer,$how,$rest) = @$q;
$qfer = '**' if ref $rest and ref $rest ne 'RE_block';
my $hc = $how eq '!' ? 'g' :
$how eq '?' ? 'f' :
Expand Down Expand Up @@ -3672,8 +3670,7 @@ END
# TODO: Investigate what the LTM engine is doing with assertions and
# optimize harder.

sub has_trailing_ws {
my $self = shift;
sub has_trailing_ws { shift;
my $before = shift;

$before; # Transparent
Expand Down Expand Up @@ -3834,12 +3831,11 @@ END

{ package RE_noop; use base "REbase";
sub _walk {
my $self = shift;
# my $self = shift;
DEEP::raw('$C', precut => 1);
}

sub has_trailing_ws {
my $self = shift;
sub has_trailing_ws { shift;
my $before = shift;

$before;
Expand All @@ -3863,8 +3859,7 @@ END
DEEP::raw($$self{body}, isblock => 1);
}

sub has_trailing_ws {
my $self = shift;
sub has_trailing_ws { shift;
my $before = shift;

$before;
Expand Down Expand Up @@ -3892,8 +3887,7 @@ END
}
}

sub has_trailing_ws {
my $self = shift;
sub has_trailing_ws { shift;
my $before = shift;

$before;
Expand Down

0 comments on commit b178d5b

Please sign in to comment.