S\"

Interpretation:

Interpretation semantics for this word are undefined.

Compilation:

( "ccc<quote>" -- )
Parse ccc delimited by " (double-quote), using the translation rules below. Append the run-time semantics given below to the current definition.

Translation rules:

Characters are processed one at a time and appended to the compiled string. If the character is a `\' character it is processed by parsing and substituting one or more characters as follows, where the character after the backslash is case sensitive:

\a BEL (alert, ASCII 7)
\b BS (backspace, ASCII 8)
\e ESC (escape, ASCII 27)
\f FF (form feed, ASCII 12)
\l LF (line feed, ASCII 10)
\m CR/LF pair (ASCII 13, 10)
\n newline(implementation dependent , e.g., CR/LF, CR, LF, LF/CR)
\q double-quote (ASCII 34)
\r CR (carriage return, ASCII 13)
\t HT (horizontal tab, ASCII 9)
\v VT (vertical tab, ASCII 11)
\z NUL (no character, ASCII 0)
\" double-quote (ASCII 34)
\x<hexdigit><hexdigit>
The resulting character is the conversion of these two hexadecimal digits. An ambiguous conditions exists if \x is not followed by two hexadecimal characters.
\\ backslash itself (ASCII 92)

An ambiguous condition exists if a \ is placed before any character, other than those defined in here.

Run-time:

( -- c-addr u )
Return c-addr and u describing a string consisting of the translation of the characters ccc. A program shall not alter the returned string.

See:

ContributeContributions

AntonErtlavatar of AntonErtl Core-ext S\" should reference File-ext S\"Proposal2017-04-16 08:03:17

This contribution has been moved to the proposal section.

BerndPaysanavatar of BerndPaysan

This reply has been moved to the proposal section.

gnuarmavatar of gnuarm

This reply has been moved to the proposal section.

AntonErtlavatar of AntonErtl

This reply has been moved to the proposal section.

BerndPaysanavatar of BerndPaysan

This reply has been moved to the proposal section.

StephenPelcavatar of StephenPelc

This reply has been moved to the proposal section.
Reply New Version

GerryJacksonavatar of GerryJackson Reference implementation for S\"Suggested reference implementation2018-01-30 08:13:52

A reference implementation for S" exists at http://www.forth200x.org/escaped-strings.html. Shouldn't this be included in Annex E?

Similarly test cases for S" should be in Annex F, the above link also has these.

Reply New Version