xo-interpreter2: + nil + cons
This commit is contained in:
parent
cb6df6c0d8
commit
2e1ae9bca3
30 changed files with 213 additions and 11 deletions
|
|
@ -134,6 +134,8 @@ namespace xo {
|
|||
/** token for @c "==" **/
|
||||
static Token cmpeq_token() { return Token(tokentype::tk_cmpeq); }
|
||||
|
||||
/** token representing keyword @c nil **/
|
||||
static Token nil_token() { return Token(tokentype::tk_nil); }
|
||||
/** token representing keyword @c type **/
|
||||
static Token type() { return Token(tokentype::tk_type); }
|
||||
/** token representing keyword @c def **/
|
||||
|
|
|
|||
|
|
@ -140,6 +140,9 @@ namespace xo {
|
|||
/** operator @c '!=' **/
|
||||
tk_cmpne,
|
||||
|
||||
/** keyword @c 'nil' **/
|
||||
tk_nil,
|
||||
|
||||
/** keyword @c 'type' **/
|
||||
tk_type,
|
||||
|
||||
|
|
|
|||
|
|
@ -587,6 +587,8 @@ namespace xo {
|
|||
if ((tk_text == "true") || (tk_text == "false")) {
|
||||
tk_type = tokentype::tk_bool;
|
||||
keep_text = true;
|
||||
} else if (tk_text == "nil") {
|
||||
tk_type = tokentype::tk_nil;
|
||||
} else if (tk_text == "type") {
|
||||
tk_type = tokentype::tk_type;
|
||||
} else if (tk_text == "def") {
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ namespace xo {
|
|||
CASE(tk_cmpeq);
|
||||
CASE(tk_cmpne);
|
||||
|
||||
CASE(tk_nil);
|
||||
CASE(tk_type);
|
||||
CASE(tk_def);
|
||||
CASE(tk_deftype);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue