making tcc happier
This commit is contained in:
21
ast.h
21
ast.h
@@ -4,6 +4,7 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "tokenizer.h"
|
||||
|
||||
typedef enum {
|
||||
@@ -498,6 +499,12 @@ typedef struct {
|
||||
AstData* datas;
|
||||
} AstNodeList;
|
||||
|
||||
typedef struct {
|
||||
AstNodeTag tag;
|
||||
AstTokenIndex main_token;
|
||||
AstData data;
|
||||
} AstNodeItem;
|
||||
|
||||
typedef struct {
|
||||
uint32_t len;
|
||||
uint32_t cap;
|
||||
@@ -505,18 +512,14 @@ typedef struct {
|
||||
AstIndex* starts;
|
||||
} AstTokenList;
|
||||
|
||||
typedef struct {
|
||||
uint32_t len;
|
||||
uint32_t cap;
|
||||
AstNodeIndex* arr;
|
||||
} AstExtraData;
|
||||
typedef SLICE(AstNodeIndex) AstNodeIndexSlice;
|
||||
|
||||
typedef struct {
|
||||
const char* source;
|
||||
uint32_t source_len;
|
||||
AstTokenList tokens;
|
||||
AstNodeList nodes;
|
||||
AstExtraData extra_data;
|
||||
AstNodeIndexSlice extra_data;
|
||||
} Ast;
|
||||
|
||||
typedef struct AstPtrType {
|
||||
@@ -596,11 +599,7 @@ typedef struct AstError {
|
||||
|
||||
Ast astParse(const char* source, uint32_t len);
|
||||
|
||||
// MultiArrayList
|
||||
void astNodeListEnsureCapacity(AstNodeList* list, uint32_t additional);
|
||||
void astTokenListEnsureCapacity(AstTokenList* list, uint32_t additional);
|
||||
|
||||
AstNodeIndex astNodeListAppend(AstNodeList* list, AstNodeTag tag, AstTokenIndex main_token, AstData data);
|
||||
AstNodeIndex astNodeListAppend(AstNodeList*, AstNodeItem);
|
||||
void astTokenListAppend(AstTokenList* list, TokenizerTag tag, AstIndex start);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user