This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export i32 main(){ | |
i32 a = 0; | |
for(i32 c = 0;c < 4;++c) { | |
++a; | |
} | |
return a;// 4 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i32 𩸽(i32 a,i32 b){ | |
return a * b; | |
} | |
export i32 main(){ | |
i32 c = 1,a = 1,b = 0; | |
if(c != 2){ | |
c = 2; | |
a += c; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i32 𩸽(i32 a,i32 b){ | |
return a * b; | |
} | |
export i32 main(){ | |
i32 c = 1,a = 1; | |
if(c != 2){ | |
c = 2; | |
a += c; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i32 mul(i32 a,i32 b){ | |
return a * b; | |
} | |
export i32 main(){ | |
i32 c = 2,a = 2; | |
// a -= 2; | |
++a; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(module | |
(type $main (func (result i32))) | |
(export "main" (func $main)) | |
(func $main (; 0 ;) (type $main) (result i32) | |
(local $0 i32) | |
(local $1 i32) | |
(set_local $0 | |
(i32.const 2) | |
) | |
(set_local $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(module | |
(type $main (func (result i32))) | |
(export "main" (func $main)) | |
(func $main (; 0 ;) (type $main) (result i32) | |
(local $0 i32) | |
(local $1 i32) | |
(set_local $0 | |
(i32.const 2) | |
) | |
(set_local $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import binaryen from 'binaryen'; | |
import tokenize from './tokens.mjs'; | |
import make_parse from './parse.mjs'; | |
import fs from 'fs'; | |
const testSrc = | |
` | |
((1 + 2) * 100 + 10) / 10 - 1 | |
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.vscode | |
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typings | |
node_modules | |
.vscode | |
temp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typings | |
node_modules | |
.vscode | |
temp |