added a new reserved word - thisProcess
This commit is contained in:
@ -103,6 +103,7 @@ static struct voca_t
|
||||
{ 4, { 's','e','l','f' } },
|
||||
{ 5, { 's','u','p','e','r' } },
|
||||
{ 11, { 't','h','i','s','C','o','n','t','e','x','t' } },
|
||||
{ 11, { 't','h','i','s','P','r','o','c','e','s','s' } },
|
||||
{ 4, { 't','r','u','e' } },
|
||||
{ 4, { 'w','o','r','d' } },
|
||||
|
||||
@ -138,6 +139,7 @@ enum voca_id_t
|
||||
VOCA_SELF,
|
||||
VOCA_SUPER,
|
||||
VOCA_THIS_CONTEXT,
|
||||
VOCA_THIS_PROCESS,
|
||||
VOCA_TRUE,
|
||||
VOCA_WORD,
|
||||
|
||||
@ -292,7 +294,8 @@ static int is_reserved_word (const stix_oocs_t* ucs)
|
||||
VOCA_NIL,
|
||||
VOCA_TRUE,
|
||||
VOCA_FALSE,
|
||||
VOCA_THIS_CONTEXT
|
||||
VOCA_THIS_CONTEXT,
|
||||
VOCA_THIS_PROCESS
|
||||
};
|
||||
int i;
|
||||
|
||||
@ -857,6 +860,10 @@ static int get_ident (stix_t* stix, stix_ooci_t char_read_ahead)
|
||||
{
|
||||
stix->c->tok.type = STIX_IOTOK_THIS_CONTEXT;
|
||||
}
|
||||
else if (is_token_word(stix, VOCA_THIS_PROCESS))
|
||||
{
|
||||
stix->c->tok.type = STIX_IOTOK_THIS_PROCESS;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -3271,6 +3278,7 @@ static int __read_array_literal (stix_t* stix, stix_oop_t* xlit)
|
||||
case STIX_IOTOK_SELF:
|
||||
case STIX_IOTOK_SUPER:
|
||||
case STIX_IOTOK_THIS_CONTEXT:
|
||||
case STIX_IOTOK_THIS_PROCESS:
|
||||
lit = stix_makesymbol (stix, stix->c->tok.name.ptr, stix->c->tok.name.len);
|
||||
break;
|
||||
|
||||
@ -3506,6 +3514,11 @@ static int compile_expression_primary (stix_t* stix, const stix_oocs_t* ident, c
|
||||
GET_TOKEN (stix);
|
||||
break;
|
||||
|
||||
case STIX_IOTOK_THIS_PROCESS:
|
||||
if (emit_byte_instruction(stix, BCODE_PUSH_PROCESS) <= -1) return -1;
|
||||
GET_TOKEN (stix);
|
||||
break;
|
||||
|
||||
case STIX_IOTOK_CHARLIT:
|
||||
STIX_ASSERT (stix->c->tok.name.len == 1);
|
||||
if (add_character_literal(stix, stix->c->tok.name.ptr[0], &index) <= -1 ||
|
||||
|
Reference in New Issue
Block a user