From eb27fd459061e1b8524e66e7eff552ae06ae8ff5 Mon Sep 17 00:00:00 2001 From: Stefan O'Rear Date: Wed, 20 Oct 2010 15:34:50 -0700 Subject: [PATCH] Fix syntax errors in v6/STD.pm6 --- v6/STD.pm6 | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/v6/STD.pm6 b/v6/STD.pm6 index f5a87173..ed4670cb 100644 --- a/v6/STD.pm6 +++ b/v6/STD.pm6 @@ -3132,7 +3132,6 @@ $¢.sorry("Can't put optional positional parameter after variadic parameters"); $ = { {:prec(%item_assignment), :assoc, :dba } } # actual test is non-inclusive! - } | [ | :dba('bracketed infix') '[' ~ ']' $ = {$} $ = {$} | $ = {$} $ = {$} @@ -3277,7 +3276,7 @@ $¢.sorry("Can't put optional positional parameter after variadic parameters"); token infix_prefix_meta_operator:sym { {} <.can_meta($, "sequence the args of")> - $ = {$> + $ = {$} } token infix_prefix_meta_operator:sym { @@ -4524,7 +4523,7 @@ method EXPR ($preclvl?) { } TERM: - loop { + while True { self.deb("In loop, at ", $here.pos) if $DEBUG::EXPR; my $oldpos = $here.pos; $here = $here.cursor_fresh(); @@ -4568,11 +4567,11 @@ method EXPR ($preclvl?) { push @termstack, $here.; @termstack[*-1].:delete; - self.deb("after push: " ~ (0+@termstack)) if $*DEBUG +& DEBUG::EXPR; + self.deb("after push: " ~ (0+@termstack)) if $DEBUG::EXPR; last TERM if $preclim eq $methodcall_prec; # in interpolation, probably # XXX P6 - loop { # while we see adverbs + while True { # while we see adverbs $oldpos = $here.pos; last TERM if (@*MEMOS[$oldpos] // 0) == 2; # XXX P6 $here = $here.cursor_fresh.ws; @@ -4582,14 +4581,14 @@ method EXPR ($preclvl?) { last TERM unless $infix.pos > $oldpos; if not $infix { - die $infix.dump if $*DEBUG +& DEBUG::EXPR; + die $infix.dump if $DEBUG::EXPR; } my $inO = $infix; my Str $inprec = $inO; if not defined $inprec { - self.deb("No prec given in infix!") if $*DEBUG +& DEBUG::EXPR; - die $infix.dump if $*DEBUG +& DEBUG::EXPR; + self.deb("No prec given in infix!") if $DEBUG::EXPR; + die $infix.dump if $DEBUG::EXPR; $inprec = %terminator; # XXX lexical scope is wrong } @@ -5360,7 +5359,7 @@ method add_my_name ($n, $d?, $p?) { ); my $old = $curstash.{$name}; if $old and $old and not $old { - self.deb("$name exists, curstash = ", $curstash.id) if $*DEBUG +& DEBUG::symtab; + self.deb("$name exists, curstash = ", $curstash.id) if $DEBUG::symtab; my $omult = $old // ''; if $declaring === $old {} # already did this, probably enum elsif $*SCOPE eq 'use' {} @@ -5391,7 +5390,7 @@ method add_my_name ($n, $d?, $p?) { elsif $name ~~ /^\w/ { self.sorry("Illegal redeclaration of symbol '$name'$loc"); } - elsif $name ~~ /^\&// { + elsif $name ~~ /^\&/ { self.sorry("Illegal redeclaration of routine '$name'$loc") unless $name eq '&'; } else { # XXX eventually check for conformant arrays here @@ -5429,7 +5428,7 @@ method add_our_name ($n) { return self if $name ~~ /\:\:\(/; my $curstash = $*CURPKG; self.deb("curstash $curstash global $*GLOBAL ", join ' ', %$*GLOBAL) if $DEBUG::symtab; - $name = ($name ~~ /(.*?):[ver|auth]/).[0] // $name; + $name = ($name ~~ /(.*?)\:[ver|auth]/).[0] // $name; my @components = self.canonicalize_name($name); if @components > 1 { my $c = self.find_top_pkg(@components[0]); @@ -5487,7 +5486,7 @@ method add_our_name ($n) { if $name ~~ /^\w/ { self.sorry("Illegal redeclaration of symbol '$sid'$loc"); } - elsif $name ~~ /^\&// { + elsif $name ~~ /^\&/ { self.sorry("Illegal redeclaration of routine '$sid'$loc") unless $name eq '&'; } else { # XXX eventually check for conformant arrays here @@ -5738,7 +5737,7 @@ method add_placeholder($name) { my $signame; my @r = ($varname ~~ /(.*?)(<[ ^ : ]>?)(.*)/); $twigil = @r[1]; - $signame = @r[1] eq ':' ?? ':' : '' + $signame = @r[1] eq ':' ?? ':' !! ''; $varname = @r[0] ~ @r[2]; $signame ~= $varname; return self if $*CURLEX.{'%?PLACEHOLDERS'}{$signame}++; @@ -5862,7 +5861,7 @@ method lookup_compiler_var($name, $default?) { return $default if defined $default; # (derived grammars should default to nextsame, terminating here) - default { self.worry("Unrecognized variable: $name"); return 0; } + self.worry("Unrecognized variable: $name"); return 0; } }