diff options
author | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-05-31 00:57:45 +0330 |
---|---|---|
committer | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-05-31 00:57:45 +0330 |
commit | b89fc3da7d9f1badde2f4879924b5df5522da203 (patch) | |
tree | 1d081ff63564fd2b7c42a374ef62d432761c4124 /src/compiler/parser.h | |
parent | c91d3a8893b9c53c5c8e4c5cff72d7caf44cfee4 (diff) |
add ability to specify int type as extension
Diffstat (limited to 'src/compiler/parser.h')
-rw-r--r-- | src/compiler/parser.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/compiler/parser.h b/src/compiler/parser.h index fd40078..3f69454 100644 --- a/src/compiler/parser.h +++ b/src/compiler/parser.h @@ -176,7 +176,22 @@ typedef struct ParserNodeFunctionCall { typedef ParserNode ParserNodeSingleChildMetadata; -typedef u64 ParserNodeIntMetadata; +typedef enum ParserNodeIntType { + PARSER_NODE_INT_TYPE_UNKNOWN, + PARSER_NODE_INT_TYPE_I8, + PARSER_NODE_INT_TYPE_U8, + PARSER_NODE_INT_TYPE_I16, + PARSER_NODE_INT_TYPE_U16, + PARSER_NODE_INT_TYPE_I32, + PARSER_NODE_INT_TYPE_U32, + PARSER_NODE_INT_TYPE_I64, + PARSER_NODE_INT_TYPE_U64, +} ParserNodeIntType; + +typedef struct ParserNodeIntMetadata { + u64 value; + ParserNodeIntType type; +} ParserNodeIntMetadata; typedef f128 ParserNodeFloatMetadata; @@ -293,3 +308,6 @@ bool isType(ParserNode *node); bool isValue(ParserNode *node); char escapeChar(char const *begin, char const *end, bool *success); + +ParserNodeIntType getIntType(char const *begin, char const *end); +size_t getIntTypeSize(ParserNodeIntType type); |