The programming environment »Open Roberta Lab« by Fraunhofer IAIS enables children and adolescents to program robots. A variety of different programming blocks are provided to program motors and sensors of the robot. Open Roberta Lab uses an approach of graphical programming so that beginners can seamlessly start coding. As a cloud-based application, the platform can be used without prior installation of specific software but runs in any popular browser, independent of operating system and device.
This PR fixes the issue, that it was possible to generate faulty code by adding an escape char "\n" in the comment block.
Removing the method visitStmtTextComment in the MicrobitPythonVisitor class which did not sanitize the input for escape characters fixes the issue, since the original visitStmtTextComment in the AbstractPythonVisitor is already sanitizing it properly.
Type of change
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update
How Has This Been Tested?
Run ReuseIntegrationTestsAsUnitTests
Imported Microbit/Robotino file into the lab which contains the problematic block with escape characters
Description
This PR fixes the issue, that it was possible to generate faulty code by adding an escape char "\n" in the comment block. Removing the method visitStmtTextComment in the MicrobitPythonVisitor class which did not sanitize the input for escape characters fixes the issue, since the original visitStmtTextComment in the AbstractPythonVisitor is already sanitizing it properly.
Type of change
How Has This Been Tested?
Run ReuseIntegrationTestsAsUnitTests Imported Microbit/Robotino file into the lab which contains the problematic block with escape characters