[svn:parrot] r43524 - in branches/tt389_fix: compilers/pge/PGE compilers/tge compilers/tge/TGE config/auto runtime/parrot/library/PGE t/compilers/pge

tene at svn.parrot.org tene at svn.parrot.org
Thu Jan 21 07:12:49 UTC 2010


Author: tene
Date: Thu Jan 21 07:12:48 2010
New Revision: 43524
URL: https://trac.parrot.org/parrot/changeset/43524

Log:
Merge the changes from pge_no_namespace_methods up through r43523

Modified:
   branches/tt389_fix/compilers/pge/PGE/Exp.pir
   branches/tt389_fix/compilers/tge/TGE.pir
   branches/tt389_fix/compilers/tge/TGE/Compiler.pir
   branches/tt389_fix/config/auto/icu.pm
   branches/tt389_fix/runtime/parrot/library/PGE/Text.pir
   branches/tt389_fix/runtime/parrot/library/PGE/Util.pir
   branches/tt389_fix/t/compilers/pge/03-optable.t
   branches/tt389_fix/t/compilers/pge/04-compile.t
   branches/tt389_fix/t/compilers/pge/06-grammar.t
   branches/tt389_fix/t/compilers/pge/pge_examples.t
   branches/tt389_fix/t/compilers/pge/pge_text.t

Modified: branches/tt389_fix/compilers/pge/PGE/Exp.pir
==============================================================================
--- branches/tt389_fix/compilers/pge/PGE/Exp.pir	Thu Jan 21 06:52:15 2010	(r43523)
+++ branches/tt389_fix/compilers/pge/PGE/Exp.pir	Thu Jan 21 07:12:48 2010	(r43524)
@@ -842,7 +842,9 @@
         %L: # grammar subrule %0::%1
           captob = captscope.'new'(captscope, 'grammar'=>'%0')
           captob.'to'(pos)
-          $P0 = get_hll_global %2, '%1'
+          $P0 = get_root_global ['parrot'], 'P6metaclass'
+          $P0 = $P0.'get_proto'('%0')
+          $P0 = find_method $P0, '%1'
         CODE
     goto subrule_match
 

Modified: branches/tt389_fix/compilers/tge/TGE.pir
==============================================================================
--- branches/tt389_fix/compilers/tge/TGE.pir	Thu Jan 21 06:52:15 2010	(r43523)
+++ branches/tt389_fix/compilers/tge/TGE.pir	Thu Jan 21 07:12:48 2010	(r43524)
@@ -103,9 +103,11 @@
 
     # import <die> and <line_number> rules from PGE::Util
     $P0 = get_class ['TGE';'Parser']
-    $P1 = get_hll_global ['PGE';'Util'], 'die'
+    $P1 = get_hll_global ['PGE'], 'Util'
+    $P1 = find_method $P1, 'die'
     $P0.'add_method'('die', $P1)
-    $P1 = get_hll_global ['PGE';'Util'], 'line_number'
+    $P1 = get_hll_global ['PGE'], 'Util'
+    $P1 = find_method $P1, 'line_number'
     $P0.'add_method'('line_number', $P1)
 
   end:

Modified: branches/tt389_fix/compilers/tge/TGE/Compiler.pir
==============================================================================
--- branches/tt389_fix/compilers/tge/TGE/Compiler.pir	Thu Jan 21 06:52:15 2010	(r43523)
+++ branches/tt389_fix/compilers/tge/TGE/Compiler.pir	Thu Jan 21 07:12:48 2010	(r43524)
@@ -29,7 +29,8 @@
     # Parse the source string and build a match tree
     .local pmc match
     .local pmc start_rule
-    start_rule = get_hll_global ['TGE';'Parser'], "start"
+    $P0 = get_hll_global ['TGE'], 'Parser'
+    start_rule = find_method $P0, "start"
     match = start_rule(source, 'grammar'=>'TGE::Parser')
     # Verify the parse
     unless match goto err_parse    # if parse fails, stop

Modified: branches/tt389_fix/config/auto/icu.pm
==============================================================================
--- branches/tt389_fix/config/auto/icu.pm	Thu Jan 21 06:52:15 2010	(r43523)
+++ branches/tt389_fix/config/auto/icu.pm	Thu Jan 21 07:12:48 2010	(r43524)
@@ -288,6 +288,7 @@
         print "Trying $arg->{icuconfig} with '--ldflags'\n"
             if $arg->{verbose};
         $icushared = capture_output("$arg->{icuconfig} --ldflags");
+        chomp $icushared;
         print "icushared:  captured $icushared\n"
             if $arg->{verbose};
         ($icushared, $arg->{without}) =

Modified: branches/tt389_fix/runtime/parrot/library/PGE/Text.pir
==============================================================================
--- branches/tt389_fix/runtime/parrot/library/PGE/Text.pir	Thu Jan 21 06:52:15 2010	(r43523)
+++ branches/tt389_fix/runtime/parrot/library/PGE/Text.pir	Thu Jan 21 07:12:48 2010	(r43524)
@@ -36,8 +36,7 @@
 
 =cut
 
-.sub "bracketed"
-    .param pmc tgt                                 # target to match
+.sub "bracketed" :method
     .param string delim        :optional           # optional delimiters
     .param int has_delim       :opt_flag
     .param pmc adverbs         :slurpy :named      # named options
@@ -51,7 +50,7 @@
     .local pmc stack                               # lookket backtracking
 
     $P0 = get_hll_global ['PGE'], 'Match'
-    (mob, pos, target) = $P0.'new'(tgt)
+    (mob, pos, target) = $P0.'new'(self)
     from = pos
 
     if has_delim goto mkdelims

Modified: branches/tt389_fix/runtime/parrot/library/PGE/Util.pir
==============================================================================
--- branches/tt389_fix/runtime/parrot/library/PGE/Util.pir	Thu Jan 21 06:52:15 2010	(r43523)
+++ branches/tt389_fix/runtime/parrot/library/PGE/Util.pir	Thu Jan 21 07:12:48 2010	(r43524)
@@ -35,11 +35,10 @@
 
 =cut
 
-.sub 'die'
-    .param pmc mob                                 # match object
+.sub 'die' :method
     .param pmc list            :slurpy             # message arguments
 
-    .local pmc it
+    .local pmc it, mob
     .local string message
     message = ''
     it = iter list
@@ -54,7 +53,7 @@
     .local string target
     .local int pos
     $P0 = get_hll_global ['PGE'], 'Match'
-    (mob, pos, target) = $P0.'new'(mob)
+    (mob, pos, target) = $P0.'new'(self)
     $I0 = length message
     dec $I0
     $I0 = is_cclass .CCLASS_NEWLINE, message, $I0
@@ -63,7 +62,8 @@
     .local int lines
     .local pmc line_number
     #  FIXME: use 'line_number' method instead?
-    line_number = get_hll_global ['PGE';'Util'], 'line_number'
+    line_number = get_hll_global ['PGE'], 'Util'
+    line_number = find_method line_number, 'line_number'
     (lines) = mob.line_number(pos)
     inc lines
     message .= ' at line '
@@ -96,11 +96,10 @@
 
 =cut
 
-.sub 'warn'
-    .param pmc mob                                 # match object
+.sub 'warn' :method
     .param pmc list            :slurpy             # message arguments
 
-    .local pmc it
+    .local pmc it, mob
     .local string message
     message = ''
     it = iter list
@@ -115,7 +114,7 @@
     .local string target
     .local int pos
     $P0 = get_hll_global ['PGE'], 'Match'
-    (mob, pos, target) = $P0.'new'(mob)
+    (mob, pos, target) = $P0.'new'(self)
     $I0 = length message
     dec $I0
     $I0 = is_cclass .CCLASS_NEWLINE, message, $I0
@@ -124,7 +123,8 @@
     .local int lines
     .local pmc line_number
     #  FIXME: use 'line_number' method instead?
-    line_number = get_hll_global ['PGE';'Util'], 'line_number'
+    line_number = get_hll_global ['PGE'], 'Util'
+    line_number = find_method line_number, 'line_number'
     (lines) = mob.line_number(pos)
     inc lines
     message .= ' at line '
@@ -150,19 +150,18 @@
 
 =cut
 
-.sub 'line_number'
-    .param pmc match
+.sub 'line_number' :method
     .param int pos             :optional
     .param int has_pos         :opt_flag
 
     if has_pos goto have_pos
-    pos = match.'from'()
+    pos = self.'from'()
   have_pos:
 
     # count newlines to the current position of the parse
     .local int npos, lines
     .local string target
-    $P99 = getattribute match, '$.target'
+    $P99 = getattribute self, '$.target'
     target = $P99
     npos = 0
     lines = 0

Modified: branches/tt389_fix/t/compilers/pge/03-optable.t
==============================================================================
--- branches/tt389_fix/t/compilers/pge/03-optable.t	Thu Jan 21 06:52:15 2010	(r43523)
+++ branches/tt389_fix/t/compilers/pge/03-optable.t	Thu Jan 21 07:12:48 2010	(r43524)
@@ -103,7 +103,8 @@
     optable.'newtok'('prefix:-', 'equiv'=>'prefix:++')
 
     .local pmc ident
-    ident = get_global ['PGE';'Match'], 'ident'
+    $P0 = get_hll_global ['PGE'], 'Match'
+    ident = find_method $P0, 'ident'
     optable.'newtok'('term:', 'tighter'=>'prefix:++', 'parsed'=>ident)
     optable.'newtok'('circumfix:( )', 'equiv'=>'term:')
     optable.'newtok'('circumfix:[ ]', 'equiv'=>'term:')

Modified: branches/tt389_fix/t/compilers/pge/04-compile.t
==============================================================================
--- branches/tt389_fix/t/compilers/pge/04-compile.t	Thu Jan 21 06:52:15 2010	(r43523)
+++ branches/tt389_fix/t/compilers/pge/04-compile.t	Thu Jan 21 07:12:48 2010	(r43524)
@@ -58,7 +58,8 @@
     .local pmc p6compiler
     p6compiler = compreg 'PGE::Perl6Regex'
     $P1 = p6compiler('.+', 'name'=>'xyz1', 'grammar'=>'PGE::Test')
-    $P2 = get_hll_global ['PGE';'Test'], 'xyz1'
+    $P0 = get_hll_global ['PGE'], 'Test'
+    $P2 = find_method $P0, 'xyz1'
     $P3 = $P2('ok 1')
     is($P3, 'ok 1', 'compile into a new grammar')
 .end
@@ -71,7 +72,8 @@
     p6compiler = compreg 'PGE::Perl6Regex'
     $P1 = p6compiler('.+', 'name'=>'abc', 'grammar'=>'PGE::Test')
     $P1 = p6compiler('.+', 'name'=>'xyz2', 'grammar'=>'PGE::Test')
-    $P2 = get_hll_global ['PGE';'Test'], 'abc'
+    $P0 = get_hll_global ['PGE'], 'Test'
+    $P2 = find_method $P0, 'abc'
     $P3 = $P2('ok 1')
     is($P3, 'ok 1', 'compile into a new grammar, 2x')
 .end

Modified: branches/tt389_fix/t/compilers/pge/06-grammar.t
==============================================================================
--- branches/tt389_fix/t/compilers/pge/06-grammar.t	Thu Jan 21 06:52:15 2010	(r43523)
+++ branches/tt389_fix/t/compilers/pge/06-grammar.t	Thu Jan 21 07:12:48 2010	(r43524)
@@ -141,8 +141,10 @@
                   test_name    = 'Simple::Test' . test_num_str
 
     $P0 = split '::', test_name
+    $S0 = pop $P0
     .local pmc parser
-               parser = get_hll_global $P0, 'main'
+               parser = get_hll_global $P0, $S0
+               parser = find_method parser, 'main'
 
   next_target:
     .local string target

Modified: branches/tt389_fix/t/compilers/pge/pge_examples.t
==============================================================================
--- branches/tt389_fix/t/compilers/pge/pge_examples.t	Thu Jan 21 06:52:15 2010	(r43523)
+++ branches/tt389_fix/t/compilers/pge/pge_examples.t	Thu Jan 21 07:12:48 2010	(r43524)
@@ -101,7 +101,8 @@
     # print code
 
     .local pmc fasta_rule
-    fasta_rule = get_global ['Bio';'Fasta'], "databank"
+    fasta_rule = get_global ['Bio'], 'Fasta'
+    fasta_rule = find_method fasta_rule, "databank"
     .local pmc match
     ( match ) = fasta_rule( fasta )
 

Modified: branches/tt389_fix/t/compilers/pge/pge_text.t
==============================================================================
--- branches/tt389_fix/t/compilers/pge/pge_text.t	Thu Jan 21 06:52:15 2010	(r43523)
+++ branches/tt389_fix/t/compilers/pge/pge_text.t	Thu Jan 21 07:12:48 2010	(r43524)
@@ -32,7 +32,8 @@
     load_bytecode 'PGE.pbc'
     load_bytecode 'PGE/Text.pbc'
 
-    bracketed = get_global ['PGE';'Text'], "bracketed"
+    bracketed = get_global ['PGE'], 'Text'
+    bracketed = find_method bracketed, "bracketed"
     .local pmc jmpstack
                jmpstack = new 'ResizableIntegerArray'
     $S0 = "{ nested { and } okay, () and <>,  escaped \\}'s } okay"


More information about the parrot-commits mailing list