When a variable is used, we need to remember to follow the `->merged`
link to find the primary instance.
+When a variable is declared, it may or may not be given an explicit
+type. We need to record which so that we can report the parsed code
+correctly.
+
###### exec type
Xvar,
struct variable *var;
};
+###### variable fields
+ int explicit_type;
+
###### Grammar
$TERM : ::
v->where_decl = $0;
v->where_set = $0;
v->type = $<Type;
+ v->explicit_type = 1;
} else {
v = var_ref(c, $1.txt);
$0->var = v;
v->where_set = $0;
v->type = $<Type;
v->constant = 1;
+ v->explicit_type = 1;
} else {
v = var_ref(c, $1.txt);
$0->var = v;
print_exec(b->left, indent, bracket);
if (cast(var, b->left)->var->constant) {
printf("::");
- if (v->where_decl == v->where_set) {
+ if (v->explicit_type) {
type_print(v->type, stdout);
printf(" ");
}
} else {
printf(":");
- if (v->where_decl == v->where_set) {
+ if (v->explicit_type) {
type_print(v->type, stdout);
printf(" ");
}