aboutsummaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-15 15:33:47 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-15 15:33:47 -0400
commite422079fcced744e3a6247aeb12a09a658989072 (patch)
tree393d5e52ba67dcc822ccfa9a812198edda5e735d /parse.c
parent259c7efcf8c3808d8151d8e15f1167ad2b6f2ca7 (diff)
Add a Byte datatype
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/parse.c b/parse.c
index a5ad136b..34c021c6 100644
--- a/parse.c
+++ b/parse.c
@@ -506,12 +506,12 @@ PARSER(parse_int) {
return NewAST(ctx->file, start, pos, Num, .n=n, .bits=64);
}
- match(&pos, "_");
auto bits = IBITS_UNSPECIFIED;
- if (match(&pos, "i64")) bits = IBITS64;
- else if (match(&pos, "i32")) bits = IBITS32;
- else if (match(&pos, "i16")) bits = IBITS16;
- else if (match(&pos, "i8")) bits = IBITS8;
+ if (match(&pos, "[64]")) bits = IBITS64;
+ else if (match(&pos, "[32]")) bits = IBITS32;
+ else if (match(&pos, "[16]")) bits = IBITS16;
+ else if (match(&pos, "[8]")) bits = IBITS8;
+ else if (match(&pos, "[B]")) bits = IBITS_BYTE;
// else if (match(&pos, ".") || match(&pos, "e")) return NULL; // looks like a float