From 62b65e16f5ef4e59dcfbdc10ae2b3cd419d79d7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Fri, 1 May 2026 10:02:50 +0200 Subject: Parsing distinction for single-word and function-call terms --- test/asset/parser/function-fail.et | 2 ++ test/asset/parser/function.et | 10 ++++++++++ test/script/parser.et | 6 ++++++ 3 files changed, 18 insertions(+) create mode 100644 test/asset/parser/function-fail.et create mode 100644 test/asset/parser/function.et (limited to 'test') diff --git a/test/asset/parser/function-fail.et b/test/asset/parser/function-fail.et new file mode 100644 index 0000000..59ac3b0 --- /dev/null +++ b/test/asset/parser/function-fail.et @@ -0,0 +1,2 @@ +test Test: + guard 1 == 1 diff --git a/test/asset/parser/function.et b/test/asset/parser/function.et new file mode 100644 index 0000000..3eca414 --- /dev/null +++ b/test/asset/parser/function.et @@ -0,0 +1,10 @@ +def f (x) and y = (x + y) + 1 + +def g (x) and y = (x + (y+1)) + +test Test: + guard (1 == 1) + guard (f 1 and 2 == 4) + guard (f 1 and 2 == g 1 and 2) + guard (f 1 and (g 2 and 3) == g 1 and 2 + 4) + guard (f (10 + g and 1 1) and (g 2 and 3) == g 1 and 2 + 10 +6) diff --git a/test/script/parser.et b/test/script/parser.et index 554e345..1a00bc8 100644 --- a/test/script/parser.et +++ b/test/script/parser.et @@ -11,3 +11,9 @@ test Parser: send "load ${scripts.path}/indent.et" expect /load-done/ + + send "load ${scripts.path}/function.et" + expect /load-done/ + + send "load ${scripts.path}/function-fail.et" + expect /load-failed parse-error/ -- cgit v1.2.3