From d5ad76a3c827b75957eabd970c3b83991520634b Mon Sep 17 00:00:00 2001 From: Zae Date: Sun, 2 Jan 2022 18:02:00 +0800 Subject: [PATCH] [3.x] [Mono] Add support for file-scoped namespace declaration. --- modules/mono/editor/script_class_parser.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/mono/editor/script_class_parser.cpp b/modules/mono/editor/script_class_parser.cpp index b46cf2bf5c2e..2729a3441ceb 100644 --- a/modules/mono/editor/script_class_parser.cpp +++ b/modules/mono/editor/script_class_parser.cpp @@ -483,6 +483,9 @@ Error ScriptClassParser::_parse_namespace_name(String &r_name, int &r_curly_stac } else if (tk == TK_CURLY_BRACKET_OPEN) { r_curly_stack++; return OK; + } else if (tk == TK_SYMBOL && String(value) == ";") { + // for file-scoped namespace declaration + return OK; } else { error_str = "Unexpected token: " + get_token_name(tk); error = true;