[svn:parrot] r43530 - in branches/pge_no_namespace_methods: compilers/json t/compilers/pge t/compilers/tge t/library
tene at svn.parrot.org
tene at svn.parrot.org
Thu Jan 21 08:41:10 UTC 2010
Author: tene
Date: Thu Jan 21 08:41:09 2010
New Revision: 43530
URL: https://trac.parrot.org/parrot/changeset/43530
Log:
Cherry-pick some patches from tt389_fix (r43525-r43529)
Modified:
branches/pge_no_namespace_methods/compilers/json/JSON.pir
branches/pge_no_namespace_methods/t/compilers/pge/04-compile.t
branches/pge_no_namespace_methods/t/compilers/pge/06-grammar.t
branches/pge_no_namespace_methods/t/compilers/tge/parser.t
branches/pge_no_namespace_methods/t/library/p6object.t
Modified: branches/pge_no_namespace_methods/compilers/json/JSON.pir
==============================================================================
--- branches/pge_no_namespace_methods/compilers/json/JSON.pir Thu Jan 21 08:05:17 2010 (r43529)
+++ branches/pge_no_namespace_methods/compilers/json/JSON.pir Thu Jan 21 08:41:09 2010 (r43530)
@@ -52,12 +52,13 @@
.param string json_string
.local pmc parse, match
- parse = get_root_global ['parrot'; 'JSON'], 'value'
+ $P0 = get_root_global ['parrot'], 'JSON'
+ parse = find_method $P0, 'value'
$P0 = get_root_global ['parrot'; 'PGE'], 'Match'
match = $P0.'new'(json_string)
match.'to'(0)
- match = parse(match)
+ match = parse(match, 'grammar' => 'JSON')
unless match goto failed
.local pmc pirgrammar, pirbuilder, pir
Modified: branches/pge_no_namespace_methods/t/compilers/pge/04-compile.t
==============================================================================
--- branches/pge_no_namespace_methods/t/compilers/pge/04-compile.t Thu Jan 21 08:05:17 2010 (r43529)
+++ branches/pge_no_namespace_methods/t/compilers/pge/04-compile.t Thu Jan 21 08:41:09 2010 (r43530)
@@ -47,7 +47,7 @@
.local pmc p6compiler
p6compiler = compreg 'PGE::Perl6Regex'
$P1 = p6compiler('.+', 'name'=>'xyz', 'grammar'=>'')
- $P2 = 'xyz'('ok 1')
+ $P2 = $P1('ok 1')
is($P2, 'ok 1', 'compile into current namespace')
.end
Modified: branches/pge_no_namespace_methods/t/compilers/pge/06-grammar.t
==============================================================================
--- branches/pge_no_namespace_methods/t/compilers/pge/06-grammar.t Thu Jan 21 08:05:17 2010 (r43529)
+++ branches/pge_no_namespace_methods/t/compilers/pge/06-grammar.t Thu Jan 21 08:41:09 2010 (r43530)
@@ -150,7 +150,7 @@
.local string target
target = shift targets
- ok = '_match_expr'( parser, target )
+ ok = '_match_expr'( parser, target, test_name )
test.'ok'( ok, description )
$I0 = targets
if $I0 goto next_target
@@ -173,6 +173,7 @@
.sub '_match_expr'
.param pmc parser
.param string expr
+ .param string grammar
.local int ok
.local string result, test_name, test_num_str
@@ -183,7 +184,7 @@
load_bytecode 'PGE/Perl6Grammar.pbc'
ok = 1
- match = parser(expr)
+ match = parser(expr, 'grammar' => grammar)
result = match
if result == expr goto match_ok
Modified: branches/pge_no_namespace_methods/t/compilers/tge/parser.t
==============================================================================
--- branches/pge_no_namespace_methods/t/compilers/tge/parser.t Thu Jan 21 08:05:17 2010 (r43529)
+++ branches/pge_no_namespace_methods/t/compilers/tge/parser.t Thu Jan 21 08:41:09 2010 (r43530)
@@ -43,7 +43,8 @@
# Match against the source
.local pmc match
.local pmc start_rule
- start_rule = get_global ['TGE';'Parser'], "start"
+ $P0 = get_global ['TGE'], 'Parser'
+ start_rule = find_method $P0, "start"
match = start_rule(source)
# Verify the match
@@ -72,7 +73,8 @@
GRAMMAR
.local pmc match
.local pmc start_rule
- start_rule = get_global ['TGE';'Parser'], "start"
+ $P0 = get_global ['TGE'], 'Parser'
+ start_rule = find_method $P0, "start"
match = start_rule(source, 'grammar'=>'TGE::Parser') # should throw.
.end
CODE
Modified: branches/pge_no_namespace_methods/t/library/p6object.t
==============================================================================
--- branches/pge_no_namespace_methods/t/library/p6object.t Thu Jan 21 08:05:17 2010 (r43529)
+++ branches/pge_no_namespace_methods/t/library/p6object.t Thu Jan 21 08:41:09 2010 (r43530)
@@ -160,7 +160,8 @@
jklobj = p6obj_tests(jklproto, 'Foo::JKL', 'isa'=>'P6object', 'can'=>'foo', 'who'=>jklns)
## add a method to a class
- $P0 = get_hll_global ['ABC'], 'foo'
+ $P0 = get_hll_global 'ABC'
+ $P0 = find_method $P0, 'foo'
p6meta.'add_method'('bar', $P0, 'to'=>jklproto)
jklobj = new ['Foo';'JKL']
$S0 = jklobj.'bar'()
More information about the parrot-commits
mailing list