|
x-engine-c v0.2.13
The C engine for x-lang
|
S-expression analyser and reader for string literals. More...
#include "x-obj.h"Go to the source code of this file.
Macros | |
| #define | X_SEXP_STR_PRE_STR "\"" |
| #define | X_SEXP_STR_PRE_STR_LEN 1 |
| #define | X_SEXP_STR_POST_STR X_SEXP_STR_PRE_STR |
| #define | X_SEXP_STR_POST_STR_LEN X_SEXP_STR_PRE_STR_LEN |
| #define | X_SEXP_STR_CHARS_STR X_SEXP_STR_PRE_STR |
Functions | |
| x_obj_t * | x_sexp_str_analyse1 (x_obj_t *p_base, x_obj_t *p_args) |
| x_obj_t * | x_sexp_str_analyse2 (x_obj_t *p_base, x_obj_t *p_args) |
| x_obj_t * | x_sexp_str_analyse3 (x_obj_t *p_base, x_obj_t *p_args) |
| x_obj_t * | x_sexp_str_read (x_obj_t *p_base, x_obj_t *p_args) |
Variables | |
Analyser state primitives (spair – composable state machines). | |
| x_spair_t | x_sexp_str_analyse1_prim |
| x_spair_t | x_sexp_str_analyse2_prim |
| x_spair_t | x_sexp_str_analyse3_prim |
Read primitives (satom – type-internal). | |
| x_satom_t | x_sexp_str_read_prim |
S-expression analyser and reader for string literals.
| #define X_SEXP_STR_CHARS_STR X_SEXP_STR_PRE_STR |
Characters that delimit other tokens.
| #define X_SEXP_STR_POST_STR X_SEXP_STR_PRE_STR |
String close delimiter.
| #define X_SEXP_STR_POST_STR_LEN X_SEXP_STR_PRE_STR_LEN |
Length of string close delimiter.
| #define X_SEXP_STR_PRE_STR "\"" |
String open delimiter.
| #define X_SEXP_STR_PRE_STR_LEN 1 |
Length of string open delimiter.
Analyse state 1: match the opening quote.
Analyse state 1: match the opening double-quote.
| p_base | Base (execution context). |
| p_args | Pair of (self, read-args). |
Analyse state 2: consume body characters, detect escape or close.
Analyse state 2: consume string body characters.
Detects backslash (transitions to escape state) and closing quote (scores the full token length). All other characters loop.
| p_base | Base (execution context). |
| p_args | Pair of (self, read-args). |
Analyse state 3: escape state – consume one character after backslash.
Analyse state 3: escape state.
Unconditionally consumes one character after a backslash and returns to the normal body-reading state (analyse2).
| p_base | Base (execution context). |
| p_args | Pair of (self, read-args). |
Read a string literal from the token buffer (with unescape).
Read a string literal from the token buffer.
Strips the surrounding quotes and processes escape sequences in-place. Supported escapes: \", \\, \n, \t, \r, \0, and \xHH (two hex digits). Unknown escapes are preserved literally.
| p_base | Base (execution context). |
| p_args | Read-args containing the token buffer. |
|
extern |
| x_spair_t x_sexp_str_analyse2_prim |
| x_spair_t x_sexp_str_analyse3_prim |
|
extern |