fix: add default values to unassigned variables

This commit is contained in:
TopchetoEU 2022-10-28 10:10:56 +03:00
parent 24f312d848
commit 9a63f8720d
2 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ bool ast::parse_field(ast_ctx_t &ctx, size_t &res_i, map_t &out) {
if (!h.parse(parse_identifier, out["name"].map({}))) return false; if (!h.parse(parse_identifier, out["name"].map({}))) return false;
bool type, defval; bool type = false, defval = false;
h.throw_ended("Expected a colon or an equals sign."); h.throw_ended("Expected a colon or an equals sign.");

View File

@ -7,7 +7,7 @@ static bool parse_arg(ast_ctx_t &ctx, size_t &res_i, map_t &out) {
if (!h.parse(parse_identifier, out["name"].map({}))) return false; if (!h.parse(parse_identifier, out["name"].map({}))) return false;
bool type, defval; bool type = false, defval = false;
h.throw_ended("Expected a colon or an equals sign."); h.throw_ended("Expected a colon or an equals sign.");