You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using a Python-Robot, initializing a variable with the help of a function that needs a generated helper function the program will crash. One of these functions is the isPrime function.
To Reproduce
Steps to reproduce the behavior:
Select a Python-Robot here Lego Spike
Add global Variable to NEPO-Program
Add isPrime with any number as input here 3 as Initiatal value
Add a show text on LED Matrix with the created variable
Upload the Program to the Robot
See error
Expected behavior
"True" will be shows by the LED-Matrix.
Screenshots
Reason for behaviour
___item = ___isPrime(3) will be called before the ___isPrime() method was visitied by the python interpreted.
Additional context
To check weather or not a function is a generated Helper Function check the Source Code of the NEPO-program.
Device Information
Device Laptop
OS:Linux
Browser Chrome
The text was updated successfully, but these errors were encountered:
I have created a potential fix for this problem at feature/Issue1650. This fix includes creating logical sections for the process of generating source code. In addition to the generate prefix method, methods such as generateImport, generateHelperMethods, .... will be added. This can be used to more easyly stucture the Program generate into different Parts. The Abstract logic on how a specific language will generate Code will be moved as far up the inheritance structure as Possible. Idealy every Programming Language will only once define this generation process.
So far this change has only been done for the Python-Code-Generation, all other Visitors have been kept unchanged.
These adjustments also resulted in changes to Code generation that does not directly affect this, since the more unified approach also results in a more unified generation of empty lines , spacing.
It has been suggested to also adjust the other Visitors, although they do not suffer from this bug. It would still be nice to introduce this more structured approach for the code generation.
TODO:
Abstract-Language-Visitor
Python-Visitors
Python Test-Cases & Python-Common-Tests
Exemplary Restructuring
Refine Restructuring
CPP-Visitors
Cpp-Tests
Aseba-Visitors
Aseba-Tests
Java-Visitors
Java-Tests
Common-Tests
Instructions on how this process might look like have been anotated with "//TODO 1650 ..." as comments in the source code.
These Additional changes should be Moved to a new Issues altogether.
Describe the bug
When using a Python-Robot, initializing a variable with the help of a function that needs a generated helper function the program will crash. One of these functions is the isPrime function.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
"True" will be shows by the LED-Matrix.
Screenshots
Reason for behaviour
___item = ___isPrime(3) will be called before the ___isPrime() method was visitied by the python interpreted.
Additional context
To check weather or not a function is a generated Helper Function check the Source Code of the NEPO-program.
Device Information
The text was updated successfully, but these errors were encountered: