Allow comments in code segments
Currently, it is not possible to write any comments in the code segments (of AF3 components). However, it would significantly improve the readability and understanding of such code segments, if you could add at least new lines which will not be transformed into execution code but are visible in the code segment editor in AF3 (e.g., indicated with '//' like Java comments).
Test procedure:
- Create an AF3 project with a component architecture and a component with a code specification (preferably add also some inputs, outputs, and functions)
- Go into the code specification and create normal code (port definitions, if-else, function calls)
- Now add also comments where you want. At the beginning, you need
/*
and at the end*/
- Everything in between will be recognized as comment (try out also symbols, etc.). The code should be highlighted as italic green
- Commenting also works across several lines. If you go into a new line, the highlighter will not directly recognize this, because the damage field that is forwarded to the scanner is always only the changed line. However, the comment still works, and if you close the editor and reopen it, the highlighting is also correct again for all multi-line comments
- If you have added some comments (maybe also "comment out" some actual code lines), close everything and then open everything again to see if the comments are still as wanted
- In addition, you should also check the internal simulator, the C code generator, the Java generator, and the FMU generator. They should all work with the component including the comments. They should behave as if the comments were not there but their source code should also have the correct comment lines
Edited by Sebastian Bergemann