Browse Source

Fix for Expression class: inner string can be single quoted

(cherry picked from commit ec164b2301034b3aa0fee4e4b93170404a2e4d98)
ntfs.hard 5 years ago
parent
commit
a822d1f133
1 changed files with 3 additions and 1 deletions
  1. 3 1
      core/math/expression.cpp

+ 3 - 1
core/math/expression.cpp

@@ -1004,6 +1004,7 @@ Error Expression::_get_token(Token &r_token) {
 
 
 				return OK;
 				return OK;
 			};
 			};
+			case '\'':
 			case '"': {
 			case '"': {
 
 
 				String str;
 				String str;
@@ -1015,7 +1016,8 @@ Error Expression::_get_token(Token &r_token) {
 						_set_error("Unterminated String");
 						_set_error("Unterminated String");
 						r_token.type = TK_ERROR;
 						r_token.type = TK_ERROR;
 						return ERR_PARSE_ERROR;
 						return ERR_PARSE_ERROR;
-					} else if (ch == '"') {
+					} else if (ch == cchar) {
+						// cchar contain a corresponding quote symbol
 						break;
 						break;
 					} else if (ch == '\\') {
 					} else if (ch == '\\') {
 						//escaped characters...
 						//escaped characters...