|
x-engine-c v0.2.13
The C engine for x-lang
|
S-expression analyser and delimiter for whitespace tokens. More...
#include "x-token/sexp/whitespace.h"#include "x-eval.h"#include "x-token.h"#include "x-type/buffer.h"#include "x-type/char.h"Functions | |
| x_obj_t * | x_sexp_whitespace_analyse1 (x_obj_t *p_base, x_obj_t *p_args) |
| x_obj_t * | x_sexp_whitespace_analyse2 (x_obj_t *p_base, x_obj_t *p_args) |
| x_obj_t * | x_sexp_whitespace_delimit (x_obj_t *p_base, x_obj_t *p_args) |
S-expression analyser and delimiter for whitespace tokens.
Analyse state 1: detect a whitespace character.
Checks the last character in the buffer against X_SEXP_WHITESPACE_CHARS_STR.
| p_base | Base (execution context). |
| p_args | Read-args containing the token buffer. |
Analyse state 2: consume additional whitespace and score.
Re-invokes analyse1 to check for more whitespace. When a non-whitespace character is found, scores bufferlen-1 (the -1 accounts for the extra non-whitespace character that was read to terminate the run).
| p_base | Base (execution context). |
| p_args | Read-args containing the token buffer and score. |
Delimiter callback for whitespace characters.
If the current character is whitespace, backs up the read pointer so the whitespace is not consumed by the current token.
| p_base | Base (execution context). |
| p_args | Read-args containing the token buffer. |
| x_satom_t x_sexp_whitespace_analyse1_prim = x_obj_set(x_type_atom_obj, X_OBJ_FLAG_NONE, { .fn = x_sexp_whitespace_analyse1 }) |
| x_satom_t x_sexp_whitespace_analyse2_prim = x_obj_set(x_type_atom_obj, X_OBJ_FLAG_NONE, { .fn = x_sexp_whitespace_analyse2 }) |
| x_satom_t x_sexp_whitespace_delimit_prim = x_obj_set(x_type_atom_obj, X_OBJ_FLAG_NONE, { .fn = x_sexp_whitespace_delimit }) |