diff options
author | Jo-Philipp Wich <jo@mein.io> | 2021-05-18 11:12:01 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2021-05-18 13:11:33 +0200 |
commit | ed32c42eefbc4560408d53445c603767469c85bd (patch) | |
tree | 15db63a3f8c7d74d9013699a067d5c984f820415 /compiler.c | |
parent | ff6811f29065951ab3917460f3d76ffe6ddb0c81 (diff) |
compiler, lexer: add NO_LEGACY define to disable legacy syntax features
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'compiler.c')
-rw-r--r-- | compiler.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -974,6 +974,7 @@ uc_compiler_compile_delete(uc_compiler *compiler, bool assignable) uc_chunk *chunk = uc_compiler_current_chunk(compiler); enum insn_type type; +#ifndef NO_LEGACY /* If the delete keyword is followed by an opening paren, it might be a * legacy delete(object, propname) call */ if (uc_compiler_parse_match(compiler, TK_LPAREN)) { @@ -1006,7 +1007,9 @@ uc_compiler_compile_delete(uc_compiler *compiler, bool assignable) /* Otherwise compile expression, ensure that it results in a property * access (I_LVAL) and overwrite it with delete operation. */ - else { + else +#endif /* NO_LEGACY */ + { uc_compiler_parse_precedence(compiler, P_UNARY); type = chunk->entries[compiler->last_insn]; |