summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
author0x221e2026-06-17 00:05:36 +0200
committer0x221e2026-06-17 00:05:36 +0200
commit9224992817c3faf7d6274681fb5bacc5ad761504 (patch)
treef795158e912052095c68a6ad736fe77840d664da /include
parente3cb7a6cab35947bb200f982f5fa8017b96bc15f (diff)
lex: fix lex_advance() and replace l->pos additions
l->pos increments are replaced with lex_advance, which now accepts offsets. lex_advance() now returns 0 and does not increment past buffer size upon out-of-bounds.
Diffstat (limited to 'include')
-rw-r--r--include/lex.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/lex.h b/include/lex.h
index 4b8b1ac..634be5f 100644
--- a/include/lex.h
+++ b/include/lex.h
@@ -48,7 +48,7 @@ struct lex {
size_t line;
};
-char lex_advance(struct lex *l);
+char lex_advance(struct lex *l, size_t o);
char lex_seek(struct lex *l, size_t o);
struct token lex_number(struct lex *l);