Ticket #177: delspace.patch
File delspace.patch, 2.6 KB (added by riffraff, 13 years ago) |
---|
-
compilers/pge/PGE/Perl6Regex.pir
1190 1190 keypos += 3 1191 1191 $I0 -= keypos 1192 1192 actionkey = substr target, keypos, $I0 1193 $I0 = index actionkey, ' ' 1194 if $I0 < 0 goto actionok 1195 $I0 = -$I0 1196 actionkey = chopn actionkey, $I0 1197 actionok: 1193 1198 mob['actionkey'] = actionkey 1194 1199 end: 1195 1200 mob.'to'(pos) -
t/compilers/pct/complete_workflow.t
8 8 9 9 use Test::More; 10 10 11 use Parrot::Test tests => 6* 9;11 use Parrot::Test tests => 8 * 9; 12 12 use Parrot::Test::Util 'create_tempfile'; 13 13 use Parrot::Config qw(%PConfig); 14 14 … … 25 25 Special cases in grammars and actions should be tested here. 26 26 27 27 This test script builds a parser from a grammar syntax file. 28 After that ac ctions are added from a NQP class file.28 After that actions are added from a NQP class file. 29 29 After that the generated compiler is tested against a sample input. 30 30 31 31 =cut … … 434 434 } 435 435 436 436 437 { 438 test_pct( 'key', <<'IN', <<'GRAMMAR', <<'ACTIONS', <<'OUT' ); 439 thingy 440 IN 441 token TOP { 'thingy' {*} #= key_with_trailing_space 442 | 'stuff' {*} #= key_for_stuff 443 } 444 GRAMMAR 445 446 method TOP($/,$key) { 447 my $past := PAST::Stmts.new( 448 PAST::Op.new( 449 PAST::Val.new( 450 :value( ~$/ ~ " with key: '" ~ $key ~ "'" ), 451 :returns('String') 452 ), 453 :pirop('say'), 454 ) 455 ); 456 457 make $past; 458 } 459 ACTIONS 460 thingy with key: 'key_with_trailing_space' 461 OUT 462 } 463 464 { 465 test_pct( 'key', <<'IN', <<'GRAMMAR', <<'ACTIONS', <<'OUT' ); 466 thingy 467 IN 468 token TOP { 'thingy' {*} #= key_with_many_trailing_spaces 469 | 'stuff' {*} #= key_for_stuff 470 } 471 GRAMMAR 472 473 method TOP($/,$key) { 474 my $past := PAST::Stmts.new( 475 PAST::Op.new( 476 PAST::Val.new( 477 :value( ~$/ ~ " with key: '" ~ $key ~ "'" ), 478 :returns('String') 479 ), 480 :pirop('say'), 481 ) 482 ); 483 484 make $past; 485 } 486 ACTIONS 487 thingy with key: 'key_with_many_trailing_spaces' 488 OUT 489 } 437 490 =head1 AUTHOR 438 491 439 492 Bernhard Schmalhofer <Bernhard.Schmalhofer@gmx.de>