Symbol table now keeps track of label statements

Before it kept track of a more specific node that referenced the symbol
in some way. Now it will only keep track of the actual label defining
statements. This is done to facilitate encoding. The encoder can now go
from a symbol name to the statement that defines the symbol.

Restructure the encoder to deal with this and pass the correct statement
to the symbol update function.
This commit is contained in:
2025-04-18 02:31:21 +02:00
parent 530e3fb423
commit 9c6b69e187
5 changed files with 61 additions and 26 deletions

View File

@ -74,11 +74,11 @@ error_t *print_encoding(tokenlist_t *list) {
return result.err;
encoder_t *encoder;
error_t *err = encoder_alloc(&encoder);
error_t *err = encoder_alloc(&encoder, result.node);
if (err)
goto cleanup_ast;
err = encoder_encode(encoder, result.node);
err = encoder_encode(encoder);
if (err)
goto cleanup_ast;