aboutsummaryrefslogtreecommitdiff
path: root/tests/i/multifile-operators/program.cps
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-18 06:11:42 +0000
committer_ov4 <ov4@ov4.org>2026-10-18 06:11:42 +0000
commit5a67f4e3833c2acca4a351f5dd613bc08f04bfc0 (patch)
tree6d75f5d13931ba0f7c15d286028049a421a6e974 /tests/i/multifile-operators/program.cps
parentb17f101cfc75565f9991c856ec62f1e17b0ab104 (diff)
feat(operators): document overloads and cover remaining operator forms
Add fixed cases for every supported operator, imported global and member operators, CASE comparisons, and declared result type errors. Document syntax, exact matching, access rules and temporary receiver lifetimes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/i/multifile-operators/program.cps')
-rw-r--r--tests/i/multifile-operators/program.cps21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/i/multifile-operators/program.cps b/tests/i/multifile-operators/program.cps
new file mode 100644
index 0000000..85eb3ee
--- /dev/null
+++ b/tests/i/multifile-operators/program.cps
@@ -0,0 +1,21 @@
+INCLUDE "operators.cps"
+DECLARE item : Key
+DECLARE low : Key
+DECLARE high : Key
+item.Value <- 3
+low.Value <- 1
+high.Value <- 4
+OUTPUT item + 2
+OUTPUT item = high
+CASE OF item
+low : OUTPUT "wrong"
+low TO high : OUTPUT "range"
+OTHERWISE : OUTPUT "wrong"
+ENDCASE
+DECLARE items : ARRAY[1:2] OF Key
+items[2].Value <- 4
+OUTPUT items[2] = high
+TYPE KeyPointer = ^Key
+DECLARE pointer : KeyPointer
+pointer <- ^item
+OUTPUT pointer^ + 5