mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
-Fix parsing of comments in VariantParser, fixes #3175
This commit is contained in:
@@ -120,6 +120,20 @@ Error VariantParser::get_token(Stream *p_stream, Token& r_token, int &line, Stri
|
||||
r_token.type=TK_COLON;
|
||||
return OK;
|
||||
};
|
||||
case ';': {
|
||||
|
||||
while(true) {
|
||||
CharType ch=p_stream->get_char();
|
||||
if (p_stream->is_eof()) {
|
||||
r_token.type=TK_EOF;
|
||||
return OK;
|
||||
}
|
||||
if (ch=='\n')
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
};
|
||||
case ',': {
|
||||
|
||||
r_token.type=TK_COMMA;
|
||||
@@ -1591,6 +1605,18 @@ Error VariantParser::parse_tag_assign_eof(Stream *p_stream, int &line, String &r
|
||||
if (p_stream->is_eof())
|
||||
return ERR_FILE_EOF;
|
||||
|
||||
if (c==';') { //comment
|
||||
while(true) {
|
||||
CharType ch=p_stream->get_char();
|
||||
if (p_stream->is_eof()) {
|
||||
return ERR_FILE_EOF;
|
||||
}
|
||||
if (ch=='\n')
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (c=='[' && what.length()==0) {
|
||||
//it's a tag!
|
||||
p_stream->saved='['; //go back one
|
||||
|
||||
Reference in New Issue
Block a user