From 7cc3ef5fa1feec8087618c899441a11052f84c48 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Wed, 28 Feb 2024 14:59:28 -0500 Subject: builtin_match_signatures (#1) Co-authored-by: Lizzy Hunt Reviewed-on: https://git.simponic.xyz/simponic/cps-interpreter/pulls/1 Co-authored-by: Elizabeth Hunt Co-committed-by: Elizabeth Hunt --- test/programs/add-1-3.cps | 3 +-- test/programs/index.ts | 9 +++++++++ test/programs/primop-scope.cps | 5 +++++ test/programs/string-equal.cps | 1 + test/programs/string-unequal.cps | 1 + 5 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 test/programs/primop-scope.cps create mode 100644 test/programs/string-equal.cps create mode 100644 test/programs/string-unequal.cps (limited to 'test/programs') diff --git a/test/programs/add-1-3.cps b/test/programs/add-1-3.cps index 95b9939..66759f7 100644 --- a/test/programs/add-1-3.cps +++ b/test/programs/add-1-3.cps @@ -1,2 +1 @@ -PRIMOP(+, [INT 1, INT 2], [u], - [APP(LABEL identity, [VAR u])]) \ No newline at end of file +PRIMOP(+, [REAL 1.0, INT 3], [result], []) \ No newline at end of file diff --git a/test/programs/index.ts b/test/programs/index.ts index e0403fd..c8f3c85 100644 --- a/test/programs/index.ts +++ b/test/programs/index.ts @@ -4,4 +4,13 @@ export namespace TestPrograms { export const AddOneThree = Bun.file( join(import.meta.dir + '/add-1-3.cps'), ).text(); + export const PrimopScope = Bun.file( + join(import.meta.dir + '/primop-scope.cps'), + ).text(); + export const StringEquality = Bun.file( + join(import.meta.dir + '/string-equal.cps'), + ).text(); + export const StringInEquality = Bun.file( + join(import.meta.dir + '/string-unequal.cps'), + ).text(); } diff --git a/test/programs/primop-scope.cps b/test/programs/primop-scope.cps new file mode 100644 index 0000000..eb834fd --- /dev/null +++ b/test/programs/primop-scope.cps @@ -0,0 +1,5 @@ +PRIMOP(+, [REAL 1.0, INT 3], [result], [ + PRIMOP(-, [REAL 1.0, VAR result], [result], [ + PRIMOP(+, [VAR result, REAL 0], [], []) + ]) +]) \ No newline at end of file diff --git a/test/programs/string-equal.cps b/test/programs/string-equal.cps new file mode 100644 index 0000000..ea49b22 --- /dev/null +++ b/test/programs/string-equal.cps @@ -0,0 +1 @@ +PRIMOP(==, ["asdf", "asdf"], [result], []) \ No newline at end of file diff --git a/test/programs/string-unequal.cps b/test/programs/string-unequal.cps new file mode 100644 index 0000000..ccd278e --- /dev/null +++ b/test/programs/string-unequal.cps @@ -0,0 +1 @@ +PRIMOP(==, ["asdfasdf", "asdf"], [result], []) -- cgit v1.3