1
Fork 0

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.
This commit is contained in:
Kevin Ballard 2013-12-03 16:55:00 -08:00
parent c8b60a2d9e
commit c00837e90a

View file

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