From c904bc2b78045bd81cfc3603422c385cbf7adc75 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Thu, 2 Oct 2025 20:06:06 -0400 Subject: kern: np: Add support for return statements This commit introduces lexical, parsing and code generation support for the return statements. As of now, one is only able to return unsigned integers but this will be expanded upon in the future Signed-off-by: Ian Moffett --- src/sys/include/np/lex.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/sys/include/np/lex.h') diff --git a/src/sys/include/np/lex.h b/src/sys/include/np/lex.h index ebd6f32..ba581b7 100644 --- a/src/sys/include/np/lex.h +++ b/src/sys/include/np/lex.h @@ -41,6 +41,7 @@ struct np_work; #define TOKEN_BEGIN "begin" #define TOKEN_PROC "proc" #define TOKEN_END "end" +#define TOKEN_RETURN "return" /* Types */ #define TOKEN_U8 "u8" @@ -93,6 +94,7 @@ typedef enum { TT_BEGIN, /* 'begin' */ TT_PROC, /* 'proc' */ TT_END, /* 'end' */ + TT_RETURN, /* 'return' */ } tt_t; typedef uint64_t tokval_t; -- cgit v1.2.3