Skip to content

Fix the comments for libsyntax::parse::parser::parse_sugary_call_expr #10792

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

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2530,22 +2530,22 @@ impl Parser {
}


// parse a 'for' or 'do'.
// the 'for' and 'do' expressions parse as calls, but look like
// function calls followed by a closure expression.
// parse a 'do'.
// the 'do' expression parses as a call, but looks like
// a function call followed by a closure expression.
pub fn parse_sugary_call_expr(&self,
lo: BytePos,
keyword: ~str,
sugar: CallSugar,
ctor: |v: @Expr| -> Expr_)
-> @Expr {
// Parse the callee `foo` in
// for foo || {
// for foo.bar || {
// do foo || {
// do foo.bar || {
// etc, or the portion of the call expression before the lambda in
// for foo() || {
// do foo() || {
// or
// for foo.bar(a) || {
// do foo.bar(a) || {
// Turn on the restriction to stop at | or || so we can parse
// them as the lambda arguments
let e = self.parse_expr_res(RESTRICT_NO_BAR_OR_DOUBLEBAR_OP);
Expand Down Expand Up @@ -2592,7 +2592,7 @@ impl Parser {
}
_ => {
// There may be other types of expressions that can
// represent the callee in `for` and `do` expressions
// represent the callee in `do` expressions
// but they aren't represented by tests
debug!("sugary call on {:?}", e.node);
self.span_fatal(
Expand Down