This is a step for wider usage of get_ccode_name() on variables
} else if (sym is Signal) {
return Symbol.camel_case_to_lower_case (sym.name).replace ("_", "-");;
} else if (sym is LocalVariable || sym is Parameter) {
- return sym.name;
+ unowned string name = sym.name;
+ if (CCodeBaseModule.reserved_identifiers.contains (name)) {
+ return "_%s_".printf (name);
+ } else {
+ return name;
+ }
} else {
return "%s%s".printf (get_ccode_prefix (sym.parent_symbol), sym.name);
}
/* (constant) hash table with all predefined marshallers */
public Set<string> predefined_marshal_set;
/* (constant) hash table with all reserved identifiers in the generated code */
- Set<string> reserved_identifiers;
+ public static Set<string> reserved_identifiers;
public int next_temp_var_id {
get { return emit_context.next_temp_var_id; }