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: Martin Sjölund Owned by: Martin Sjölund
Priority: high Milestone: Bootstrapping
Component: Instantiation Version:
Keywords: Cc: Martin Sjölund, Martin Sjölund

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 by Adrian Pop, 14 years ago

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

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

comment:2 by Martin Sjölund, 14 years ago

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 by Adrian Pop, 14 years ago

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

Note: See TracTickets for help on using tickets.