summaryrefslogtreecommitdiff
path: root/src/string_view.c
diff options
context:
space:
mode:
authorCarlos Maniero <carlos@maniero.me>2023-05-02 23:45:51 -0300
committerJohnny Richard <johnny@johnnyrichard.com>2023-05-03 22:45:23 +0200
commite623c701d2ef41cf4993590e2932c7538c83fc54 (patch)
treee096ead143fe76d73df5789a3aee5b2b6358c602 /src/string_view.c
parent990f4d3e4c662c401a08e3704a39878fd6c1c1b6 (diff)
parser: Use lookahead instead of consuming tokens
Previously, during block declaration, the parser consumed the token which caused some parsers (such as return and variable declaration) to not be self-contained and to depend on the callee to start the parser. In this commit, I've refactored the parser to only look for future tokens using lookahead, and delegate the consumption to child parser functions. This results in a more modular and self-contained parser that improves the overall maintainability and readability of the code. Signed-off-by: Carlos Maniero <carlos@maniero.me>
Diffstat (limited to 'src/string_view.c')
0 files changed, 0 insertions, 0 deletions