mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +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
|
|
@ -511,19 +511,16 @@ Ref<Texture2D> EditorScriptPreviewPlugin::_generate_from_source_code(const Scrip
|
|||
return Ref<Texture2D>();
|
||||
}
|
||||
|
||||
List<String> kwors;
|
||||
if (p_language) {
|
||||
p_language->get_reserved_words(&kwors);
|
||||
}
|
||||
|
||||
HashSet<String> control_flow_keywords;
|
||||
HashSet<String> keywords;
|
||||
|
||||
for (const String &E : kwors) {
|
||||
if (p_language && p_language->is_control_flow_keyword(E)) {
|
||||
control_flow_keywords.insert(E);
|
||||
} else {
|
||||
keywords.insert(E);
|
||||
if (p_language) {
|
||||
for (const String &keyword : p_language->get_reserved_words()) {
|
||||
if (p_language->is_control_flow_keyword(keyword)) {
|
||||
control_flow_keywords.insert(keyword);
|
||||
} else {
|
||||
keywords.insert(keyword);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue