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:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user