mirror of
https://github.com/remko/waforth
synced 2025-01-15 15:41:17 +01:00
Implement [']
This commit is contained in:
parent
5c1c33d63d
commit
f17dac3e09
2 changed files with 23 additions and 0 deletions
|
@ -1195,6 +1195,12 @@
|
||||||
(i32.store (i32.const !stateBase) (i32.const 0)))
|
(i32.store (i32.const !stateBase) (i32.const 0)))
|
||||||
(!def_word "[" "$left-bracket" !fImmediate)
|
(!def_word "[" "$left-bracket" !fImmediate)
|
||||||
|
|
||||||
|
;; 6.1.2510
|
||||||
|
(func $bracket-tick
|
||||||
|
(call $tick)
|
||||||
|
(call $compilePushConst (call $pop)))
|
||||||
|
(!def_word "[']" "$bracket-tick" !fImmediate)
|
||||||
|
|
||||||
;; 6.1.2540
|
;; 6.1.2540
|
||||||
(func $right-bracket
|
(func $right-bracket
|
||||||
(i32.store (i32.const !stateBase) (i32.const 1)))
|
(i32.store (i32.const !stateBase) (i32.const 1)))
|
||||||
|
|
|
@ -1264,6 +1264,23 @@ function loadTests(wasmModule, arrayToBase64) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("[']", () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
core.loadPrelude();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should work", () => {
|
||||||
|
run(': HELLO ." Hello " ;');
|
||||||
|
run(': GOODBYE ." Goodbye " ;');
|
||||||
|
run("VARIABLE 'aloha ' HELLO 'aloha !");
|
||||||
|
run(": ALOHA 'aloha @ EXECUTE ;");
|
||||||
|
run(": GOING ['] GOODBYE 'aloha ! ;");
|
||||||
|
run("GOING");
|
||||||
|
run("ALOHA");
|
||||||
|
expect(output.trim()).to.eql("Goodbye");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe("system", () => {
|
describe("system", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
core.loadPrelude();
|
core.loadPrelude();
|
||||||
|
|
Loading…
Reference in a new issue