summaryrefslogtreecommitdiffstats
path: root/modules/mono/editor/script_class_parser.cpp
diff options
context:
space:
mode:
authorIgnacio Etcheverry <ignalfonsore@gmail.com>2019-08-09 03:39:45 +0200
committerIgnacio Etcheverry <ignalfonsore@gmail.com>2019-08-09 12:13:21 +0200
commitc55ce204b3065d55df2717a7e0bcb0681392ac34 (patch)
treebc672241bc93761fd87db6ba8b1707f9a9f38a3a /modules/mono/editor/script_class_parser.cpp
parentfe3cd5175589c27c3564224b317bbc0177a5a735 (diff)
downloadredot-engine-c55ce204b3065d55df2717a7e0bcb0681392ac34.tar.gz
Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in 'modules/mono'
And 'CRASH_*_MSG' as well. Also make error messages puntuation and quotation more consistent.
Diffstat (limited to 'modules/mono/editor/script_class_parser.cpp')
-rw-r--r--modules/mono/editor/script_class_parser.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/modules/mono/editor/script_class_parser.cpp b/modules/mono/editor/script_class_parser.cpp
index dfb652a7aa..dcb0ca5a80 100644
--- a/modules/mono/editor/script_class_parser.cpp
+++ b/modules/mono/editor/script_class_parser.cpp
@@ -162,8 +162,8 @@ ScriptClassParser::Token ScriptClassParser::get_token() {
error = true;
return TK_ERROR;
} else if (code[idx] == begin_str) {
- if (verbatim && code[idx + 1] == '"') { // `""` is verbatim string's `\"`
- idx += 2; // skip next `"` as well
+ if (verbatim && code[idx + 1] == '"') { // '""' is verbatim string's '\"'
+ idx += 2; // skip next '"' as well
continue;
}
@@ -590,7 +590,7 @@ Error ScriptClassParser::parse(const String &p_code) {
name = String(value);
} else if (tk == TK_CURLY_BRACKET_OPEN) {
if (name.empty()) {
- error_str = "Expected " + get_token_name(TK_IDENTIFIER) + " after keyword `struct`, found " + get_token_name(TK_CURLY_BRACKET_OPEN);
+ error_str = "Expected " + get_token_name(TK_IDENTIFIER) + " after keyword 'struct', found " + get_token_name(TK_CURLY_BRACKET_OPEN);
error = true;
return ERR_PARSE_ERROR;
}
@@ -657,12 +657,12 @@ Error ScriptClassParser::parse_file(const String &p_filepath) {
String source;
Error ferr = read_all_file_utf8(p_filepath, source);
- if (ferr != OK) {
- if (ferr == ERR_INVALID_DATA) {
- ERR_EXPLAIN("File '" + p_filepath + "' contains invalid unicode (utf-8), so it was not loaded. Please ensure that scripts are saved in valid utf-8 unicode.");
- }
- ERR_FAIL_V(ferr);
- }
+
+ ERR_FAIL_COND_V_MSG(ferr != OK, ferr,
+ ferr == ERR_INVALID_DATA ?
+ "File '" + p_filepath + "' contains invalid unicode (UTF-8), so it was not loaded."
+ " Please ensure that scripts are saved in valid UTF-8 unicode." :
+ "Failed to read file: '" + p_filepath + "'.");
return parse(source);
}