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
The Reserved library contains keywords For, While, Break, Continue, End, If, Else, Elif, Else If, and Return. Using them fails with a message telling that the keyword name is reserved and some keywords also instruct how to use the actual FOR, IF, etc. syntax.
We added the library ages ago to avoid problems if new syntax is added. Now all the syntax there (and more!) has been added so there's no need to reserve anything. When we added IF in RF 4.0, we also made a decision to require all this kind of syntax to be upper case. That makes it mostly unnecessary to reserve possible new syntax because even if we'd add something like CASE, there would be no problem using keyword Case.
When this library is removed, using a keyword like Continue will continue to fail, but the error message changes from 'Continue' is a reserved keyword. to No keyword with name 'Continue' found.. With keywords containing usage instructions, like If that currently fails like 'If' is a reserved keyword. It must be an upper case 'IF' when used as a marker., the new error isn't as informative as earlier. I would say we can nowadays expect users to know that this kind of syntax must be upper case so this isn't a big deal. If we were to report such errors to users, we should detect them already at parsing time anyway to make errors easily available for IDEs and other tools using Robot's parsing modules.
A benefit of removing the Reserved library is that in some contexts the current custom error message is pretty confusing. For a concrete example, see #4297.
The text was updated successfully, but these errors were encountered:
This issue doesn't affect using IF at all. It's recognized as a control structure already by the parser and never considered a keyword. If you use If (not all caps), the error message will change as explained above. If you happen to actually have your own keyword with name If, using it will work exactly as earlier.
The Reserved library contains keywords
For
,While
,Break
,Continue
,End
,If
,Else
,Elif
,Else If
, andReturn
. Using them fails with a message telling that the keyword name is reserved and some keywords also instruct how to use the actualFOR
,IF
, etc. syntax.We added the library ages ago to avoid problems if new syntax is added. Now all the syntax there (and more!) has been added so there's no need to reserve anything. When we added
IF
in RF 4.0, we also made a decision to require all this kind of syntax to be upper case. That makes it mostly unnecessary to reserve possible new syntax because even if we'd add something likeCASE
, there would be no problem using keywordCase
.When this library is removed, using a keyword like
Continue
will continue to fail, but the error message changes from'Continue' is a reserved keyword.
toNo keyword with name 'Continue' found.
. With keywords containing usage instructions, likeIf
that currently fails like'If' is a reserved keyword. It must be an upper case 'IF' when used as a marker.
, the new error isn't as informative as earlier. I would say we can nowadays expect users to know that this kind of syntax must be upper case so this isn't a big deal. If we were to report such errors to users, we should detect them already at parsing time anyway to make errors easily available for IDEs and other tools using Robot's parsing modules.A benefit of removing the Reserved library is that in some contexts the current custom error message is pretty confusing. For a concrete example, see #4297.
The text was updated successfully, but these errors were encountered: