summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_tokenizer.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-02-19 08:55:04 +0100
committerRémi Verschelde <rverschelde@gmail.com>2019-02-20 14:05:08 +0100
commitd35003d92ae97c515b6fd2c319df2d7a8f14e28d (patch)
treef13dada500a6335702cc55948939c5b0871176af /modules/gdscript/gdscript_tokenizer.cpp
parent29fd942dd6e6851014da8d3da9a7fcdca2921781 (diff)
downloadredot-engine-d35003d92ae97c515b6fd2c319df2d7a8f14e28d.tar.gz
GDScript: Remove unused `switch`, `case` and `do` CF keywords
They had been reserved for future implementation, but we now have the `match` CF keyword which does the same and more. According to @reduz `do` was even added by mistake when copying from the shader language parser, it was never intended to add support for `do`... `while` loops, as the syntax would be awkward in GDScript, and the added sugar is not worth it. Fixes #25787.
Diffstat (limited to 'modules/gdscript/gdscript_tokenizer.cpp')
-rw-r--r--modules/gdscript/gdscript_tokenizer.cpp9
1 files changed, 0 insertions, 9 deletions
diff --git a/modules/gdscript/gdscript_tokenizer.cpp b/modules/gdscript/gdscript_tokenizer.cpp
index 127a00a9f3..0f2f0bbb26 100644
--- a/modules/gdscript/gdscript_tokenizer.cpp
+++ b/modules/gdscript/gdscript_tokenizer.cpp
@@ -80,10 +80,7 @@ const char *GDScriptTokenizer::token_names[TK_MAX] = {
"elif",
"else",
"for",
- "do",
"while",
- "switch (reserved)",
- "case (reserved)",
"break",
"continue",
"pass",
@@ -224,9 +221,6 @@ static const _kws _keyword_list[] = {
{ GDScriptTokenizer::TK_CF_ELSE, "else" },
{ GDScriptTokenizer::TK_CF_FOR, "for" },
{ GDScriptTokenizer::TK_CF_WHILE, "while" },
- { GDScriptTokenizer::TK_CF_DO, "do" },
- { GDScriptTokenizer::TK_CF_SWITCH, "switch" },
- { GDScriptTokenizer::TK_CF_CASE, "case" },
{ GDScriptTokenizer::TK_CF_BREAK, "break" },
{ GDScriptTokenizer::TK_CF_CONTINUE, "continue" },
{ GDScriptTokenizer::TK_CF_RETURN, "return" },
@@ -291,9 +285,6 @@ bool GDScriptTokenizer::is_token_literal(int p_offset, bool variable_safe) const
case TK_CF_ELSE:
case TK_CF_FOR:
case TK_CF_WHILE:
- case TK_CF_DO:
- case TK_CF_SWITCH:
- case TK_CF_CASE:
case TK_CF_BREAK:
case TK_CF_CONTINUE:
case TK_CF_RETURN: