On Monday 20 February 2006 17:54, chromatic wrote: > The old PIR subroutine attributes ("method", "@MULTI", "@MAIN", "@LOAD", > "@IMMEDIATE", "@POSTCOMP", and "@ANON") are now deprecated in favor of the > lowercased colon-prefixed version. (At least, that's what the code appears > to say.)
Here's a patch to the test suite and libraries (but nothing in languages/) to migrate the attributes. All tests pass for me after applying the patch (and making the parser stricter -- but this patch doesn't touch the PIR grammar.) -- c
Index: runtime/parrot/library/Test/Builder.pir =================================================================== --- runtime/parrot/library/Test/Builder.pir (revision 11707) +++ runtime/parrot/library/Test/Builder.pir (working copy) @@ -90,10 +90,10 @@ =cut -.sub __fake_init method +.sub __fake_init :method .end -.sub __init method +.sub __init :method .param pmc args :optional .local pmc output .local pmc testplan @@ -103,7 +103,7 @@ self.'_assign_args'( output, testplan, results ) .end -.sub _assign_args method +.sub _assign_args :method .param pmc output .param pmc testplan .param pmc results @@ -171,7 +171,7 @@ .return( test ) .end -.sub _assign_default_args method +.sub _assign_default_args :method .param pmc args .local pmc single @@ -231,7 +231,7 @@ .return( output, testplan, results ) .end -.sub output method +.sub output :method .local pmc output .local int offset @@ -241,7 +241,7 @@ .return( output ) .end -.sub testplan method +.sub testplan :method .local pmc testplan .local int offset @@ -252,7 +252,7 @@ .return( testplan ) .end -.sub results method +.sub results :method .local pmc output .local int offset .local pmc results @@ -275,7 +275,7 @@ =cut -.sub finish method +.sub finish :method .local pmc output .local pmc testplan .local pmc results @@ -308,7 +308,7 @@ =cut -.sub plan method +.sub plan :method .param string tests .local pmc testplan @@ -397,7 +397,7 @@ =cut -.sub diag method +.sub diag :method .param string diagnostic if diagnostic goto DIAGNOSTIC_SET @@ -416,7 +416,7 @@ =cut -.sub ok method +.sub ok :method .param int passed .param string description :optional .param int has_description :opt_flag @@ -452,7 +452,7 @@ =cut -.sub todo method +.sub todo :method .param int passed .param string description :optional .param int has_description :opt_flag @@ -494,7 +494,7 @@ =cut -.sub skip method +.sub skip :method .param int number :optional .param int has_number :opt_flag .param string reason :optional @@ -543,7 +543,7 @@ =cut -.sub skip_all method +.sub skip_all :method .local pmc testplan testplan = self.'testplan'() @@ -568,7 +568,7 @@ =cut -.sub BAILOUT method +.sub BAILOUT :method .param string reason :optional .param int has_reason :opt_flag @@ -588,7 +588,7 @@ exit 0 .end -.sub report_test method +.sub report_test :method .param pmc test_args .local pmc testplan Index: runtime/parrot/library/Test/Builder/Tester.pir =================================================================== --- runtime/parrot/library/Test/Builder/Tester.pir (revision 11707) +++ runtime/parrot/library/Test/Builder/Tester.pir (working copy) @@ -72,7 +72,7 @@ addattribute tbto_class, 'diagnostics' .end -.sub __init method +.sub __init :method .local int offset classoffset offset, self, 'Test::Builder::Tester::Output' @@ -85,7 +85,7 @@ setattribute self, offset, diagnostics .end -.sub get_output method +.sub get_output :method .local int offset classoffset offset, self, 'Test::Builder::Tester::Output' @@ -94,7 +94,7 @@ .return( output ) .end -.sub get_diagnostics method +.sub get_diagnostics :method .local int offset classoffset offset, self, 'Test::Builder::Tester::Output' inc offset @@ -104,7 +104,7 @@ .return( diagnostics ) .end -.sub write method +.sub write :method .param string message .local pmc message_string @@ -116,7 +116,7 @@ push output, message_string .end -.sub diag method +.sub diag :method .param string message .local pmc message_string @@ -128,7 +128,7 @@ push diagnostics, message_string .end -.sub output method +.sub output :method .local pmc output output = self.'get_output'() @@ -144,7 +144,7 @@ .return( output_string ) .end -.sub diagnostics method +.sub diagnostics :method .local pmc diagnostics diagnostics = self.'get_diagnostics'() Index: runtime/parrot/library/Test/Builder/TestPlan.pir =================================================================== --- runtime/parrot/library/Test/Builder/TestPlan.pir (revision 11707) +++ runtime/parrot/library/Test/Builder/TestPlan.pir (working copy) @@ -44,7 +44,7 @@ =cut -.sub __init method +.sub __init :method .param pmc args :optional .param int has_args :opt_flag @@ -89,7 +89,7 @@ =cut -.sub header method +.sub header :method .local string expect .local int offset .local string header @@ -113,7 +113,7 @@ =cut -.sub footer method +.sub footer :method .param int ran .local int expect @@ -144,13 +144,13 @@ .namespace [ 'Test::Builder::NullPlan' ] -.sub header method +.sub header :method .local string header header = '' .return( header ) .end -.sub footer method +.sub footer :method .param int tests_run .local string tests_run_string Index: runtime/parrot/library/Test/Builder/Test.pir =================================================================== --- runtime/parrot/library/Test/Builder/Test.pir (revision 11707) +++ runtime/parrot/library/Test/Builder/Test.pir (working copy) @@ -129,7 +129,7 @@ .namespace [ 'Test::Builder::Test::Base' ] -.sub __init method +.sub __init :method .param pmc args .local int offset @@ -171,7 +171,7 @@ setattribute self, offset, description .end -.sub passed method +.sub passed :method .local pmc passed .local int offset @@ -181,7 +181,7 @@ .return( passed ) .end -.sub number method +.sub number :method .local pmc number .local int offset @@ -192,7 +192,7 @@ .return( number ) .end -.sub diagnostic method +.sub diagnostic :method .local pmc diagnostic .local int offset @@ -203,7 +203,7 @@ .return( diagnostic ) .end -.sub description method +.sub description :method .local pmc description .local int offset @@ -214,7 +214,7 @@ .return( description ) .end -.sub status method +.sub status :method .local pmc passed .local pmc description .local pmc status @@ -227,7 +227,7 @@ set status['description'], description .end -.sub report method +.sub report :method .local pmc passed .local pmc number .local pmc description @@ -266,7 +266,7 @@ .namespace [ 'Test::Builder::Test::WithReason' ] -.sub __init method +.sub __init :method .param pmc args .local int offset @@ -284,7 +284,7 @@ setattribute self, offset, reason .end -.sub reason method +.sub reason :method .local pmc reason .local int offset @@ -294,7 +294,7 @@ .return( reason ) .end -.sub status method +.sub status :method .local pmc reason .local pmc status .local pmc parent_status @@ -310,7 +310,7 @@ .namespace [ 'Test::Builder::Test::Skip' ] -.sub report method +.sub report :method .local pmc reason .local pmc number .local string report @@ -330,7 +330,7 @@ .return( report ) .end -.sub status method +.sub status :method .local pmc status .local pmc parent_status @@ -343,7 +343,7 @@ .namespace [ 'Test::Builder::Test::TODO' ] -.sub report method +.sub report :method .local pmc passed .local pmc description .local pmc number @@ -374,7 +374,7 @@ .return( report ) .end -.sub status method +.sub status :method .local pmc passed .local pmc status .local pmc parent_status Index: runtime/parrot/library/Test/Builder/Output.pir =================================================================== --- runtime/parrot/library/Test/Builder/Output.pir (revision 11707) +++ runtime/parrot/library/Test/Builder/Output.pir (working copy) @@ -49,7 +49,7 @@ =cut -.sub __init method +.sub __init :method .param pmc args .local pmc output @@ -72,7 +72,7 @@ setattribute self, offset, diag_output .end -.sub output method +.sub output :method .local pmc output .local int offset @@ -82,7 +82,7 @@ .return( output ) .end -.sub diag_output method +.sub diag_output :method .local pmc diag_output .local int offset @@ -99,7 +99,7 @@ =cut -.sub write method +.sub write :method .param string message .local int message_length @@ -115,7 +115,7 @@ output.'puts'( message ) .end -.sub escape_newlines method +.sub escape_newlines :method .param string message .local pmc lines lines = new ResizableStringArray @@ -174,7 +174,7 @@ =cut -.sub diag method +.sub diag :method .param string message .local int message_length Index: runtime/parrot/library/Stream/Coroutine.pir =================================================================== --- runtime/parrot/library/Stream/Coroutine.pir (revision 11707) +++ runtime/parrot/library/Stream/Coroutine.pir (working copy) @@ -44,7 +44,7 @@ =cut -.sub rawRead method +.sub rawRead :method .local pmc coro .local string str Index: runtime/parrot/library/Stream/Sub.pir =================================================================== --- runtime/parrot/library/Stream/Sub.pir (revision 11707) +++ runtime/parrot/library/Stream/Sub.pir (working copy) @@ -18,7 +18,7 @@ ... - .sub _test method + .sub _test :method self."write"( "hello, world" ) .end @@ -83,7 +83,7 @@ =cut -.sub write method +.sub write :method .param string str .local pmc _write .local pmc ret @@ -94,7 +94,7 @@ $P0 =self."_call_writer"(_write, str) .end -.sub _call_writer method +.sub _call_writer :method .param pmc writer .param string str .local pmc cont @@ -110,7 +110,7 @@ =cut -.sub rawRead method +.sub rawRead :method .local pmc temp .local string str Index: runtime/parrot/library/Stream/Base.pir =================================================================== --- runtime/parrot/library/Stream/Base.pir (revision 11707) +++ runtime/parrot/library/Stream/Base.pir (working copy) @@ -39,7 +39,7 @@ END: .end -.sub __init method +.sub __init :method .local pmc close # call our own close @@ -51,7 +51,7 @@ =cut -.sub __set_pmc method +.sub __set_pmc :method .param pmc source classoffset $I0, self, "Stream::Base" @@ -59,7 +59,7 @@ null source .end -.sub setSource method +.sub setSource :method .param pmc source classoffset $I0, self, "Stream::Base" @@ -71,7 +71,7 @@ =cut -.sub close method +.sub close :method .local pmc temp # reset source @@ -93,7 +93,7 @@ =cut -.sub dump method +.sub dump :method .local string str .local int i .local pmc escape @@ -116,7 +116,7 @@ =cut -.sub copyTo method +.sub copyTo :method .param pmc to .local string str .local int i @@ -137,7 +137,7 @@ =cut -.sub source method +.sub source :method .local pmc ret classoffset $I0, self, "Stream::Base" @@ -158,7 +158,7 @@ =cut -.sub connected method +.sub connected :method .local pmc stream classoffset $I0, self, "Stream::Base" @@ -183,7 +183,7 @@ =cut -.sub read method +.sub read :method .local string ret .local pmc includes @@ -244,7 +244,7 @@ =cut -.sub include method +.sub include :method .param pmc stream .local pmc includes @@ -262,7 +262,7 @@ =cut -.sub flush method +.sub flush :method .local int i .local string str .local pmc includes @@ -290,7 +290,7 @@ =cut -.sub read_bytes method +.sub read_bytes :method .param int requested .local string ret .local pmc buffer @@ -349,7 +349,7 @@ =cut -.sub byte_buffer method +.sub byte_buffer :method .param pmc buf :optional .param int has_buf :opt_flag Index: runtime/parrot/library/Stream/Lines.pir =================================================================== --- runtime/parrot/library/Stream/Lines.pir (revision 11707) +++ runtime/parrot/library/Stream/Lines.pir (working copy) @@ -41,7 +41,7 @@ .namespace ["Stream::Lines"] -.sub __init method +.sub __init :method .local pmc temp classoffset $I0, self, "Stream::Lines" @@ -55,7 +55,7 @@ =cut -.sub connected method +.sub connected :method # XXX: check if the buffer is empty if the source stream is not connected classoffset $I0, self, "Stream::Base" getattribute $P0, self, $I0 @@ -74,7 +74,7 @@ =cut -.sub rawRead method +.sub rawRead :method .local pmc temp .local string buffer .local string ret @@ -112,7 +112,7 @@ =cut -.sub buffer method +.sub buffer :method .local pmc temp .local string _buffer @@ -129,7 +129,7 @@ =cut -.sub setBuffer method +.sub setBuffer :method .param string buffer .local pmc temp @@ -145,7 +145,7 @@ =cut -.sub fillBuffer method +.sub fillBuffer :method .local pmc temp .local string buffer .local string str Index: runtime/parrot/library/Stream/Replay.pir =================================================================== --- runtime/parrot/library/Stream/Replay.pir (revision 11707) +++ runtime/parrot/library/Stream/Replay.pir (working copy) @@ -62,7 +62,7 @@ =cut -.sub __init method +.sub __init :method .local pmc temp classoffset $I0, self, "Stream::Replay" @@ -78,7 +78,7 @@ =cut -.sub __set_pmc method +.sub __set_pmc :method .param pmc val .local pmc buffer @@ -126,7 +126,7 @@ =cut -.sub rawRead method +.sub rawRead :method .local pmc source .local pmc buffer .local pmc pos @@ -152,7 +152,7 @@ =cut -.sub __clone method +.sub __clone :method .local pmc ret .local pmc temp @@ -172,7 +172,7 @@ .namespace ["Stream::Replay::Buffer"] -.sub __init method +.sub __init :method .local pmc temp classoffset $I0, self, "Stream::Replay::Buffer" @@ -185,12 +185,12 @@ setattribute self, $I0, temp .end -.sub compact method +.sub compact :method # XXX check the begin of the queue for stale entries noop .end -.sub read method +.sub read :method .param pmc pos .param pmc source .local string ret @@ -230,7 +230,7 @@ .return(ret) .end -.sub add method +.sub add :method .param pmc stream .local pmc clones @@ -240,7 +240,7 @@ push clones, stream .end -.sub remove method +.sub remove :method .param pmc stream .local pmc clones .local pmc entry Index: runtime/parrot/library/Stream/Writer.pir =================================================================== --- runtime/parrot/library/Stream/Writer.pir (revision 11707) +++ runtime/parrot/library/Stream/Writer.pir (working copy) @@ -20,7 +20,7 @@ ... - .sub _reader method + .sub _reader :method .local string str str = self."read"() .end @@ -52,7 +52,7 @@ =cut -.sub _reader_stub method +.sub _reader_stub :method .local pmc source .local pmc mysub #.local pmc myself @@ -75,7 +75,7 @@ status = 0 .end -.sub __init method +.sub __init :method .local pmc status new status, .PerlInt @@ -85,7 +85,7 @@ setattribute self, $I0, status .end -.sub __set_pmc method +.sub __set_pmc :method .param pmc source .local pmc status @@ -99,7 +99,7 @@ status = 1 .end -.sub close method +.sub close :method .local string str null str @@ -111,7 +111,7 @@ END: .end -.sub connected method +.sub connected :method .local pmc status .local int ret @@ -128,7 +128,7 @@ =cut -.sub write method +.sub write :method .param string str .local pmc source .local pmc status @@ -168,7 +168,7 @@ =cut -.sub rawRead method +.sub rawRead :method .local string str .local pmc writer .local pmc cont @@ -189,7 +189,7 @@ .return(str) .end -.sub _call_writer method +.sub _call_writer :method .param pmc writer .local pmc cont .local string str Index: runtime/parrot/library/Stream/Combiner.pir =================================================================== --- runtime/parrot/library/Stream/Combiner.pir (revision 11707) +++ runtime/parrot/library/Stream/Combiner.pir (working copy) @@ -54,7 +54,7 @@ .namespace ["Stream::Combiner"] -.sub __init method +.sub __init :method .const .Sub temp = "_default_combiner" self."combiner"( temp ) @@ -69,7 +69,7 @@ =cut -.sub combiner method +.sub combiner :method .param pmc _combiner :optional .param int has_combiner :opt_flag .local pmc ret @@ -92,7 +92,7 @@ =cut -.sub __set_pmc method +.sub __set_pmc :method .param pmc arg .local pmc source @@ -106,7 +106,7 @@ =cut -.sub connected method +.sub connected :method .local pmc sources .local pmc source .local int i @@ -146,7 +146,7 @@ =cut -.sub rawRead method +.sub rawRead :method .local pmc sources .local pmc source .local pmc combiner Index: runtime/parrot/library/Stream/ParrotIO.pir =================================================================== --- runtime/parrot/library/Stream/ParrotIO.pir (revision 11707) +++ runtime/parrot/library/Stream/ParrotIO.pir (working copy) @@ -39,7 +39,7 @@ .namespace ["Stream::ParrotIO"] -.sub __init method +.sub __init :method self."blockSize"( 50 ) .end @@ -49,7 +49,7 @@ =cut -.sub open method +.sub open :method .param string name .param string mode .local pmc pio @@ -64,7 +64,7 @@ =cut -.sub blockSize method +.sub blockSize :method .param int bs :optional .param int has_bs :opt_flag @@ -92,7 +92,7 @@ =cut -.sub rawRead method +.sub rawRead :method .local string str .local pmc pio .local int bs Index: runtime/parrot/library/Stream/Filter.pir =================================================================== --- runtime/parrot/library/Stream/Filter.pir (revision 11707) +++ runtime/parrot/library/Stream/Filter.pir (working copy) @@ -45,7 +45,7 @@ =cut -.sub filter method +.sub filter :method .param pmc _filter :optional .param int has_filter :opt_flag .local pmc ret @@ -67,7 +67,7 @@ =cut -.sub rawRead method +.sub rawRead :method .local pmc source .local pmc filter .local string str Index: runtime/parrot/library/PGE/Dumper.pir =================================================================== --- runtime/parrot/library/PGE/Dumper.pir (revision 11707) +++ runtime/parrot/library/PGE/Dumper.pir (working copy) @@ -90,7 +90,7 @@ =cut -.sub "dump" method +.sub "dump" :method .param string prefix :optional # name of match variable .param int has_prefix :opt_flag .param string b1 :optional # bracket open @@ -201,14 +201,14 @@ .namespace [ "PGE::Exp" ] -.sub "dumpindent" method +.sub "dumpindent" :method .param int indent $S0 = repeat ' ', indent print $S0 .return () .end -.sub "dump" method +.sub "dump" :method .param int indent self."dumpindent"(indent) print "EXP (abstract) " @@ -220,7 +220,7 @@ .namespace [ "PGE::Exp::Start" ] -.sub dump method +.sub dump :method .param int indent .local pmc exp1 $S0 = self["firstchars"] @@ -234,7 +234,7 @@ .namespace [ "PGE::Exp::End" ] -.sub dump method +.sub dump :method .param int indent self."dumpindent"(indent) print "End\n" @@ -243,7 +243,7 @@ .namespace [ "PGE::Exp::Literal" ] -.sub "dump" method +.sub "dump" :method .param int indent .local pmc literal literal = self["literal"] @@ -259,7 +259,7 @@ .namespace [ "PGE::Exp::Scalar" ] -.sub "dump" method +.sub "dump" :method .param int indent .local pmc cname cname = self["cname"] @@ -275,7 +275,7 @@ .namespace [ "PGE::Exp::Dot" ] -.sub "dump" method +.sub "dump" :method .param int indent self."dumpindent"(indent) print "DOT " @@ -287,7 +287,7 @@ .namespace [ "PGE::Exp::CharClass" ] -.sub dump method +.sub dump :method .param int indent self."dumpindent"(indent) print "CharClass " @@ -305,7 +305,7 @@ .namespace [ "PGE::Exp::WS" ] -.sub "dump" method +.sub "dump" :method .param int indent self."dumpindent"(indent) print "<?ws> " @@ -317,7 +317,7 @@ .namespace [ "PGE::Exp::Anchor" ] -.sub "dump" method +.sub "dump" :method .param int indent .local string token self."dumpindent"(indent) @@ -331,7 +331,7 @@ .namespace [ "PGE::Exp::Concat" ] -.sub "dump" method +.sub "dump" :method .param int indent $P0 = self["exp1"] $P0."dump"(indent) @@ -342,7 +342,7 @@ .namespace [ "PGE::Exp::Alt" ] -.sub "dump" method +.sub "dump" :method .param int indent .local int offset .local pmc exp @@ -369,7 +369,7 @@ .namespace [ "PGE::Exp::Group" ] -.sub "dump" method +.sub "dump" :method .param int indent .local int offset .local pmc exp Index: runtime/parrot/library/PGE/Text.pir =================================================================== --- runtime/parrot/library/PGE/Text.pir (revision 11707) +++ runtime/parrot/library/PGE/Text.pir (working copy) @@ -14,7 +14,7 @@ .include "cclass.pasm" -.sub "__onload" @LOAD +.sub "__onload" :load .local pmc base base = getclass "PGE::Rule" $P0 = subclass base, "PGE::Text" Index: src/packfile.c =================================================================== --- src/packfile.c (revision 11707) +++ src/packfile.c (working copy) @@ -346,7 +346,7 @@ } else { /* XXX which warn_class */ - Parrot_warn(interpreter, PARROT_WARNINGS_ALL_FLAG, "@MAIN sub not allowed\n"); + Parrot_warn(interpreter, PARROT_WARNINGS_ALL_FLAG, ":main sub not allowed\n"); } } } Index: docs/imcc/operation.pod =================================================================== --- docs/imcc/operation.pod (revision 11707) +++ docs/imcc/operation.pod (working copy) @@ -116,7 +116,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: docs/intro.pod =================================================================== --- docs/intro.pod (revision 11707) +++ 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. Index: compilers/pge/PGE/Exp.pir =================================================================== --- compilers/pge/PGE/Exp.pir (revision 11707) +++ compilers/pge/PGE/Exp.pir (working copy) @@ -507,7 +507,7 @@ .return (self) .end -.sub "gen" method +.sub "gen" :method .param pmc code .param string label .param string next @@ -1032,7 +1032,7 @@ .return (self) .end -.sub "gen" method +.sub "gen" :method .param pmc code .param string label .param string next Index: compilers/pge/PGE/Match.pir =================================================================== --- compilers/pge/PGE/Match.pir (revision 11707) +++ compilers/pge/PGE/Match.pir (working copy) @@ -91,7 +91,7 @@ =cut -.sub "next" method +.sub "next" :method .local pmc corou corou = getattribute self, "PGE::Match\x0&:corou" @@ -114,7 +114,7 @@ =cut -.sub "from" method +.sub "from" :method .local pmc from from = getattribute self, "PGE::Match\x0$:from" .return (from) @@ -126,7 +126,7 @@ =cut -.sub "to" method +.sub "to" :method .local pmc to to = getattribute self, "PGE::Match\x0$:pos" .return (to) @@ -139,7 +139,7 @@ =cut -.sub "__get_bool" method +.sub "__get_bool" :method $P1 = getattribute self, "PGE::Match\x0$:pos" $I0 = $P1 $I1 = isge $I0, 0 @@ -152,7 +152,7 @@ =cut -.sub "__get_integer" method +.sub "__get_integer" :method $S0 = self $I0 = $S0 .return ($I0) @@ -164,7 +164,7 @@ =cut -.sub "__get_number" method +.sub "__get_number" :method $S0 = self $N0 = $S0 .return ($N0) @@ -176,7 +176,7 @@ =cut -.sub "__get_string" method +.sub "__get_string" :method $P0 = getattribute self, "PGE::Match\x0$:target" $P1 = getattribute self, "PGE::Match\x0$:from" $P2 = getattribute self, "PGE::Match\x0$:pos" @@ -199,7 +199,7 @@ =cut -.sub "__get_string_keyed_int" method +.sub "__get_string_keyed_int" :method .param int key $P0 = getattribute self, "PGE::Match\x0@:capt" $S0 = '' @@ -218,7 +218,7 @@ =cut -.sub "__get_pmc_keyed_int" method +.sub "__get_pmc_keyed_int" :method .param int key $P0 = getattribute self, "PGE::Match\x0@:capt" if_null $P0, get_1 @@ -227,7 +227,7 @@ .return ($P0) .end -.sub "__set_pmc_keyed_int" method +.sub "__set_pmc_keyed_int" :method .param int key .param pmc val .local pmc capt @@ -264,7 +264,7 @@ =cut -.sub "get_hash" method +.sub "get_hash" :method .return (self) .end @@ -274,7 +274,7 @@ =cut -.sub "get_array" method +.sub "get_array" :method .local pmc array array = getattribute self, "PGE::Match\x0@:capt" .return (array) Index: compilers/pge/PGE/TokenHash.pir =================================================================== --- compilers/pge/PGE/TokenHash.pir (revision 11707) +++ compilers/pge/PGE/TokenHash.pir (working copy) @@ -14,7 +14,7 @@ .return () .end -.sub "__init" method +.sub "__init" :method .local pmc ihash, vhash ihash = new .Hash vhash = new .Hash @@ -23,7 +23,7 @@ .return () .end -.sub "__get_pmc_keyed" method +.sub "__get_pmc_keyed" :method .param pmc key_p .local pmc vhash vhash = getattribute self, "PGE::TokenHash\x0.vhash" @@ -31,7 +31,7 @@ .return ($P0) .end -.sub "__set_pmc_keyed" method +.sub "__set_pmc_keyed" :method .param pmc key_p .param pmc value .local string key @@ -53,7 +53,7 @@ .return () .end -.sub "__exists_keyed" method +.sub "__exists_keyed" :method .param pmc key_p .local pmc vhash vhash = getattribute self, "PGE::TokenHash\x0.vhash" Index: t/pmc/mmd.t =================================================================== --- t/pmc/mmd.t (revision 11707) +++ t/pmc/mmd.t (working copy) @@ -1010,26 +1010,26 @@ print "\n" .end .namespace ["AInt"] -.sub __init method +.sub __init :method $P0 = new Integer setattribute self, ".i", $P0 .end -.sub __set_integer_native method +.sub __set_integer_native :method .param int i $P0 = getattribute self, ".i" $P0 = i .end -.sub __set_number_native method +.sub __set_number_native :method .param float f $P0 = getattribute self, ".i" $P0 = f .end -.sub __get_string method +.sub __get_string :method $P0 = getattribute self, ".i" $S0 = $P0 .return ($S0) .end -.sub __get_number method +.sub __get_number :method $P0 = getattribute self, ".i" $N0 = $P0 .return ($N0) @@ -1047,11 +1047,11 @@ 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/object-meths.t =================================================================== --- t/pmc/object-meths.t (revision 11707) +++ t/pmc/object-meths.t (working copy) @@ -292,7 +292,7 @@ .namespace ["A"] -.sub foo method +.sub foo :method .local pmc B print "A::foo\n" @@ -304,17 +304,17 @@ .end -.sub blah method +.sub blah :method print "A::blah\n" .end .namespace ["B"] -.sub foo method +.sub foo :method print "B::foo\n" .end -.sub blah method +.sub blah :method print "B::blah\n" .end CODE @@ -348,7 +348,7 @@ .namespace ["A"] -.sub foo method +.sub foo :method .param pmc B print "A::foo\n" @@ -359,17 +359,17 @@ .end -.sub blah method +.sub blah :method print "A::blah\n" .end .namespace ["B"] -.sub foo method +.sub foo :method print "B::foo\n" .end -.sub blah method +.sub blah :method print "B::blah\n" .end CODE @@ -404,7 +404,7 @@ .namespace ["A"] -.sub foo method +.sub foo :method .param pmc B print "A::foo\n" @@ -418,17 +418,17 @@ .end -.sub blah method +.sub blah :method print "A::blah\n" .end .namespace ["B"] -.sub foo method +.sub foo :method print "B::foo\n" .end -.sub blah method +.sub blah :method print "B::blah\n" .end CODE @@ -711,7 +711,7 @@ pir_output_is(<<'CODE', <<'OUTPUT', "same method name in two namespaces"); .namespace ["A"] -.sub foo method +.sub foo :method .param int i .pcc_begin_return @@ -719,7 +719,7 @@ .end .namespace ["B"] -.sub foo method +.sub foo :method .param int i .pcc_begin_return @@ -749,7 +749,7 @@ .namespace ["A"] -.sub foo method +.sub foo :method .include "interpinfo.pasm" $P0 = interpinfo .INTERPINFO_CURRENT_OBJECT eq_addr self, $P0, ok @@ -778,7 +778,7 @@ .namespace ["Foo"] -.sub __get_integer_keyed method +.sub __get_integer_keyed :method .param pmc key print "Key = " print key @@ -808,7 +808,7 @@ .namespace ["Foo"] -.sub __get_integer_keyed method +.sub __get_integer_keyed :method .param pmc key $S0 = "bar" print "Key = " @@ -837,11 +837,11 @@ store_global "Bar", "__get_string", $P0 print o .end -.sub ok2 method +.sub ok2 :method .return("ok 2\n") .end .namespace [ "Foo" ] -.sub __get_string method +.sub __get_string :method .return("ok 1\n") .end CODE @@ -909,7 +909,7 @@ .end .namespace ["Foo"] -.sub go method +.sub go :method .local pmc n n = getattribute self, "Foo\0n" dec n @@ -933,7 +933,7 @@ .end .namespace ["MyString"] -.sub __set_string_native method +.sub __set_string_native :method .param string s classoffset $I0, self, "MyString" $P0 = getattribute self, $I0 @@ -954,16 +954,16 @@ .end .namespace ['Parent'] -.sub foo method +.sub foo :method print "Parent foo\n" self."bar"() .end -.sub bar method +.sub bar :method print "Parent bar\n" .end .namespace ['Child'] -.sub foo method +.sub foo :method print "Child foo\n" .local pmc s s = new .Super, self Index: t/pmc/objects.t =================================================================== --- t/pmc/objects.t (revision 11707) +++ t/pmc/objects.t (working copy) @@ -1313,7 +1313,7 @@ .end .namespace ["MyInt"] -.sub __get_integer method +.sub __get_integer :method $I0 = classoffset self, "MyInt" $P0 = getattribute self, $I0 $I0 = $P0 @@ -1321,7 +1321,7 @@ .return $I0 .pcc_end_return .end -.sub __get_string method +.sub __get_string :method $I0 = classoffset self, "MyInt" $P0 = getattribute self, $I0 $I0 = $P0 @@ -1368,7 +1368,7 @@ .end .namespace ["MyInt"] -.sub __get_string method +.sub __get_string :method $I0 = classoffset self, "MyInt" $P0 = getattribute self, $I0 $I0 = $P0 @@ -1463,7 +1463,7 @@ .end .namespace ["MyInt"] -.sub __get_integer method +.sub __get_integer :method $I0 = classoffset self, "MyInt" $P0 = getattribute self, $I0 $I0 = $P0 @@ -1471,7 +1471,7 @@ .return $I0 .pcc_end_return .end -.sub __get_string method +.sub __get_string :method $I0 = classoffset self, "MyInt" $P0 = getattribute self, $I0 $I0 = $P0 @@ -1529,7 +1529,7 @@ .namespace ["MyInt2"] # subclassing methods from MyInt is ok # this one changes the value a bit -.sub __get_integer method +.sub __get_integer :method $I0 = classoffset self, "MyInt" $P0 = getattribute self, $I0 $I0 = $P0 @@ -1539,7 +1539,7 @@ .pcc_end_return .end .namespace ["MyInt"] -.sub __get_integer method +.sub __get_integer :method $I0 = classoffset self, "MyInt" $P0 = getattribute self, $I0 $I0 = $P0 @@ -1547,7 +1547,7 @@ .return $I0 .pcc_end_return .end -.sub __get_string method +.sub __get_string :method $I0 = classoffset self, "MyInt" $P0 = getattribute self, $I0 $I0 = $P0 @@ -1605,7 +1605,7 @@ .end .namespace ["MyInt2"] -.sub __get_integer method +.sub __get_integer :method $I0 = classoffset self, "MyInt" $P0 = getattribute self, $I0 $I0 = $P0 @@ -1613,7 +1613,7 @@ .return $I0 .pcc_end_return .end -.sub __get_string method +.sub __get_string :method $I0 = classoffset self, "MyInt" $P0 = getattribute self, $I0 $I0 = $P0 @@ -1696,7 +1696,7 @@ .end .namespace ["Foo"] -.sub __instantiate method +.sub __instantiate :method .param int val # in realiter check what is passed $I0 = find_type "Foo" .local pmc obj @@ -1765,7 +1765,7 @@ .end .namespace ["Foo"] -.sub __init method +.sub __init :method print "X: " print argcI print argcS @@ -1801,7 +1801,7 @@ print "ok 2\n" .end .namespace [ "Foo" ] -.sub __get_string method +.sub __get_string :method .return("ok 1\n") .end .sub Foo Index: t/pmc/delegate.t =================================================================== --- t/pmc/delegate.t (revision 11707) +++ t/pmc/delegate.t (working copy) @@ -146,7 +146,7 @@ end .end .namespace ["delegate"] -.sub __set_integer_native method +.sub __set_integer_native :method .param int i # just return print i @@ -184,7 +184,7 @@ end .end .namespace ["delegate"] -.sub __set_integer_native method +.sub __set_integer_native :method .param int i # cant keep state yet # just print arg and return @@ -205,7 +205,7 @@ d = 3 .return (d) .end -.sub __get_string method +.sub __get_string :method .return("one") .end CODE Index: t/compilers/imcc/syn/tail.t =================================================================== --- t/compilers/imcc/syn/tail.t (revision 11707) +++ t/compilers/imcc/syn/tail.t (working copy) @@ -335,7 +335,7 @@ .end .namespace ["Foo"] -.sub go method +.sub go :method .local pmc n n = getattribute self, "Foo\0n" dec n Index: t/compilers/imcc/syn/objects.t =================================================================== --- t/compilers/imcc/syn/objects.t (revision 11707) +++ t/compilers/imcc/syn/objects.t (working copy) @@ -28,7 +28,7 @@ .end .namespace [ "Foo" ] -.sub _meth method +.sub _meth :method print "in meth\n" .end CODE @@ -52,7 +52,7 @@ .end .namespace [ "Foo" ] -.sub _meth method +.sub _meth :method .param pmc s print "in meth\n" print s @@ -78,7 +78,7 @@ .end .namespace [ "Foo" ] -.sub _meth method +.sub _meth :method .param pmc s print "in meth\n" print s @@ -111,7 +111,7 @@ end .end .namespace [ "Foo" ] -.sub _meth method +.sub _meth :method print "in meth\n" .end CODE @@ -136,17 +136,17 @@ .end .namespace ["Foo"] -.sub __init method +.sub __init :method print "foo_init\n" .end .namespace ["Bar"] -.sub __init method +.sub __init :method print "bar_init\n" .end .namespace ["Baz"] -.sub __init method +.sub __init :method print "baz_init\n" .end @@ -176,7 +176,7 @@ .end .namespace [ "Foo" ] -.sub _meth method +.sub _meth :method print "in meth\n" isa $I0, self, "Foo" if $I0, ok @@ -207,7 +207,7 @@ .end .namespace [ "Foo" ] -.sub _meth method +.sub _meth :method print "in meth\n" .end CODE @@ -235,7 +235,7 @@ .end .namespace [ "Foo" ] -.sub _meth method +.sub _meth :method print "in meth\n" .end CODE @@ -263,7 +263,7 @@ .end .namespace [ "Foo" ] -.sub _meth method +.sub _meth :method .param string p1 .param string p2 print "in meth\n" @@ -297,7 +297,7 @@ .end .namespace [ "Foo" ] -.sub _meth method +.sub _meth :method print "in meth\n" .end CODE @@ -319,7 +319,7 @@ .end .namespace [ "Foo" ] -.sub open method +.sub open :method print "in meth\n" .end CODE Index: t/compilers/imcc/reg/spill.t =================================================================== --- t/compilers/imcc/reg/spill.t (revision 11707) +++ t/compilers/imcc/reg/spill.t (working copy) @@ -528,13 +528,13 @@ end .end -.sub method1 method +.sub method1 :method print "In method 1\n" .pcc_begin_return .pcc_end_return .end -.sub method2 method +.sub method2 :method print "In method 2\n" .pcc_begin_return .pcc_end_return Index: t/tools/pbc_merge.t =================================================================== --- t/tools/pbc_merge.t (revision 11707) +++ t/tools/pbc_merge.t (working copy) @@ -57,7 +57,7 @@ # First test - check sub relocation works. { pir_to_pbc( "pbc_merge_t1_1", <<'PIR' ); -.sub _main @MAIN +.sub _main :main _testcall() .end PIR @@ -74,7 +74,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 11707) +++ t/library/streams.t (working copy) @@ -88,7 +88,7 @@ print "finished\n" end .end -.sub _hello method +.sub _hello :method self."write"( "hello" ) self."write"( "world!" ) self."write"( "parrot" ) @@ -160,7 +160,7 @@ end .end -.sub _hello method +.sub _hello :method print "_hello start!\n" self."write"( "hello" ) self."write"( "world!" ) @@ -822,7 +822,7 @@ end .end -.sub _counter method +.sub _counter :method .local string str .local int i @@ -851,7 +851,7 @@ if i < 10 goto LOOP .end -.sub _included method +.sub _included :method .local pmc temp self."write"( "hello" ) @@ -868,7 +868,7 @@ self."write"( "world" ) .end -.sub _counter2 method +.sub _counter2 :method .local string str str = 'A' @@ -939,7 +939,7 @@ end .end -.sub _text method +.sub _text :method self."write"( "this\nis a\n" ) self."write"( "Stream::Lines\ntest" ) self."write"( "case\nhello world" ) @@ -1301,7 +1301,7 @@ end .end -.sub _reader method +.sub _reader :method .local pmc stream1 .local pmc stream2 .local pmc stream3 @@ -1400,7 +1400,7 @@ end .end -.sub _counter method +.sub _counter :method .local string str .local int i @@ -1466,7 +1466,7 @@ end .end -.sub _reader method +.sub _reader :method print "reader start\n" self."dump"() print "reader done\n" Index: t/library/test_more.t =================================================================== --- t/library/test_more.t (revision 11707) +++ t/library/test_more.t (working copy) @@ -1,6 +1,6 @@ #!./parrot -.sub _main @MAIN +.sub _main :main load_bytecode 'library/Test/Builder/Tester.pir' load_bytecode 'library/Test/More.pir' Index: t/library/yaml_parser_syck.t =================================================================== --- t/library/yaml_parser_syck.t (revision 11707) +++ t/library/yaml_parser_syck.t (working copy) @@ -32,7 +32,7 @@ .include "library/YAML/Parser/Syck.pir" .include "library/dumper.pir" -.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/data_escape.t =================================================================== --- t/library/data_escape.t (revision 11707) +++ t/library/data_escape.t (working copy) @@ -25,7 +25,7 @@ my @subs= qw/ String /; my $PRE=<<PRE; -.sub main [EMAIL PROTECTED] +.sub main :main load_bytecode "$lib" .local pmc escape_string @@ -46,7 +46,7 @@ ## 1 pir_output_is(<<CODE, <<'OUT', "load_bytecode"); -.sub main [EMAIL PROTECTED] +.sub main :main load_bytecode "$lib" goto OK NOK: @@ -65,7 +65,7 @@ for my $sub ( @subs ) { pir_output_is(<<CODE, <<'OUT', "find_global '$sub'"); -.sub main [EMAIL PROTECTED] +.sub main :main load_bytecode "$lib" .local pmc sub sub = find_global "$ns", "$sub" @@ -247,7 +247,7 @@ escaped_frozen_pmc = escape_string( frozen_pmc, '"' ) .local string pir_code - pir_code = ".sub test @ANON\n$P1 = thaw binary:\"" + pir_code = ".sub test :anon\n$P1 = thaw binary:\"" pir_code .= escaped_frozen_pmc pir_code .= "\"\nprint $P1\n.end\n" Index: t/library/test_builder_tester.t =================================================================== --- t/library/test_builder_tester.t (revision 11707) +++ t/library/test_builder_tester.t (working copy) @@ -1,6 +1,6 @@ #!./parrot -.sub _main @MAIN +.sub _main :main load_bytecode 'library/Test/Builder/Tester.pir' .local int tb_type Index: t/library/dumper.t =================================================================== --- t/library/dumper.t (revision 11707) +++ t/library/dumper.t (working copy) @@ -528,7 +528,7 @@ .namespace ["TestClass"] -.sub __dump method +.sub __dump :method .param pmc dumper .param string dname .local string subindent @@ -933,14 +933,14 @@ .end .namespace ["bar"] -.sub __init method +.sub __init :method .local pmc ar ar = getattribute self, '__value' push ar, 1 push ar, 2 .end -.sub __dump method +.sub __dump :method .param pmc dumper .param string label print " __value => {\n" Index: t/op/gc.t =================================================================== --- t/op/gc.t (revision 11707) +++ t/op/gc.t (working copy) @@ -187,7 +187,7 @@ .end .namespace ["Foo"] -.sub __init method +.sub __init :method print "init\n" sweep 1 new P6, .String @@ -196,14 +196,14 @@ sweep 1 .end -.sub do_inc method +.sub do_inc :method sweep 1 inc self sweep 1 print "back from _inc\n" .end -.sub __increment method +.sub __increment :method print "inc\n" sweep 1 .end @@ -305,7 +305,7 @@ print "\n" .end .namespace ["b"] -.sub b11 method +.sub b11 :method .param pmc n .local pmc n1 # new_pad -1 Index: t/op/string.t =================================================================== --- t/op/string.t (revision 11707) +++ t/op/string.t (working copy) @@ -2651,7 +2651,7 @@ .namespace ["Foo"] -.sub __get_string method +.sub __get_string :method .local string ret null ret Index: t/op/calling.t =================================================================== --- t/op/calling.t (revision 11707) +++ t/op/calling.t (working copy) @@ -1041,7 +1041,7 @@ f(o, "ok 4\n") .end .namespace ["Foo"] -.sub bar method +.sub bar :method .param string s print self print " " @@ -1054,7 +1054,7 @@ print " " print s .end -.sub __get_string method +.sub __get_string :method $S0 = typeof self .return ($S0) .end @@ -2092,7 +2092,7 @@ ok OUTPUT -pir_output_like(<<'CODE', <<'OUTPUT', "param .. 'a' => v :named('foo'"); +pir_output_like(<<'CODE', <<'OUTPUT', "param .. 'a' => v :named('foo')"); .sub main :main foo( "b" => 10, "a" => 20) print "never\n" @@ -2108,7 +2108,7 @@ OUTPUT -pir_output_like(<<'CODE', <<'OUTPUT', "param .. 'a' => v :named('foo'"); +pir_output_like(<<'CODE', <<'OUTPUT', "param .. 'a' => v :named('foo')"); .sub main :main foo( "b" => 10, "a" => 20) print "never\n" Index: examples/streams/Bytes.pir =================================================================== --- examples/streams/Bytes.pir (revision 11707) +++ examples/streams/Bytes.pir (working copy) @@ -66,7 +66,7 @@ =cut -.sub _hello method +.sub _hello :method self."write"( "hello" ) self."write"( "world!" ) self."write"( "parrot" ) Index: examples/streams/SubCounter.pir =================================================================== --- examples/streams/SubCounter.pir (revision 11707) +++ examples/streams/SubCounter.pir (working copy) @@ -39,7 +39,7 @@ =cut -.sub _counter method +.sub _counter :method .local string str .local int i Index: examples/streams/Lines.pir =================================================================== --- examples/streams/Lines.pir (revision 11707) +++ examples/streams/Lines.pir (working copy) @@ -47,7 +47,7 @@ =cut -.sub _text method +.sub _text :method self."write"( "this\nis a\n" ) self."write"( "Stream::Lines\ntest" ) self."write"( "case\nhello world" ) Index: examples/streams/Replay.pir =================================================================== --- examples/streams/Replay.pir (revision 11707) +++ examples/streams/Replay.pir (working copy) @@ -20,7 +20,7 @@ end .end -.sub _reader method +.sub _reader :method .local pmc stream1 .local pmc stream2 .local pmc stream3 Index: examples/streams/Writer.pir =================================================================== --- examples/streams/Writer.pir (revision 11707) +++ examples/streams/Writer.pir (working copy) @@ -43,7 +43,7 @@ =cut -.sub _reader method +.sub _reader :method print "reader start\n" self."dump"() print "reader done\n" Index: examples/streams/SubHello.pir =================================================================== --- examples/streams/SubHello.pir (revision 11707) +++ examples/streams/SubHello.pir (working copy) @@ -38,7 +38,7 @@ =cut -.sub _hello method +.sub _hello :method self."write"( "hello" ) self."write"( "world!" ) self."write"( "parrot" ) Index: examples/streams/Include.pir =================================================================== --- examples/streams/Include.pir (revision 11707) +++ examples/streams/Include.pir (working copy) @@ -40,7 +40,7 @@ =cut -.sub _counter method +.sub _counter :method .local string str .local int i @@ -78,7 +78,7 @@ =cut -.sub _included method +.sub _included :method .local pmc temp .local pmc func @@ -104,7 +104,7 @@ =cut -.sub _counter2 method +.sub _counter2 :method .local string str str = 'A'