diff options
author | Lizzy Hunt <lizzy.hunt@usu.edu> | 2024-02-28 13:41:53 -0700 |
---|---|---|
committer | Lizzy Hunt <lizzy.hunt@usu.edu> | 2024-02-28 13:41:53 -0700 |
commit | d39cf84965dffd11cab440f5a4efa1b16932ba73 (patch) | |
tree | e0239d2047756120c51fd431999520ffbb38d29b /test/programs | |
parent | 7cc3ef5fa1feec8087618c899441a11052f84c48 (diff) | |
download | cps-interpreter-d39cf84965dffd11cab440f5a4efa1b16932ba73.tar.gz cps-interpreter-d39cf84965dffd11cab440f5a4efa1b16932ba73.zip |
branching
Diffstat (limited to 'test/programs')
-rw-r--r-- | test/programs/branching.cps | 10 | ||||
-rw-r--r-- | test/programs/index.ts | 3 |
2 files changed, 13 insertions, 0 deletions
diff --git a/test/programs/branching.cps b/test/programs/branching.cps new file mode 100644 index 0000000..f73704c --- /dev/null +++ b/test/programs/branching.cps @@ -0,0 +1,10 @@ +PRIMOP(>=, [REAL 0, REAL 1], [resultFalse], [ + PRIMOP(+, [REAL 2, REAL 4], [result], []), + PRIMOP(<=, [INT 1, REAL 1], [resultTrue], [ + PRIMOP(&&, [VAR resultTrue, VAR resultFalse], [fin], [ + PRIMOP(-, [REAL 1, REAL 1], [result], []), + PRIMOP(+, [REAL 1, REAL 1], [twoWhenFinIsFalse], []) + ]), + PRIMOP(-, [REAL 1, REAL 1], [result], []) + ]) +])
\ No newline at end of file diff --git a/test/programs/index.ts b/test/programs/index.ts index c8f3c85..864169f 100644 --- a/test/programs/index.ts +++ b/test/programs/index.ts @@ -7,6 +7,9 @@ export namespace TestPrograms { export const PrimopScope = Bun.file( join(import.meta.dir + '/primop-scope.cps'), ).text(); + export const Branching = Bun.file( + join(import.meta.dir + '/branching.cps'), + ).text(); export const StringEquality = Bun.file( join(import.meta.dir + '/string-equal.cps'), ).text(); |