File tree Expand file tree Collapse file tree 6 files changed +568
-15
lines changed Expand file tree Collapse file tree 6 files changed +568
-15
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ executable agda2lambox
2020 other-modules : Agda.Utils,
2121 Agda.Utils.EliminateDefaults,
2222 Agda.Utils.EtaExpandConstructors,
23+ Agda.Utils.Simplify,
2324 Agda.Utils.Treeless,
2425 Agda2Lambox.Compile.Target,
2526 Agda2Lambox.Compile.Utils,
Original file line number Diff line number Diff line change @@ -102,13 +102,21 @@ <h1>agda2lambox</h1>
102102async function exec ( ) {
103103 log ( "Running main_function()" )
104104
105- wasm . exports . main_function ( )
105+ try {
106+ wasm . exports . main_function ( )
106107
107- mem = new Uint32Array ( wasm . exports . memory . buffer )
108- let res = wasm . exports . result . value
109- let dec = decoders [ decoder . value ]
110- // mem = new Uint32Array(wasm.exports.memory.buffer)
111- log ( `Result: ${ pretty ( dec ( res ) ) } ` )
108+ mem = new Uint32Array ( wasm . exports . memory . buffer )
109+ let res = wasm . exports . result . value
110+ let dec = decoders [ decoder . value ]
111+ // mem = new Uint32Array(wasm.exports.memory.buffer)
112+ log ( `Result: ${ pretty ( dec ( res ) ) } ` )
113+ } catch ( e ) {
114+ log ( `Failed to run: ${ e } ` , true )
115+ if ( wasm . exports . out_of_mem . value ) {
116+ log ( `Wasm instance may have run out of memory...` , true )
117+ }
118+ throw e
119+ }
112120}
113121
114122function log ( str , err = false ) { // ugly logging
You can’t perform that action at this time.
0 commit comments