some progress

some progress
This commit is contained in:
2026-09-30 22:31:18 +02:00
parent 1919ca01de
commit 9ac4b4f061
2 changed files with 80 additions and 96 deletions
+7 -10
View File
@@ -293,15 +293,8 @@ typedef union scan_value {
char *string_literal;
} scan_value_t;
typedef enum scan_result_type {
scan_result_type_value,
scan_result_type_error,
scan_result_type_none,
count_scan_result_type
} scan_result_type_t;
typedef struct scan_result {
scan_result_type_t type;
bool ok;
union {
scan_value_t value;
scan_error_t error;
@@ -317,8 +310,12 @@ typedef struct scanner {
scanner_t make_scanner(char const *name, char const *buffer, allocator_t allocator);
void scanner_recover(scanner_t *s);
scan_result_t scanner_error(scanner_t *s, char const *message);
void scanner_error_and_recover(scanner_t *s, char const *message);
scan_result_t scan_error(scanner_t *s, char const *message);
scan_result_t scan_value_func(scan_value_t value);
#define scan_value(arg) scan_value_func((scan_value_t){arg})
scan_result_t scan_error_and_recover(scanner_t *s, char const *message);
bool scan_eof(scanner_t *s);
bool scan_literal(scanner_t *s, char const *lit);
int scan_repeat_literal(scanner_t *s, char const *lit);