[svn:parrot] r42115 - trunk/compilers/pct/src/PAST
pmichaud at svn.parrot.org
pmichaud at svn.parrot.org
Mon Oct 26 19:09:08 UTC 2009
Author: pmichaud
Date: Mon Oct 26 19:09:07 2009
New Revision: 42115
URL: https://trac.parrot.org/parrot/changeset/42115
Log:
[pct/past]: Add 'nsentry' attribute to PAST::Block.
Modified:
trunk/compilers/pct/src/PAST/Compiler.pir
trunk/compilers/pct/src/PAST/Node.pir
Modified: trunk/compilers/pct/src/PAST/Compiler.pir
==============================================================================
--- trunk/compilers/pct/src/PAST/Compiler.pir Mon Oct 26 19:04:22 2009 (r42114)
+++ trunk/compilers/pct/src/PAST/Compiler.pir Mon Oct 26 19:09:07 2009 (r42115)
@@ -749,18 +749,33 @@
unshift blockpast, node
.local string name, pirflags, blocktype
- .local pmc subid, ns, hll
+ .local pmc nsentry, subid, ns, hll
name = node.'name'()
pirflags = node.'pirflags'()
blocktype = node.'blocktype'()
+ nsentry = node.'nsentry'()
subid = node.'subid'()
ns = node.'namespace'()
hll = node.'hll'()
+ ## handle nsentry attribute
+ $I0 = defined nsentry
+ unless $I0 goto nsentry_done
+ unless nsentry goto nsentry_anon
+ $S0 = self.'escape'(nsentry)
+ pirflags = concat pirflags, ' :nsentry('
+ pirflags = concat pirflags, $S0
+ pirflags = concat pirflags, ')'
+ goto nsentry_done
+ nsentry_anon:
+ pirflags = concat pirflags, ' :anon'
+ nsentry_done:
+
## handle anonymous blocks
if name goto have_name
name = self.'unique'('_block')
if ns goto have_name
+ if nsentry goto have_name
pirflags = concat pirflags, ' :anon'
have_name:
Modified: trunk/compilers/pct/src/PAST/Node.pir
==============================================================================
--- trunk/compilers/pct/src/PAST/Node.pir Mon Oct 26 19:04:22 2009 (r42114)
+++ trunk/compilers/pct/src/PAST/Node.pir Mon Oct 26 19:09:07 2009 (r42115)
@@ -553,6 +553,19 @@
.end
+=item nsentry([nsentry])
+
+Get/set the C<nsentry> for this block.
+
+=cut
+
+.sub 'nsentry' :method
+ .param pmc value :optional
+ .param int has_value :opt_flag
+ .tailcall self.'attr'('nsentry', value, has_value)
+.end
+
+
=item symbol(name [, attr1 => val1, attr2 => val2, ...])
If called with named arguments, sets the symbol hash corresponding
More information about the parrot-commits
mailing list