changetype builtin; some namespace parsing; more stdlib ideas; compiler options for asc

This commit is contained in:
dcodeIO
2017-12-08 04:03:44 +01:00
parent 59dafc8d22
commit bbb57baecb
62 changed files with 636 additions and 469 deletions

View File

@ -1,7 +1,6 @@
(module
(type $v (func))
(memory $0 1)
(data (i32.const 4) "\08")
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)

View File

@ -1,7 +1,7 @@
(module
(type $v (func))
(global $HEAP_START i32 (i32.const 4))
(memory $0 1)
(data (i32.const 4) "\08\00\00\00")
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)
@ -37,6 +37,7 @@
reinterpret
select
sizeof
changetype
isNaN
isFinite
assert

View File

@ -6,7 +6,6 @@
(global $binary/f (mut f32) (f32.const 0))
(global $binary/F (mut f64) (f64.const 0))
(memory $0 1)
(data (i32.const 4) "\08")
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)

View File

@ -5,8 +5,8 @@
(global $binary/I (mut i64) (i64.const 0))
(global $binary/f (mut f32) (f32.const 0))
(global $binary/F (mut f64) (f64.const 0))
(global $HEAP_START i32 (i32.const 4))
(memory $0 1)
(data (i32.const 4) "\08\00\00\00")
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)
@ -840,6 +840,7 @@
reinterpret
select
sizeof
changetype
isNaN
isFinite
assert

View File

@ -7,7 +7,6 @@
(global $builtins/F (mut f64) (f64.const 0))
(global $builtins/s (mut i32) (i32.const 0))
(memory $0 1)
(data (i32.const 4) "\08")
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)

View File

@ -6,8 +6,8 @@
(global $builtins/b (mut i32) (i32.const 0))
(global $builtins/F (mut f64) (f64.const 0))
(global $builtins/s (mut i32) (i32.const 0))
(global $HEAP_START i32 (i32.const 4))
(memory $0 1)
(data (i32.const 4) "\08\00\00\00")
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)
@ -1083,6 +1083,7 @@
reinterpret
select
sizeof
changetype
isNaN
isFinite
assert

View File

@ -1,8 +1,8 @@
(module
(type $v (func))
(import "env" "external" (func $declare/external))
(global $HEAP_START i32 (i32.const 4))
(memory $0 1)
(data (i32.const 4) "\08\00\00\00")
(export "external" (func $declare/external))
(export "memory" (memory $0))
)
@ -30,6 +30,7 @@
reinterpret
select
sizeof
changetype
isNaN
isFinite
assert

View File

@ -1,7 +1,6 @@
(module
(type $iv (func (param i32)))
(memory $0 1)
(data (i32.const 4) "\08")
(export "loopDo" (func $do/loopDo))
(export "loopDoInDo" (func $do/loopDoInDo))
(export "memory" (memory $0))

View File

@ -1,7 +1,7 @@
(module
(type $iv (func (param i32)))
(global $HEAP_START i32 (i32.const 4))
(memory $0 1)
(data (i32.const 4) "\08\00\00\00")
(export "loopDo" (func $do/loopDo))
(export "loopDoInDo" (func $do/loopDoInDo))
(export "memory" (memory $0))
@ -75,6 +75,7 @@
reinterpret
select
sizeof
changetype
isNaN
isFinite
assert

View File

@ -4,7 +4,6 @@
(global $enum/NonConstant.ZERO (mut i32) (i32.const 0))
(global $enum/NonConstant.ONE (mut i32) (i32.const 0))
(memory $0 1)
(data (i32.const 4) "\08")
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)

View File

@ -4,7 +4,6 @@
(global $enum/NonConstant.ZERO (mut i32) (i32.const 0))
(global $enum/NonConstant.ONE (mut i32) (i32.const 0))
(memory $0 1)
(data (i32.const 4) "\08")
(export "memory" (memory $0))
(start $start)
(func $enum/getZero (; 0 ;) (type $i) (result i32)

View File

@ -15,8 +15,8 @@
(global $enum/Mixed.FOUR i32 (i32.const 4))
(global $enum/NonConstant.ZERO (mut i32) (i32.const 0))
(global $enum/NonConstant.ONE (mut i32) (i32.const 0))
(global $HEAP_START i32 (i32.const 4))
(memory $0 1)
(data (i32.const 4) "\08\00\00\00")
(export "memory" (memory $0))
(start $start)
(func $enum/getZero (; 0 ;) (type $i) (result i32)
@ -60,6 +60,7 @@
reinterpret
select
sizeof
changetype
isNaN
isFinite
assert

View File

@ -3,7 +3,6 @@
(global $export/a i32 (i32.const 1))
(global $export/b i32 (i32.const 2))
(memory $0 1)
(data (i32.const 4) "\08")
(export "add" (func $export/add))
(export "renamed_sub" (func $export/sub))
(export "a" (global $export/a))

View File

@ -13,3 +13,8 @@ export const a: i32 = 1;
const b: i32 = 2;
export { b as renamed_b };
/* export namespace ns {
function one(): void {}
export function two(): void {}
} */

View File

@ -2,8 +2,8 @@
(type $iii (func (param i32 i32) (result i32)))
(global $export/a i32 (i32.const 1))
(global $export/b i32 (i32.const 2))
(global $HEAP_START i32 (i32.const 4))
(memory $0 1)
(data (i32.const 4) "\08\00\00\00")
(export "add" (func $export/add))
(export "renamed_sub" (func $export/sub))
(export "a" (global $export/a))
@ -50,6 +50,7 @@
reinterpret
select
sizeof
changetype
isNaN
isFinite
assert

View File

@ -2,7 +2,6 @@
(type $v (func))
(global $for/i (mut i32) (i32.const 0))
(memory $0 1)
(data (i32.const 4) "\08")
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)

View File

@ -1,8 +1,8 @@
(module
(type $v (func))
(global $for/i (mut i32) (i32.const 0))
(global $HEAP_START i32 (i32.const 4))
(memory $0 1)
(data (i32.const 4) "\08\00\00\00")
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)
@ -171,6 +171,7 @@
reinterpret
select
sizeof
changetype
isNaN
isFinite
assert

View File

@ -5,7 +5,6 @@
(global $game-of-life/h (mut i32) (i32.const 0))
(global $game-of-life/s (mut i32) (i32.const 0))
(memory $0 1)
(data (i32.const 4) "\08")
(export "init" (func $game-of-life/init))
(export "step" (func $game-of-life/step))
(export "memory" (memory $0))

View File

@ -4,8 +4,8 @@
(global $game-of-life/w (mut i32) (i32.const 0))
(global $game-of-life/h (mut i32) (i32.const 0))
(global $game-of-life/s (mut i32) (i32.const 0))
(global $HEAP_START i32 (i32.const 4))
(memory $0 1)
(data (i32.const 4) "\08\00\00\00")
(export "init" (func $game-of-life/init))
(export "step" (func $game-of-life/step))
(export "memory" (memory $0))
@ -332,6 +332,7 @@
reinterpret
select
sizeof
changetype
isNaN
isFinite
assert

View File

@ -1,7 +1,6 @@
(module
(type $ii (func (param i32) (result i32)))
(memory $0 1)
(data (i32.const 4) "\08")
(export "ifThenElse" (func $if/ifThenElse))
(export "ifThen" (func $if/ifThen))
(export "ifThenElseBlock" (func $if/ifThenElse))

View File

@ -1,7 +1,7 @@
(module
(type $ii (func (param i32) (result i32)))
(global $HEAP_START i32 (i32.const 4))
(memory $0 1)
(data (i32.const 4) "\08\00\00\00")
(export "ifThenElse" (func $if/ifThenElse))
(export "ifThen" (func $if/ifThen))
(export "ifThenElseBlock" (func $if/ifThenElseBlock))
@ -70,6 +70,7 @@
reinterpret
select
sizeof
changetype
isNaN
isFinite
assert

View File

@ -2,7 +2,6 @@
(type $iii (func (param i32 i32) (result i32)))
(type $v (func))
(memory $0 1)
(data (i32.const 4) "\08")
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)

View File

@ -2,7 +2,6 @@
(type $iii (func (param i32 i32) (result i32)))
(type $v (func))
(memory $0 1)
(data (i32.const 4) "\08")
(export "memory" (memory $0))
(start $start)
(func $export/add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)

View File

@ -3,8 +3,8 @@
(type $v (func))
(global $export/a i32 (i32.const 1))
(global $export/b i32 (i32.const 2))
(global $HEAP_START i32 (i32.const 4))
(memory $0 1)
(data (i32.const 4) "\08\00\00\00")
(export "memory" (memory $0))
(start $start)
(func $export/add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
@ -62,6 +62,7 @@
reinterpret
select
sizeof
changetype
isNaN
isFinite
assert

View File

@ -1,7 +1,6 @@
(module
(type $v (func))
(memory $0 1)
(data (i32.const 4) "\08")
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)

View File

@ -1,7 +1,7 @@
(module
(type $v (func))
(global $HEAP_START i32 (i32.const 4))
(memory $0 1)
(data (i32.const 4) "\08\00\00\00")
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)
@ -163,6 +163,7 @@
reinterpret
select
sizeof
changetype
isNaN
isFinite
assert

View File

@ -5,7 +5,6 @@
(global $logical/f (mut f32) (f32.const 0))
(global $logical/F (mut f64) (f64.const 0))
(memory $0 1)
(data (i32.const 4) "\08")
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)

View File

@ -4,8 +4,8 @@
(global $logical/I (mut i64) (i64.const 0))
(global $logical/f (mut f32) (f32.const 0))
(global $logical/F (mut f64) (f64.const 0))
(global $HEAP_START i32 (i32.const 4))
(memory $0 1)
(data (i32.const 4) "\08\00\00\00")
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)
@ -291,6 +291,7 @@
reinterpret
select
sizeof
changetype
isNaN
isFinite
assert

View File

@ -4,7 +4,6 @@
(global $export/a i32 (i32.const 1))
(global $export/b i32 (i32.const 2))
(memory $0 1)
(data (i32.const 4) "\08")
(export "add" (func $export/add))
(export "renamed_sub" (func $export/sub))
(export "renamed_a" (global $export/a))

View File

@ -3,8 +3,8 @@
(type $v (func))
(global $export/a i32 (i32.const 1))
(global $export/b i32 (i32.const 2))
(global $HEAP_START i32 (i32.const 4))
(memory $0 1)
(data (i32.const 4) "\08\00\00\00")
(export "add" (func $export/add))
(export "renamed_sub" (func $export/sub))
(export "renamed_a" (global $export/a))
@ -68,6 +68,7 @@
reinterpret
select
sizeof
changetype
isNaN
isFinite
assert

View File

@ -1,7 +1,6 @@
(module
(type $ii (func (param i32) (result i32)))
(memory $0 1)
(data (i32.const 4) "\08")
(export "doSwitch" (func $switch/doSwitch))
(export "doSwitchDefaultFirst" (func $switch/doSwitchDefaultFirst))
(export "doSwitchDefaultOmitted" (func $switch/doSwitchDefaultOmitted))

View File

@ -1,7 +1,7 @@
(module
(type $ii (func (param i32) (result i32)))
(global $HEAP_START i32 (i32.const 4))
(memory $0 1)
(data (i32.const 4) "\08\00\00\00")
(export "doSwitch" (func $switch/doSwitch))
(export "doSwitchDefaultFirst" (func $switch/doSwitchDefaultFirst))
(export "doSwitchDefaultOmitted" (func $switch/doSwitchDefaultOmitted))
@ -169,6 +169,7 @@
reinterpret
select
sizeof
changetype
isNaN
isFinite
assert

View File

@ -2,7 +2,6 @@
(type $v (func))
(global $ternary/a (mut i32) (i32.const 0))
(memory $0 1)
(data (i32.const 4) "\08")
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)

View File

@ -1,8 +1,8 @@
(module
(type $v (func))
(global $ternary/a (mut i32) (i32.const 0))
(global $HEAP_START i32 (i32.const 4))
(memory $0 1)
(data (i32.const 4) "\08\00\00\00")
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)
@ -57,6 +57,7 @@
reinterpret
select
sizeof
changetype
isNaN
isFinite
assert

View File

@ -6,7 +6,6 @@
(type $iv (func (param i32)))
(type $v (func))
(memory $0 1)
(data (i32.const 4) "\08")
(export "control$construct" (func $tlsf/control$construct))
(export "memory" (memory $0))
(start $start)

View File

@ -6,7 +6,6 @@
(type $iv (func (param i32)))
(type $v (func))
(memory $0 1)
(data (i32.const 4) "\08")
(export "control$construct" (func $tlsf/control$construct))
(export "memory" (memory $0))
(start $start)

View File

@ -21,8 +21,8 @@
(global $tlsf/CONTROL$SL_BITMAP_OFFSET i32 (i32.const 20))
(global $tlsf/SL_INDEX_COUNT i32 (i32.const 32))
(global $tlsf/CONTROL$BLOCKS_OFFSET i32 (i32.const 112))
(global $HEAP_START i32 (i32.const 4))
(memory $0 1)
(data (i32.const 4) "\08\00\00\00")
(export "control$construct" (func $tlsf/control$construct))
(export "memory" (memory $0))
(start $start)
@ -352,6 +352,7 @@
reinterpret
select
sizeof
changetype
isNaN
isFinite
assert

View File

@ -5,7 +5,6 @@
(global $unary/f (mut f32) (f32.const 0))
(global $unary/F (mut f64) (f64.const 0))
(memory $0 1)
(data (i32.const 4) "\08")
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)

View File

@ -4,8 +4,8 @@
(global $unary/I (mut i64) (i64.const 0))
(global $unary/f (mut f32) (f32.const 0))
(global $unary/F (mut f64) (f64.const 0))
(global $HEAP_START i32 (i32.const 4))
(memory $0 1)
(data (i32.const 4) "\08\00\00\00")
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)
@ -657,6 +657,7 @@
reinterpret
select
sizeof
changetype
isNaN
isFinite
assert

View File

@ -1,7 +1,6 @@
(module
(type $iv (func (param i32)))
(memory $0 1)
(data (i32.const 4) "\08")
(export "loopWhile" (func $while/loopWhile))
(export "loopWhileInWhile" (func $while/loopWhileInWhile))
(export "memory" (memory $0))

View File

@ -1,7 +1,7 @@
(module
(type $iv (func (param i32)))
(global $HEAP_START i32 (i32.const 4))
(memory $0 1)
(data (i32.const 4) "\08\00\00\00")
(export "loopWhile" (func $while/loopWhile))
(export "loopWhileInWhile" (func $while/loopWhileInWhile))
(export "memory" (memory $0))
@ -84,6 +84,7 @@
reinterpret
select
sizeof
changetype
isNaN
isFinite
assert