Namespaced imports

This commit is contained in:
dcodeIO
2017-12-27 22:38:32 +01:00
parent eccac129ad
commit 7795d48d98
13 changed files with 157 additions and 74 deletions

View File

@ -4,6 +4,7 @@
(global $namespace/Outer.Inner.aVar (mut i32) (i32.const 0))
(global $namespace/Outer.Inner.anEnum.ONE i32 (i32.const 1))
(global $namespace/Outer.Inner.anEnum.TWO i32 (i32.const 2))
(global $namespace/Joined.THREE i32 (i32.const 3))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "memory" (memory $0))
@ -13,7 +14,12 @@
(get_global $namespace/Outer.Inner.aVar)
)
)
(func $start (; 1 ;) (type $v)
(func $namespace/Joined.anotherFunc (; 1 ;) (type $i) (result i32)
(return
(get_global $namespace/Joined.THREE)
)
)
(func $start (; 2 ;) (type $v)
(drop
(get_global $namespace/Outer.Inner.aVar)
)
@ -23,6 +29,9 @@
(drop
(get_global $namespace/Outer.Inner.anEnum.ONE)
)
(drop
(call $namespace/Joined.anotherFunc)
)
)
)
(;
@ -76,6 +85,8 @@
GLOBAL: namespace/Outer.Inner.aVar
FUNCTION_PROTOTYPE: namespace/Outer.Inner.aFunc
ENUM: namespace/Outer.Inner.anEnum
ENUM: namespace/Joined
FUNCTION_PROTOTYPE: namespace/Joined.anotherFunc
[program.exports]
;)