openroberta-lab
openroberta-lab copied to clipboard
Variable names should be defined properly
This bug needs frontend and backend changes. To Reproduce Steps to reproduce the behavior:
- Click on the + begore the start block on the main page.
- type with two spaces "spacespacefor(int i = 0; i < 10; ++i)" without quotes.
- Press Click anywhere on the screen.
Expected behavior
- Error or warning showing that invalid variable name.
Screenshots
Device information
- Type Desktop
- OS: Catalina 10.15.3
- Browser chrome Version 80.0.3987.149 (Official Build) (64-bit)
Additional context
- The possible workout would be to add a RegEx checker for the variable name, and if the variable name is not following RegEx a warning should be shown.
There are checkers, both on frontend and backend site. I cannot reproduce this behaviour. Will check it on browser stack
Could you please make a screenshot after clicking somewhere else than in the variables name field and put it in here?
The error comes when you click anywhere on the screen.
PS: I have updated that above.
which robot have you chosen?
I have selected the EV3 but it works for other robots as well. It shows up when you directly click on the reload code option in the source code view sidebar.

Thank you very much, now I can reproduce it! Seems that validators in blockly are not triggered, but validators on backend side should catch this
@bjost2s Can you refer to some files where I can find the variable name tester part for this issue? I tried finding some files but could not find the direct link to the variable name checker.
@rishabhdeepsingh, it seems that we do not have a variable name tester at the backend yet. It should be implemented as part of the empty checker, see #306.
Let me know If I can contribute on this one and where.
works