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

@@ -199,7 +199,8 @@ void JLANG_visualize(void *ptr) {
}
} else {
// Mark all block as JLANG_NOT_USE
memset(byteMapPtr + blockIndex, JLANG_NOT_USE, sizeof(JLANG_metadata) + currentHeader->size);
memset(byteMapPtr + blockIndex, JLANG_NOT_USE,
sizeof(JLANG_metadata) + currentHeader->size);
}
} else {
break;
@@ -215,7 +216,6 @@ void JLANG_visualize(void *ptr) {
int bytePerRow = 40;
int totalRows = _ceil(allocPtr->size / bytePerRow);
printf("totalRows=%d\n", totalRows);
char *currentMemPtr = allocPtr->memory;
@@ -242,9 +242,11 @@ void JLANG_visualize(void *ptr) {
printf("%.2x", (unsigned char)*(currentMemPtr + (n + i * bytePerRow)));
if (n < bytePerRow - 1) {
printf(" ");
}
/*
if (n < bytePerRow - 1) {
printf(" ");
}
*/
printf("\033[0m");
}