Skip to content

Commit c00837e

Browse files
committed
Fix the comments for libsyntax::parse::parser::parse_sugary_call_expr
The comments on this function date back from when it was used for `for` expressions in addition to `do` expressions.
1 parent c8b60a2 commit c00837e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Diff for: src/libsyntax/parse/parser.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -2530,22 +2530,22 @@ impl Parser {
25302530
}
25312531

25322532

2533-
// parse a 'for' or 'do'.
2534-
// the 'for' and 'do' expressions parse as calls, but look like
2535-
// function calls followed by a closure expression.
2533+
// parse a 'do'.
2534+
// the 'do' expression parses as a call, but looks like
2535+
// a function call followed by a closure expression.
25362536
pub fn parse_sugary_call_expr(&self,
25372537
lo: BytePos,
25382538
keyword: ~str,
25392539
sugar: CallSugar,
25402540
ctor: |v: @Expr| -> Expr_)
25412541
-> @Expr {
25422542
// Parse the callee `foo` in
2543-
// for foo || {
2544-
// for foo.bar || {
2543+
// do foo || {
2544+
// do foo.bar || {
25452545
// etc, or the portion of the call expression before the lambda in
2546-
// for foo() || {
2546+
// do foo() || {
25472547
// or
2548-
// for foo.bar(a) || {
2548+
// do foo.bar(a) || {
25492549
// Turn on the restriction to stop at | or || so we can parse
25502550
// them as the lambda arguments
25512551
let e = self.parse_expr_res(RESTRICT_NO_BAR_OR_DOUBLEBAR_OP);
@@ -2592,7 +2592,7 @@ impl Parser {
25922592
}
25932593
_ => {
25942594
// There may be other types of expressions that can
2595-
// represent the callee in `for` and `do` expressions
2595+
// represent the callee in `do` expressions
25962596
// but they aren't represented by tests
25972597
debug!("sugary call on {:?}", e.node);
25982598
self.span_fatal(

0 commit comments

Comments
 (0)