[svn:parrot] r39716 - in branches/pmc_pct/compilers: pmcc pmcc/src pmcc/src/parser vtdumper
cotto at svn.parrot.org
cotto at svn.parrot.org
Mon Jun 22 13:32:02 UTC 2009
Author: cotto
Date: Mon Jun 22 13:31:59 2009
New Revision: 39716
URL: https://trac.parrot.org/parrot/changeset/39716
Log:
[vtdumper] make vtable dump easier to use and fix some trailing spaces
Modified:
branches/pmc_pct/compilers/pmcc/pmcc.pir
branches/pmc_pct/compilers/pmcc/src/builtins.pir
branches/pmc_pct/compilers/pmcc/src/parser/actions.pm
branches/pmc_pct/compilers/pmcc/src/parser/grammar.pg
branches/pmc_pct/compilers/vtdumper/vtdumper.pir
Modified: branches/pmc_pct/compilers/pmcc/pmcc.pir
==============================================================================
--- branches/pmc_pct/compilers/pmcc/pmcc.pir Mon Jun 22 13:03:32 2009 (r39715)
+++ branches/pmc_pct/compilers/pmcc/pmcc.pir Mon Jun 22 13:31:59 2009 (r39716)
@@ -32,7 +32,7 @@
setattribute $P0, '@cmdoptions', $P1
.end
-
+
# override HLLCompiler's default evalfiles in order to store the name of the file being compiled
.sub 'evalfiles' :method
Modified: branches/pmc_pct/compilers/pmcc/src/builtins.pir
==============================================================================
--- branches/pmc_pct/compilers/pmcc/src/builtins.pir Mon Jun 22 13:03:32 2009 (r39715)
+++ branches/pmc_pct/compilers/pmcc/src/builtins.pir Mon Jun 22 13:31:59 2009 (r39716)
@@ -63,7 +63,7 @@
does_hash = does what, 'hash'
does_array = does what, 'array'
if does_scalar == 1 goto clone_scalar
-
+
clone_aggregate:
.local pmc it, key, val, cloned, cloned_val
.local int i
Modified: branches/pmc_pct/compilers/pmcc/src/parser/actions.pm
==============================================================================
--- branches/pmc_pct/compilers/pmcc/src/parser/actions.pm Mon Jun 22 13:03:32 2009 (r39715)
+++ branches/pmc_pct/compilers/pmcc/src/parser/actions.pm Mon Jun 22 13:31:59 2009 (r39716)
@@ -160,7 +160,7 @@
$past<parameters> := $<c_signature><c_arguments>.ast;
# Handle parameters to create short and long signaures
-
+
# Largely stolen from Pmc2c::MULTIs::rewrite_multi_sub
my $short_sig := "JP"; # prepend the short signature interpreter and invocant
my @long_sig;
@@ -201,7 +201,7 @@
PIR q<
.local pmc type
type = find_lex '$type'
-
+
$S0 = type
$I1 = length $S0
$I0 = find_not_cclass .CCLASS_ALPHABETIC, $S0, 0, $I1
Modified: branches/pmc_pct/compilers/pmcc/src/parser/grammar.pg
==============================================================================
--- branches/pmc_pct/compilers/pmcc/src/parser/grammar.pg Mon Jun 22 13:03:32 2009 (r39715)
+++ branches/pmc_pct/compilers/pmcc/src/parser/grammar.pg Mon Jun 22 13:31:59 2009 (r39716)
@@ -67,7 +67,7 @@
}
rule simple_attr {
- <simple_attr_type> <identifier>
+ <simple_attr_type> <identifier>
}
rule simple_attr_type {
@@ -80,7 +80,7 @@
}
rule pointer_attr {
- <pointer_attr_type> <identifier>
+ <pointer_attr_type> <identifier>
}
rule pointer_attr_type {
@@ -156,7 +156,7 @@
}
rule c_parameter {
- <-[()]>+ <c_parameters_parens>?
+ <-[()]>+ <c_parameters_parens>?
{*}
}
Modified: branches/pmc_pct/compilers/vtdumper/vtdumper.pir
==============================================================================
--- branches/pmc_pct/compilers/vtdumper/vtdumper.pir Mon Jun 22 13:03:32 2009 (r39715)
+++ branches/pmc_pct/compilers/vtdumper/vtdumper.pir Mon Jun 22 13:31:59 2009 (r39716)
@@ -37,10 +37,11 @@
#spast = simplified past, i.e. converted from a Capture
.local pmc node, spast, snode, sattrs, sargs, sarg
- .local pmc it, key
+ .local pmc it, key, attr_it, attr_key
+ .local string name
.local int i, j, elems
- spast = new ['ResizablePMCArray']
+ spast = new ['Hash']
#PAST::Block doesn't support iteration or even get_integer, so this is the
#easiest way to get all elements. Also, freeze/thaw on Captures is broken.
@@ -52,8 +53,7 @@
snode = new ['Hash']
- $S0 = node['name']
- snode['name'] = $S0
+ name = node['name']
$S0 = node['returns']
snode['returns'] = $S0
@@ -89,8 +89,18 @@
snode['parameter_list'] = $P0
sattrs = node['attributes']
- snode['attributes'] = sattrs
- push spast, snode
+ $P0 = new ['Hash']
+
+ attr_it = iter sattrs
+ attr_iter_start:
+ unless attr_it goto attr_iter_end
+ attr_key = shift attr_it
+ $P0[attr_key] = 1
+ goto attr_iter_start
+ attr_iter_end:
+
+ snode['attributes'] = $P0
+ spast[name] = snode
goto spast_loop_start
More information about the parrot-commits
mailing list