Add * and / operators, VM step debugger, and visualizer tweaks
Support multiply and divide in lexer, parser and eval. Add step-by-step VM debug output with AST and heap visualization. Remove spacing in visualizer hex output.
This commit is contained in:
@@ -80,9 +80,9 @@ ASTNode *parse_expr(Token *tokens)
|
||||
{
|
||||
ASTNode *left = parse_term(tokens);
|
||||
|
||||
while (tokens[pos].type == TOK_PLUS || tokens[pos].type == TOK_MINUS)
|
||||
while (tokens[pos].type == TOK_PLUS || tokens[pos].type == TOK_MINUS || tokens[pos].type == TOK_STAR || tokens[pos].type == TOK_SLASH)
|
||||
{
|
||||
char op = tokens[pos].value[0]; // + o -
|
||||
char op = tokens[pos].value[0]; // +,-,*,/
|
||||
pos++;
|
||||
ASTNode *right = parse_term(tokens);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user