diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-01 08:23:42 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-01 08:23:42 +0100 |
commit | e101305950883661f9c47d8e6c552355f5e1fc2e (patch) | |
tree | 06b2b2c830575af964f5be99a0b4d5dc89705fa4 /modules/gdscript/gdscript_parser.cpp | |
parent | d29036bcda1312d88958be1d7b6ed89823282dbb (diff) | |
parent | a166833bfa23a21a7bff196a85a20b014e7c1396 (diff) | |
download | redot-engine-e101305950883661f9c47d8e6c552355f5e1fc2e.tar.gz |
Merge pull request #72487 from vnen/gdscript-warning-default-error
GDScript: Add warnings that are set to error by default
Diffstat (limited to 'modules/gdscript/gdscript_parser.cpp')
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 713ad3ed17..816be5a449 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -158,14 +158,10 @@ void GDScriptParser::push_warning(const Node *p_source, GDScriptWarning::Code p_ return; } - if (ignored_warning_codes.has(p_code)) { + if (ignored_warnings.has(p_code)) { return; } - String warn_name = GDScriptWarning::get_name_from_code((GDScriptWarning::Code)p_code).to_lower(); - if (ignored_warnings.has(warn_name)) { - return; - } int warn_level = (int)GLOBAL_GET(GDScriptWarning::get_settings_path_from_code(p_code)); if (!warn_level) { return; @@ -180,7 +176,7 @@ void GDScriptParser::push_warning(const Node *p_source, GDScriptWarning::Code p_ warning.rightmost_column = p_source->rightmost_column; if (warn_level == GDScriptWarning::WarnLevel::ERROR || bool(GLOBAL_GET("debug/gdscript/warnings/treat_warnings_as_errors"))) { - push_error(warning.get_message(), p_source); + push_error(warning.get_message() + String(" (Warning treated as error.)"), p_source); return; } @@ -3548,7 +3544,11 @@ const GDScriptParser::SuiteNode::Local &GDScriptParser::SuiteNode::get_local(con return empty; } -bool GDScriptParser::AnnotationNode::apply(GDScriptParser *p_this, Node *p_target) const { +bool GDScriptParser::AnnotationNode::apply(GDScriptParser *p_this, Node *p_target) { + if (is_applied) { + return true; + } + is_applied = true; return (p_this->*(p_this->valid_annotations[name].apply))(this, p_target); } |