libsyntax: Stop parsing bare functions in preparation for switching them over
This commit is contained in:
parent
d18f785457
commit
bd2d17e4a1
8 changed files with 40 additions and 9 deletions
|
@ -76,7 +76,11 @@ use parse::obsolete::{ObsoleteUnsafeBlock, ObsoleteImplSyntax};
|
|||
use parse::obsolete::{ObsoleteTraitBoundSeparator, ObsoleteMutOwnedPointer};
|
||||
use parse::obsolete::{ObsoleteMutVector, ObsoleteTraitImplVisibility};
|
||||
use parse::obsolete::{ObsoleteRecordType, ObsoleteRecordPattern};
|
||||
<<<<<<< HEAD
|
||||
use parse::obsolete::{ObsoleteAssertion, ObsoletePostFnTySigil};
|
||||
=======
|
||||
use parse::obsolete::{ObsoleteAssertion, ObsoleteBareFnType};
|
||||
>>>>>>> libsyntax: Stop parsing bare functions in preparation for switching them over
|
||||
use parse::prec::{as_prec, token_to_binop};
|
||||
use parse::token::{can_begin_expr, is_ident, is_ident_or_path};
|
||||
use parse::token::{is_plain_ident, INTERPOLATED, special_idents};
|
||||
|
@ -647,8 +651,14 @@ pub impl Parser {
|
|||
} else if self.eat_keyword(&~"extern") {
|
||||
self.parse_ty_bare_fn()
|
||||
} else if self.token_is_closure_keyword(© *self.token) {
|
||||
<<<<<<< HEAD
|
||||
// self.warn(fmt!("Old-school closure keyword"));
|
||||
self.parse_ty_closure(ast::BorrowedSigil, None)
|
||||
=======
|
||||
let result = self.parse_ty_closure(None, None);
|
||||
self.obsolete(*self.last_span, ObsoleteBareFnType);
|
||||
result
|
||||
>>>>>>> libsyntax: Stop parsing bare functions in preparation for switching them over
|
||||
} else if *self.token == token::MOD_SEP
|
||||
|| is_ident_or_path(&*self.token) {
|
||||
let path = self.parse_path_with_tps(colons_before_params);
|
||||
|
@ -2813,7 +2823,7 @@ pub impl Parser {
|
|||
fn parse_fn_decl_with_self(
|
||||
&self,
|
||||
parse_arg_fn:
|
||||
fn(&Parser) -> arg_or_capture_item
|
||||
&fn(&Parser) -> arg_or_capture_item
|
||||
) -> (self_ty, fn_decl) {
|
||||
fn maybe_parse_self_ty(
|
||||
cnstr: &fn(+v: mutability) -> ast::self_ty_,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue