Last active
April 20, 2019 02:03
-
-
Save sfpgmr/1af26755495b676d54f59ea2980335ca to your computer and use it in GitHub Desktop.
WASMテキストモードのプリプロセスをJSでできるようにしてみた。
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
;; block | |
{@ | |
$.X = 0x1; | |
$.Y = 2; | |
$.Z = 0x3; | |
} | |
;; code | |
(module | |
(export "test" (func $test)) | |
(memory $memory 1) | |
(export "memory" (memory $memory)) | |
(func $test (result i32) | |
i32.const @X;; comment | |
i32.const {$ $.X + $.Y } | |
i32.add | |
i32.const { | |
++$.X; return $.X + $.Y; | |
} | |
i32.mul | |
) | |
) |
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
;; block | |
;; code | |
( module | |
( export "test" ( func $test ) ) | |
( memory $memory 1 ) | |
( export "memory" ( memory $memory ) ) | |
( func $test ( result i32 ) | |
i32.const 1 ;; comment | |
i32.const 3 | |
i32.add | |
i32.const 4 | |
i32.mul | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment