Ticket #1118: add__END__.patch
File add__END__.patch, 1.3 KB (added by mgrimes, 12 years ago) |
---|
-
compilers/imcc/imcc.l
671 671 return yytext[0]; 672 672 } 673 673 674 <emit>^"__END__"{EOL} { 675 BEGIN(INITIAL); 676 677 if (IMCC_INFO(interp)->frames->s.pasm_file) { 678 IMCC_INFO(interp)->frames->s.pasm_file = 2; 679 return EOM; 680 } 681 682 return 0; 683 } 684 685 <INITIAL>^"__END__"{EOL} yyterminate(); 686 674 687 <emit><<EOF>> { 675 688 BEGIN(INITIAL); 676 689 -
t/compilers/imcc/syn/end.t
1 #!perl 2 # Copyright (C) 2001-2008, Parrot Foundation. 3 # $Id: const.t 37201 2009-03-08 12:07:48Z fperrad $ 4 5 use strict; 6 use warnings; 7 use lib qw( . lib ../lib ../../lib ); 8 9 use Test::More; 10 use Parrot::Test tests => 1; 11 12 pir_output_is( <<'CODE', <<'OUT', "__END__ acts like EOF" ); 13 .sub 'main' :main 14 set $I0, 1 15 print "ok 1\n" 16 .end 17 18 __END__ 19 this would not compile 20 CODE 21 ok 1 22 OUT 23 24 # Local Variables: 25 # mode: cperl 26 # cperl-indent-level: 4 27 # fill-column: 100 28 # End: 29 # vim: expandtab shiftwidth=4: