refactor(hmpl): eval

This commit is contained in:
2025-03-22 19:45:17 +00:00
parent f64636fe9e
commit 972e2d2968
5 changed files with 133 additions and 34 deletions

View File

@@ -202,13 +202,18 @@ void substr(const char *src, char *dest, size_t start, size_t len);
// -- Json --
// ----------
typedef enum {
JSON_NORAW = 0,
JSON_RAW = 1,
} JsonRawOpt;
typedef enum {
JSON_NULL,
JSON_BOOL,
JSON_NUMBER,
JSON_STRING,
JSON_ARRAY,
JSON_OBJECT
JSON_OBJECT,
} JsonType;
/* Full JSON structure */
@@ -228,7 +233,7 @@ Json *json_parse(Arena *arena, const char **s);
char *json_to_string(Arena *arena, Json *item);
char *json_to_string_with_opts(Arena *arena, Json *item, int raw);
char *json_to_string_with_opts(Arena *arena, Json *item, JsonRawOpt raw);
/* Retrieve an object item by key (case-sensitive) */
Json *json_get_object_item(Json *object, const char *key);