mirror of
https://github.com/remko/waforth
synced 2024-12-26 09:59:09 +01:00
2>R
This commit is contained in:
parent
7ffc90eca9
commit
09f342fcf3
3 changed files with 302 additions and 285 deletions
570
src/waforth.wat
570
src/waforth.wat
File diff suppressed because it is too large
Load diff
|
@ -151,12 +151,12 @@ T{ RO5 2 PICK -> 100 200 300 400 500 300 }T
|
|||
T{ RO5 1 PICK -> RO5 OVER }T
|
||||
T{ RO5 0 PICK -> RO5 DUP }T
|
||||
|
||||
\ \ -----------------------------------------------------------------------------
|
||||
\ TESTING 2>R 2R@ 2R> (contributed by James Bowman)
|
||||
\ -----------------------------------------------------------------------------
|
||||
TESTING 2>R 2R@ 2R> (contributed by James Bowman)
|
||||
|
||||
\ T{ : RR0 2>R 100 R> R> ; -> }T
|
||||
\ T{ 300 400 RR0 -> 100 400 300 }T
|
||||
\ T{ 200 300 400 RR0 -> 200 100 400 300 }T
|
||||
T{ : RR0 2>R 100 R> R> ; -> }T
|
||||
T{ 300 400 RR0 -> 100 400 300 }T
|
||||
T{ 200 300 400 RR0 -> 200 100 400 300 }T
|
||||
|
||||
\ T{ : RR1 2>R 100 2R@ R> R> ; -> }T
|
||||
\ T{ 300 400 RR1 -> 100 300 400 400 300 }T
|
||||
|
|
|
@ -1564,6 +1564,13 @@ function loadTests() {
|
|||
});
|
||||
});
|
||||
|
||||
describe("2>R", () => {
|
||||
it("should work", () => {
|
||||
run("400 300 2>R R> R>");
|
||||
expect(stackValues()).to.eql([300, 400]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("system", () => {
|
||||
it("should run sieve", () => {
|
||||
run(sieve);
|
||||
|
|
Loading…
Reference in a new issue