summaryrefslogtreecommitdiff
path: root/modules/gdscript
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-04-10 18:16:10 +0200
committerGitHub <noreply@github.com>2019-04-10 18:16:10 +0200
commit07b76c0376eef34fcbf52ecc21074c5084f980f5 (patch)
tree9b947d26c956a370b3f7c18c0e49062cb9bc2094 /modules/gdscript
parente33764744cb2bf72ee77c823c3beeb6dc870d2dc (diff)
parent7a0dfc04aa85d0a7c5f317252e9eb917d0aef788 (diff)
Merge pull request #27170 from timoschwarzer/allow-whitespaces-in-warning-ignore-comments
Allow whitespaces in warning-ignore comments
Diffstat (limited to 'modules/gdscript')
-rw-r--r--modules/gdscript/gdscript_tokenizer.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/modules/gdscript/gdscript_tokenizer.cpp b/modules/gdscript/gdscript_tokenizer.cpp
index cc1f4333fc..36503af4d7 100644
--- a/modules/gdscript/gdscript_tokenizer.cpp
+++ b/modules/gdscript/gdscript_tokenizer.cpp
@@ -535,13 +535,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