From f04c858d9a4e8266c4f75fdd57cd7b8af86b1358 Mon Sep 17 00:00:00 2001 From: Max Wash Date: Thu, 28 Nov 2024 10:56:23 +0000 Subject: [PATCH] lang: lex: add base/limit markers around token type enums --- lang/include/ivy/lang/lex.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lang/include/ivy/lang/lex.h b/lang/include/ivy/lang/lex.h index f15ef18..f576e70 100644 --- a/lang/include/ivy/lang/lex.h +++ b/lang/include/ivy/lang/lex.h @@ -8,7 +8,8 @@ enum ivy_token_type { IVY_TOK_NONE = 0, - IVY_TOK_KEYWORD = 100, + __IVY_TOK_INDEX_BASE = 100, + IVY_TOK_KEYWORD, IVY_TOK_SYMBOL, IVY_TOK_ATOM, IVY_TOK_INT, @@ -19,12 +20,13 @@ enum ivy_token_type { IVY_TOK_STR_START, IVY_TOK_STR_END, IVY_TOK_LINEFEED, - IVY_TOK_TYPE_COUNT, + __IVY_TOK_INDEX_LIMIT, }; enum ivy_keyword { IVY_KW_NONE = 0, - IVY_KW_PACKAGE = 200, + __IVY_KW_INDEX_BASE = 200, + IVY_KW_PACKAGE, IVY_KW_USE, IVY_KW_CLASS, IVY_KW_PROTOCOL, @@ -47,12 +49,13 @@ enum ivy_keyword { IVY_KW_GET, IVY_KW_SET, IVY_KW_END, - IVY_KW_TYPE_COUNT, + __IVY_KW_INDEX_LIMIT, }; enum ivy_symbol { IVY_SYM_NONE = 0, - IVY_SYM_DOT = 300, + __IVY_SYM_INDEX_BASE = 300, + IVY_SYM_DOT, IVY_SYM_SQUOTE, IVY_SYM_DQUOTE, IVY_SYM_LEFT_BRACE, @@ -101,7 +104,7 @@ enum ivy_symbol { IVY_SYM_EQUAL_RIGHT_ANGLE, IVY_SYM_FORWARD_SLASH_ASTERISK, IVY_SYM_ASTERISK_FORWARD_SLASH, - IVY_SYM_TYPE_COUNT, + __IVY_SYM_INDEX_LIMIT, }; struct ivy_token {