Legend:
- Unmodified
- Added
- Removed
-
src/perl6/Cursor.pmc
r22550 r22599 1958 1958 1959 1959 sub _COMMITBRANCH { my $self = shift; 1960 $self->{LAST} = shift() if @_; 1960 1961 local $CTX = $self->callm if $DEBUG & DEBUG::trace_call; 1961 1962 my $P = $self->{_pos}; 1963 my $F = $self->{_from}; 1964 my $buf = $self->{_orig}; 1965 $self->{FIRST} = substr($$buf, $F, $P - $F); 1962 1966 $self->deb("Commit branch to $P") if $DEBUG & DEBUG::matchers; 1963 1967 $self, LazyMap->new(sub { $self->deb("ABORTBRANCH") if $DEBUG & DEBUG::trace_call; die "ABORTBRANCH" }, $self); -
src/perl6/STD.pm
r22585 r22599 2671 2671 | <?> { $kind = '!' } 2672 2672 ] 2673 2674 2673 <.ws> 2674 2675 2675 $<subsig> = [ 2676 | '[' ~ ']' <signature> 2677 | <?before '{'> <!{ $+GOAL eq '{'}> 2678 '{' ~ '}' <signature> 2676 '[' ~ ']' <signature> 2677 <.ws> 2679 2678 ]* 2680 2679 … … 3233 3232 | :dba('argument list') '(' ~ ')' <semilist> {*} #= func args 3234 3233 | :dba('argument list') <.unsp> '.'? '(' ~ ')' <semilist> {*} #= func args 3235 | {} [<?before \s> <!{ $istype }> <.ws> <!infixstopper> < arglist> { $listopish = 1 }]?3234 | {} [<?before \s> <!{ $istype }> <.ws> <!infixstopper> <listopargs=arglist> { $listopish = 1 }]? 3236 3235 ] 3237 3236 … … 3239 3238 [ 3240 3239 || <?{ $listopish }> 3241 || ':' <?before \s> < arglist> # either switch to listopiness3240 || ':' <?before \s> <listopargs=arglist> # either switch to listopiness 3242 3241 || {{ $<O> = {}; }} # or allow adverbs (XXX needs hoisting?) 3243 3242 ] … … 3451 3450 3452 3451 self.deb($op.dump) if $*DEBUG +& DEBUG::EXPR; 3453 $op<arg> = (pop @termstack).cleanup; 3454 $op<_from> = $op<arg><_from> 3455 if $op<_from> > $op<arg><_from>; 3456 $op<_to> = $op<arg><_to> 3457 if $op<_to> < $op<arg><_to>; 3458 $op<_arity> = 'UNARY'; 3459 push @termstack, $op._REDUCE('EXPR'); 3452 my $nop = $op.cursor_fresh(); 3453 $nop<_from> = $op<_from>; 3454 $nop<_to> = $op<_to>; 3455 $nop<_pos> = $op<_pos>; 3456 $nop<arg> = (pop @termstack).cleanup; 3457 if ($nop<arg><_from> < $nop<_from>) { 3458 $nop<_from> = $nop<arg><_from>; 3459 } 3460 if ($nop<arg><_to> > $nop<_to>) { 3461 $nop<_to> = $nop<arg><_to>; 3462 } 3463 $nop<_arity> = 'UNARY'; 3464 push @termstack, $nop._REDUCE('EXPR'); 3460 3465 } 3461 3466 default { … … 3465 3470 3466 3471 self.deb($op.dump) if $*DEBUG +& DEBUG::EXPR; 3467 $op<right> = (pop @termstack).cleanup; 3468 $op<left> = (pop @termstack).cleanup; 3469 $op<_from> = $op<left><_from>; 3470 $op<_to> = $op<right><_to>; 3471 $op<_arity> = 'BINARY'; 3472 push @termstack, $op._REDUCE('EXPR'); 3472 my $nop = $op.cursor_fresh(); 3473 $nop<right> = (pop @termstack).cleanup; 3474 $nop<left> = (pop @termstack).cleanup; 3475 $nop<_from> = $nop<left><_from>; 3476 $nop<_to> = $nop<right><_to>; 3477 $nop<_arity> = 'BINARY'; 3478 push @termstack, $nop._REDUCE('EXPR'); 3473 3479 } 3474 3480 } -
src/perl6/viv
r22585 r22599 275 275 } 276 276 277 { package VAST:: AddSym; our @ISA = 'VAST::Base';277 { package VAST::PreSym; our @ISA = 'VAST::Base'; 278 278 sub emit_p6 { my $self = shift; 279 279 my $text = $self->get_ws; 280 280 $text .= $self->{sym}; 281 281 $text .= $self->SUPER::emit_p6(@_); 282 $text; 283 } 284 } 285 286 { package VAST::CircumSym; our @ISA = 'VAST::Base'; 287 sub emit_p6 { my $self = shift; 288 my $text = $self->get_ws; 289 $text .= $self->{sym}[0]; 290 $text .= $self->SUPER::emit_p6(@_); 291 $text .= $self->{sym}[1]; 292 $text; 293 } 294 } 295 296 { package VAST::FirstLast; our @ISA = 'VAST::Base'; 297 sub emit_p6 { my $self = shift; 298 my $text = $self->get_ws; 299 $text .= $self->{FIRST}; 300 $text .= $self->SUPER::emit_p6(@_); 301 $text .= $self->{LAST}; 282 302 $text; 283 303 } … … 364 384 } 365 385 366 { package VAST::scope_declarator; our @ISA = 'VAST::AddSym'; }367 { package VAST::statement_control; our @ISA = 'VAST::AddSym'; }368 { package VAST::version; our @ISA = 'VAST::AddSym'; }369 370 386 { package VAST::variable_declarator; our @ISA = 'VAST::Base'; 371 387 sub emit_p6 { my $self = shift; … … 379 395 } 380 396 397 { package VAST::scope_declarator; our @ISA = 'VAST::PreSym'; } 398 { package VAST::statement_control; our @ISA = 'VAST::PreSym'; } 399 { package VAST::statement_prefix; our @ISA = 'VAST::PreSym'; } 400 { package VAST::version; our @ISA = 'VAST::PreSym'; } 401 402 { package VAST::block; our @ISA = 'VAST::CircumSym'; } 403 { package VAST::circumfix; our @ISA = 'VAST::CircumSym'; } 404 { package VAST::postcircumfix; our @ISA = 'VAST::CircumSym'; } 405 { package VAST::args; our @ISA = 'VAST::FirstLast'; } 406 381 407 if ($0 eq __FILE__) { 382 408 ::MAIN(@ARGV);
