xo-reader2 stack: expand symbol table to store typedefs

+ typedef utest
+ misc qol policy choices
This commit is contained in:
Roland Conybeare 2026-03-11 07:49:14 -05:00
commit 458fd04ca2
4 changed files with 10 additions and 2 deletions

View file

@ -111,8 +111,8 @@ namespace xo {
static Token comma_token() { return Token(tokentype::tk_comma); }
/** token representing colon @c ":" **/
static Token colon_token() { return Token(tokentype::tk_colon); }
/** token representing double-colo @c "::" **/
static Token doublecolon() { return Token(tokentype::tk_doublecolon); }
/** token representing double-colon @c "::" **/
static Token doublecolon_token() { return Token(tokentype::tk_doublecolon); }
/** token representing semicolon @c ";" **/
static Token semicolon_token() { return Token(tokentype::tk_semicolon); }
/** token representing single-assignment @c "=" (editor bait: equal_token) **/
@ -138,6 +138,8 @@ namespace xo {
static Token type() { return Token(tokentype::tk_type); }
/** token representing keyword @c def **/
static Token def_token() { return Token(tokentype::tk_def); }
/** token representing keyword @c deftype **/
static Token deftype_token() { return Token(tokentype::tk_deftype); }
/** token representing keyword @c lambda **/
static Token lambda_token() { return Token(tokentype::tk_lambda); }
/** token representing keyword @c if **/

View file

@ -146,6 +146,9 @@ namespace xo {
/** keyword @c 'def' **/
tk_def,
/** keyword @c 'deftype' **/
tk_deftype,
/** keyword @c 'lambda' **/
tk_lambda,

View file

@ -591,6 +591,8 @@ namespace xo {
tk_type = tokentype::tk_type;
} else if (tk_text == "def") {
tk_type = tokentype::tk_def;
} else if (tk_text == "deftype") {
tk_type = tokentype::tk_deftype;
} else if (tk_text == "lambda") {
tk_type = tokentype::tk_lambda;
} else if (tk_text == "if") {

View file

@ -51,6 +51,7 @@ namespace xo {
CASE(tk_type);
CASE(tk_def);
CASE(tk_deftype);
CASE(tk_lambda);
CASE(tk_if);
CASE(tk_then);