aboutsummaryrefslogtreecommitdiff
path: root/tests/i
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-30 14:31:07 +0000
committer_ov4 <ov4@ov4.org>2026-10-30 14:31:07 +0000
commit0cf54b4f77ccf8376341950b02ceb7c1d1268ed7 (patch)
treeeebbba01063451c28f0a2e1cc048215f50beb98f /tests/i
parent4cb0d9b196008bc55dbfcdac1f9211dbbc879895 (diff)
refactor(strings): construct string values implicitly from raw literals
Keep double-quoted literals and text constants as C_STRING values. Use marked STRING constructors for text and CHAR conversion, preserving string operations and I/O through the existing class machinery. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/i')
-rw-r--r--tests/i/c-string-literals/expected.txt2
-rw-r--r--tests/i/c-string-literals/notes.md2
-rw-r--r--tests/i/custom-string/program.cps2
3 files changed, 3 insertions, 3 deletions
diff --git a/tests/i/c-string-literals/expected.txt b/tests/i/c-string-literals/expected.txt
index 2255027..ba0bd18 100644
--- a/tests/i/c-string-literals/expected.txt
+++ b/tests/i/c-string-literals/expected.txt
@@ -1,4 +1,4 @@
quote:" slash:\
AB
0
-1:2
+2:2
diff --git a/tests/i/c-string-literals/notes.md b/tests/i/c-string-literals/notes.md
index a469ce1..a146f16 100644
--- a/tests/i/c-string-literals/notes.md
+++ b/tests/i/c-string-literals/notes.md
@@ -2,4 +2,4 @@
Human review: pending. Expectations follow the literal bytes and declared overloads.
-The adjacent uppercase C suffix produces C_STRING. Escapes use the ordinary lexer rules. Explicit STRING casts preserve the text; an empty C string has length zero after conversion. Overload selection distinguishes STRING from C_STRING.
+The adjacent uppercase C suffix produces C_STRING. Escapes use the ordinary lexer rules. Explicit STRING casts preserve the text; an empty C string has length zero after conversion. Both ordinary and suffixed literals have type C_STRING, so both calls select the exact C_STRING overload.
diff --git a/tests/i/custom-string/program.cps b/tests/i/custom-string/program.cps
index cf2bb24..93dcba5 100644
--- a/tests/i/custom-string/program.cps
+++ b/tests/i/custom-string/program.cps
@@ -1,6 +1,6 @@
CLASS STRING
Text : C_STRING
- PROCEDURE NEW(Value : C_STRING)
+ IMPLICIT PROCEDURE NEW(Value : C_STRING)
Text <- Value
ENDPROCEDURE
FUNCTION C_STR() RETURNS C_STRING