diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-08-25 20:17:03 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-08-25 20:38:15 +0200 |
commit | d63d8b6f0c0a43a14de9493f1683a209a0166889 (patch) | |
tree | a025491b84e629194b0b6b1b854606578f4d0079 /lexer.c | |
parent | 93902cd86f8244b2036a0e5bd910099da13b6885 (diff) |
treewide: introduce this keyword
Support a new keyword `this` which allows functions to access the context
they're called upon.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'lexer.c')
-rw-r--r-- | lexer.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -131,6 +131,7 @@ static const struct token reserved_words[] = { { T_BOOL, "false", 5, parse_bool }, { T_BOOL, "true", 4, parse_bool }, { T_ELSE, "else", 4 }, + { T_THIS, "this", 4 }, { T_NUMBER, "NaN", 3, parse_number }, { T_FOR, "for", 3 }, { T_IN, "in", 2 }, @@ -204,6 +205,7 @@ const char *tokennames[__T_MAX] = { [T_RETURN] = "'return'", [T_BREAK] = "'break'", [T_CONTINUE] = "'continue'", + [T_THIS] = "'this'", //[T_LSTM] = "'{%'", //[T_RSTM] = "'%}'" }; |