diff options
Diffstat (limited to 'modules/gdscript')
| -rw-r--r-- | modules/gdscript/gd_parser.cpp | 8 | ||||
| -rw-r--r-- | modules/gdscript/gd_tokenizer.cpp | 22 |
2 files changed, 18 insertions, 12 deletions
diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp index ef9e85a8c..143a81d48 100644 --- a/modules/gdscript/gd_parser.cpp +++ b/modules/gdscript/gd_parser.cpp @@ -2089,6 +2089,7 @@ void GDParser::_parse_class(ClassNode *p_class) { current_export=PropertyInfo(); _set_error("Expected a string constant in enumeration hint."); + return; } String c = tokenizer->get_token_constant(); @@ -2106,6 +2107,7 @@ void GDParser::_parse_class(ClassNode *p_class) { if (tokenizer->get_token()!=GDTokenizer::TK_COMMA) { current_export=PropertyInfo(); _set_error("Expected ')' or ',' in enumeration hint."); + return; } tokenizer->advance(); @@ -2122,6 +2124,7 @@ void GDParser::_parse_class(ClassNode *p_class) { current_export=PropertyInfo(); _set_error("Expected a range in numeric hint."); + return; } //enumeration @@ -2139,6 +2142,7 @@ void GDParser::_parse_class(ClassNode *p_class) { current_export=PropertyInfo(); _set_error("Expected ',' or ')' in numeric range hint."); + return; } tokenizer->advance(); @@ -2147,6 +2151,7 @@ void GDParser::_parse_class(ClassNode *p_class) { current_export=PropertyInfo(); _set_error("Expected a number as upper bound in numeric range hint."); + return; } current_export.hint_string+=","+tokenizer->get_token_constant().operator String(); @@ -2159,6 +2164,7 @@ void GDParser::_parse_class(ClassNode *p_class) { current_export=PropertyInfo(); _set_error("Expected ',' or ')' in numeric range hint."); + return; } tokenizer->advance(); @@ -2167,6 +2173,7 @@ void GDParser::_parse_class(ClassNode *p_class) { current_export=PropertyInfo(); _set_error("Expected a number as step in numeric range hint."); + return; } current_export.hint_string+=","+tokenizer->get_token_constant().operator String(); @@ -2185,6 +2192,7 @@ void GDParser::_parse_class(ClassNode *p_class) { current_export=PropertyInfo(); _set_error("Expected a string constant in enumeration hint."); + return; } String c = tokenizer->get_token_constant(); diff --git a/modules/gdscript/gd_tokenizer.cpp b/modules/gdscript/gd_tokenizer.cpp index f73c895d7..bd0beb313 100644 --- a/modules/gdscript/gd_tokenizer.cpp +++ b/modules/gdscript/gd_tokenizer.cpp @@ -565,22 +565,21 @@ void GDTokenizerText::_advance() { case '\'': res='\''; break; case '\"': res='\"'; break; case '\\': res='\\'; break; - case 'x': { - //hexnumbarh - oct is deprecated + case '/': res='/'; break; //wtf - int read=0; + case 'u': { + //hexnumbarh - oct is deprecated + i+=1; for(int j=0;j<4;j++) { CharType c = GETCHAR(i+j); if (c==0) { _make_error("Unterminated String"); return; } - if (!_is_hex(c)) { - if (j==0 || !(j&1)) { - _make_error("Malformed hex constant in string"); - return; - } else - break; + if (!((c>='0' && c<='9') || (c>='a' && c<='f') || (c>='A' && c<='F'))) { + + _make_error("Malformed hex constant in string"); + return; } CharType v; if (c>='0' && c<='9') { @@ -599,10 +598,9 @@ void GDTokenizerText::_advance() { res<<=4; res|=v; - read++; - } - i+=read-1; + } + i+=3; } break; default: { |
