43 json_t *name = inner_query_type(ctx, json,
"$.name", eJsonString);
58 .type = get_meta_type(type->
string),
68 json_t *name = inner_query_type(ctx, json,
"$.name", eJsonString);
74 json_t *fields = inner_query_type(ctx, json,
"$.fields", eJsonArray);
88 if (!parse_ast_field(ctx, field, ast.
fields))
125 for (
size_t i = 0; i < len; i++)
128 if (!parse_ast_node(&ctx, node, info->
nodes))
#define CT_TEXT_VIEW(str)
create a text view from a string literal
CT_JSON_API json_t * json_array_get(const json_t *json, size_t index)
get an array element by index
json_kind_t
the kind of json value
CT_JSON_API json_t * json_map_get(const json_t *json, const char *key)
get a json value from an object by key
CT_NODISCARD CT_SCAN_API node_t * node_new(const scan_t *scan, where_t where)
create a new node on the heap
#define ARENA_MALLOC(size, name, parent, arena)
allocate memory from a custom allocator
CT_NOTIFY_API event_builder_t msg_notify(INOUT_NOTNULL logger_t *logs, const diagnostic_t *diagnostic, const node_t *node, STA_FORMAT_STRING const char *fmt,...)
notify the logger of a new message
CT_NODISCARD CT_STD_API bool text_view_equal(text_view_t lhs, text_view_t rhs)
check if two strings are equal
CT_STD_API void * typevec_push(typevec_t *vec, const void *src)
push a value onto the vector
CT_NODISCARD CT_PUREFN CT_STD_API size_t typevec_len(const typevec_t *vec)
get the length of a vector
CT_NODISCARD CT_STD_API typevec_t * typevec_new(size_t width, size_t len, arena_t *arena)
create a new typed vector on the heap
text_view_t string
the string value of this node
typevec_t array
the array value of this node
where_t where
the source location of the json value
a non-owning view of text
A vector with a fixed type size.
CT_JSON_API json_t * json_query_type(json_t *json, const char *query, json_kind_t kind, logger_t *logger, arena_t *arena)
query a json object and ensure it is of a specific type