[svn:parrot] r39532 - trunk/runtime/parrot/languages/parrot
tene at svn.parrot.org
tene at svn.parrot.org
Sat Jun 13 06:04:00 UTC 2009
Author: tene
Date: Sat Jun 13 06:03:55 2009
New Revision: 39532
URL: https://trac.parrot.org/parrot/changeset/39532
Log:
[languages/parrot]:
* Behave better when a library doesn't explicitly define exports
Modified:
trunk/runtime/parrot/languages/parrot/parrot.pir
Modified: trunk/runtime/parrot/languages/parrot/parrot.pir
==============================================================================
--- trunk/runtime/parrot/languages/parrot/parrot.pir Sat Jun 13 01:23:31 2009 (r39531)
+++ trunk/runtime/parrot/languages/parrot/parrot.pir Sat Jun 13 06:03:55 2009 (r39532)
@@ -16,7 +16,7 @@
.sub 'load_library' :method
.param pmc name
.param pmc extra :named :slurpy
- .local pmc name, library, inc_hash
+ .local pmc name, library, ns, inc_hash
.local string file
$I0 = does name, 'array'
if $I0 goto have_namelist
@@ -29,12 +29,18 @@
library = new 'Hash'
library['name'] = name
library['filename'] = file
- # If this fails, we should build a hash of DEFAULT and ALL => the normal ns
- $P0 = get_hll_namespace name
- $P0 = $P0['EXPORT']
+ ns = get_hll_namespace name
+ library['namespace'] = ns
+ $P0 = ns['EXPORT']
+ if null $P0 goto no_exports
library['symbols'] = $P0
- $P0 = get_hll_namespace name
- library['namespace'] = $P0
+ goto symbols_done
+ no_exports:
+ $P0 = new 'Hash'
+ $P0['ALL'] = ns
+ $P0['DEFAULT'] = ns
+ library['symbols'] = $P0
+ symbols_done:
.return (library)
fail:
# TODO: better fail?
More information about the parrot-commits
mailing list