diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-09-11 22:53:53 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-09-11 22:55:38 +0200 |
commit | 280a7c191bd5bda0d1d885c1c24ec4674d8a880e (patch) | |
tree | b18b6fb7337302edcda77f769c0fe508bea5ba5f /lexer.c | |
parent | 974eafbb07578742ac6aa965c73b62792865ebd7 (diff) |
syntax: introduce !== and === operators
Also treat "in" as relational operator.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'lexer.c')
-rw-r--r-- | lexer.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -61,6 +61,8 @@ static const struct token tokens[] = { { T_LSTM, "{%+", 3 }, { T_LSTM, "{%-", 3 }, { T_RSTM, "-%}", 3 }, + { T_EQS, "===", 3 }, + { T_NES, "!==", 3 }, { T_AND, "&&", 2 }, { T_ASADD, "+=", 2 }, { T_ASBAND, "&=", 2 }, @@ -164,6 +166,8 @@ const char *tokennames[__T_MAX] = { [T_INC] = "'x++'", [T_EQ] = "'x==y'", [T_NE] = "'x!=y'", + [T_EQS] = "'x===y'", + [T_NES] = "'x!==y'", [T_LE] = "'x<=y'", [T_GE] = "'x>=y'", [T_LSHIFT] = "'x<<y'", |