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
Two highly related enhancement ideas to for loops:
Don't require a colon as a marker like :FOR but instead require both FOR and IN to be all upper case.
Support the pipe character as a block marker instead of a backslash.
Together these enhancements would allow writing current
*** Keywords ***
Example
:FOR ${x} IN @{STUFF}
\ Keyword ${x}
\ Another keyword
like
*** Keywords ***
Example
FOR ${x} IN @{STUFF}
| Keyword ${x}
| Another keyword
This is especially nice if we later add support for other programmatic structures like IF/ELSE. Compare
*** Keywords ***
Example
:FOR ${x} IN @{STUFF}
\ Keyword ${x}
\ :IF ${x} > 42
\ \ Another keyword
\ \ Yet another keyword
\ :ELSE
\ \ Keyword here too
\ One keyword more ${x}
with
*** Keywords ***
Example
FOR ${x} IN @{STUFF}
| Keyword ${x}
| IF ${x} > 42
| | Another keyword
| | Yet another keyword
| ELSE
| | Keyword here too
| One keyword more ${x}
UPDATE: This issue was just ideas and brainstorming. These concrete issues were submitted based on the discussion here:
Notice that at the moment this issue is just in idea, not a concrete proposal. Removal of : from :FOR sounds like a good idea, but how to handle blocks when using the normal plain text format (i.e. not the pipe separated format) is still totally open.
One possibility would be using significant whitespace like in Python:
*** Keywords ***
Example
FOR ${x} IN @{STUFF}
Keyword ${x}
IF ${x} > 42
Another keyword
Yet another keyword
ELSE
Keyword here too
One keyword more ${x}
but that's likely to cause backwards incompatibility problems.
Another solution would be closing blocks with END like in Ruby:
*** Keywords ***
Example
FOR ${x} IN @{STUFF}
Keyword ${x}
IF ${x} > 42
Another keyword
Yet another keyword
ELSE
Keyword here too
END
One keyword more ${x}
END
#2990 covers using just FOR (case-sensitive) as a marker and #2991 deprecates using IN, IN RANGE, and friends case- and space-insensitively. Both of them are targeted for RF 3.1.
How to handle blocks is still open, but the pipe idea doesn't sound too good anymore. A separate and more concrete issue will be submitted about that later.
Activity
adam-wypych commentedon Mar 28, 2018
Is it will be only supported in TSV and TXT/ROBOT with no
|pipe separated format?pekkaklarck commentedon Mar 28, 2018
You don't get this same problem when using the pipe separate format as you can just use
and don't need such escaping at all.
UPDATE: Explicit
ENDmarker will be required also in this case. See #3009 for details.pekkaklarck commentedon Mar 28, 2018
Notice that at the moment this issue is just in idea, not a concrete proposal. Removal of
:from:FORsounds like a good idea, but how to handle blocks when using the normal plain text format (i.e. not the pipe separated format) is still totally open.One possibility would be using significant whitespace like in Python:
but that's likely to cause backwards incompatibility problems.
Another solution would be closing blocks with
ENDlike in Ruby:adam-wypych commentedon Mar 28, 2018
Thanks @pekkaklarck for clarification, so this syntax is only for not pipe separated format.
basic-settings commentedon Jul 5, 2018
I'm really liking the
ENDidea more than pipe separation.pekkaklarck commentedon Oct 16, 2018
#2990 covers using just
FOR(case-sensitive) as a marker and #2991 deprecates usingIN,IN RANGE, and friends case- and space-insensitively. Both of them are targeted for RF 3.1.How to handle blocks is still open, but the pipe idea doesn't sound too good anymore. A separate and more concrete issue will be submitted about that later.
pekkaklarck commentedon Nov 21, 2018
We decided to go with the
ENDat the end. See #3009 for more information.