-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
documentImprovements or additions to documentationImprovements or additions to documentation
Description
Description
I was debating making some unit tests for the for statement which covers oddities of it. for instance for(;;show_debug_message("second")){ show_debug_message("first") } will actually cycle and default the conditional statement to true. Secondly the note that an initializer isn't needed, and thirdly the incrementor should be a valid block statement. Though the downside with this is with gmrt it's possible these features are not intended behavior, and they are not syntax valid. So before making a PR I was hoping to get confirmation on which of these are expected syntax.
Much of this information was covered quite well by Katsaii in her Syntax Extension blog post.
Steps To The Task
Initializer:
- [Missing Initializer] Should be valid to be optional, this is only variable declaration and not a valid block statement
- [Single
varInitializer] This is the standardvar i=0, and just a sanity check - [Double
varInitializer] Confirmationvar i=0, j=1;should work. (due notevar i=0; var j=1wont work even if wrapped in brackets)
Condition:
- [Missing Conditional] Should result in a default of
trueevery time
Incrementor:
- [Missing Incrementor] Incrementor statements are optional, and could simply be placed into the block statement
- [Incrementor Block Statement] The incrementor can accept a block statement such as
{ i += 2; j += 1 }.
Block Statement:
- [Empty Block Statement]
for(var i=0; i<j; i++){}valid syntax, howeverfor(var i=0; i<j; i++);is crashing syntax reasonably
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentImprovements or additions to documentationImprovements or additions to documentation