Opened 14 years ago

Last modified 14 years ago

#1316 closed defect (fixed)

Generated code may contain names that are reserved in C++

Reported by: sjoelund.se Owned by: sjoelund.se
Priority: high Milestone: Bootstrapping
Component: Instantiation Version:
Keywords: Cc: sjoelund.se, sjoelund.se

Description

For example:
{{{function fn
input Real default;
output Real o:=default;
algorithm
end fn;}}}

This will soon be solved (by preprending _ before variable names in function context) in branches/sjoelund-functiontree (to be merged after Red October).

Change History (3)

comment:1 Changed 14 years ago by adrpo

What do we do about quoted id's in C?

model '$ 75(kg)'
 parameter Real x = 1;
end '$ 75(kg)';

comment:2 Changed 14 years ago by sjoelund.se

We make a new ticket is what we do :)

(We use strings as is, everywhere. It might be easiest to write a traverse-SimCode function that handles this)

comment:3 Changed 14 years ago by adrpo

Agreed. We should only look for ID strings starting with ' and escape them somehow.

Note: See TracTickets for help on using tickets.