-
Notifications
You must be signed in to change notification settings - Fork 501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loops grammar #139
Loops grammar #139
Conversation
src/expressions/loop-expr.md
Outdated
A `while let` loop is semantically similar to a `while` loop but in place of a | ||
condition expression it expects the keyword `let` followed by a refutable | ||
pattern, an `=` and an expression. If the value of the expression on the right | ||
pattern, an `=` and a block expression. If the value of the expression on the right |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...an =
, an expression and a block expression.
src/expressions/loop-expr.md
Outdated
@@ -44,10 +67,15 @@ while i < 10 { | |||
|
|||
## `while let` loops | |||
|
|||
> **<sup>Syntax</sup>** | |||
> [_WhileLetExpression_] : | |||
> `while` `let` _Pattern_ `=` [_Expression_]<sub>except struct expression</sub> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the other loop expressions are named after what they do. So shouldn't this one be called PredicatePatternLoopExpression
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -61,6 +89,11 @@ while let Some(y) = x.pop() { | |||
|
|||
## Iterator loops | |||
|
|||
> **<sup>Syntax</sup>** | |||
> _IteratorLoopExpression_ : | |||
> `for` _Pattern_ `in` [_Expression_]<sub>except struct expression</sub> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like if
, we probably want to link to struct expressions here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still deciding how I'll do this (the "no struct expression" thing) to make it clear. But yeah, I agree a link to it will be needed.
e02b4da
to
413fe21
Compare
💟 Thanks! |
Part of #84.