OpenRoberta / openroberta-lab

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.
Apache License 2.0
124 stars 121 forks source link

Issue 1598: fixes python codegeneration comment block bug #1602

Closed PamoCurtis closed 7 months ago

PamoCurtis commented 9 months ago

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

bjost2s commented 7 months ago

accepted with https://github.com/OpenRoberta/openroberta-lab/commit/c96962dbe69bed166ba4f52148d4452c7d8ec614