commit dcf7e86ba7ae9918bda1122dd8cb51d396920696 (tree) parent a9c4b5c7ab2f7da1eaf7d5b26f0d3441073824e5 Author: Motiejus Jakštys <motiejus@jakstys.lt> Date: Mon, 23 Dec 2024 00:11:26 +0200 more fields Diffstat:
| M | ast.h | | | 75 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1 file changed, 75 insertions(+), 0 deletions(-)
diff --git a/ast.h b/ast.h @@ -519,6 +519,81 @@ typedef struct { AstExtraData extra_data; } 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); // MultiArrayList