Fix comments in beginning of file

Also improve error for unknown characters.
This commit is contained in:
George Marques 2020-06-01 16:40:29 -03:00
parent 5d6e853806
commit 34c28eb2b8
No known key found for this signature in database
GPG Key ID: 046BD46A3201E43D
1 changed files with 2 additions and 2 deletions

View File

@ -791,7 +791,7 @@ void GDScriptTokenizer::check_indent() {
CharType current_indent_char = _peek();
int indent_count = 0;
if (current_indent_char != ' ' && current_indent_char != '\t' && current_indent_char != '\r' && current_indent_char != '\n') {
if (current_indent_char != ' ' && current_indent_char != '\t' && current_indent_char != '\r' && current_indent_char != '\n' && current_indent_char != '#') {
// First character of the line is not whitespace, so we clear all indentation levels.
// Unless we are in a continuation or in multiline mode (inside expression).
if (line_continuation || multiline_mode) {
@ -1248,7 +1248,7 @@ GDScriptTokenizer::Token GDScriptTokenizer::scan() {
}
default:
return make_error("Unknown character.");
return make_error(vformat(R"(Unknown character "%s".")", String(&c, 1)));
}
}