#715 JavaScript/HTML codegen: fix function parameter and local variable references
- Best to review per commit.
- Function JS/HTML code generation changes that are the main scope of this merge request:
- Improved exception message.
- Use single quotes for strings in generated JS code.
- No compile errors for unreachable statements in JS code, unlike Java.
- Various changes for references, reading variables, writing variables, etc.
- Other non-JS/HTML-specific changes (not end user visible for the other target languages):
- No more references to commented out code to
readOnly
fromVariableInformation
, as that field doesn't exist. - Removed
VariableInformation.isReference
, as only assigned, copied, etc, but never read. - Proper and consistent marking of temporary variables.
- Renamed
VariableInformation.targetName
totargetRef
. - Renamed
CodeGen.getTargetName
togetTargetRef
. - Implement target variable name logic in
getTargetVariableName
instead of ingetTargetRef
. The reference should default to the name, not the other way around. Then also Simulink code generation does not need to overridegetTargetVariableName
anymore. - Renamed
SimulinkCodeGen.simulinkTargetNameMap
tosimulinkTargetRefMap
. - Renamed
SimulinkCodeGen.setupVarmaps
tosetupVarMaps
. - Some other renaming etc, for consistency.
- Add
CodeGen.getPrefix()
and use it inCodeGen
.
- No more references to commented out code to
Addresses #715