more fields

This commit is contained in:
2024-12-23 00:11:26 +02:00
parent a9c4b5c7ab
commit dcf7e86ba7

75
ast.h
View File

@@ -519,6 +519,81 @@ typedef struct {
AstExtraData extra_data; AstExtraData extra_data;
} Ast; } Ast;
typedef struct AstPtrType {
AstNodeIndex sentinel;
AstNodeIndex align_node;
AstNodeIndex addrspace_node;
} AstPtrType;
typedef struct AstPtrTypeBitRange {
AstNodeIndex sentinel;
AstNodeIndex align_node;
AstNodeIndex addrspace_node;
AstNodeIndex bit_range_start;
AstNodeIndex bit_range_end;
} AstPtrTypeBitRange;
typedef struct AstFnProtoOne {
AstNodeIndex param;
AstNodeIndex align_expr;
AstNodeIndex addrspace_expr;
AstNodeIndex section_expr;
AstNodeIndex callconv_expr;
} AstFnProtoOne;
typedef struct AstFnProto {
AstNodeIndex params_start;
AstNodeIndex params_end;
AstNodeIndex align_expr;
AstNodeIndex addrspace_expr;
AstNodeIndex section_expr;
AstNodeIndex callconv_expr;
} AstFnProto;
typedef struct AstSubRange {
AstNodeIndex start;
AstNodeIndex end;
} AstSubRange;
typedef struct AstSliceSentinel {
AstNodeIndex start;
AstNodeIndex end;
AstNodeIndex sentinel;
} AstSliceSentinel;
typedef struct AstWhileCont {
AstNodeIndex cont_expr;
AstNodeIndex then_expr;
} AstWhileCont;
typedef struct AstWhile {
AstNodeIndex cont_expr;
AstNodeIndex then_expr;
AstNodeIndex else_expr;
} AstWhile;
typedef struct AstFor {
unsigned int inputs : 31;
unsigned int has_else : 1;
} AstFor;
typedef struct AstIf {
AstNodeIndex then_expr;
AstNodeIndex else_expr;
} AstIf;
typedef struct AstError {
bool is_note;
AstTokenIndex token;
union {
struct {
TokenizerTag expected_tag;
} expected;
struct {
} none;
} extra;
} AstError;
Ast astParse(const char* source, uint32_t len); Ast astParse(const char* source, uint32_t len);
// MultiArrayList // MultiArrayList