diff options
author | AndreaCatania <info@andreacatania.com> | 2020-11-28 13:47:52 +0100 |
---|---|---|
committer | AndreaCatania <info@andreacatania.com> | 2020-11-28 13:47:52 +0100 |
commit | 40403b02fb203068f9b6ee6cbf74170c562a4379 (patch) | |
tree | 536d255b07d66716f85783fd058d6f002d04a3e1 /modules | |
parent | f73374629dd57d3eea6a960859ca223fa2d95fc4 (diff) |
Implement proper error print, Fixes a crash when no error messages are generated by the analyser.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdscript/gdscript.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index 53602f7a9b..6b74abf15d 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -628,8 +628,12 @@ Error GDScript::reload(bool p_keep_state) { if (EngineDebugger::is_active()) { GDScriptLanguage::get_singleton()->debug_break_parse(get_path(), parser.get_errors().front()->get().line, "Parser Error: " + parser.get_errors().front()->get().message); } - // TODO: Show all error messages. - _err_print_error("GDScript::reload", path.empty() ? "built-in" : (const char *)path.utf8().get_data(), parser.get_errors().front()->get().line, ("Parse Error: " + parser.get_errors().front()->get().message).utf8().get_data(), ERR_HANDLER_SCRIPT); + + const List<GDScriptParser::ParserError>::Element *e = parser.get_errors().front(); + while (e != nullptr) { + _err_print_error("GDScript::reload", path.empty() ? "built-in" : (const char *)path.utf8().get_data(), e->get().line, ("Parse Error: " + e->get().message).utf8().get_data(), ERR_HANDLER_SCRIPT); + e = e->next(); + } ERR_FAIL_V(ERR_PARSE_ERROR); } |