Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Resolve ticket #38168 ([TODO] - Tcl - :slurpy HLL mappings)

Allow pmc2c to handle multiple HLL mappings in the specification of a PMC.

[tcl]

Take advantage of this; simplify some code that no longer has to
re-box the passed in array of args.




git-svn-id: https://svn.parrot.org/parrot/trunk@23272 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
commit b6641b08050605165fa81a2e848c7a60730a0ae2 1 parent 5528e9f
Will Coleda coke authored
6 docs/pmc2c.pod
View
@@ -126,11 +126,13 @@ The High level language this PMC corresponds to.
The basic parrot PMC type that this PMC correspond to for C<.HLL>
usage. For example:
- pmcclass TclInt hll Tcl maps Integer
+ pmclass TclInt hll Tcl maps Integer
allows this PMC to automatically be used when autoboxing C<I> registers to PMCs.
-Requires the C<hll> flag.
+Requires the C<hll> flag. Note that multiple mappings can be specified:
+
+ pmclass myOrderedHash hll frob maps Hash maps Array
=back
5 languages/tcl/runtime/builtin/list.pir
View
@@ -7,10 +7,7 @@
.sub '&list'
.param pmc argv :slurpy
- $P0 = new 'TclList'
- assign $P0, argv
-
- .return($P0)
+ .return(argv)
.end
# Local Variables:
1  languages/tcl/src/pmc/tcllist.pmc
View
@@ -30,6 +30,7 @@ pmclass TclList
group tcl_group
hll Tcl
maps Array
+ maps ResizablePMCArray
{
/*
10 lib/Parrot/Pmc2c/PMCEmitter.pm
View
@@ -569,15 +569,21 @@ EOC
if ( $self->{flags}{hll} && $self->{flags}{maps} ) {
my $hll = $self->{flags}{hll};
- my $maps = ( keys %{ $self->{flags}{maps} } )[0];
$cout .= <<"EOC";
{
/* Register this PMC as a HLL mapping */
INTVAL pmc_id = Parrot_get_HLL_id( interp, const_string(interp, "$hll")
);
- if (pmc_id > 0)
+ if (pmc_id > 0) {
+EOC
+ foreach my $maps ( keys %{ $self->{flags}{maps} } ) {
+ $cout .= <<"EOC";
Parrot_register_HLL_type( interp, pmc_id, enum_class_$maps, entry);
+EOC
+ }
+ $cout .= <<"EOC";
+ }
} /* Register */
EOC
}
Please sign in to comment.
Something went wrong with that request. Please try again.