summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorGabriel Kerneis2013-11-05 16:41:55 +0000
committerGabriel Kerneis2013-11-05 16:41:55 +0000
commit097b5eff41ff77f5ef54d937a9e1ac8bc46ccbc6 (patch)
tree1154f06da496f341a9211b3e9a9a31a8edec199b /src/test
parent9368a56882338955d0e1a0960895f1f3a8bec5ec (diff)
Parsing of infix operators
The interpreter is broken for infix calls (fails to find the relevant function, either internal or external).
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test3.sail9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/test/test3.sail b/src/test/test3.sail
index 19a2d5d2..60f32469 100644
--- a/src/test/test3.sail
+++ b/src/test/test3.sail
@@ -6,8 +6,11 @@ val ( nat -> nat effect { wmem , rmem } ) MEM
val ( nat -> nat effect { wmem , rmem } ) MEM_GPU
val ( ( nat * nat ) -> nat effect { wmem , rmem } ) MEM_SIZE
-(* extern function *)
+(* extern functions *)
val extern ( nat -> nat pure ) add = "add"
+val extern ( nat -> nat pure ) (: + ) = "add" (* infix plus *)
+
+function nat (: * ) ( < nat > x, < nat > y ) = 42
function nat main _ = {
(* left-hand side function call = memory write *)
@@ -19,6 +22,9 @@ function nat main _ = {
(* register read, thanks to register declaration *)
dummy_reg;
+ (* infix call *)
+ 7 * 9;
+
(* Some more checks *)
MEM(1) := 2;
MEM(1);
@@ -29,5 +35,6 @@ function nat main _ = {
MEM_SIZE( (0,1) );
(* extern calls *)
+ 3 + 39;
add(5);
}