diff options
author | Ian Moffett <ian@osmora.org> | 2025-10-01 03:34:27 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-10-01 03:34:27 -0400 |
commit | 35c10bb221ab678fb1722bd36c489e1b65d45391 (patch) | |
tree | 84b777e16d5de0729c21cd9dd7b1b3b19483e0b2 /src | |
parent | 7f1b8e0de568defb342286216f0f9a8afd568bdb (diff) |
np: lex: Detect colon (':')
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/sys/include/np/lex.h | 1 | ||||
-rw-r--r-- | src/sys/np/core/np_lex.c | 3 | ||||
-rw-r--r-- | src/sys/np/core/np_parse.c | 1 |
3 files changed, 5 insertions, 0 deletions
diff --git a/src/sys/include/np/lex.h b/src/sys/include/np/lex.h index 8977305..ba4bdb8 100644 --- a/src/sys/include/np/lex.h +++ b/src/sys/include/np/lex.h @@ -61,6 +61,7 @@ typedef enum { TT_LT, /* '<' */ TT_LBRACK, /* '[' */ TT_RBRACK, /* ']' */ + TT_COLON, /* ':' */ /* Types */ TT_U8, /* 'u8' */ diff --git a/src/sys/np/core/np_lex.c b/src/sys/np/core/np_lex.c index 787f369..27341ab 100644 --- a/src/sys/np/core/np_lex.c +++ b/src/sys/np/core/np_lex.c @@ -287,6 +287,9 @@ lex_nom(struct np_work *work, struct lex_token *res) case ']': res->token = TT_RBRACK; break; + case ':': + res->token = TT_COLON; + break; default: if (is_num(c)) { lex_nomnum(work, c, res); diff --git a/src/sys/np/core/np_parse.c b/src/sys/np/core/np_parse.c index 29079d7..b894edb 100644 --- a/src/sys/np/core/np_parse.c +++ b/src/sys/np/core/np_parse.c @@ -54,6 +54,7 @@ static const char *stoktab[] = { [TT_LT] = "<TT_LESSTHAN>", [TT_LBRACK] = "<TT_LBRACK>", [TT_RBRACK] = "<TT_RBRACK>", + [TT_COLON] = "<TT_COLON>", /* Types */ [TT_U8] = "<TT_U8>", |