From 78ad002e878fd633b7e3b147021e417b4fb480ee Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Tue, 30 Sep 2025 22:31:06 -0400 Subject: np: lex: Increment line number every newline Signed-off-by: Ian Moffett --- src/sys/np/core/np_lex.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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; } -- cgit v1.2.3