Int is allowed to be down to 16-bits wide, whereas long is at least 32-bit. Fortunately Clang doesn't complain even on our system where long is 64-bit.
22 lines
400 B
C++
22 lines
400 B
C++
#include "tokenizer_internal.h"
|
|
|
|
#include <stdint.h>
|
|
|
|
typedef uint32_t ast_node_id;
|
|
constexpr ast_node_id ast_node_id_max = 0xffff'ffffUL;
|
|
|
|
enum ast_node_type { NODE_ERROR };
|
|
|
|
typedef struct {
|
|
struct source_location at;
|
|
enum ast_node_type type;
|
|
} ast_node;
|
|
|
|
DECL_VEC(ast_node);
|
|
|
|
struct parse_result {
|
|
VEC(ast_node) nodes;
|
|
ast_node_id root_node;
|
|
};
|
|
|
|
struct parse_result parse(SPAN(token) tokens);
|