summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-10-01 03:34:45 -0400
committerIan Moffett <ian@osmora.org>2025-10-01 03:34:45 -0400
commita82c11bd25f83dfc567f8dfec05b3ce8dea34088 (patch)
tree97d9c6cd012bcf2f7a44a9455747efe97962ba00
parent35c10bb221ab678fb1722bd36c489e1b65d45391 (diff)
np: lex: Return -2 on EOF
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r--src/sys/np/core/np_lex.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/sys/np/core/np_lex.c b/src/sys/np/core/np_lex.c
index 27341ab..cecb425 100644
--- a/src/sys/np/core/np_lex.c
+++ b/src/sys/np/core/np_lex.c
@@ -269,6 +269,8 @@ lex_nom(struct np_work *work, struct lex_token *res)
/* Match the token type */
switch (c) {
+ case '\0':
+ return -2; /* EOF */
case '(':
res->token = TT_LPAREN;
break;