UoY-RoboStar / robocert-textual

Textual plugin and CSP generator for RoboCert
Eclipse Public License 2.0
2 stars 0 forks source link

Consider `as N` notation for named loops #50

Closed MattWindsor91 closed 2 years ago

MattWindsor91 commented 3 years ago

The syntax loop X: BOUND is clunky, especially with regards to the fact that it can sometimes safely have the : removed. I wonder if a more natural syntax might be loop BOUND as X:

loop {}
loop as L {}
loop forever {}
loop forever as L {}

This works nicely, but then the question appears of how we get a consistent syntax between this and other things. Maybe ...as X for optionally named things and X: for named things. Unsure.

MattWindsor91 commented 2 years ago

Fixed an alternative way, by using the solution to #74 to get rid of the :. We do still have a bit of a difficulty whereby there's inconsistency with loop N (xyz) { abc } and assertion N: abc, but maybe that's ok because the { implies the same sort of 'this is the body coming' that : does.