From e77c34f654a47cb90857f1ac4d6957e008858d6a Mon Sep 17 00:00:00 2001 From: Taylan Kammer Date: Wed, 3 Jun 2026 20:56:00 +0200 Subject: At-quoted strings carry the sentinel. --- doc/c1/1-parse.md | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'doc') 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 & ) | - +-----------+----------------------+ - | "bytes" | (#DQSTR & ) | - +-----------+----------------------+ - | @_bytes_ | (#ATSTR & ) | - +-----------+----------------------+ +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 & ) | + +-----------+-----------------------------+ + | "bytes" | (#DQSTR & ) | + +-----------+-----------------------------+ + | @_bytes_ | (#ATSTR & ) | + +-----------+-----------------------------+ The visual token `` denotes the actual string, as a Zisp value, in the -second position of the pair. +second position of the pair. The visual token `` 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 -- cgit v1.2.3