making parser
This commit is contained in:
28
ast.h
28
ast.h
@@ -479,23 +479,23 @@ typedef enum {
|
||||
AST_NODE_TAG_ERROR_VALUE,
|
||||
/// `lhs!rhs`. main_token is the `!`.
|
||||
AST_NODE_TAG_ERROR_UNION,
|
||||
} ast_node_tag;
|
||||
} astNodeTag;
|
||||
|
||||
typedef uint32_t ast_token_index;
|
||||
typedef uint32_t ast_node_index;
|
||||
typedef uint32_t ast_index;
|
||||
typedef int32_t astTokenIndex;
|
||||
typedef uint32_t astNodeIndex;
|
||||
typedef uint32_t astIndex;
|
||||
|
||||
typedef struct {
|
||||
ast_index lhs, rhs;
|
||||
} ast_data;
|
||||
astIndex lhs, rhs;
|
||||
} astData;
|
||||
|
||||
typedef struct {
|
||||
uint32_t len;
|
||||
uint32_t cap;
|
||||
ast_node_tag* tags;
|
||||
ast_token_index* main_tokens;
|
||||
ast_data* datas;
|
||||
} ast_node_list;
|
||||
astNodeTag* tags;
|
||||
astTokenIndex* main_tokens;
|
||||
astData* datas;
|
||||
} astNodeList;
|
||||
|
||||
typedef struct {
|
||||
const char* source;
|
||||
@@ -503,13 +503,13 @@ typedef struct {
|
||||
|
||||
struct {
|
||||
uint32_t len;
|
||||
tokenizer_tag* tags;
|
||||
ast_index* starts;
|
||||
tokenizerTag* tags;
|
||||
astIndex* starts;
|
||||
} tokens;
|
||||
|
||||
ast_node_list nodes;
|
||||
astNodeList nodes;
|
||||
|
||||
ast_node_index* extra_data;
|
||||
astNodeIndex* extra_data;
|
||||
uint32_t extra_data_len;
|
||||
} ast;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user