From 8151110002c051a8d7d33ef20439a1980eb29fd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 4 Feb 2016 10:17:23 +0100 Subject: Reorder reserved words by categories They were previously kind of sorted with a mix between alphabetical and logical ordering, which made it hard to spot duplicates or missing words. --- modules/gdscript/gd_script.cpp | 61 +++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index 62c5eb735a..f6eeaaca0c 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -2677,40 +2677,45 @@ void GDScriptLanguage::frame() { void GDScriptLanguage::get_reserved_words(List *p_words) const { static const char *_reserved_words[]={ - "break", - "class", - "continue", - "const", - "else", - "elif", - "enum", - "extends" , - "onready", - "for" , - "func" , - "if" , - "in" , - "null" , - "not" , - "return" , - "self" , - "while" , - "true" , - "false" , - "tool", - "var", - "setget", - "pass", + // operators "and", + "in", + "not", "or", - "export", + // types and values + "false", + "float", + "int", + "null", + "self", + "true", + // functions "assert", "breakpoint", + "class", + "extends", + "func", + "setget", + "signal", + "tool", "yield", + // var + "const", + "enum", + "export", + "onready", "static", - "float", - "int", - "signal", + "var", + // control flow + "break", + "continue", + "if", + "elif", + "else", + "for", + "pass", + "return", + "while", 0}; -- cgit v1.2.3 From 99d9188da8f022cf0baca709964df0513700296c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 4 Feb 2016 10:26:10 +0100 Subject: Add preload and PI to GDScript reserved keywords I've noticed that gd_tokenizer also has keywords for `switch' and `do', but they seem not to be supported actually (only used in commented code for the shader language), so I don't add them. --- modules/gdscript/gd_script.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index f6eeaaca0c..514c2b210a 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -2687,6 +2687,7 @@ void GDScriptLanguage::get_reserved_words(List *p_words) const { "float", "int", "null", + "PI", "self", "true", // functions @@ -2695,6 +2696,7 @@ void GDScriptLanguage::get_reserved_words(List *p_words) const { "class", "extends", "func", + "preload" "setget", "signal", "tool", -- cgit v1.2.3