diff options
| author | Taylan Kammer <taylan.kammer@gmail.com> | 2026-06-03 20:56:00 +0200 |
|---|---|---|
| committer | Taylan Kammer <taylan.kammer@gmail.com> | 2026-06-03 20:56:00 +0200 |
| commit | e77c34f654a47cb90857f1ac4d6957e008858d6a (patch) | |
| tree | 1daa1ad34faa4e0e262f97ffafe48addcaa14b57 /doc | |
| parent | 8484220d8b364d118288cf204a1459f45b37cb1d (diff) | |
At-quoted strings carry the sentinel.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/c1/1-parse.md | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/doc/c1/1-parse.md b/doc/c1/1-parse.md index babf160..d4c4c2e 100644 --- a/doc/c1/1-parse.md +++ b/doc/c1/1-parse.md @@ -176,23 +176,26 @@ is only a *datum* if it adheres to additional constraints as explained below. Strings can appear *bare* or be quoted in various ways. A quoted string is in fact parsed into a pair value with a rune in the first position to identify the -quotation variant that was parsed, and the string value in the second position. - - +-----------+----------------------+ - | Syntax | Parse output | - +-----------+----------------------+ - | |bytes| | (#PQSTR & <STRING>) | - +-----------+----------------------+ - | "bytes" | (#DQSTR & <STRING>) | - +-----------+----------------------+ - | @_bytes_ | (#ATSTR & <STRING>) | - +-----------+----------------------+ +quotation variant that was parsed, and the string value in the second position; +or, in case of at-quoted strings, a special construct we will look at later. + + +-----------+-----------------------------+ + | Syntax | Parse output | + +-----------+-----------------------------+ + | |bytes| | (#PQSTR & <STRING>) | + +-----------+-----------------------------+ + | "bytes" | (#DQSTR & <STRING>) | + +-----------+-----------------------------+ + | @_bytes_ | (#ATSTR <BYTE> & <STRING>) | + +-----------+-----------------------------+ The visual token `<STRING>` denotes the actual string, as a Zisp value, in the -second position of the pair. +second position of the pair. The visual token `<BYTE>` stands for an integer +Zisp value between 0 and 255. These external representations of strings will be explained in more detail -further below, including backslash escape sequences allowed within. +further below, including backslash escape sequences allowed within, and how +exactly at-quoted strings work. Strings have a fixed length, counted in bytes. Each byte can have any value, including zero (ASCII NUL). The parser reads bytes, not Unicode characters; a |
