diff options
author | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-06-09 18:56:19 +0330 |
---|---|---|
committer | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-06-09 18:56:19 +0330 |
commit | 8dc246166a007c2815f93ff6db535a660b05431c (patch) | |
tree | a3747464019316434103fe757a83fbdd990f16ce /src/compiler | |
parent | 03e9e1708eada3985529949302f214a223a297c2 (diff) |
fix assigning to dereference access in a chain
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/lexer.c | 6 | ||||
-rw-r--r-- | src/compiler/lexer.h | 4 | ||||
-rw-r--r-- | src/compiler/parser.c | 12 |
3 files changed, 11 insertions, 11 deletions
diff --git a/src/compiler/lexer.c b/src/compiler/lexer.c index 43a0850..869f62f 100644 --- a/src/compiler/lexer.c +++ b/src/compiler/lexer.c @@ -9,7 +9,6 @@ const char *LEXER_TOKEN_STRINGS[] = { "LEXER_TOKEN_SYMBOL_CLOSE_CURLY_BRACKET", "LEXER_TOKEN_SYMBOL_CLOSE_PARENTHESIS", - "LEXER_TOKEN_SYMBOL_CLOSE_BRACKET", "LEXER_TOKEN_IDENTIFIER", "LEXER_TOKEN_BUILTIN", "LEXER_TOKEN_BUILTIN_CAST", @@ -73,15 +72,16 @@ const char *LEXER_TOKEN_STRINGS[] = { "LEXER_TOKEN_KEYWORD_UNDEFINED", "LEXER_TOKEN_SYMBOL_FUNCTION_ARROW", - "LEXER_TOKEN_SYMBOL_POINTER", "LEXER_TOKEN_KEYWORD_STRUCT", - "LEXER_TOKEN_SYMBOL_CLOSE_BRACKET_LEFT", "LEXER_TOKEN_SYMBOL_DEREFERENCE", + "LEXER_TOKEN_SYMBOL_CLOSE_BRACKET", "LEXER_TOKEN_SYMBOL_ACCESS", "LEXER_TOKEN_SYMBOL_FUNCTION_CALL", "LEXER_TOKEN_SYMBOL_PLUS", + "LEXER_TOKEN_SYMBOL_CLOSE_BRACKET_LEFT", + "LEXER_TOKEN_SYMBOL_POINTER", "LEXER_TOKEN_SYMBOL_MINUS", "LEXER_TOKEN_SYMBOL_ADDRESS", "LEXER_TOKEN_SYMBOL_LOGICAL_NOT", diff --git a/src/compiler/lexer.h b/src/compiler/lexer.h index e868900..1802e41 100644 --- a/src/compiler/lexer.h +++ b/src/compiler/lexer.h @@ -9,7 +9,6 @@ typedef enum LexerToken { LEXER_TOKEN_SYMBOL_CLOSE_PARENTHESIS, LEXER_TOKEN_ORDER1 = LEXER_TOKEN_SYMBOL_CLOSE_PARENTHESIS, - LEXER_TOKEN_SYMBOL_CLOSE_BRACKET, LEXER_TOKEN_IDENTIFIER, LEXER_TOKEN_BUILTIN, LEXER_TOKEN_BUILTIN_CAST, @@ -75,15 +74,16 @@ typedef enum LexerToken { LEXER_TOKEN_SYMBOL_FUNCTION_ARROW, LEXER_TOKEN_ORDER2 = LEXER_TOKEN_SYMBOL_FUNCTION_ARROW, LEXER_TOKEN_KEYWORD_STRUCT, - LEXER_TOKEN_SYMBOL_CLOSE_BRACKET_LEFT, LEXER_TOKEN_SYMBOL_DEREFERENCE, LEXER_TOKEN_ORDER3 = LEXER_TOKEN_SYMBOL_DEREFERENCE, + LEXER_TOKEN_SYMBOL_CLOSE_BRACKET, LEXER_TOKEN_SYMBOL_ACCESS, LEXER_TOKEN_SYMBOL_FUNCTION_CALL, LEXER_TOKEN_SYMBOL_PLUS, LEXER_TOKEN_ORDER4 = LEXER_TOKEN_SYMBOL_PLUS, + LEXER_TOKEN_SYMBOL_CLOSE_BRACKET_LEFT, LEXER_TOKEN_SYMBOL_POINTER, LEXER_TOKEN_SYMBOL_MINUS, LEXER_TOKEN_SYMBOL_ADDRESS, diff --git a/src/compiler/parser.c b/src/compiler/parser.c index a35800c..1becd88 100644 --- a/src/compiler/parser.c +++ b/src/compiler/parser.c @@ -1522,7 +1522,7 @@ ParserNode *parserParenthesis(LexerNode *closing, LexerNode *begin, ParserNode *pNode = getUntilCommonParents(iter->parserNode, parent, parserNode); if (pNode == NULL) { - printLog(pNode->str_begin, pNode->str_end, "Bad node"); + printError(pNode->str_begin, pNode->str_end, "Bad node"); return NULL; } else { pNode->parent = parserNode; @@ -1557,7 +1557,7 @@ ParserNode *parserFunctionCall(LexerNode *closing, LexerNode *begin, ParserNode *pNode = getUntilCommonParents(iter->parserNode, parent, parserNode); if (pNode == NULL) { - printLog(pNode->str_begin, pNode->str_end, "Bad node"); + printError(pNode->str_begin, pNode->str_end, "Bad node"); return NULL; } else { pNode->parent = parserNode; @@ -1640,7 +1640,7 @@ ParserNode *parserBracketsRight(LexerNode *closing, LexerNode *begin, ParserNode *pNode = getUntilCommonParents(iter->parserNode, parent, parserNode); if (pNode == NULL) { - printLog(pNode->str_begin, pNode->str_end, "Bad node"); + printError(pNode->str_begin, pNode->str_end, "Bad node"); return NULL; } else { pNode->parent = parserNode; @@ -1676,8 +1676,8 @@ ParserNode *parserBracketsLeft(LexerNode *closing, LexerNode *begin, if (afterNode >= end || afterNode->parserNode == NULL || (after = getUntilCommonParent(afterNode->parserNode, parent)) == NULL || !isExpression(after)) { - printLog(closing->str_begin, closing->str_end, - "Bad bracket can't be parsed"); + printError(closing->str_begin, closing->str_end, + "Bad bracket can't be parsed"); return NULL; } @@ -1694,7 +1694,7 @@ ParserNode *parserBracketsLeft(LexerNode *closing, LexerNode *begin, ParserNode *pNode = getUntilCommonParents(iter->parserNode, parent, parserNode); if (pNode == NULL) { - printLog(pNode->str_begin, pNode->str_end, "Bad node"); + printError(pNode->str_begin, pNode->str_end, "Bad node"); return NULL; } else { pNode->parent = parserNode; |