diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-18 08:00:31 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-18 08:00:31 +0000 |
| commit | e7320359c12b97ccb85ebfb06b2540124630df7b (patch) | |
| tree | fe8740cf489cea87cccea26adb62997d10b7fe9d /AGENTS | |
| parent | 2141916363d7f33a7a22adf6846f77276d7c4da3 (diff) | |
feat(lexer): support C++ escape sequences in literals
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'AGENTS')
| -rw-r--r-- | AGENTS/CONVENTIONS.md | 3 | ||||
| -rw-r--r-- | AGENTS/PITFALLS.md | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/AGENTS/CONVENTIONS.md b/AGENTS/CONVENTIONS.md index d1f018d..41b049f 100644 --- a/AGENTS/CONVENTIONS.md +++ b/AGENTS/CONVENTIONS.md @@ -22,8 +22,7 @@ ASCII case-insensitive lookup/comparison through `IdentifierMap`, `IdentifierSet and `sameIdentifier`; retain source spelling in ASTs and diagnostics. This includes functions, types, enum values, fields and builtins, but not C_TYPE import strings. Integer tokens carry a checked unsigned magnitude through lookahead; the parser -applies the sign and i64 range check, including the minimum value. No escape sequences -in string/char literals. Comments are `//` to end of line. +applies the sign and i64 range check, including the minimum value. String/char literals support C++17 byte escapes and Unicode escapes (UTF-8 in STRING, ASCII only in CHAR). Comments are `//` to end of line. **The lexer reads a caller-owned stream.** Construct it with `Lexer(std::istream &)`; the stream must outlive the lexer. Lookahead, line number and error state belong to diff --git a/AGENTS/PITFALLS.md b/AGENTS/PITFALLS.md index 4059767..820fa55 100644 --- a/AGENTS/PITFALLS.md +++ b/AGENTS/PITFALLS.md @@ -169,10 +169,12 @@ test programs. SET types (`SET`/`DEFINE` are reserved with dedicated errors), random files (OPENFILE...FOR RANDOM/SEEK/GETRECORD/PUTRECORD — TYPE is done, so these are unblocked now; the RANDOM keyword is reserved and gives a dedicated parse error), -DATE, string escape sequences, +DATE, array-typed record fields, whole-array RETURN and class inheritance (INHERITS/SUPER). Compiler fixtures now live in `tests/` (see TESTING.md). Nightly CI runs the compiler suites, packaged EMBEDDED smoke checks and existing plugin tests. The initial standard conflicts and missing diagnostic locations are fixed on Linux. WHILE accepts both the standard header without DO and the older WHILE DO form. + +- **Literal escapes.** C++17 escapes are decoded by the lexer. Unicode escapes encode UTF-8 in strings; CHAR Unicode escapes must be ASCII. Built-in STRING remains NUL-terminated: `"a\0b"` is observed as `"a"`. |
