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:
Jose Luis Montañes Ojados
2026-02-16 02:24:37 +01:00
parent 01740d4892
commit 14b6a2ddd2
5 changed files with 34 additions and 8 deletions

View File

@@ -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);