fix: add default values to unassigned variables
This commit is contained in:
parent
24f312d848
commit
9a63f8720d
@ -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.");
|
||||||
|
|
||||||
|
@ -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.");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user