Search parent namespaces when resolving identifiers

This commit is contained in:
dcodeIO
2017-12-27 19:17:29 +01:00
parent ba61a5e414
commit eccac129ad
9 changed files with 264 additions and 253 deletions

View File

@ -1,19 +1,25 @@
(module
(type $i (func (result i32)))
(type $v (func))
(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 $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "test" (func $namespace/test))
(export "memory" (memory $0))
(func $namespace/Outer.Inner.aFunc (; 0 ;) (type $v)
(start $start)
(func $namespace/Outer.Inner.aFunc (; 0 ;) (type $i) (result i32)
(return
(get_global $namespace/Outer.Inner.aVar)
)
)
(func $namespace/test (; 1 ;) (type $v)
(func $start (; 1 ;) (type $v)
(drop
(get_global $namespace/Outer.Inner.aVar)
)
(call $namespace/Outer.Inner.aFunc)
(drop
(call $namespace/Outer.Inner.aFunc)
)
(drop
(get_global $namespace/Outer.Inner.anEnum.ONE)
)
@ -70,7 +76,6 @@
GLOBAL: namespace/Outer.Inner.aVar
FUNCTION_PROTOTYPE: namespace/Outer.Inner.aFunc
ENUM: namespace/Outer.Inner.anEnum
FUNCTION_PROTOTYPE: namespace/test
[program.exports]
FUNCTION_PROTOTYPE: namespace/test
;)