mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Improve ScriptLanguage get keyword API.
This commit is contained in:
parent
34f005d810
commit
1384e82c2c
13 changed files with 87 additions and 123 deletions
|
@ -2731,9 +2731,9 @@ void GDScriptLanguage::frame() {
|
|||
}
|
||||
|
||||
/* EDITOR FUNCTIONS */
|
||||
void GDScriptLanguage::get_reserved_words(List<String> *p_words) const {
|
||||
Vector<String> GDScriptLanguage::get_reserved_words() const {
|
||||
// Please keep alphabetical order within categories.
|
||||
static const char *_reserved_words[] = {
|
||||
static const Vector<String> ret = {
|
||||
// Control flow.
|
||||
"break",
|
||||
"continue",
|
||||
|
@ -2786,15 +2786,9 @@ void GDScriptLanguage::get_reserved_words(List<String> *p_words) const {
|
|||
"preload",
|
||||
// Types (highlighter uses type color instead).
|
||||
"void",
|
||||
nullptr,
|
||||
};
|
||||
|
||||
const char **w = _reserved_words;
|
||||
|
||||
while (*w) {
|
||||
p_words->push_back(*w);
|
||||
w++;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool GDScriptLanguage::is_control_flow_keyword(const String &p_keyword) const {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue