Highlight control flow keywords with a different color

This makes them easier to distinguish from other keywords.
This commit is contained in:
Hugo Locurcio 2019-11-12 17:08:07 +01:00
parent 130ecf0c9f
commit a38b447413
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C
24 changed files with 119 additions and 8 deletions

View file

@ -2628,6 +2628,20 @@ void ShaderLanguage::get_keyword_list(List<String> *r_keywords) {
}
}
bool ShaderLanguage::is_control_flow_keyword(String p_keyword) {
return p_keyword == "break" ||
p_keyword == "case" ||
p_keyword == "continue" ||
p_keyword == "default" ||
p_keyword == "do" ||
p_keyword == "else" ||
p_keyword == "for" ||
p_keyword == "if" ||
p_keyword == "return" ||
p_keyword == "switch" ||
p_keyword == "while";
}
void ShaderLanguage::get_builtin_funcs(List<String> *r_keywords) {
Set<String> kws;