Skip to content
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

Update Token::can_begin_expr() to make it consistent with the grammar: #20901

Merged
merged 2 commits into from
Jan 18, 2015

Conversation

dgrunwald
Copy link
Contributor

  • add Token::AndAnd (double borrow)
  • add Token::DotDot (range notation)
  • remove Token::Pound and Token::At

This fixes a syntax error when parsing fn f() -> RangeTo<i32> { return ..1; }.

Also, remove fn_expr_lookahead.
It's from the fn~ days and seems to no longer be necessary.

 * add Token::AndAnd (double borrow)
 * add Token::DotDot (range notation)
 * remove Token::Pound and Token::At

Fixes a syntax error when parsing "fn f() -> RangeTo<i32> { return ..1; }".

Also, remove "fn_expr_lookahead".
It's from the fn~ days and seems to no longer be necessary.
@rust-highfive
Copy link
Collaborator

r? @sfackler

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member

Would it be possible to add regression tests for the added cases as well?

@dgrunwald
Copy link
Contributor Author

I added a test case for range notation.
The test case for double-borrow would be

fn f() -> &'static &'static i32 {
   return &&1;
}

but that's currently a lifetime error (but I think @eddyb wants to change that).

bors added a commit that referenced this pull request Jan 18, 2015
…sanxiyn

 * add `Token::AndAnd` (double borrow)
 * add `Token::DotDot` (range notation)
 * remove `Token::Pound` and `Token::At`

This fixes a syntax error when parsing `fn f() -> RangeTo<i32> { return ..1; }`.

Also, remove `fn_expr_lookahead`.
It's from the `fn~` days and seems to no longer be necessary.
@bors bors merged commit ca8578a into rust-lang:master Jan 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants