summaryrefslogtreecommitdiff
path: root/src/sys/np
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-09-30 22:31:06 -0400
committerIan Moffett <ian@osmora.org>2025-09-30 22:31:06 -0400
commit78ad002e878fd633b7e3b147021e417b4fb480ee (patch)
tree211b9ebad7978301fee498858193f56e80c6b614 /src/sys/np
parent0ec22cf8ffdc4fba512883a006126962f1ee29d9 (diff)
np: lex: Increment line number every newline
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/sys/np')
-rw-r--r--src/sys/np/core/np_lex.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sys/np/core/np_lex.c b/src/sys/np/core/np_lex.c
index 436df16..2b47dd9 100644
--- a/src/sys/np/core/np_lex.c
+++ b/src/sys/np/core/np_lex.c
@@ -174,10 +174,12 @@ lex_nom(struct np_work *work, struct lex_token *res)
/* Skip all whitespace */
while ((c = lex_pop(work)) != 0) {
+ if (c == '\n') {
+ ++work->line_no;
+ }
if (is_space(c)) {
continue;
}
-
break;
}