summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorA404M <ahmadmahmoudiprogrammer@gmail.com>2025-02-23 22:09:19 +0330
committerA404M <ahmadmahmoudiprogrammer@gmail.com>2025-02-23 22:09:19 +0330
commitaf6a58bfad54dc9d3cb49d1efa1c90a5d094bcb1 (patch)
tree73d775c037d680446181a48ac4d17025c0974603 /src/compiler
parent4a39184dfcf0af72e2a28ffed2e3b342202fcba1 (diff)
fix bugs in float types
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/ast-tree.c3
-rw-r--r--src/compiler/lexer.c1
-rw-r--r--src/compiler/parser.c5
3 files changed, 8 insertions, 1 deletions
diff --git a/src/compiler/ast-tree.c b/src/compiler/ast-tree.c
index 1b56220..8cb1fce 100644
--- a/src/compiler/ast-tree.c
+++ b/src/compiler/ast-tree.c
@@ -2447,7 +2447,8 @@ bool setTypesValueFloat(AstTree *tree, AstTreeSetTypesHelper helper) {
printWarning(tree->str_begin, tree->str_end, "Value is overflowing");
}
tree->type = &AST_TREE_F32_TYPE;
- } else if (helper.lookingType == &AST_TREE_F64_TYPE || helper.lookingType == NULL) {
+ } else if (helper.lookingType == &AST_TREE_F64_TYPE ||
+ helper.lookingType == NULL) {
tree->token = AST_TREE_TOKEN_VALUE_FLOAT;
AstTreeFloat value = *(AstTreeFloat *)tree->metadata;
f64 newValue = value;
diff --git a/src/compiler/lexer.c b/src/compiler/lexer.c
index 1c8ae5d..2b7a789 100644
--- a/src/compiler/lexer.c
+++ b/src/compiler/lexer.c
@@ -180,6 +180,7 @@ LexerNodeArray lexer(char *str) {
goto RETURN_ERROR;
}
}
+ continue;
} else {
--iter;
c = *iter;
diff --git a/src/compiler/parser.c b/src/compiler/parser.c
index a25f549..405c921 100644
--- a/src/compiler/parser.c
+++ b/src/compiler/parser.c
@@ -49,6 +49,11 @@ const char *PARSER_TOKEN_STRINGS[] = {
"PARSER_TOKEN_SYMBOL_COMMA",
"PARSER_TOKEN_OPERATOR_ASSIGN",
+ "PARSER_TOKEN_OPERATOR_SUM_ASSIGN",
+ "PARSER_TOKEN_OPERATOR_SUB_ASSIGN",
+ "PARSER_TOKEN_OPERATOR_MULTIPLY_ASSIGN",
+ "PARSER_TOKEN_OPERATOR_DIVIDE_ASSIGN",
+ "PARSER_TOKEN_OPERATOR_MODULO_ASSIGN",
"PARSER_TOKEN_OPERATOR_PLUS",
"PARSER_TOKEN_OPERATOR_MINUS",
"PARSER_TOKEN_OPERATOR_SUM",