diff options
author | Timo Schwarzer <me@timoschwarzer.com> | 2019-03-17 18:42:59 +0100 |
---|---|---|
committer | Timo Schwarzer <me@timoschwarzer.com> | 2019-03-17 18:42:59 +0100 |
commit | 7a0dfc04aa85d0a7c5f317252e9eb917d0aef788 (patch) | |
tree | 32ce01edf31225269e6118d13879c0df21a1192c /modules | |
parent | df7d3708c5b535c3696943322a14ec19a175e30c (diff) |
Allow whitespaces in warning-ignore comments
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdscript/gdscript_tokenizer.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/modules/gdscript/gdscript_tokenizer.cpp b/modules/gdscript/gdscript_tokenizer.cpp index 8b22d6f085..69d59dc980 100644 --- a/modules/gdscript/gdscript_tokenizer.cpp +++ b/modules/gdscript/gdscript_tokenizer.cpp @@ -534,13 +534,14 @@ void GDScriptTokenizerText::_advance() { } } #ifdef DEBUG_ENABLED - if (comment.begins_with("#warning-ignore:")) { - String code = comment.get_slice(":", 1); + String comment_content = comment.trim_prefix("#").trim_prefix(" "); + if (comment_content.begins_with("warning-ignore:")) { + String code = comment_content.get_slice(":", 1); warning_skips.push_back(Pair<int, String>(line, code.strip_edges().to_lower())); - } else if (comment.begins_with("#warning-ignore-all:")) { - String code = comment.get_slice(":", 1); + } else if (comment_content.begins_with("warning-ignore-all:")) { + String code = comment_content.get_slice(":", 1); warning_global_skips.insert(code.strip_edges().to_lower()); - } else if (comment.strip_edges() == "#warnings-disable") { + } else if (comment_content.strip_edges() == "warnings-disable") { ignore_warnings = true; } #endif // DEBUG_ENABLED |