Index: runtime/parrot/library/Digest/MD5.pir =================================================================== --- runtime/parrot/library/Digest/MD5.pir (revision 9443) +++ runtime/parrot/library/Digest/MD5.pir (working copy) @@ -49,7 +49,7 @@ ########################################################################### # Export function entries to globals -.sub onload @LOAD +.sub onload :load .local pmc f f = find_global "Digest", "_md5sum" Index: runtime/parrot/library/Test/Builder.pir =================================================================== --- runtime/parrot/library/Test/Builder.pir (revision 9443) +++ runtime/parrot/library/Test/Builder.pir (working copy) @@ -47,7 +47,7 @@ .namespace [ 'Test::Builder' ] -.sub _initialize @LOAD +.sub _initialize :load load_bytecode 'library/Test/Builder/Test.pir' load_bytecode 'library/Test/Builder/Output.pir' load_bytecode 'library/Test/Builder/TestPlan.pir' Index: runtime/parrot/library/Test/Builder/Tester.pir =================================================================== --- runtime/parrot/library/Test/Builder/Tester.pir (revision 9443) +++ runtime/parrot/library/Test/Builder/Tester.pir (working copy) @@ -65,7 +65,7 @@ .namespace [ 'Test::Builder::Tester::Output' ] -.sub _initialize @LOAD +.sub _initialize :load .local pmc tbto_class newclass tbto_class, 'Test::Builder::Tester::Output' addattribute tbto_class, 'output' @@ -162,7 +162,7 @@ .namespace [ 'Test::Builder::Tester' ] -.sub _initialize @LOAD +.sub _initialize :load load_bytecode 'library/Test/Builder.pir' .local pmc test Index: runtime/parrot/library/Test/Builder/TestPlan.pir =================================================================== --- runtime/parrot/library/Test/Builder/TestPlan.pir (revision 9443) +++ runtime/parrot/library/Test/Builder/TestPlan.pir (working copy) @@ -25,7 +25,7 @@ .namespace [ 'Test::Builder::TestPlan' ] -.sub _initialize @LOAD +.sub _initialize :load .local pmc tbtp_class newclass tbtp_class, 'Test::Builder::TestPlan' addattribute tbtp_class, 'expect' Index: runtime/parrot/library/Test/Builder/Test.pir =================================================================== --- runtime/parrot/library/Test/Builder/Test.pir (revision 9443) +++ runtime/parrot/library/Test/Builder/Test.pir (working copy) @@ -16,7 +16,7 @@ .namespace [ 'Test::Builder::Test' ] -.sub _initialize @LOAD +.sub _initialize :load .local pmc tbtb_class newclass tbtb_class, 'Test::Builder::Test::Base' Index: runtime/parrot/library/Test/Builder/Output.pir =================================================================== --- runtime/parrot/library/Test/Builder/Output.pir (revision 9443) +++ runtime/parrot/library/Test/Builder/Output.pir (working copy) @@ -21,7 +21,7 @@ .namespace [ 'Test::Builder::Output' ] -.sub _initialize @LOAD +.sub _initialize :load .local pmc tbo_class newclass tbo_class, 'Test::Builder::Output' addattribute tbo_class, 'output' Index: runtime/parrot/library/ncurses.pasm =================================================================== --- runtime/parrot/library/ncurses.pasm (revision 9443) +++ runtime/parrot/library/ncurses.pasm (working copy) @@ -1,4 +1,4 @@ -.pcc_sub @LOAD __ncurses_init: +.pcc_sub :load __ncurses_init: loadlib P1, 'libform' dlfunc P2, P1, 'new_field', 'piiiiii' store_global 'ncurses::new_field', P2 Index: runtime/parrot/library/SDL/Surface.imc =================================================================== --- runtime/parrot/library/SDL/Surface.imc (revision 9443) +++ runtime/parrot/library/SDL/Surface.imc (working copy) @@ -40,7 +40,7 @@ .namespace [ 'SDL::Surface' ] -.sub _initialize @LOAD +.sub _initialize :load .local pmc surface_class $I0 = find_type 'SDL::Surface' Index: runtime/parrot/library/SDL/Button.imc =================================================================== --- runtime/parrot/library/SDL/Button.imc (revision 9443) +++ runtime/parrot/library/SDL/Button.imc (working copy) @@ -42,7 +42,7 @@ .namespace ['SDL::Button'] -.sub __onload @LOAD +.sub __onload :load $I0 = find_type 'SDL::Button' if $I0 > 1 goto END Index: runtime/parrot/library/SDL/Constants.imc =================================================================== --- runtime/parrot/library/SDL/Constants.imc (revision 9443) +++ runtime/parrot/library/SDL/Constants.imc (working copy) @@ -23,7 +23,7 @@ .namespace [ 'SDL::Constants' ] -.sub _initialize @LOAD +.sub _initialize :load # load the constants _load_key_names() Index: runtime/parrot/library/SDL/StopWatch.imc =================================================================== --- runtime/parrot/library/SDL/StopWatch.imc (revision 9443) +++ runtime/parrot/library/SDL/StopWatch.imc (working copy) @@ -33,7 +33,7 @@ .include "iterator.pasm" .namespace ['SDL::StopWatch'] -.sub __onload @LOAD +.sub __onload :load $I0 = find_type 'SDL::StopWatch' if $I0 > 1 goto END @@ -264,7 +264,7 @@ .namespace ["SDL::StopWatch::Timer"] -.sub __onload @LOAD +.sub __onload :load # XXX: an old array will be overwritten when loading this file again $P0 = new PerlArray store_global "SDL::StopWatch::Timer", "array", $P0 Index: runtime/parrot/library/SDL/Rect.imc =================================================================== --- runtime/parrot/library/SDL/Rect.imc (revision 9443) +++ runtime/parrot/library/SDL/Rect.imc (working copy) @@ -44,7 +44,7 @@ .namespace [ 'SDL::Rect' ] -.sub _initialize @LOAD +.sub _initialize :load $I0 = find_type 'SDL::Rect' if $I0 > 1 goto END Index: runtime/parrot/library/SDL/Color.imc =================================================================== --- runtime/parrot/library/SDL/Color.imc (revision 9443) +++ runtime/parrot/library/SDL/Color.imc (working copy) @@ -50,7 +50,7 @@ .namespace [ 'SDL::Color' ] -.sub _initialize , @LOAD +.sub _initialize , :load .local pmc color_class Index: runtime/parrot/library/SDL/EventHandler.imc =================================================================== --- runtime/parrot/library/SDL/EventHandler.imc (revision 9443) +++ runtime/parrot/library/SDL/EventHandler.imc (working copy) @@ -64,7 +64,7 @@ .namespace [ 'SDL::EventHandler' ] -.sub _initialize @LOAD +.sub _initialize :load .local pmc handler_class Index: runtime/parrot/library/SDL/App.imc =================================================================== --- runtime/parrot/library/SDL/App.imc (revision 9443) +++ runtime/parrot/library/SDL/App.imc (working copy) @@ -59,7 +59,7 @@ .namespace [ 'SDL::App' ] -.sub _initialize @LOAD +.sub _initialize :load .include 'datatypes.pasm' load_bytecode 'library/SDL.imc' Index: runtime/parrot/library/SDL/Event.imc =================================================================== --- runtime/parrot/library/SDL/Event.imc (revision 9443) +++ runtime/parrot/library/SDL/Event.imc (working copy) @@ -41,7 +41,7 @@ .namespace [ 'SDL::Event' ] -.sub _initialize @LOAD +.sub _initialize :load .local pmc event_class newclass event_class, 'SDL::Event' Index: runtime/parrot/library/SDL/LCD.imc =================================================================== --- runtime/parrot/library/SDL/LCD.imc (revision 9443) +++ runtime/parrot/library/SDL/LCD.imc (working copy) @@ -36,7 +36,7 @@ .namespace ["SDL::LCD"] -.sub __onload @LOAD +.sub __onload :load $I0 = find_type 'SDL::LCD' if $I0 > 1 goto END Index: runtime/parrot/library/SDL/Image.imc =================================================================== --- runtime/parrot/library/SDL/Image.imc (revision 9443) +++ runtime/parrot/library/SDL/Image.imc (working copy) @@ -39,7 +39,7 @@ .namespace [ 'SDL::Image' ] -.sub _initialize @LOAD +.sub _initialize :load .local pmc surface_type .local pmc image_class Index: runtime/parrot/library/SDL/Sprite.imc =================================================================== --- runtime/parrot/library/SDL/Sprite.imc (revision 9443) +++ runtime/parrot/library/SDL/Sprite.imc (working copy) @@ -53,7 +53,7 @@ .namespace [ 'SDL::Sprite' ] -.sub _initialize @LOAD +.sub _initialize :load .local pmc sprite_class newclass sprite_class, 'SDL::Sprite' Index: runtime/parrot/library/SDL/Font.imc =================================================================== --- runtime/parrot/library/SDL/Font.imc (revision 9443) +++ runtime/parrot/library/SDL/Font.imc (working copy) @@ -41,7 +41,7 @@ .namespace [ 'SDL::Font' ] -.sub _sdl_init @LOAD +.sub _sdl_init :load .local pmc init_ttf init_ttf = find_global 'SDL', '_init_ttf' init_ttf() Index: runtime/parrot/library/SDL.imc =================================================================== --- runtime/parrot/library/SDL.imc (revision 9443) +++ runtime/parrot/library/SDL.imc (working copy) @@ -48,7 +48,7 @@ .namespace [ 'SDL' ] -.sub _sdl_init @LOAD +.sub _sdl_init :load _init_video() .local pmc layouts Index: runtime/parrot/library/ncurses.imc =================================================================== --- runtime/parrot/library/ncurses.imc (revision 9443) +++ runtime/parrot/library/ncurses.imc (working copy) @@ -1,4 +1,4 @@ -.pcc_sub __ncurses_init @LOAD +.pcc_sub __ncurses_init :load loadlib $P1, 'libform' dlfunc $P2, $P1, 'new_field', 'piiiiii' Index: runtime/parrot/library/Stream/Sub.imc =================================================================== --- runtime/parrot/library/Stream/Sub.imc (revision 9443) +++ runtime/parrot/library/Stream/Sub.imc (working copy) @@ -52,7 +52,7 @@ =cut -.sub onload @LOAD, @ANON +.sub onload :load, :anon .local int i .local pmc base .local pmc sub Index: runtime/parrot/library/Stream/Base.imc =================================================================== --- runtime/parrot/library/Stream/Base.imc (revision 9443) +++ runtime/parrot/library/Stream/Base.imc (working copy) @@ -26,7 +26,7 @@ .const int aIncludes = 1 .const int aBuffer = 2 -.sub onload @LOAD, @ANON +.sub onload :load, :anon find_type $I0, "Stream::Base" if $I0 > 1 goto END Index: runtime/parrot/library/Stream/Lines.imc =================================================================== --- runtime/parrot/library/Stream/Lines.imc (revision 9443) +++ runtime/parrot/library/Stream/Lines.imc (working copy) @@ -22,7 +22,7 @@ .include "library/Data/Escape.imc" -.sub onload @LOAD, @ANON +.sub onload :load, :anon .local int i .local pmc base .local pmc lines Index: runtime/parrot/library/Stream/Replay.imc =================================================================== --- runtime/parrot/library/Stream/Replay.imc (revision 9443) +++ runtime/parrot/library/Stream/Replay.imc (working copy) @@ -37,7 +37,7 @@ .namespace ["Stream::Replay"] -.sub onload @LOAD, @ANON +.sub onload :load, :anon find_type $I0, "Stream::Replay" if $I0 > 1 goto END Index: runtime/parrot/library/Stream/Writer.imc =================================================================== --- runtime/parrot/library/Stream/Writer.imc (revision 9443) +++ runtime/parrot/library/Stream/Writer.imc (working copy) @@ -32,7 +32,7 @@ .include "interpinfo.pasm" .namespace ["Stream::Writer"] -.sub __onload @LOAD +.sub __onload :load find_type $I0, "Stream::Writer" if $I0 > 1 goto END Index: runtime/parrot/library/Stream/Combiner.imc =================================================================== --- runtime/parrot/library/Stream/Combiner.imc (revision 9443) +++ runtime/parrot/library/Stream/Combiner.imc (working copy) @@ -24,7 +24,7 @@ =cut -.sub onload @LOAD, @ANON +.sub onload :load, :anon .local int i .local pmc base .local pmc comb Index: runtime/parrot/library/Stream/ParrotIO.imc =================================================================== --- runtime/parrot/library/Stream/ParrotIO.imc (revision 9443) +++ runtime/parrot/library/Stream/ParrotIO.imc (working copy) @@ -20,7 +20,7 @@ =cut -.sub onload @LOAD, @ANON +.sub onload :load, :anon .local int i .local pmc base .local pmc io Index: runtime/parrot/library/Stream/Filter.imc =================================================================== --- runtime/parrot/library/Stream/Filter.imc (revision 9443) +++ runtime/parrot/library/Stream/Filter.imc (working copy) @@ -20,7 +20,7 @@ =cut -.sub onload @LOAD, @ANON +.sub onload :load, :anon .local int i .local pmc base .local pmc filter Index: runtime/parrot/library/Stream/Coroutine.imc =================================================================== --- runtime/parrot/library/Stream/Coroutine.imc (revision 9443) +++ runtime/parrot/library/Stream/Coroutine.imc (working copy) @@ -20,7 +20,7 @@ =cut -.sub onload @LOAD, @ANON +.sub onload :load, :anon .local pmc base .local pmc coro .local int i Index: runtime/parrot/library/Getopt/Long.pir =================================================================== --- runtime/parrot/library/Getopt/Long.pir (revision 9443) +++ runtime/parrot/library/Getopt/Long.pir (working copy) @@ -49,7 +49,7 @@ .include "library/dumper.imc" -.sub "__onload" @LOAD +.sub "__onload" :load # Load dependant libraries load_bytecode "PGE.pbc" Index: runtime/parrot/library/postgres.pasm =================================================================== --- runtime/parrot/library/postgres.pasm (revision 9443) +++ runtime/parrot/library/postgres.pasm (working copy) @@ -1,4 +1,4 @@ -.pcc_sub __postgres_init @LOAD +.pcc_sub __postgres_init :load loadlib $P1, 'libpq' dlfunc $P2, $P1, 'PQconnectStart', 'pt' Index: runtime/parrot/library/parrotlib.imc =================================================================== --- runtime/parrot/library/parrotlib.imc (revision 9443) +++ runtime/parrot/library/parrotlib.imc (working copy) @@ -17,7 +17,7 @@ =cut -.sub __onload @LOAD +.sub __onload :load .local pmc paths .local pmc includes .local string root Index: runtime/parrot/library/Data/Replace.imc =================================================================== --- runtime/parrot/library/Data/Replace.imc (revision 9443) +++ runtime/parrot/library/Data/Replace.imc (working copy) @@ -107,7 +107,7 @@ END: .end -.sub __onload @LOAD +.sub __onload :load $P0 = find_global "Data::Replace", "PerlArray" store_global "Data::Replace", "PMCArray", $P0 store_global "Data::Replace", "StringArray", $P0 Index: runtime/parrot/library/PGE/Hs.pir =================================================================== --- runtime/parrot/library/PGE/Hs.pir (revision 9443) +++ runtime/parrot/library/PGE/Hs.pir (working copy) @@ -53,7 +53,7 @@ .const string PGE_SUB_POS = "@:capt" .const string PGE_SUB_NAMED = "%:capt" -.sub "__onload" @LOAD +.sub "__onload" :load .local pmc load load_bytecode "Data/Escape.imc" .end Index: runtime/parrot/library/PGE/RegCounter.pir =================================================================== --- runtime/parrot/library/PGE/RegCounter.pir (revision 9443) +++ runtime/parrot/library/PGE/RegCounter.pir (working copy) @@ -27,7 +27,7 @@ =cut -.sub __onload @ANON, @LOAD +.sub __onload :anon, :load newclass $P0, "PGE::RegCounter" addattribute $P0, ".counter" addattribute $P0, ".map" Index: runtime/parrot/library/PGE/Class.pir =================================================================== --- runtime/parrot/library/PGE/Class.pir (revision 9443) +++ runtime/parrot/library/PGE/Class.pir (working copy) @@ -18,7 +18,7 @@ =cut -.sub __onload @LOAD +.sub __onload :load .local pmc base newclass base, "PGE::Class" Index: runtime/parrot/library/postgres.imc =================================================================== --- runtime/parrot/library/postgres.imc (revision 9443) +++ runtime/parrot/library/postgres.imc (working copy) @@ -1,4 +1,4 @@ -.pcc_sub __postgres_init @LOAD +.pcc_sub __postgres_init :load loadlib $P1, 'libpq' dlfunc $P2, $P1, 'PQconnectStart', 'pt' Index: src/packfile.c =================================================================== --- src/packfile.c (revision 9443) +++ src/packfile.c (working copy) @@ -200,7 +200,7 @@ sub_pragma(Parrot_Interp interpreter, int action, PMC *sub_pmc)> -Handle @LOAD, @MAIN ... pragmas for B +Handle :load, :main ... pragmas for B =cut @@ -236,7 +236,7 @@ =item C -Run the B due its B<@LOAD>, B<@IMMEDIATE>, ... pragma +Run the B due its B<:load>, B<:immediate>, ... pragma =cut Index: docs/compiler_faq.pod =================================================================== --- docs/compiler_faq.pod (revision 9443) +++ docs/compiler_faq.pod (working copy) @@ -143,7 +143,7 @@ You can retrieve the namespace hash and use the C opcode. Nested namespace names have a NULL char prepended to their name. - .sub main @MAIN + .sub main :main $P0 = new Integer store_global "foo", $P0 store_global "Bar", "baz", $P0 @@ -244,7 +244,7 @@ You can C the current pad and use C. - .sub main @MAIN + .sub main :main new_pad 0 $P0 = new Integer store_lex -1, "foo", $P0 Index: docs/pmc/subs.pod =================================================================== --- docs/pmc/subs.pod (revision 9443) +++ docs/pmc/subs.pod (working copy) @@ -69,19 +69,19 @@ Exactly one subroutine in the first executed source or byte code file may be flagged as the "main" subroutine, where executions starts. - .pcc_sub @MAIN _main: + .pcc_sub :main _main: -In the absence of a B<@MAIN> entry Parrot starts execution at the first +In the absence of a B<:main> entry Parrot starts execution at the first statement. =head2 Automatically loaded initializer code -If a subroutine is marked as B<@LOAD> this subroutine is run, before the +If a subroutine is marked as B<:load> this subroutine is run, before the B opcode returns. e.g. - .pcc_sub @MAIN _main: + .pcc_sub :main _main: print "in main\n" load_bytecode "library_code.pasm" ... @@ -89,12 +89,12 @@ # library_code.pasm ... - .pcc_sub @LOAD _my_lib_init: + .pcc_sub :load _my_lib_init: ... invoke P1 -B<@LOAD> is ignored, if another subroutine in that file is marked with -B<@MAIN>. +B<:load> is ignored, if another subroutine in that file is marked with +B<:main>. =head2 Invocation i.e. calling the sub Index: docs/tests.pod =================================================================== --- docs/tests.pod (revision 9443) +++ docs/tests.pod (working copy) @@ -47,7 +47,7 @@ pir_output_is(<<'CODE',<<'OUT','nothing useful'); .include 'library/config.imc' - .sub main @MAIN + .sub main :main print "hi\n" .end CODE Index: docs/intro.pod =================================================================== --- docs/intro.pod (revision 9443) +++ docs/intro.pod (working copy) @@ -336,7 +336,7 @@ .end - .sub _main @MAIN + .sub _main :main .local int f, i # We'll do factorial 0 to 1. @@ -386,9 +386,9 @@ The call to C<_fact> in main works in just the same was as the recursive call to C<_fact> within the sub C<_fact> itself. The only remaining bit of new -syntax is the C<@MAIN>, written after C<.sub _main>. By default, PIR assumes +syntax is the C<:main>, written after C<.sub _main>. By default, PIR assumes that execution begins with the first sub in the file. This behavior can be -changed by making the sub to start in with C<@MAIN>. +changed by marking the sub to start in with C<:main>. =head2 Compiling to PBC Index: tools/dev/bench_op.imc =================================================================== --- tools/dev/bench_op.imc (revision 9443) +++ tools/dev/bench_op.imc (working copy) @@ -68,7 +68,7 @@ .const string VERSION = "0.1.0" -.sub main @MAIN +.sub main :main .param pmc argv load_bytecode "Getopt/Long.pbc" Index: tools/dev/nm.pl =================================================================== --- tools/dev/nm.pl (revision 9443) +++ tools/dev/nm.pl (working copy) @@ -139,7 +139,7 @@ require 5.005; -$VERSION = sprintf "%d.%d", q$Revision: 6964 $ =~ /(\d+)/g; # jhi@iki.fi; +$VERSION = sprintf "%d.%d", q$Revision$ =~ /(\d+)/g; # jhi@iki.fi; my $ME = basename($0); my $RCS_DATE = q$Date$; Index: imcc/docs/calling_conventions.pod =================================================================== --- imcc/docs/calling_conventions.pod (revision 9443) +++ imcc/docs/calling_conventions.pod (working copy) @@ -105,23 +105,23 @@ =over 4 -=item * @MAIN +=item * :main Define "main" entry point to start execution. If multiple subroutines -are marked as B<@MAIN>, the B marked subroutine is entered. +are marked as B<:main>, the B marked subroutine is entered. -=item * @LOAD +=item * :load Run this subroutine during the B opcode. -B<@LOAD> is ignored, if another subroutine in that file is marked with -B<@MAIN>. +B<:load> is ignored, if another subroutine in that file is marked with +B<:main>. -=item * @ANON +=item * :anon Do not install this subroutine in the namespace. Allows the subroutine name to be reused. -=item * @MULTI(Type1, Type2...) +=item * :multi(Type1, Type2...) Engage in multiple dispatch with the listed types. Index: imcc/docs/operation.pod =================================================================== --- imcc/docs/operation.pod (revision 9443) +++ imcc/docs/operation.pod (working copy) @@ -111,7 +111,7 @@ Consider these two code snippets (block numbers are attached): - .sub main @MAIN + .sub main :main 0 $I0 = 0 # initialized 0 if $I0 goto l1 1 $I1 = 1 # init in block 1 @@ -127,7 +127,7 @@ and: - .sub main @MAIN + .sub main :main 0 $I0 = 0 # initialized 0 if $I0 goto l1 # branch to bb 1 or 2 1 $I1 = 1 # init only in block 1 Index: imcc/t/syn/op.t =================================================================== --- imcc/t/syn/op.t (revision 9443) +++ imcc/t/syn/op.t (working copy) @@ -7,7 +7,7 @@ ############################## pir_output_is(<<'CODE', <<'OUT', "+="); -.sub test @MAIN +.sub test :main $I0 = 10 $I0 += 20 print $I0 @@ -20,7 +20,7 @@ ############################## pir_output_is(<<'CODE', <<'OUT', "-="); -.sub test @MAIN +.sub test :main $I0 = 10 $I0 -= 20 print $I0 @@ -32,7 +32,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "*="); -.sub test @MAIN +.sub test :main $I0 = 10 $I0 *= 20 print $I0 @@ -44,7 +44,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "/="); -.sub test @MAIN +.sub test :main $I0 = 20 $I0 /= 2 print $I0 @@ -56,7 +56,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "%="); -.sub test @MAIN +.sub test :main $I0 = 20 $I0 %= 7 print $I0 @@ -68,7 +68,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', ".="); -.sub test @MAIN +.sub test :main $S0 = "ab" $S0 .= "cd" print $S0 @@ -79,7 +79,7 @@ abcd OUT pir_output_is(<<'CODE', <<'OUT', "&="); -.sub test @MAIN +.sub test :main $I0 = 0b1011 $I0 &= 0b1000 print $I0 @@ -91,7 +91,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "|="); -.sub test @MAIN +.sub test :main $I0 = 0b1011 $I0 |= 0b1000 print $I0 @@ -103,7 +103,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "~="); -.sub test @MAIN +.sub test :main $I0 = 0b1011 $I0 ~= 0b1000 print $I0 @@ -115,7 +115,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', ">>="); -.sub test @MAIN +.sub test :main $I0 = 0b1011 $I0 >>= 1 print $I0 @@ -127,7 +127,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', ">>>="); -.sub test @MAIN +.sub test :main $I0 = 0b1011 $I0 >>>= 1 print $I0 @@ -139,7 +139,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "<<="); -.sub test @MAIN +.sub test :main $I0 = 0b1011 $I0 <<= 1 print $I0 @@ -151,7 +151,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "x = defined"); -.sub test @MAIN +.sub test :main .local pmc a a = new PerlArray push a, 10 @@ -169,7 +169,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "x = clone"); -.sub test @MAIN +.sub test :main .local pmc a a = new Integer a = 10 @@ -184,7 +184,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "x = length"); -.sub test @MAIN +.sub test :main .local string s s = "abc" $I0 = length s @@ -197,7 +197,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "x = sin"); -.sub test @MAIN +.sub test :main $N0 = sin 0 print $N0 print "\n" @@ -208,7 +208,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "x = can"); -.sub test @MAIN +.sub test :main $P0 = new ParrotIO $I0 = can $P0, "puts" print $I0 @@ -220,7 +220,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "x = isa"); -.sub test @MAIN +.sub test :main $P0 = new Integer $I0 = isa $P0, "scalar" print $I0 @@ -232,7 +232,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "x = add"); -.sub test @MAIN +.sub test :main $I0 = 10 $I1 = add $I0, 10 print $I1 @@ -244,7 +244,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "x = invoke"); -.sub test @MAIN +.sub test :main $P0 = find_global "_s" $P0 = invokecc $S0 = "done\n" Index: imcc/t/syn/file.t =================================================================== --- imcc/t/syn/file.t (revision 9443) +++ imcc/t/syn/file.t (working copy) @@ -30,7 +30,7 @@ close FOO; pir_output_is(<<'CODE', <<'OUT', "include pasm"); -.sub test @MAIN +.sub test :main print "before\n" .include "temp.pasm" print .BAR @@ -52,7 +52,7 @@ close FOO; pir_output_is(<<'CODE', <<'OUT', "include pir"); -.sub test @MAIN +.sub test :main print "before\n" .include "temp.imc" print BAR @@ -74,7 +74,7 @@ close FOO; pir_output_is(<<'CODE', <<'OUT', "include .inc"); -.sub test @MAIN +.sub test :main print "before\n" .include "temp.inc" print BAR @@ -111,7 +111,7 @@ close F; pir_output_is(<<'CODE', <<'OUT', "subroutine in external file"); -.sub test @MAIN +.sub test :main .local int x x = 10 .const int y = 20 @@ -341,7 +341,7 @@ # Including a non-existent file should produce an error .include "non_existent.imc" # An error should have been raised -.sub test @MAIN +.sub test :main # dummy, because a main function is expected end .end @@ -365,7 +365,7 @@ my $ENOENT = $! + 0; open FOO, ">temp.imc" or die "Can't write temp.imc\n"; print FOO << "END_PIR"; -.sub test \@MAIN +.sub test \:main # run a OS command, and get the errmessge for the exit code .local string enoent_err_msg err enoent_err_msg, $ENOENT Index: imcc/t/syn/pod.t =================================================================== --- imcc/t/syn/pod.t (revision 9443) +++ imcc/t/syn/pod.t (working copy) @@ -8,7 +8,7 @@ # POD pir_output_is(<<'CODE', <<'OUT', "simple pod"); -.sub test @MAIN +.sub test :main print "pass\n" end .end @@ -20,7 +20,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "pod with decimal digits"); -.sub test @MAIN +.sub test :main print "pass\n" end .end @@ -32,7 +32,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "pod inside sub"); -.sub test @MAIN +.sub test :main print "pass\n" bsr _x end Index: imcc/t/syn/bsr.t =================================================================== --- imcc/t/syn/bsr.t (revision 9443) +++ imcc/t/syn/bsr.t (working copy) @@ -7,7 +7,7 @@ pir_output_is(<<'CODE', <<'OUT', "bsr 1"); # this tests register allocation/preserving of local bsr calls -.sub test @MAIN +.sub test :main $I0 = 2 $I1 = 3 bsr L @@ -26,7 +26,7 @@ ############################## pir_output_is(<<'CODE', <<'OUT', "stack calling conventions"); -.sub test @MAIN +.sub test :main .local int x x = 10 .const int y = 20 @@ -79,7 +79,7 @@ ############################## # pir_output_is(<<'CODE', <<'OUT', "fact with stack calling conventions"); -.sub test @MAIN +.sub test :main .local int counter counter = 5 save counter @@ -114,7 +114,7 @@ # this is considered a non local bsr # pir_output_is(<<'CODE', <<'OUT', "recursive bsr with saveall"); -.sub test @MAIN +.sub test :main $I0 = 5 # count $I1 = 1 # product save $I0 @@ -148,7 +148,7 @@ ############################## # tail recursion - caller saves pir_output_is(<<'CODE', <<'OUT', "tail recursive bsr"); -.sub test @MAIN +.sub test :main $I0 = 5 # count $I1 = 1 # product saveall @@ -179,7 +179,7 @@ ############################## # tail recursion - caller saves pir_output_is(<<'CODE', <<'OUT', "tail recursive bsr 2"); -.sub test @MAIN +.sub test :main $I0 = 5 # count $I1 = 1 # product saveall @@ -206,7 +206,7 @@ ############################## # tail recursion - caller saves pir_output_is(<<'CODE', <<'OUT', "tail recursive bsr - opt"); -.sub test @MAIN +.sub test :main $I0 = 5 # count $I1 = 1 # product saveall @@ -233,7 +233,7 @@ ############################## # tail recursion - caller saves - parrot calling convention pir_output_is(<<'CODE', <<'OUT', "tail recursive bsr, parrot cc"); -.sub test @MAIN +.sub test :main $I0 = _fact(1, 5) print $I0 print "\n" @@ -261,7 +261,7 @@ ############################## # coroutine pir_output_is(<<'CODE', <<'OUT', "coroutine"); -.sub test @MAIN +.sub test :main .local Coroutine co co = new Coroutine co = addr _routine @@ -285,7 +285,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "newsub"); - .sub test @MAIN + .sub test :main newsub P0, .Sub, _foo # PASM syntax only for now invokecc P0 end @@ -309,7 +309,7 @@ fasel $cut -.sub test \@MAIN +.sub test \:main print "ok 1\\n" end .end @@ -323,7 +323,7 @@ fasel $cut -.sub test \@MAIN +.sub test \:main print "ok 1\\n" end .end @@ -336,7 +336,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "bug #25948"); -.sub main @MAIN +.sub main :main goto L1 test: $I1 = 1 Index: imcc/t/syn/eval.t =================================================================== --- imcc/t/syn/eval.t (revision 9443) +++ imcc/t/syn/eval.t (working copy) @@ -10,7 +10,7 @@ ############################## pir_output_is(<<'CODE', <<'OUT', "eval pasm"); -.sub test @MAIN +.sub test :main $S0 = 'set S1, "in eval\n"' concat $S0, "\n" concat $S0, "print S1\nend\n" @@ -26,7 +26,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "eval pir"); -.sub test @MAIN +.sub test :main $S1 = ".sub _foo\n" concat $S1, '$S1 = "42\n"' concat $S1, "\nprint $S1\nend\n" @@ -53,7 +53,7 @@ # 7 ##### -.sub test @MAIN +.sub test :main I1 = 5 $S0 = ".sub _e\nif I1 == 6 goto LAB\nend\n.end\n" compreg P2, "PIR" @@ -70,7 +70,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "intersegment branch 2"); -.sub test @MAIN +.sub test :main I1 = 4 $S0 = ".sub _e\nif I1 <= 6 goto LAB\nend\n.end\n" compreg P2, "PIR" @@ -87,7 +87,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "intersegment branch 3"); -.sub test @MAIN +.sub test :main I1 = 4 compreg P2, "PIR" $S0 = ".sub _e\nif I1 <= 5 goto LAB\nend\n.end\n" @@ -108,7 +108,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "intersegment branch 4"); -.sub test @MAIN +.sub test :main I1 = 4 compreg P2, "PIR" $S0 = ".sub _e\nif I1 <= 5 goto LAB\nend\n.end\n" @@ -130,7 +130,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "eval - same constants"); -.sub test @MAIN +.sub test :main print "hello" print "\n" $S0 = 'print "hello"' Index: imcc/t/syn/objects.t =================================================================== --- imcc/t/syn/objects.t (revision 9443) +++ imcc/t/syn/objects.t (working copy) @@ -11,7 +11,7 @@ pir_output_is(<<'CODE', <<'OUT', "meth call syntax"); -.sub test @MAIN +.sub test :main .local pmc class .local pmc obj newclass class, "Foo" @@ -34,7 +34,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "meth call syntax m.o(arg)"); -.sub test @MAIN +.sub test :main .local pmc class .local pmc obj newclass class, "Foo" @@ -60,7 +60,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "meth call ret = o.m(arg)"); -.sub test @MAIN +.sub test :main .local pmc class .local pmc obj newclass class, "Foo" @@ -89,7 +89,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "meth call syntax, string"); -.sub test @MAIN +.sub test :main .local pmc class .local pmc obj .local string meth @@ -119,7 +119,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "initializer"); -.sub test @MAIN +.sub test :main newclass P1, "Foo" subclass P2, P1, "Bar" subclass P3, P2, "Baz" @@ -160,7 +160,7 @@ pir_output_is(<<'CODE', <<'OUT', "meth call syntax - method, self"); -.sub test @MAIN +.sub test :main .local pmc class .local pmc obj newclass class, "Foo" @@ -188,7 +188,7 @@ pir_output_is(<<'CODE', <<'OUT', "explicit meth call syntax"); -.sub test @MAIN +.sub test :main .local pmc class .local pmc obj newclass class, "Foo" @@ -213,7 +213,7 @@ pir_output_is(<<'CODE', <<'OUT', "explicit meth call syntax, meth var"); -.sub test @MAIN +.sub test :main .local pmc class .local pmc obj .local string meth @@ -240,7 +240,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "explicit meth call syntax, args"); -.sub test @MAIN +.sub test :main .local pmc class .local pmc obj newclass class, "Foo" @@ -278,7 +278,7 @@ pir_output_is(<<'CODE', <<'OUT', "explicit meth call syntax"); -.sub test @MAIN +.sub test :main .local pmc class .local pmc obj newclass class, "Foo" @@ -303,7 +303,7 @@ pir_output_is(<<'CODE', <<'OUT', "meth call syntax - reserved word"); -.sub test @MAIN +.sub test :main .local pmc class .local pmc obj newclass class, "Foo" Index: imcc/t/syn/tail.t =================================================================== --- imcc/t/syn/tail.t (revision 9443) +++ imcc/t/syn/tail.t (working copy) @@ -11,7 +11,7 @@ $ENV{TEST_PROG_ARGS} = '-Oc'; pir_output_is(<<'CODE', <<'OUT', "tail call optimization, final position"); -.sub _main @MAIN +.sub _main :main $P1 = new Integer $P1 = 20 $P2 = new Integer @@ -95,7 +95,7 @@ skip("missing HLL :slurp syntax", 3); pir_output_is(<<'CODE', <<'OUT', "tail call optimization, intermediate position"); -.sub _main @MAIN +.sub _main :main $P1 = new Integer $P1 = 20 $P2 = new Integer @@ -177,7 +177,7 @@ pir_output_is(<<'CODE', <<'OUT', "tail call optimization, implicit final return"); -.sub _main @MAIN +.sub _main :main $P1 = new Integer $P1 = 20 @@ -259,7 +259,7 @@ pir_output_is(<<'CODE', <<'OUT', ":flatten in .return"); -.sub _main @MAIN +.sub _main :main $P1 = new Integer $P1 = 20 @@ -318,7 +318,7 @@ } pir_output_is(<<'CODE', <<'OUT', "new tail call syntax"); -.sub main @MAIN +.sub main :main $S0 = foo() print $S0 .end @@ -336,7 +336,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "new tail method call syntax"); -.sub main @MAIN +.sub main :main .local pmc cl, o, n cl = newclass "Foo" addattribute cl, "n" Index: imcc/t/syn/clash.t =================================================================== --- imcc/t/syn/clash.t (revision 9443) +++ imcc/t/syn/clash.t (working copy) @@ -6,7 +6,7 @@ use Parrot::Test tests => 15; pir_output_is(<<'CODE', <<'OUT', "if/unless"); -.sub test @MAIN +.sub test :main $I0 = 0 if $I0 goto nok1 print "ok 1\n" @@ -29,7 +29,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "if/unless"); -.sub test @MAIN +.sub test :main $I0 = 0 $I1 = 1 if $I0 == $I1 goto nok1 @@ -58,7 +58,7 @@ pir_output_is(<<'CODE', <<'OUT', "new"); -.sub test @MAIN +.sub test :main $P1 = new String $P1 = "ok 1\n" new P1, .String @@ -74,7 +74,7 @@ pir_output_is(<<'CODE', <<'OUT', "clone"); -.sub test @MAIN +.sub test :main $P1 = new String $P1 = "ok 1\n" $P0 = clone $P1 @@ -92,7 +92,7 @@ pir_output_is(<<'CODE', <<'OUT', "defined"); -.sub test @MAIN +.sub test :main $P1 = new Hash $I0 = defined $P1 new P1, .Hash @@ -110,7 +110,7 @@ pir_output_is(<<'CODE', <<'OUT', "defined keyed"); -.sub test @MAIN +.sub test :main $P1 = new Hash $P1["a"] = "ok 1\n" $I0 = defined $P1["a"] @@ -134,7 +134,7 @@ pir_output_is(<<'CODE', <<'OUT', "parrot op as identifier"); -.sub test @MAIN +.sub test :main .local int set set = 5 print set @@ -151,7 +151,7 @@ pir_output_is(<<'CODE', <<'OUT', "parrot op as label"); -.sub test @MAIN +.sub test :main null I0 goto set set: @@ -172,7 +172,7 @@ OUT pir_output_like(<<'CODE', <<'OUTPUT', "new with a native type"); -.sub test @MAIN +.sub test :main $P1 = new INTVAL print "never\n" end @@ -182,7 +182,7 @@ OUTPUT pir_output_is(<<'CODE', <<'OUTPUT', "setline w comment"); -.sub test @MAIN +.sub test :main setline 1 # comment print "ok\n" end @@ -192,7 +192,7 @@ OUTPUT pir_output_is(<<'CODE', <<'OUTPUT', "setfile w comment"); -.sub test @MAIN +.sub test :main setfile "foo" # comment print "ok\n" end @@ -202,7 +202,7 @@ OUTPUT pir_output_is(<<'CODE', <<'OUTPUT', "eq_num => eq"); -.sub test @MAIN +.sub test :main .local int i .local int j i = 1 @@ -218,7 +218,7 @@ OUTPUT pir_output_is(<<'CODE', <<'OUTPUT', "eq_num => eq mixed => eq_n_n"); -.sub test @MAIN +.sub test :main .local int i .local float j i = 1 @@ -234,7 +234,7 @@ OUTPUT pir_output_like(<<'CODE', <<'OUT', "undefined ident"); -.sub test @MAIN +.sub test :main print no_such .end CODE @@ -242,7 +242,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "label ident"); -.sub test @MAIN +.sub test :main branch no_such end no_such: Index: imcc/t/syn/macro.t =================================================================== --- imcc/t/syn/macro.t (revision 9443) +++ imcc/t/syn/macro.t (working copy) @@ -8,7 +8,7 @@ # macro tests pir_output_is( <<'CODE', < 11; -pir_2_pasm_like(<<'CODE', <<'OUT', 'end in @MAIN'); -.sub _main @MAIN +pir_2_pasm_like(<<'CODE', <<'OUT', 'end in :main'); +.sub _main :main noop .end CODE Index: imcc/t/reg/spill.t =================================================================== --- imcc/t/reg/spill.t (revision 9443) +++ imcc/t/reg/spill.t (working copy) @@ -11,7 +11,7 @@ # Test the ability of the register allocator to # generate spills. # -.sub test @MAIN +.sub test :main $I0 = 0 $I1 = 1 $I2 = 2 @@ -85,7 +85,7 @@ # Test the ability of the register allocator to # generate spills. # -.sub test @MAIN +.sub test :main $I0 = 0 $I1 = 1 $I2 = 2 @@ -243,7 +243,7 @@ # combination with PCC calling convention and overflow arguments. # Slightly redundant with tests in t/syn/pcc.t but please leave. # -.sub test @MAIN +.sub test :main _foo(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40) end .end @@ -334,7 +334,7 @@ # # Another spill test # -.sub test @MAIN +.sub test :main $I0 = 0 $I1 = 1 $I2 = 2 @@ -434,7 +434,7 @@ .namespace ["Foo"] -.sub __biginit @MAIN +.sub __biginit :main newclass $P0, "Foo" $I1 = find_type "Foo" $P1 = new $I1 Index: imcc/t/reg/alloc.t =================================================================== --- imcc/t/reg/alloc.t (revision 9443) +++ imcc/t/reg/alloc.t (working copy) @@ -9,7 +9,7 @@ # if the side-effect of newsub/continuation isn't # detected this program prints "Hi\nalligator\n" -.sub main @MAIN +.sub main :main $P0 = new .String $P0 = "Hi\n" $I0 = 2 Index: imcc/parser_util.c =================================================================== --- imcc/parser_util.c (revision 9443) +++ imcc/parser_util.c (working copy) @@ -705,7 +705,7 @@ /* * create sub PMC * - * TODO if a sub was denoted @MAIN return that instead + * TODO if a sub was denoted :main return that instead */ sub = pmc_new(interp, enum_class_Eval); sub_data = PMC_sub(sub); Index: editor/imc.vim.in =================================================================== --- editor/imc.vim.in (revision 9443) +++ editor/imc.vim.in (working copy) @@ -36,7 +36,7 @@ syn match imcDirective /\.\(include|pcc_begin|pcc_end\)/ syn match imcDirective /\.\(pcc_begin_return|pcc_end_return\)/ syn match imcDirective /\.\(pcc_begin_yield|pcc_end_yield\)/ -syn keyword imcDirective non_prototyped prototyped @LOAD @MAIN +syn keyword imcDirective non_prototyped prototyped :load @MAIN " imcWord before imcRegister " FIXME :: in identifiers and labels Index: editor/pir-mode.el =================================================================== --- editor/pir-mode.el (revision 9443) +++ editor/pir-mode.el (working copy) @@ -218,7 +218,7 @@ (defvar pir-dollar-register-regexp "\\$[INPS][0-9]+") (defvar pir-directives - '("method" "non_prototyped" "prototyped" "@LOAD" "@MAIN")) + '("method" "non_prototyped" "prototyped" ":load" "@MAIN")) (defvar pir-dotted-directives '(".sub" ".pcc_sub" ".end" ".emit" ".eom" ".const" ".namespace" Index: compilers/pge/PGE.pir =================================================================== --- compilers/pge/PGE.pir (revision 9443) +++ compilers/pge/PGE.pir (working copy) @@ -8,14 +8,14 @@ (via .include) each of the separate PGE modules into a single compilation unit, and then calls the "__onload" subroutines for each. We do this because as of this writing (2005-May-03) the semantics of -multiple @LOAD pragmas in a single compilation unit aren't well +multiple :load pragmas in a single compilation unit aren't well defined. =cut .namespace [ "PGE" ] -.sub "__onload" @LOAD +.sub "__onload" :load .local pmc load load_bytecode "Data/Escape.pbc" load = find_global "PGE::TokenHash", "__onload" Index: classes/sub.pmc =================================================================== --- classes/sub.pmc (revision 9443) +++ classes/sub.pmc (working copy) @@ -84,10 +84,10 @@ * - private1 ... Fixup is done * - private2 ... tailcall invoked this Sub * - private3 ... pythonic coroutine generator flag - * - private4 ... @MAIN - * - private5 ... @LOAD - * - private6 ... @IMMEDIATE - * - private7 ... @POSTCOMP + * - private4 ... :main (nee @MAIN) + * - private5 ... :load (nee @LOAD) + * - private6 ... :immediate (nee @IMMEDIATE) + * - private7 ... :postcomp (nee @POSTCOMP) * * see also the enum in include/parrot/sub.h * @@ -465,7 +465,7 @@ * - start offset in byte-code segment * - end offset in byte-code segment * - segment TODO ??? - * - flags (i.e. @LOAD pragma and such) + * - flags (i.e. :load pragma and such) * - name of the sub's label * - name_space * - HLL_id Index: t/pmc/perlint.t =================================================================== --- t/pmc/perlint.t (revision 9443) +++ t/pmc/perlint.t (working copy) @@ -2015,7 +2015,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "check whether interface is done"); -.sub test @MAIN +.sub test :main .local pmc pmc1 pmc1 = new PerlInt .local int bool1 @@ -2038,7 +2038,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "Fix for a minor problem"); -.sub test @MAIN +.sub test :main $P1 = new PerlInt $P1 = 5 $P2 = new PerlNum Index: t/pmc/mmd.t =================================================================== --- t/pmc/mmd.t (revision 9443) +++ t/pmc/mmd.t (working copy) @@ -364,7 +364,7 @@ pir_output_is(<<'CODE', <<'OUT', "first dynamic MMD call"); -.sub main @MAIN +.sub main :main .local pmc F, B, f, b, m, s newclass F, "Foo" f = new "Foo" @@ -383,13 +383,13 @@ foo(b, f) .end -.sub foo method, @MULTI(Foo, Bar) +.sub foo method, :multi(Foo, Bar) .param pmc x .param pmc y print " Foo::foo\n" .end -.sub foo method, @MULTI(Bar, Foo) +.sub foo method, :multi(Bar, Foo) .param pmc x .param pmc y print " Bar::foo\n" @@ -403,19 +403,19 @@ pir_output_is(<<'CODE', <<'OUT', "MMD on argument count"); .namespace ["main"] -.sub main @MAIN +.sub main :main p("ok 1\n") p("-twice", "ok 2\n") .end .namespace [""] -.sub p @MULTI(string) +.sub p :multi(string) .param string s print s .end -.sub p @MULTI(string, string) +.sub p :multi(string, string) .param string opt .param string s if opt != '-twice' goto no_twice @@ -433,19 +433,19 @@ pir_output_is(<<'CODE', <<'OUT', "MMD on mative types"); .namespace ["main"] -.sub main @MAIN +.sub main :main p("ok 1\n") p(42) .end .namespace [""] -.sub p @MULTI(string) +.sub p :multi(string) .param string s print s .end -.sub p @MULTI(int) +.sub p :multi(int) .param int i print i print "\n" @@ -457,7 +457,7 @@ pir_output_is(<<'CODE', <<'OUT', "MMD on PMC types"); .namespace ["main"] -.sub main @MAIN +.sub main :main $P0 = new String $P0 = "ok 1\n" $P1 = new PerlString @@ -476,13 +476,13 @@ .namespace [""] -.sub p @MULTI(String) +.sub p :multi(String) .param pmc p print "String " print p .end -.sub p @MULTI(PerlString) +.sub p :multi(PerlString) .param pmc p print "PerlSt " print p @@ -496,7 +496,7 @@ pir_output_like(<<'CODE', <<'OUT', "MMD on PMC types, invalid"); .namespace ["main"] -.sub main @MAIN +.sub main :main $P0 = new String $P0 = "ok 1\n" $P1 = new PerlString @@ -517,13 +517,13 @@ .namespace [""] -.sub p @MULTI(String) +.sub p :multi(String) .param pmc p print "String " print p .end -.sub p @MULTI(PerlString) +.sub p :multi(PerlString) .param pmc p print "PerlSt " print p @@ -538,7 +538,7 @@ pir_output_is(<<'CODE', <<'OUT', "MMD on PMC types 3"); .namespace ["main"] -.sub main @MAIN +.sub main :main $P0 = new String $P0 = "ok 1\n" $P1 = new PerlString @@ -560,19 +560,19 @@ .namespace [""] -.sub p @MULTI(String) +.sub p :multi(String) .param pmc p print "String " print p .end -.sub p @MULTI(PerlString) +.sub p :multi(PerlString) .param pmc p print "PerlSt " print p .end -.sub p @MULTI(Integer) +.sub p :multi(Integer) .param pmc p print "Intege " print p @@ -588,7 +588,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "MMD on PMC types, global namespace"); -.sub main @MAIN +.sub main :main $P0 = new String $P0 = "ok 1\n" $P1 = new PerlString @@ -605,13 +605,13 @@ p($P1) .end -.sub p @MULTI(String) +.sub p :multi(String) .param pmc p print "String " print p .end -.sub p @MULTI(PerlString) +.sub p :multi(PerlString) .param pmc p print "PerlSt " print p @@ -627,7 +627,7 @@ .namespace ["Some"] -.sub main @MAIN +.sub main :main $P0 = new String $P0 = "ok 1\n" $P1 = new PerlString @@ -644,13 +644,13 @@ p($P1) .end -.sub p @MULTI(String) +.sub p :multi(String) .param pmc p print "String " print p .end -.sub p @MULTI(PerlString) +.sub p :multi(PerlString) .param pmc p print "PerlSt " print p @@ -664,7 +664,7 @@ pir_output_is(<<'CODE', <<'OUT', "MMD on PMC types - Any"); -.sub main @MAIN +.sub main :main $P0 = new String $P0 = "ok 1\n" $P1 = new PerlString @@ -681,26 +681,26 @@ .namespace [""] -.sub p @MULTI(String) +.sub p :multi(String) .param pmc p print "String " print p .end -.sub p @MULTI(PerlString) +.sub p :multi(PerlString) .param pmc p print "PerlSt " print p .end -.sub p @MULTI(_) +.sub p :multi(_) .param pmc p print "Any " print p print "\n" .end -.sub q @MULTI(pmc) +.sub q :multi(pmc) .param pmc p print "Any " print p @@ -715,7 +715,7 @@ OUT pir_output_is(<<'CODE', <<'OUTPUT', "__add as function - Int, Float"); -.sub main @MAIN +.sub main :main .local pmc d, l, r d = new Integer l = new Integer @@ -732,7 +732,7 @@ OUTPUT pir_output_is(<<'CODE', <<'OUTPUT', "__add as method"); -.sub main @MAIN +.sub main :main .local pmc d, l, r l = new Integer r = new Integer @@ -748,7 +748,7 @@ OUTPUT pir_output_is(<<'CODE', <<'OUTPUT', "__add as method - inherited"); -.sub main @MAIN +.sub main :main .local pmc d, l, r l = new PerlInt r = new PerlInt @@ -763,7 +763,7 @@ OUTPUT pir_output_is(<<'CODE', <<'OUTPUT', "__add as method - Int, Float"); -.sub main @MAIN +.sub main :main .local pmc d, l, r l = new Integer r = new Float @@ -781,7 +781,7 @@ SKIP: { skip("bound method disabled", 1); pir_output_is(<<'CODE', <<'OUTPUT', "bound __add method"); -.sub main @MAIN +.sub main :main .local pmc d, l, r, m d = new Integer l = new Integer @@ -807,7 +807,7 @@ } pir_output_is(<<'CODE', <<'OUTPUT', "Integer subclasses"); -.sub main @MAIN +.sub main :main .local pmc d, l, r, cl cl = subclass "Integer", "AInt" d = new "AInt" @@ -841,7 +841,7 @@ OUTPUT pir_output_is(<<'CODE', <<'OUTPUT', "Integer subclasses, n_add"); -.sub main @MAIN +.sub main :main $P0 = subclass "Integer", "AInt" $P0 = new "AInt" $P1 = new Integer @@ -853,7 +853,7 @@ print "\n" .end .namespace ["AInt"] -.sub __add @MULTI(AInt, Integer) +.sub __add :multi(AInt, Integer) .param pmc l .param pmc r print l @@ -873,7 +873,7 @@ open P, ">$temp" or die "can't write $temp"; print P <<'EOF'; -.sub __add @MULTI(Integer, Integer) +.sub __add :multi(Integer, Integer) .param pmc l .param pmc r print l @@ -907,21 +907,21 @@ pir_output_is(<<'CODE', <<'OUTPUT', "mmd bug reported by Jeff"); .namespace ['Foo'] -.sub bar method, @MULTI(Foo, string) +.sub bar method, :multi(Foo, string) print "string\n" .end -.sub bar method, @MULTI(Foo, pmc) +.sub bar method, :multi(Foo, pmc) print "PMC\n" .end -.sub bar method, @MULTI(Foo) +.sub bar method, :multi(Foo) print "nothing\n" .end .namespace [''] -.sub main @MAIN +.sub main :main newclass $P0, 'Foo' $I0 = find_type 'Foo' @@ -943,7 +943,7 @@ } pir_output_is(<<'CODE', <<'OUTPUT', "use a core func for an object"); -.sub main @MAIN +.sub main :main .local pmc d, l, r, cl cl = newclass "AInt" addattribute cl, ".i" @@ -998,17 +998,17 @@ OUTPUT pir_output_is(<<'CODE', <<'OUTPUT', "multisub vs find_name"); -.sub main @MAIN +.sub main :main $P0 = find_name "foo" $S0 = classname $P0 print $S0 print "\n" .end -.sub foo method, @MULTI(string) +.sub foo method, :multi(string) .param pmc x print " foo\n" .end -.sub foo method, @MULTI(pmc) +.sub foo method, :multi(pmc) .param pmc x print " foo\n" .end Index: t/pmc/pmc.t =================================================================== --- t/pmc/pmc.t (revision 9443) +++ t/pmc/pmc.t (working copy) @@ -445,7 +445,7 @@ OUTPUT output_is(<<'CODE', <<'OUT', ".const - Sub constant"); -.pcc_sub @MAIN main: +.pcc_sub :main main: print "ok 1\n" .const .Sub P0 = "foo" invokecc P0 @@ -481,7 +481,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "pmc constant 1"); -.sub main @MAIN +.sub main :main .const Integer i = "42" print i print "\n" @@ -491,7 +491,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "pmc constant 2"); -.sub main @MAIN +.sub main :main .const .Integer i = "42" print i print "\n" Index: t/pmc/freeze.t =================================================================== --- t/pmc/freeze.t (revision 9443) +++ t/pmc/freeze.t (working copy) @@ -762,7 +762,7 @@ OUTPUT pir_output_is(<<'CODE', <<'OUTPUT', "freeze/thaw a ResizableBooleanArray"); -.sub test @MAIN +.sub test :main .local pmc original_arr, thawed_arr .local string frozen_arr original_arr = new ResizableBooleanArray @@ -826,7 +826,7 @@ OUTPUT pir_output_is(<<'CODE', <<'OUTPUT', "freeze/thaw a ResizablePMCArray"); -.sub test @MAIN +.sub test :main .local pmc original_arr, thawed_arr .local string frozen_arr original_arr = new .ResizablePMCArray Index: t/pmc/eval.t =================================================================== --- t/pmc/eval.t (revision 9443) +++ t/pmc/eval.t (working copy) @@ -124,7 +124,7 @@ pir_output_is(<<'CODE', <<'OUTPUT', "PIR compiler sub"); -.sub test @MAIN +.sub test :main .local NCI compiler find_global compiler, "xcompile" compreg "XPASM", compiler @@ -161,7 +161,7 @@ pir_output_is(<<'CODE', <<'OUTPUT', "bug #31467"); - .sub main @MAIN + .sub main :main $P1 = new Hash newsub $P0, .Sub, _builtin $P1['builtin'] = $P0 @@ -194,7 +194,7 @@ pir_output_is(<<'CODE', <<'OUTPUT', "compile PAST in PIR"); -.sub main @MAIN +.sub main :main .local pmc past_compiler past_compiler = compreg "PAST" .local string past_source @@ -234,7 +234,7 @@ pir_output_is(<<'CODE', <<'OUTPUT', "compile PAST in PASM in PIR"); -.sub test @MAIN +.sub test :main # PIR .local pmc pasm_compiler @@ -278,7 +278,7 @@ OUTPUT pir_output_is(<<'CODE', <<'OUTPUT', "PIR compiler sub PASM"); -.sub main @MAIN +.sub main :main register_compiler() .local pmc compiler, invokable @@ -317,7 +317,7 @@ OUTPUT pir_output_is(<<'CODE', <<'OUTPUT', "PIR compiler sub PIR"); -.sub main @MAIN +.sub main :main register_compiler() .local pmc compiler, invokable @@ -352,7 +352,7 @@ code = ".sub anonymous" $S0 = counter code .= $S0 - code .= " @ANON\n" + code .= " :anon\n" code .= "print \"" code .= printme code .= "\\n\"\n" @@ -367,7 +367,7 @@ OUTPUT pir_output_is(<<'CODE', <<'OUTPUT', "eval.get_string"); -.sub main @MAIN +.sub main :main .local pmc f1, f2 .local pmc io @@ -392,7 +392,7 @@ pir_compiler = compreg "PIR" code = ".sub " code .= name - code .= " @LOAD\n" + code .= " :load\n" code .= "print \"" code .= printme code .= "\\n\"\n" @@ -411,7 +411,7 @@ }; pir_output_is(<<'CODE', <<'OUTPUT', "eval.freeze"); -.sub main @MAIN +.sub main :main .local pmc f, e .local pmc io f = compi("foo_1", "hello from foo_1") @@ -444,7 +444,7 @@ OUTPUT pir_output_is(<<'CODE', <<'OUTPUT', "eval.thaw"); -.sub main @MAIN +.sub main :main .local pmc io, e .local string file .local int size Index: t/pmc/perlstring.t =================================================================== --- t/pmc/perlstring.t (revision 9443) +++ t/pmc/perlstring.t (working copy) @@ -1987,7 +1987,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "lower method"); -.sub _main @MAIN +.sub _main :main .local pmc pmc1 pmc1 = new String pmc1 = "ABCdef\n" Index: t/pmc/sub.t =================================================================== --- t/pmc/sub.t (revision 9443) +++ t/pmc/sub.t (working copy) @@ -527,7 +527,7 @@ OUTPUT output_is(<<'CODE', <<'OUT', "MAIN pragma, syntax only"); -.pcc_sub @MAIN _main: +.pcc_sub :main _main: print "ok\n" end CODE @@ -536,13 +536,13 @@ open S, ">$temp" or die "Can't write $temp"; print S <<'EOF'; - .pcc_sub @LOAD _sub1: + .pcc_sub :load _sub1: print "in sub1\n" returncc EOF close S; -output_is(<<'CODE', <<'OUTPUT', 'load_bytecode @LOAD'); +output_is(<<'CODE', <<'OUTPUT', 'load_bytecode :load'); .pcc_sub _main: print "main\n" load_bytecode "temp.pasm" @@ -558,13 +558,13 @@ print S <<'EOF'; .pcc_sub _error: print "error\n" - .pcc_sub @LOAD _sub1: + .pcc_sub :load _sub1: print "in sub1\n" returncc EOF close S; -output_is(<<'CODE', <<'OUTPUT', 'load_bytecode @LOAD second sub'); +output_is(<<'CODE', <<'OUTPUT', 'load_bytecode :load second sub'); .pcc_sub _main: print "main\n" load_bytecode "temp.pasm" @@ -578,7 +578,7 @@ system(".$PConfig{slash}parrot$PConfig{exe} -o temp.pbc $temp"); -output_is(<<'CODE', <<'OUTPUT', 'load_bytecode @LOAD in pbc'); +output_is(<<'CODE', <<'OUTPUT', 'load_bytecode :load in pbc'); .pcc_sub _main: print "main\n" load_bytecode "temp.pbc" @@ -592,7 +592,7 @@ open S, ">$temp" or die "Can't write $temp"; print S <<'EOF'; - .pcc_sub @LOAD _sub1: + .pcc_sub :load _sub1: print "in sub1\n" returncc .pcc_sub _sub2: @@ -642,7 +642,7 @@ .pcc_sub _sub1: print "in sub1\n" returncc - .pcc_sub @LOAD _sub2: + .pcc_sub :load _sub2: print "in sub2\n" returncc EOF @@ -686,10 +686,10 @@ open S, ">$temp" or die "Can't write $temp"; print S <<'EOF'; - .pcc_sub @LOAD _sub1: + .pcc_sub :load _sub1: print "in sub1\n" returncc - .pcc_sub @LOAD _sub2: + .pcc_sub :load _sub2: print "in sub2\n" returncc EOF @@ -733,39 +733,39 @@ back OUTPUT -output_is(<<'CODE', <<'OUTPUT', '@MAIN pragma'); +output_is(<<'CODE', <<'OUTPUT', ':main pragma'); .pcc_sub _first: print "first\n" returncc -.pcc_sub @MAIN _main: +.pcc_sub :main _main: print "main\n" end CODE main OUTPUT -output_is(<<'CODE', <<'OUTPUT', 'two @MAIN pragmas'); +output_is(<<'CODE', <<'OUTPUT', 'two :main pragmas'); .pcc_sub _first: print "first\n" returncc -.pcc_sub @MAIN _main: +.pcc_sub :main _main: print "main\n" end -.pcc_sub @MAIN _second: +.pcc_sub :main _second: print "second\n" returncc CODE main OUTPUT -output_is(<<'CODE', <<'OUTPUT', '@MAIN pragma call subs'); +output_is(<<'CODE', <<'OUTPUT', ':main pragma call subs'); .pcc_sub _first: print "first\n" returncc .pcc_sub _second: print "second\n" returncc -.pcc_sub @MAIN _main: +.pcc_sub :main _main: print "main\n" find_global P0, "_first" invokecc P0 @@ -783,14 +783,14 @@ open S, ">$temp" or die "Can't write $temp"; print S <<'EOF'; .emit - .pcc_sub @LOAD _sub1: + .pcc_sub :load _sub1: print "in sub1\n" returncc .eom EOF close S; -output_is(<<'CODE', <<'OUTPUT', 'load_bytecode @LOAD first sub - imc'); +output_is(<<'CODE', <<'OUTPUT', 'load_bytecode :load first sub - imc'); .pcc_sub _main: print "main\n" load_bytecode "temp.imc" @@ -811,14 +811,14 @@ .emit # LOAD or other pragmas are only evaluated on the first # instruction of a compilation unit - .pcc_sub @LOAD _sub1: + .pcc_sub :load _sub1: print "in sub1\n" returncc .eom EOF close S; -output_is(<<'CODE', <<'OUTPUT', 'load_bytecode @LOAD second sub - imc'); +output_is(<<'CODE', <<'OUTPUT', 'load_bytecode :load second sub - imc'); .pcc_sub _main: print "main\n" load_bytecode "temp.imc" @@ -842,7 +842,7 @@ EOF close S; -output_is(<<'CODE', <<'OUTPUT', 'load_bytecode no @LOAD - imc'); +output_is(<<'CODE', <<'OUTPUT', 'load_bytecode no :load - imc'); .pcc_sub _main: print "main\n" load_bytecode "temp.imc" @@ -855,7 +855,7 @@ pir_output_like(<<'CODE', <<'OUTPUT', "warn on in main"); -.sub _main @MAIN +.sub _main :main .include "warnings.pasm" warningson .PARROT_WARNINGS_UNDEF_FLAG _f1() @@ -869,7 +869,7 @@ OUTPUT pir_output_is(<<'CODE', <<'OUTPUT', "warn on in sub"); -.sub _main @MAIN +.sub _main :main .include "warnings.pasm" _f1() $P0 = new PerlUndef @@ -884,7 +884,7 @@ OUTPUT pir_output_like(<<'CODE', <<'OUTPUT', "warn on in sub, turn off in f2"); -.sub _main @MAIN +.sub _main :main .include "warnings.pasm" _f1() $P0 = new PerlUndef @@ -933,7 +933,7 @@ .pcc_sub dummy: print "never\n" noop -.pcc_sub @MAIN main: +.pcc_sub :main main: .include "interpinfo.pasm" interpinfo P20, .INTERPINFO_CURRENT_SUB print P20 @@ -957,7 +957,7 @@ OUTPUT pir_output_is(<<'CODE', <<'OUTPUT', "sub names w newsub"); -.sub main @MAIN +.sub main :main .include "interpinfo.pasm" $P0 = interpinfo .INTERPINFO_CURRENT_SUB print $P0 @@ -980,7 +980,7 @@ OUTPUT pir_output_is(<<'CODE', <<'OUTPUT', "caller introspection"); -.sub main @MAIN +.sub main :main .include "interpinfo.pasm" # this test will fail when run with -Oc # as the call chain is cut down with tail calls @@ -1041,10 +1041,10 @@ # its not captured by the test system my $code = << 'CODE'; -.sub optc @IMMEDIATE, @POSTCOMP +.sub optc :immediate, :postcomp print "initial\n" .end -.sub _main @MAIN +.sub _main :main print "main\n" .end CODE @@ -1052,12 +1052,12 @@ initial main OUTPUT - my $descr = '@IMMEDIATE, @POSTCOMP'; + my $descr = ':immediate, :postcomp'; if ( exists $ENV{TEST_PROG_ARGS} and $ENV{TEST_PROG_ARGS} =~ m/-r / ) { TODO: { - local $TODO = "output from POSTCOMP is lost"; + local $TODO = "output from :postcomp is lost"; output_is( $code, $output, $descr); }; } else { @@ -1065,8 +1065,8 @@ } } -pir_output_like(<<'CODE', <<'OUTPUT', '@ANON'); -.sub main @MAIN +pir_output_like(<<'CODE', <<'OUTPUT', ':anon'); +.sub main :main "foo"() print "ok\n" $P0 = global "new" @@ -1076,7 +1076,7 @@ $P0 = global "foo" .end -.sub "foo" @ANON +.sub "foo" :anon print "foo\n" "new"() .end @@ -1094,11 +1094,11 @@ open S, ">test_l1.imc" or die "Can't write test_l1.imc"; print S <<'EOF'; -.sub l11 @LOAD +.sub l11 :load print "l11\n" .end -.sub l12 @LOAD +.sub l12 :load print "l12\n" .end EOF @@ -1106,11 +1106,11 @@ open S, ">test_l2.imc" or die "Can't write test_l2.imc"; print S <<'EOF'; -.sub l21 @LOAD +.sub l21 :load print "l21\n" .end -.sub l22 @LOAD +.sub l22 :load print "l22\n" .end EOF @@ -1121,8 +1121,8 @@ END { unlink(qw/ test_l1.imc test_l2.imc test_l1.pbc test_l2.pbc /); }; -pir_output_is(<<'CODE', <<'OUTPUT', 'multiple @LOAD'); -.sub main @MAIN +pir_output_is(<<'CODE', <<'OUTPUT', 'multiple :load'); +.sub main :main print "main 1\n" load_bytecode "test_l1.imc" load_bytecode "test_l2.imc" @@ -1146,7 +1146,7 @@ OUTPUT pir_output_is(<<'CODE', <<'OUTPUT', "immediate code as const"); -.sub make_pi @IMMEDIATE, @ANON +.sub make_pi :immediate, :anon $N0 = atan 1.0, 1.0 $N0 *= 4 $P0 = new .Float @@ -1154,7 +1154,7 @@ .return ($P0) .end -.sub main @MAIN +.sub main :main .const .Sub pi = "make_pi" print pi print "\n" @@ -1164,7 +1164,7 @@ OUTPUT pir_output_is(<<'CODE', <<'OUTPUT', "immediate code as const - obj"); -.sub make_obj @IMMEDIATE, @ANON +.sub make_obj :immediate, :anon .local pmc cl, o cl = newclass "Foo" addattribute cl, 'x' @@ -1175,7 +1175,7 @@ .return (o) .end -.sub main @MAIN +.sub main :main .const .Sub o = "make_obj" $P0 = getattribute o, 'x' print $P0 Index: t/pmc/integer.t =================================================================== --- t/pmc/integer.t (revision 9443) +++ t/pmc/integer.t (working copy) @@ -311,7 +311,7 @@ OUTPUT pir_output_is(<< 'CODE', << 'OUTPUT', "n_"); -.sub main @MAIN +.sub main :main $P0 = new Integer $P1 = new Integer set $P0, 6 Index: t/pmc/fixedpmcarray.t =================================================================== --- t/pmc/fixedpmcarray.t (revision 9443) +++ t/pmc/fixedpmcarray.t (working copy) @@ -294,7 +294,7 @@ pir_output_like(<<'CODE', -.sub main @MAIN +.sub main :main .local pmc compares, cmp_fun # XXX doesnt work wit prederef of JIT bounds 1 @@ -381,7 +381,7 @@ pir_output_like(<<'CODE', <<'OUTPUT', "Getting unitialized elements"); -.sub main @MAIN +.sub main :main .local pmc arr1 arr1 = new FixedPMCArray arr1 = 2005 @@ -397,7 +397,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "Multi keys"); -.sub test @MAIN +.sub test :main .local pmc matrix, row .local pmc elem_in_pmc .local pmc elem_out_pmc Index: t/pmc/iter.t =================================================================== --- t/pmc/iter.t (revision 9443) +++ t/pmc/iter.t (working copy) @@ -1158,7 +1158,7 @@ pir_output_is(<<'CODE', <<'OUTPUT', "slice, get strings from array"); -.sub main @MAIN +.sub main :main .include "iterator.pasm" .local pmc ar ar = new PerlArray @@ -1326,7 +1326,7 @@ pir_output_is(<<'CODE', <<'OUTPUT', "iter.next method"); -.sub main @MAIN +.sub main :main new $P0, .PerlString set $P0, "abcdef" iter $P1, $P0 Index: t/pmc/config.t =================================================================== --- t/pmc/config.t (revision 9443) +++ t/pmc/config.t (working copy) @@ -21,7 +21,7 @@ use Cwd qw(cwd); pir_output_is(<<'CODE', <<'OUT', "get config hash"); -.sub main @MAIN +.sub main :main .include "iglobals.pasm" .local pmc config_hash, interp interp = getinterp @@ -35,7 +35,7 @@ OUT pir_output_is(<<'CODE', cwd, "prefix"); -.sub main @MAIN +.sub main :main .include "iglobals.pasm" .local pmc config_hash, interp interp = getinterp @@ -46,7 +46,7 @@ CODE pir_output_is(<<'CODE', <<'OUT', "load src/pbc from library path"); -.sub main @MAIN +.sub main :main load_bytecode "config.imc" print "ok 1\n" load_bytecode "config.pbc" Index: t/pmc/builtin.t =================================================================== --- t/pmc/builtin.t (revision 9443) +++ t/pmc/builtin.t (working copy) @@ -19,7 +19,7 @@ use Parrot::Test tests => 4; pir_output_is(<<'CODE', <<'OUT', "three ways to call a method"); -.sub main @MAIN +.sub main :main .local pmc x, y, cl, m x = new Float x = 1.0 @@ -46,7 +46,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "say"); -.sub main @MAIN +.sub main :main .local pmc io $I0 = say "ok 1" io = getstdout @@ -66,7 +66,7 @@ SKIP: { skip("bound methods - n/y", 2); pir_output_is(<<'CODE', <<'OUT', "bound methods"); -.sub main @MAIN +.sub main :main .local pmc x, y, cl, m x = new Float x = 1.0 @@ -96,7 +96,7 @@ OUT pir_output_is(<<'CODE', <<'OUT', "ParrotIO.puts"); -.sub main @MAIN +.sub main :main .local pmc o, m, cl o = getstdout $I0 = o."puts"("ok 1\n") Index: t/pmc/perlhash.t =================================================================== --- t/pmc/perlhash.t (revision 9443) +++ t/pmc/perlhash.t (working copy) @@ -1067,7 +1067,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "Setting with compound keys"); -.sub test @MAIN +.sub test :main .local pmc outer_hash outer_hash = new PerlHash .local pmc inner_hash @@ -1224,7 +1224,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "check whether interface is done"); -.sub test @MAIN +.sub test :main .local pmc pmc1 pmc1 = new PerlHash .local int bool1 @@ -1247,7 +1247,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "iter"); -.sub test @MAIN +.sub test :main new P0, .PerlHash set P0['a'], 'x' iter P1, P0 Index: t/pmc/io.t =================================================================== --- t/pmc/io.t (revision 9443) +++ t/pmc/io.t (working copy) @@ -388,7 +388,7 @@ pir_output_is(<<'CODE', <<'OUTPUT', 'puts method - PIR'); -.sub main @MAIN +.sub main :main .local string s s = "ok 2\n" .local pmc io Index: t/pmc/complex.t =================================================================== --- t/pmc/complex.t (revision 9443) +++ t/pmc/complex.t (working copy) @@ -740,7 +740,7 @@ OUTPUT pir_output_is(<< 'CODE', << 'OUTPUT', "sub"); -.sub main @MAIN +.sub main :main .local pmc d, f, c d = new Undef f = new Float @@ -768,7 +768,7 @@ OUTPUT pir_output_is(<< 'CODE', << 'OUTPUT', "i_sub"); -.sub main @MAIN +.sub main :main .local pmc f, c f = new Float f = 2.2 Index: t/pmc/sys.t =================================================================== --- t/pmc/sys.t (revision 9443) +++ t/pmc/sys.t (working copy) @@ -25,10 +25,10 @@ pir_output_is(<<'CODE', <" - print O, ".sub _main @MAIN\n" + print O, ".sub _main :main\n" print O, "\tprint \"Hello, World!\\n\"\n" print O, ".end\n" close O Index: t/pmc/resizablepmcarray.t =================================================================== --- t/pmc/resizablepmcarray.t (revision 9443) +++ t/pmc/resizablepmcarray.t (working copy) @@ -341,7 +341,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "check whether interface is done"); -.sub test @MAIN +.sub test :main .local pmc pmc1 pmc1 = new ResizablePMCArray .local int bool1 @@ -364,7 +364,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "inherited sort method"); -.sub test @MAIN +.sub test :main .local pmc ar ar = new ResizablePMCArray @@ -397,7 +397,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "push pmc"); -.sub test @MAIN +.sub test :main .local pmc pmc_arr, pmc_9999, pmc_10000 pmc_arr = new ResizablePMCArray pmc_9999 = new Float @@ -423,7 +423,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "push integer"); -.sub test @MAIN +.sub test :main .local pmc pmc_arr, pmc_9999 .local int int_10000 pmc_arr = new ResizablePMCArray @@ -449,7 +449,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "push string"); -.sub test @MAIN +.sub test :main .local pmc pmc_arr, pmc_9999 .local string string_10000 pmc_arr = new ResizablePMCArray @@ -475,7 +475,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "shift integer"); -.sub test @MAIN +.sub test :main .local pmc pmc_arr, elem pmc_arr = new ResizablePMCArray push pmc_arr, 4 @@ -588,7 +588,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "push and pop"); -.sub test @MAIN +.sub test :main .local float f, f_elem .local int i, i_elem, elements .local pmc p, p_elem, pmc_arr @@ -682,7 +682,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "unshift and shift"); -.sub test @MAIN +.sub test :main .local float f, f_elem .local int i, i_elem, elements .local pmc p, p_elem, pmc_arr @@ -776,7 +776,7 @@ # An Integer Matrix, as used by befunge as a playing field pir_output_is(<< 'CODE', << 'OUTPUT', "multi key access"); -.sub test @MAIN +.sub test :main .local pmc matrix, row_in, row_out matrix = new ResizablePMCArray row_in = new ResizableIntegerArray Index: t/pmc/perlnum.t =================================================================== --- t/pmc/perlnum.t (revision 9443) +++ t/pmc/perlnum.t (working copy) @@ -1107,7 +1107,7 @@ no warnings 'once'; local $TODO = "pending PerlInt's numeric tower morphinc semantics"; pir_output_is(<<'CODE', <<'OUT', "perlint should morph to num on cos()ing"); -.sub main @MAIN +.sub main :main .local pmc x, y # integer morphing for perlint print "perlint morph" Index: t/pmc/hash.t =================================================================== --- t/pmc/hash.t (revision 9443) +++ t/pmc/hash.t (working copy) @@ -337,7 +337,7 @@ ret: .end -.sub _main @MAIN +.sub _main :main new P30, .Hash print "round 1\n" I29 = 1 @@ -1315,7 +1315,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "iter"); -.sub __main__ @MAIN +.sub __main__ :main new P0, .Hash set P0['a'], 'x' iter P1, P0 @@ -1341,7 +1341,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "broken delete, thx to azuroth on irc"); .include "iterator.pasm" -.sub main @MAIN +.sub main :main .local pmc thash # just put in some dummy data... Index: t/pmc/object-meths.t =================================================================== --- t/pmc/object-meths.t (revision 9443) +++ t/pmc/object-meths.t (working copy) @@ -725,7 +725,7 @@ .end .namespace [""] -.sub _main @MAIN +.sub _main :main print "ok\n" .end CODE @@ -824,7 +824,7 @@ OUTPUT pir_output_is(<<'CODE', <<'OUTPUT', "method cache invalidation"); -.sub main @MAIN +.sub main :main .local pmc o, cl newclass cl, "Foo" subclass cl, cl, "Bar" @@ -874,7 +874,7 @@ SKIP: { skip("no bound NCI method", 1); pir_output_is(<<'CODE', <<'OUTPUT', "bound NCI method"); -.sub main @MAIN +.sub main :main .local pmc s, l, f s = new String s = "ABC\n" @@ -892,7 +892,7 @@ } pir_output_is(<<'CODE', <<'OUTPUT', "tailcallmeth"); -.sub main @MAIN +.sub main :main .local pmc cl, o, n cl = newclass "Foo" addattribute cl, "n" @@ -927,7 +927,7 @@ # \ / # \ / # F -.sub main @MAIN +.sub main :main .local pmc A, B, C, D, E, F, m, p, it newclass A, "A" newclass B, "B" @@ -958,7 +958,7 @@ pir_output_is(<<'CODE', <<'OUTPUT', "kind of a super"); -.sub main @MAIN +.sub main :main .local pmc cl, o cl = subclass "String", "MyString" o = new "MyString" @@ -980,7 +980,7 @@ OUTPUT pir_output_is(<<'CODE', <<'OUTPUT', "super 1"); -.sub main @MAIN +.sub main :main .local pmc o, cl cl = newclass 'Parent' cl = subclass cl, 'Child' Index: t/pmc/objects.t =================================================================== --- t/pmc/objects.t (revision 9443) +++ t/pmc/objects.t (working copy) @@ -1245,7 +1245,7 @@ pir_output_is(<<'CODE', <<'OUTPUT', "PMC as classes - subclass"); -.sub main @MAIN +.sub main :main .local pmc MyInt getclass $P0, "Integer" print "ok 1\n" @@ -1269,7 +1269,7 @@ pir_output_is(<<'CODE', <<'OUTPUT', "PMC as classes - instantiate"); -.sub main @MAIN +.sub main :main .local pmc MyInt getclass $P0, "Integer" print "ok 1\n" @@ -1289,7 +1289,7 @@ pir_output_is(<<'CODE', <<'OUTPUT', "PMC as classes - methods"); -.sub main @MAIN +.sub main :main .local pmc MyInt getclass $P0, "Integer" print "ok 1\n" @@ -1342,7 +1342,7 @@ pir_output_is(<<'CODE', <<'OUTPUT', "PMC as classes - mmd methods"); -.sub main @MAIN +.sub main :main .local pmc MyInt getclass $P0, "Integer" subclass MyInt, $P0, "MyInt" @@ -1384,7 +1384,7 @@ pir_output_is(<<'CODE', <<'OUTPUT', "PMC as classes - overridden mmd methods"); -.sub main @MAIN +.sub main :main .local pmc MyInt getclass $P0, "Integer" subclass MyInt, $P0, "MyInt" @@ -1408,7 +1408,7 @@ .end .namespace ["MyInt"] -.sub __add @MULTI(MyInt, MyInt) +.sub __add :multi(MyInt, MyInt) .param pmc self .param pmc right .param pmc dest @@ -1429,7 +1429,7 @@ pir_output_is(<<'CODE', <<'OUTPUT', "PMC as classes - derived 1"); -.sub main @MAIN +.sub main :main .local pmc MyInt .local pmc MyInt2 getclass $P0, "Integer" @@ -1493,7 +1493,7 @@ pir_output_is(<<'CODE', <<'OUTPUT', "PMC as classes - derived 2"); -.sub main @MAIN +.sub main :main .local pmc MyInt .local pmc MyInt2 getclass $P0, "Integer" @@ -1571,7 +1571,7 @@ local $TODO = "methods can't be overridden in derived class only"; pir_output_is(<<'CODE', <<'OUTPUT', "PMC as classes - derived 3"); -.sub main @MAIN +.sub main :main .local pmc MyInt .local pmc MyInt2 getclass $P0, "Integer" @@ -1636,7 +1636,7 @@ pir_output_is(<<'CODE', <<'OUTPUT', "subclassing ParrotClass"); -.sub main @MAIN +.sub main :main .local pmc cl .local pmc parent parent = getclass "ParrotClass" @@ -1683,7 +1683,7 @@ pir_output_is(<<'CODE', <<'OUTPUT', "instantiate - PIR"); -.sub main @MAIN +.sub main :main .local pmc cl cl = subclass "Integer", "Foo" .local pmc i @@ -1714,7 +1714,7 @@ { local $TODO = "new Px, Ix: argcP is wrong in __init method"; pir_output_is(<<'CODE', <<'OUTPUT', "__init argcP"); -.sub main @MAIN +.sub main :main $P0 = newclass "Foo" $I0 = find_type "Foo" @@ -1782,7 +1782,7 @@ } pir_output_is(<<'CODE', <<'OUTPUT', "namespace vs name"); -.sub main @MAIN +.sub main :main .local pmc o, cl, f newclass cl, "Foo" $I0 = find_type "Foo" @@ -1832,7 +1832,7 @@ OUTPUT pir_output_is(<<'CODE', <<'OUTPUT', "subclassed Integer bug"); -.sub _main @MAIN +.sub _main :main .local pmc class .local pmc a .local pmc b Index: t/pmc/n_arithmetics.t =================================================================== --- t/pmc/n_arithmetics.t (revision 9443) +++ t/pmc/n_arithmetics.t (working copy) @@ -24,7 +24,7 @@ ### Operations on a single INTVAL ### pir_output_is(<<'CODE', < P"); -.sub test @MAIN +.sub test :main .local string library_name library_name = 'libnci_test' .local pmc libnci_test @@ -2413,7 +2413,7 @@ OUTPUT pir_output_is(<< 'CODE', << 'OUTPUT', "conversion S <-> P"); -.sub test @MAIN +.sub test :main .local string library_name library_name = 'libnci_test' .local pmc libnci_test @@ -2431,7 +2431,7 @@ OUTPUT pir_output_is(<< 'CODE', << 'OUTPUT', "conversion I <-> P"); -.sub test @MAIN +.sub test :main .local string library_name library_name = 'libnci_test' .local pmc libnci_test Index: t/pmc/delegate.t =================================================================== --- t/pmc/delegate.t (revision 9443) +++ t/pmc/delegate.t (working copy) @@ -150,7 +150,7 @@ print "\n" returncc .end -.sub __add @MULTI(pmc, int) +.sub __add :multi(pmc, int) .param pmc l .param int r .param pmc d @@ -188,7 +188,7 @@ print i print "\n" .end -.sub __add @MULTI(delegate, pmc) +.sub __add :multi(delegate, pmc) .param pmc l .param pmc r .param pmc d Index: t/pmc/bigint.t =================================================================== --- t/pmc/bigint.t (revision 9443) +++ t/pmc/bigint.t (working copy) @@ -593,7 +593,7 @@ goto forever .end -.sub main @MAIN +.sub main :main .local int i .local pmc d loop: Index: t/dynclass/gdbmhash.t =================================================================== --- t/dynclass/gdbmhash.t (revision 9443) +++ t/dynclass/gdbmhash.t (working copy) @@ -30,7 +30,7 @@ # PIR fragment for setting up a GDBM Hash my $new_hash_1 = << 'CODE'; -.sub test @MAIN +.sub test :main .local pmc gdbmhash_lib gdbmhash_lib = loadlib "gdbmhash" .local int gdbmhash_type Index: t/dynclass/pyclass.t =================================================================== --- t/dynclass/pyclass.t (revision 9443) +++ t/dynclass/pyclass.t (working copy) @@ -20,7 +20,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "attribute"); -.sub main @MAIN +.sub main :main loadlib $P0, "python_group" getclass $P1, 'PyType' @@ -61,7 +61,7 @@ end .end -.sub _m @ANON +.sub _m :anon find_type $I0, "PyInt" new $P0, $I0 $P0 = 1 @@ -73,7 +73,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "classname"); -.sub main @MAIN +.sub main :main loadlib $P0, "python_group" getclass $P1, 'PyType' @@ -97,7 +97,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "delprop"); -.sub main @MAIN +.sub main :main loadlib $P0, "python_group" getclass $P1, 'PyType' @@ -137,7 +137,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "nested subclasses"); -.sub main @MAIN +.sub main :main loadlib $P0, "python_group" getclass $P1, 'PyType' @@ -179,7 +179,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "overriding builtins"); -.sub __main__ @MAIN +.sub __main__ :main new_pad 0 loadlib P1, 'python_group' find_global P0, 'PyBuiltin', '__load__' @@ -206,7 +206,7 @@ .return () .end -.sub ___repr__ @ANON, method +.sub ___repr__ :anon, method find_type $I0, 'PyObject' new $P0, $I0 find_type $I1, 'PyString' Index: t/dynclass/pybuiltin.t =================================================================== --- t/dynclass/pybuiltin.t (revision 9443) +++ t/dynclass/pybuiltin.t (working copy) @@ -20,7 +20,7 @@ use Parrot::Config; pir_output_is(<< 'CODE', << 'OUTPUT', "autoload"); -.sub main @MAIN +.sub main :main new_pad 0 new $P0, "PyInt" @@ -36,7 +36,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "delegating"); -.sub main @MAIN +.sub main :main new_pad 0 loadlib $P0, "python_group" find_global P0, "PyBuiltin", "__load__" @@ -97,7 +97,7 @@ SKIP: { skip("No BigInt Lib configured", 1) if !$PConfig{gmp}; pir_output_is(<< 'CODE', << 'OUTPUT', "bigint"); -.sub main @MAIN +.sub main :main new_pad 0 loadlib $P0, "python_group" find_global P0, "PyBuiltin", "__load__" @@ -120,7 +120,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "range"); -.sub main @MAIN +.sub main :main new_pad 0 loadlib $P0, "python_group" find_global P0, "PyBuiltin", "__load__" @@ -175,7 +175,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "boolean"); -.sub main @MAIN +.sub main :main new_pad 0 loadlib $P0, "python_group" find_global P0, "PyBuiltin", "__load__" @@ -195,7 +195,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "boolean"); -.sub main @MAIN +.sub main :main new_pad 0 loadlib $P0, "python_group" Index: t/dynclass/pycomplex.t =================================================================== --- t/dynclass/pycomplex.t (revision 9443) +++ t/dynclass/pycomplex.t (working copy) @@ -21,7 +21,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "eq"); -.sub main @MAIN +.sub main :main loadlib P1, "python_group" new $P1, "PyComplex" new $P2, "PyComplex" @@ -38,7 +38,7 @@ OUTPUT pir_output_is(<< 'CODE', << 'OUTPUT', "sub"); -.sub main @MAIN +.sub main :main .local pmc d, i, c d = new "PyObject" i = new "PyInt" @@ -67,7 +67,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "abs - test registered type"); .HLL "Python", "python_group" -.sub main @MAIN +.sub main :main .local pmc d, c c = new .PyComplex c = "3+4j" @@ -86,7 +86,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "n_abs - test registered type"); .pragma n_operators 1 .HLL "Python", "python_group" -.sub main @MAIN +.sub main :main .local pmc d, c c = new .PyComplex c = "3+4j" Index: t/dynclass/pyint.t =================================================================== --- t/dynclass/pyint.t (revision 9443) +++ t/dynclass/pyint.t (working copy) @@ -21,7 +21,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "abs"); -.sub main @MAIN +.sub main :main loadlib P1, "python_group" find_type $I0, "PyInt" new $P1, $I0 @@ -42,7 +42,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "add"); -.sub main @MAIN +.sub main :main loadlib P1, "python_group" find_type $I0, "PyInt" new $P0, $I0 @@ -68,7 +68,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "and"); -.sub main @MAIN +.sub main :main loadlib P1, "python_group" find_type $I0, "PyInt" new $P0, $I0 @@ -97,7 +97,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "cmp"); -.sub main @MAIN +.sub main :main loadlib P1, "python_group" find_type $I0, "PyInt" new $P0, $I0 @@ -125,7 +125,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "div"); -.sub main @MAIN +.sub main :main loadlib P1, "python_group" find_type $I0, "PyInt" new $P0, $I0 @@ -154,7 +154,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "float"); -.sub main @MAIN +.sub main :main loadlib P1, "python_group" find_type $I0, "PyInt" new $P0, $I0 @@ -171,7 +171,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "floordiv"); -.sub main @MAIN +.sub main :main loadlib P1, "python_group" find_type $I0, "PyInt" new $P0, $I0 @@ -200,7 +200,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "hex"); -.sub main @MAIN +.sub main :main loadlib P1, "python_group" find_type $I0, "PyInt" new $P0, $I0 @@ -216,7 +216,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "int"); -.sub main @MAIN +.sub main :main loadlib P1, "python_group" find_type $I0, "PyInt" new $P0, $I0 @@ -233,7 +233,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "invert"); -.sub main @MAIN +.sub main :main loadlib P1, "python_group" find_type $I0, "PyInt" new $P1, $I0 @@ -254,7 +254,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "is"); -.sub main @MAIN +.sub main :main loadlib P1, "python_group" new $P0, "PyInt" new $P1, "PyInt" @@ -274,7 +274,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "lshift"); -.sub main @MAIN +.sub main :main loadlib P1, "python_group" find_type $I0, "PyInt" new $P0, $I0 @@ -303,7 +303,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "mod"); -.sub main @MAIN +.sub main :main loadlib P1, "python_group" find_type $I0, "PyInt" new $P0, $I0 @@ -332,7 +332,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "mul"); -.sub main @MAIN +.sub main :main loadlib P1, "python_group" find_type $I0, "PyInt" new $P0, $I0 @@ -361,7 +361,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "neg"); -.sub main @MAIN +.sub main :main loadlib P1, "python_group" find_type $I0, "PyInt" new $P1, $I0 @@ -382,7 +382,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "nonzero"); -.sub main @MAIN +.sub main :main loadlib P1, "python_group" find_type $I0, "PyInt" new $P1, $I0 @@ -400,7 +400,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "oct"); -.sub main @MAIN +.sub main :main loadlib P1, "python_group" find_type $I0, "PyInt" new $P0, $I0 @@ -416,7 +416,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "or"); -.sub main @MAIN +.sub main :main loadlib P1, "python_group" find_type $I0, "PyInt" new $P0, $I0 @@ -445,7 +445,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "pos"); -.sub main @MAIN +.sub main :main loadlib P1, "python_group" find_type $I0, "PyInt" new $P1, $I0 @@ -463,7 +463,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "pow"); -.sub main @MAIN +.sub main :main loadlib P1, "python_group" find_type $I0, "PyInt" new $P0, $I0 @@ -497,7 +497,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "repr"); -.sub main @MAIN +.sub main :main loadlib P1, "python_group" find_type $I0, "PyInt" new $P0, $I0 @@ -519,7 +519,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "rshift"); -.sub main @MAIN +.sub main :main loadlib P1, "python_group" find_type $I0, "PyInt" new $P0, $I0 @@ -548,7 +548,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "sub"); -.sub main @MAIN +.sub main :main loadlib P1, "python_group" find_type $I0, "PyInt" new $P0, $I0 @@ -574,7 +574,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "truediv"); -.sub main @MAIN +.sub main :main loadlib P1, "python_group" find_type $I0, "PyInt" new $P0, $I0 @@ -594,7 +594,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "xor"); -.sub main @MAIN +.sub main :main loadlib P1, "python_group" find_type $I0, "PyInt" new $P0, $I0 @@ -623,7 +623,7 @@ skip("No bigint support", 1) unless $PConfig{gmp}; pir_output_like(<< 'CODE', << 'OUTPUT', "sub - propagate to PyLong"); -.sub main @MAIN +.sub main :main .include "sysinfo.pasm" .local pmc d, l, r .local int b, i Index: t/dynclass/foo.t =================================================================== --- t/dynclass/foo.t (revision 9443) +++ t/dynclass/foo.t (working copy) @@ -21,7 +21,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "get_integer"); -.sub main @MAIN +.sub main :main loadlib P1, "foo" find_type $I0, "Foo" new $P1, $I0 @@ -35,7 +35,7 @@ OUTPUT pir_output_is(<< 'CODE', << 'OUTPUT', "loadlib with relative pathname, no ext"); -.sub main @MAIN +.sub main :main ## load a relative pathname without the extension. loadlib will convert the ## '/' characters to '\\' on windows. $S0 = "runtime/parrot/dynext/foo" @@ -53,7 +53,7 @@ OUTPUT pir_output_is(<< 'CODE', << 'OUTPUT', "loadlib with absolute pathname, no ext"); -.sub main @MAIN +.sub main :main ## get cwd in $S0. .include "iglobals.pasm" $P11 = getinterp @@ -78,7 +78,7 @@ OUTPUT pir_output_is(<< 'CODE', << 'OUTPUT', "loadlib with relative pathname & ext"); -.sub main @MAIN +.sub main :main ## get load_ext in $S0. .include "iglobals.pasm" $P11 = getinterp @@ -101,7 +101,7 @@ OUTPUT pir_output_is(<< 'CODE', << 'OUTPUT', "loadlib with absolute pathname & ext"); -.sub main @MAIN +.sub main :main ## get cwd in $S0, load_ext in $S1. .include "iglobals.pasm" $P11 = getinterp @@ -130,7 +130,7 @@ SKIP: { skip("No BigInt Lib configured", 1) if !$PConfig{gmp}; pir_output_is(<< 'CODE', << 'OUTPUT', "inherited add"); -.sub _main @MAIN +.sub _main :main .local pmc d, l, r $P0 = loadlib "foo" print "ok\n" @@ -155,7 +155,7 @@ } pir_output_is(<<'CODE', <<'OUTPUT', "Foo subclass isa Integer"); -.sub main @MAIN +.sub main :main .local pmc F, f, d, r loadlib F, "foo" f = new "Foo" @@ -175,7 +175,7 @@ # load our Foo test (pseudo) language # it defines one PMC type "Foo" .HLL "Fool", "foo" -.sub main @MAIN +.sub main :main new $P1, "Foo" # load by name $I1 = $P1 print $I1 @@ -187,7 +187,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', ".HLL 2"); .HLL "Fool", "foo" -.sub main @MAIN +.sub main :main new $P1, .Foo # load by index $I1 = $P1 print $I1 Index: t/dynclass/pyfunc.t =================================================================== --- t/dynclass/pyfunc.t (revision 9443) +++ t/dynclass/pyfunc.t (working copy) @@ -20,7 +20,7 @@ my $base = << 'CODE'; -.sub __main__ @MAIN +.sub __main__ :main new_pad 0 loadlib P1, "python_group" @@ -43,7 +43,7 @@ testcase() .end -.sub _f0 @ANON +.sub _f0 :anon .param object x .param object y .param object z Index: t/src/compiler.t =================================================================== --- t/src/compiler.t (revision 9443) +++ t/src/compiler.t (working copy) @@ -31,7 +31,7 @@ run(Parrot_Interp interpreter, int argc, char *argv[]) { const char *c_src = - ".sub main @MAIN\n" + ".sub main :main\n" " print \"ok\\n\"\n" ".end\n"; Index: t/tools/pbc_merge.t =================================================================== --- t/tools/pbc_merge.t (revision 9443) +++ t/tools/pbc_merge.t (working copy) @@ -53,7 +53,7 @@ # First test - check sub relocation works. pir_to_pbc "pbc_merge_t1_1", <<'PIR'; -.sub _main @MAIN +.sub _main :main _testcall() .end PIR @@ -67,7 +67,7 @@ # Second test - check constant table pointers in bytecode are fixed up. pir_to_pbc "pbc_merge_t2_1", <<'PIR'; -.sub _main @MAIN +.sub _main :main .local num years .local string rockers Index: t/library/streams.t =================================================================== --- t/library/streams.t (revision 9443) +++ t/library/streams.t (working copy) @@ -58,7 +58,7 @@ # pir_output_is(<<'CODE', <<'OUT', "Stream::Sub"); -.sub _main @MAIN +.sub _main :main .local pmc stream .local pmc temp @@ -106,7 +106,7 @@ # pir_output_is(<<'CODE', <<'OUT', "Stream::read_bytes"); -.sub _main @MAIN +.sub _main :main .local pmc stream .local pmc temp @@ -966,7 +966,7 @@ # pir_output_is(<<'CODE', <<'OUT', "Stream::ParrotIO"); -.sub _main @MAIN +.sub _main :main .local pmc stream .local pmc temp @@ -1282,7 +1282,7 @@ skip("broken method invocation", 1); pir_output_is(<<'CODE', <<'OUT', "Stream::Replay"); -.sub _main @MAIN +.sub _main :main .local pmc stream load_bytecode "library/Stream/Writer.imc" @@ -1449,7 +1449,7 @@ skip("broken method invocation", 1); pir_output_is(<<'CODE', <<'OUT', "Stream::Write"); -.sub _main @MAIN +.sub _main :main .local pmc stream .local pmc temp Index: t/library/getopt_long.t =================================================================== --- t/library/getopt_long.t (revision 9443) +++ t/library/getopt_long.t (working copy) @@ -23,7 +23,7 @@ # no. 1 pir_output_is( <<'CODE', <<'OUT', "basic long options" ); -.sub test @MAIN +.sub test :main load_bytecode "Getopt/Long.pbc" .local pmc get_options Index: t/library/yaml_parser_syck.t =================================================================== --- t/library/yaml_parser_syck.t (revision 9443) +++ t/library/yaml_parser_syck.t (working copy) @@ -28,7 +28,7 @@ .include "library/YAML/Parser/Syck.imc" .include "library/dumper.imc" -.sub test @MAIN +.sub test :main .local pmc loaded ( loaded ) = load( "---\n- key1: val1\n key2: val2\n- elem1\n- elem12\n- elem123\n- elem1234\n- elem12345\n- elem123456\n- elem1234567\n- elem12345678\n" ) Index: t/library/pcre.t =================================================================== --- t/library/pcre.t (revision 9443) +++ t/library/pcre.t (working copy) @@ -33,7 +33,7 @@ pir_output_is( <<'CODE', <<'OUT', 'soup to nuts' ); -.sub main @MAIN +.sub main :main load_bytecode "library/pcre.imc" .local pmc func .local pmc lib Index: t/library/data_escape.t =================================================================== --- t/library/data_escape.t (revision 9443) +++ t/library/data_escape.t (working copy) @@ -21,7 +21,7 @@ my @subs= qw/ String /; my $PRE=<imc_info->last_unit) { - imc_info = mem_sys_allocate_zeroed(sizeof(imc_info_t)); - imc_info->ghash = interp->imc_info->ghash; - imc_info->prev = interp->imc_info; - interp->imc_info = imc_info; - } - */ - - /* m4_eval_compiler always compiles to interp->code->cur_cs - * make new, switch and save old cs - */ - sprintf(name, "EVAL_" INTVAL_FMT, ++interp->code->base.pf->eval_nr); - new_cs = PF_create_default_segs(interp, name, 0); - old_cs = Parrot_switch_to_cs(interp, new_cs, 0); - /* TODO gcc complains interp->imc_info->cur_namespace = NULL: */ - - /* - * need a packfile segment - */ - /* - * alloc byte code mem - */ - new_cs->base.data = mem_sys_allocate(CODE_SIZE * sizeof(opcode_t)); - new_cs->base.size = CODE_SIZE; - - /* - * Generate some bytecode - * This is actually simulating the now obsolete calling conventions. - * TODO: Let the PIR-compiler generate the PBC - */ - program_counter = new_cs->base.data; - /* set the single integer return value */ - *program_counter++ = interp->op_lib->op_code("set_i_ic", 1); - *program_counter++ = 5; - *program_counter++ = value; - /* promise to fill in the counters */ - *program_counter++ = interp->op_lib->op_code("set_i_ic", 1); - *program_counter++ = 0; - *program_counter++ = 1; - /* one integer return value */ - *program_counter++ = interp->op_lib->op_code("set_i_ic", 1); - *program_counter++ = 1; - *program_counter++ = 1; - /* no string return values */ - *program_counter++ = interp->op_lib->op_code("set_i_ic", 1); - *program_counter++ = 2; - *program_counter++ = 0; - /* no PMC return values */ - *program_counter++ = interp->op_lib->op_code("set_i_ic", 1); - *program_counter++ = 3; - *program_counter++ = 0; - /* no numeric return values */ - *program_counter++ = interp->op_lib->op_code("set_i_ic", 1); - *program_counter++ = 4; - *program_counter++ = 0; - /* invoke the return continuation */ - *program_counter++ = interp->op_lib->op_code("returncc", 1); - - if (old_cs) { - /* restore old byte_code, */ - (void)Parrot_switch_to_cs(interp, old_cs, 0); - } - /* - * create sub PMC - */ - sub = pmc_new(interp, enum_class_Eval); - sub_data = PMC_sub(sub); - sub_data->seg = new_cs; - sub_data->address = new_cs->base.data; - sub_data->end = new_cs->base.data + new_cs->base.size; - sub_data->name = string_from_cstring(interp, "m4 eval", 0); - - return sub; -} + struct PackFile_ByteCo \ No newline at end of file Index: languages/m4/src/m4.pir =================================================================== --- languages/m4/src/m4.pir (revision 9443) +++ languages/m4/src/m4.pir (working copy) @@ -46,7 +46,7 @@ =cut -.sub "__onload" @LOAD +.sub "__onload" :load # load_bytecode "PGE.pbc" # Loaded by Getopt/Long.pbc #load_bytecode "Getopt/Long.pbc" # This also loads PGE @@ -60,7 +60,7 @@ =cut -.sub 'm4' @MAIN +.sub 'm4' :main .param pmc argv # TODO: put this into '__onload' Index: languages/python/pie-thon.pl =================================================================== --- languages/python/pie-thon.pl (revision 9443) +++ languages/python/pie-thon.pl (working copy) @@ -334,7 +334,7 @@ sub gen_code { $cur_func = 'test::main'; print <{emit_main}; print $fh <<'END'; -.sub _main @MAIN +.sub _main :main .param pmc args .local string input_string input_string = args[1] Index: languages/regex/01_basic.imc =================================================================== --- languages/regex/01_basic.imc (revision 9443) +++ languages/regex/01_basic.imc (working copy) @@ -4,7 +4,7 @@ # parrot -o regex-compiler.pbc regex-compiler.imc # -.sub main @MAIN +.sub main :main .local pmc match .local pmc compile_regex .local pmc regex1 Index: languages/regex/regex-compiler.imc =================================================================== --- languages/regex/regex-compiler.imc (revision 9443) +++ languages/regex/regex-compiler.imc (working copy) @@ -1,4 +1,4 @@ -.sub __init_compiler @LOAD +.sub __init_compiler :load loadlib $P0, "match_group" newsub $P0, .Sub, _compile_regex compreg "regex", $P0 Index: examples/assembly/md5sum.imc =================================================================== --- examples/assembly/md5sum.imc (revision 9443) +++ examples/assembly/md5sum.imc (working copy) @@ -24,7 +24,7 @@ # Main Harness to demonstrate MD5.imc -.sub _main @MAIN +.sub _main :main .param pmc args .local int size Index: examples/assembly/queens_r.imc =================================================================== --- examples/assembly/queens_r.imc (revision 9443) +++ examples/assembly/queens_r.imc (working copy) @@ -2,7 +2,7 @@ # prints all 92 solutions in chess notation # by leo -.sub main @MAIN +.sub main :main .local pmc queen_row, queen_state queen_row = new ResizableIntegerArray queen_state = new ResizableIntegerArray Index: examples/assembly/ncurses_life.imc =================================================================== --- examples/assembly/ncurses_life.imc (revision 9443) +++ examples/assembly/ncurses_life.imc (working copy) @@ -56,7 +56,7 @@ =cut -.sub _MAIN @MAIN +.sub _MAIN :main .param pmc argv # the command line load_bytecode "library/ncurses.pasm" Index: examples/assembly/pcre.imc =================================================================== --- examples/assembly/pcre.imc (revision 9443) +++ examples/assembly/pcre.imc (working copy) @@ -25,7 +25,7 @@ .include 'library/pcre.imc' -.sub main @MAIN +.sub main :main .param pmc argv .local int argc Index: examples/assembly/sudoku.pir =================================================================== --- examples/assembly/sudoku.pir (revision 9443) +++ examples/assembly/sudoku.pir (working copy) @@ -139,7 +139,7 @@ .const string VERSION="0.2.3" -.sub _main @MAIN +.sub _main :main .param pmc argv .local int argc .local string raw_given Index: examples/sdl/lcd/clock.imc =================================================================== --- examples/sdl/lcd/clock.imc (revision 9443) +++ examples/sdl/lcd/clock.imc (working copy) @@ -25,7 +25,7 @@ =cut -.sub _main @MAIN +.sub _main :main load_bytecode "library/SDL/App.imc" load_bytecode "library/SDL/Event.imc" load_bytecode "library/SDL/EventHandler.imc" Index: examples/sdl/minesweeper/mines.imc =================================================================== --- examples/sdl/minesweeper/mines.imc (revision 9443) +++ examples/sdl/minesweeper/mines.imc (working copy) @@ -19,7 +19,7 @@ =cut -.sub _main @MAIN +.sub _main :main .param pmc args .local pmc field .local pmc screen Index: examples/sdl/minesweeper/eventhandler.imc =================================================================== --- examples/sdl/minesweeper/eventhandler.imc (revision 9443) +++ examples/sdl/minesweeper/eventhandler.imc (working copy) @@ -20,7 +20,7 @@ .namespace ["Mines::EventHandler"] -.sub __onload @LOAD +.sub __onload :load $I0 = find_type "Mines::EventHandler" if $I0 > 1 goto END Index: examples/sdl/minesweeper/field.imc =================================================================== --- examples/sdl/minesweeper/field.imc (revision 9443) +++ examples/sdl/minesweeper/field.imc (working copy) @@ -1082,7 +1082,7 @@ =cut -.sub __onload @LOAD +.sub __onload :load $I0 = find_type "Mines::Field" if $I0 > 1 goto END Index: examples/sdl/raw_pixels.imc =================================================================== --- examples/sdl/raw_pixels.imc (revision 9443) +++ examples/sdl/raw_pixels.imc (working copy) @@ -13,7 +13,7 @@ .include 'datatypes.pasm' -.sub _main @MAIN +.sub _main :main # first load the necessary libraries load_bytecode "library/SDL/App.imc" load_bytecode "library/SDL/Rect.imc" Index: examples/sdl/move_parrot_logo.imc =================================================================== --- examples/sdl/move_parrot_logo.imc (revision 9443) +++ examples/sdl/move_parrot_logo.imc (working copy) @@ -11,7 +11,7 @@ =cut -.sub _main @MAIN +.sub _main :main load_bytecode "library/SDL/App.imc" load_bytecode "library/SDL/Color.imc" load_bytecode "library/SDL/Rect.imc" Index: examples/sdl/blue_font.imc =================================================================== --- examples/sdl/blue_font.imc (revision 9443) +++ examples/sdl/blue_font.imc (working copy) @@ -17,7 +17,7 @@ =cut -.sub _main @MAIN +.sub _main :main # first load the necessary libraries load_bytecode "library/SDL/App.imc" Index: examples/sdl/bounce_parrot_logo.imc =================================================================== --- examples/sdl/bounce_parrot_logo.imc (revision 9443) +++ examples/sdl/bounce_parrot_logo.imc (working copy) @@ -15,7 +15,7 @@ =cut -.sub _main @MAIN +.sub _main :main load_bytecode "library/SDL/App.imc" load_bytecode "library/SDL/Color.imc" load_bytecode "library/SDL/Rect.imc" Index: examples/sdl/tetris/block.imc =================================================================== --- examples/sdl/tetris/block.imc (revision 9443) +++ examples/sdl/tetris/block.imc (working copy) @@ -27,7 +27,7 @@ .const int Fall = 3 .const int Board = 4 -.sub __onload @LOAD +.sub __onload :load find_type $I0, "Tetris::Block" if $I0 > 1 goto END load_bytecode "examples/sdl/tetris/blockdata.imc" Index: examples/sdl/tetris/tetris.imc =================================================================== --- examples/sdl/tetris/tetris.imc (revision 9443) +++ examples/sdl/tetris/tetris.imc (working copy) @@ -27,7 +27,7 @@ =cut -.sub _main @MAIN +.sub _main :main .param pmc argv .local pmc app Index: examples/sdl/tetris/blocks.imc =================================================================== --- examples/sdl/tetris/blocks.imc (revision 9443) +++ examples/sdl/tetris/blocks.imc (working copy) @@ -6,7 +6,7 @@ .namespace ["Tetris::Blocks"] -.sub __onload @LOAD +.sub __onload :load find_type $I0, "Tetris::Block::1" if $I0 > 1 goto END Index: examples/sdl/tetris/eventhandler.imc =================================================================== --- examples/sdl/tetris/eventhandler.imc (revision 9443) +++ examples/sdl/tetris/eventhandler.imc (working copy) @@ -6,7 +6,7 @@ .namespace ["Tetris::EventHandler"] -.sub __onload @LOAD +.sub __onload :load find_type $I0, "Tetris::EventHandler" if $I0 > 1 goto END load_bytecode "library/SDL/EventHandler.imc" Index: examples/sdl/tetris/app.imc =================================================================== --- examples/sdl/tetris/app.imc (revision 9443) +++ examples/sdl/tetris/app.imc (working copy) @@ -40,7 +40,7 @@ .const int tPalette = 7 .const int tBoards = 8 -.sub __onload @LOAD +.sub __onload :load find_type $I0, "Tetris::App" if $I0 > 1 goto END Index: examples/sdl/tetris/boarddata.imc =================================================================== --- examples/sdl/tetris/boarddata.imc (revision 9443) +++ examples/sdl/tetris/boarddata.imc (working copy) @@ -24,7 +24,7 @@ .const int bWidth = 1 .const int bHeight = 2 -.sub __onload @LOAD +.sub __onload :load find_type $I0, "Tetris::BoardData" if $I0 > 1 goto END newclass $P0, "Tetris::BoardData" Index: examples/sdl/tetris/blockdata.imc =================================================================== --- examples/sdl/tetris/blockdata.imc (revision 9443) +++ examples/sdl/tetris/blockdata.imc (working copy) @@ -14,7 +14,7 @@ .namespace ["Tetris::BlockData"] -.sub __onload @LOAD +.sub __onload :load find_type $I0, "Tetris::BlockData" if $I0 > 1 goto END newclass $P0, "Tetris::BlockData" Index: examples/sdl/tetris/board.imc =================================================================== --- examples/sdl/tetris/board.imc (revision 9443) +++ examples/sdl/tetris/board.imc (working copy) @@ -20,7 +20,7 @@ .namespace ["Tetris::Board"] -.sub __onload @LOAD +.sub __onload :load find_type $I0, "Tetris::Board" if $I0 > 1 goto END load_bytecode "examples/sdl/tetris/boarddata.imc" Index: examples/sdl/blue_rect.imc =================================================================== --- examples/sdl/blue_rect.imc (revision 9443) +++ examples/sdl/blue_rect.imc (working copy) @@ -11,7 +11,7 @@ =cut -.sub _main @MAIN +.sub _main :main # first load the necessary libraries load_bytecode "library/SDL/App.imc" Index: examples/sdl/anim_image_dblbuf.imc =================================================================== --- examples/sdl/anim_image_dblbuf.imc (revision 9443) +++ examples/sdl/anim_image_dblbuf.imc (working copy) @@ -12,7 +12,7 @@ =cut -.sub _main non_prototyped, @MAIN +.sub _main non_prototyped, :main load_bytecode "library/SDL/App.imc" load_bytecode "library/SDL/Color.imc" load_bytecode "library/SDL/Rect.imc" Index: examples/sdl/anim_image.imc =================================================================== --- examples/sdl/anim_image.imc (revision 9443) +++ examples/sdl/anim_image.imc (working copy) @@ -12,7 +12,7 @@ =cut -.sub _main non_prototyped, @MAIN +.sub _main non_prototyped, :main load_bytecode "library/SDL/App.imc" load_bytecode "library/SDL/Color.imc" load_bytecode "library/SDL/Rect.imc" Index: examples/library/getopt_demo.imc =================================================================== --- examples/library/getopt_demo.imc (revision 9443) +++ examples/library/getopt_demo.imc (working copy) @@ -26,7 +26,7 @@ =cut -.sub main @MAIN +.sub main :main .param pmc argv load_bytecode "Getopt/Long.pbc" Index: examples/io/pipe2.imc =================================================================== --- examples/io/pipe2.imc (revision 9443) +++ examples/io/pipe2.imc (working copy) @@ -1,4 +1,4 @@ -.sub main @MAIN +.sub main :main .param pmc argv .local int argc argc = argv Index: examples/io/pipe3.imc =================================================================== --- examples/io/pipe3.imc (revision 9443) +++ examples/io/pipe3.imc (working copy) @@ -1,4 +1,4 @@ -.sub main @MAIN +.sub main :main .param pmc argv .local int argc .local pmc pipew Index: examples/io/httpd.imc =================================================================== --- examples/io/httpd.imc (revision 9443) +++ examples/io/httpd.imc (working copy) @@ -44,7 +44,7 @@ =cut -.sub main @MAIN +.sub main :main .local pmc sock, work, fp .local pmc fp # read requested files from disk .local string address Index: examples/benchmarks/overload.imc =================================================================== --- examples/benchmarks/overload.imc (revision 9443) +++ examples/benchmarks/overload.imc (working copy) @@ -1,6 +1,6 @@ # $Id$ -.sub bench @MAIN +.sub bench :main .include "pmctypes.pasm" .include "mmd.pasm" .local pmc my_mul Index: examples/benchmarks/array_access.imc =================================================================== --- examples/benchmarks/array_access.imc (revision 9443) +++ examples/benchmarks/array_access.imc (working copy) @@ -15,7 +15,7 @@ =cut -.sub main @MAIN +.sub main :main .param pmc argv load_bytecode "Getopt/Long.pbc" Index: examples/streams/Writer.imc =================================================================== --- examples/streams/Writer.imc (revision 9443) +++ examples/streams/Writer.imc (working copy) @@ -12,7 +12,7 @@ =cut -.sub _main @MAIN +.sub _main :main .local pmc stream .local pmc temp Index: examples/streams/Replay.imc =================================================================== --- examples/streams/Replay.imc (revision 9443) +++ examples/streams/Replay.imc (working copy) @@ -1,4 +1,4 @@ -.sub _main @MAIN +.sub _main :main .local pmc stream load_bytecode "library/Stream/Writer.imc" Index: examples/streams/SubHello.imc =================================================================== --- examples/streams/SubHello.imc (revision 9443) +++ examples/streams/SubHello.imc (working copy) @@ -12,7 +12,7 @@ =cut -.sub _main @MAIN +.sub _main :main .local pmc stream .local pmc temp Index: examples/streams/ParrotIO.imc =================================================================== --- examples/streams/ParrotIO.imc (revision 9443) +++ examples/streams/ParrotIO.imc (working copy) @@ -16,7 +16,7 @@ =cut -.sub _main @MAIN +.sub _main :main .local pmc stream .local pmc temp Index: examples/streams/Bytes.imc =================================================================== --- examples/streams/Bytes.imc (revision 9443) +++ examples/streams/Bytes.imc (working copy) @@ -11,7 +11,7 @@ =cut -.sub _main @MAIN +.sub _main :main .local pmc stream .local pmc temp