summaryrefslogtreecommitdiff
path: root/src/lexer.c
diff options
context:
space:
mode:
authorCarlos Maniero <carlos@maniero.me>2023-05-02 23:45:52 -0300
committerJohnny Richard <johnny@johnnyrichard.com>2023-05-03 22:52:41 +0200
commitb18a53b912ae66ad2bb23985640c9fac56ced358 (patch)
treeeadc80d198b9ddab5f1fe77377e1249a3ec3259f /src/lexer.c
parente623c701d2ef41cf4993590e2932c7538c83fc54 (diff)
parser: Split block into small functions
Since it is possible to look a future token without consuming it, it was possible to split the block parser into small chunks of code. There is the performance drawback, because now the parser makes multiple lookups to the same token. However IMO that it is not a big concern given the small computation required to get a token. Also it can be easily addressed by computing all token in advance. Memory Leak: During the refactor I found some extra memory leaks related to not released scopes. So then, more than just printing a message I introduced an assert on scope.c to make sure developers will get this feedback asap because our testing framework suppress messages from stderr when the test passes. Signed-off-by: Carlos Maniero <carlos@maniero.me>
Diffstat (limited to 'src/lexer.c')
0 files changed, 0 insertions, 0 deletions