From 097b5eff41ff77f5ef54d937a9e1ac8bc46ccbc6 Mon Sep 17 00:00:00 2001 From: Gabriel Kerneis Date: Tue, 5 Nov 2013 16:41:55 +0000 Subject: Parsing of infix operators The interpreter is broken for infix calls (fails to find the relevant function, either internal or external). --- src/test/test3.sail | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/test') 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); } -- cgit v1.2.3