fn parse_pat_ident(&mut self,
                       binding_mode: ast::BindingMode)
                       -> ast::Pat_ {
        if !is_plain_ident(&self.token) {
            self.span_fatal(self.last_span,
                            "expected identifier, found path");
        }
        // why a path here, and not just an identifier?
        let name = self.parse_path(NoTypesAllowed).path;
        let sub = if self.eat(&token::AT) {
            Some(self.parse_pat())
        } else {
            None
        };

        // just to be friendly, if they write something like
        //   ref Some(i)
        // we end up here with ( as the current token.  This shortly
        // leads to a parse error.  Note that if there is no explicit
        // binding mode then we do not end up here, because the lookahead
        // will direct us over to parse_enum_variant()
        if self.token == token::LPAREN {
            self.span_fatal(
                self.last_span,
                "expected identifier, found enum pattern");
        }

        PatIdent(binding_mode, name, sub)
    }
// parse ident or ident @ pat
// used by the copy foo and ref foo patterns to give a good
// error message when parsing mistakes like ref foo(a,b)
parse ident or ident @ pat
used by the copy foo and ref foo patterns to give a good
error message when parsing mistakes like ref foo(a,b)
parse ident or ident @ pat used by the copy foo and ref foo patterns to give a good error message when parsing mistakes like ref foo ( a b )
fn parse_pat_ident(&mut self,
                       binding_mode: ast::BindingMode)
                       -> ast::Pat_ {
        if !is_plain_ident(&self.token) {
            self.span_fatal(self.last_span,
                            "expected identifier, found path");
        }
        // why a path here, and not just an identifier?
        let name = self.parse_path(NoTypesAllowed).path;
        let sub = if self.eat(&token::AT) {
            Some(self.parse_pat())
        } else {
            None
        };
        // just to be friendly, if they write something like
        //   ref Some(i)
        // we end up here with ( as the current token.  This shortly
        // leads to a parse error.  Note that if there is no explicit
        // binding mode then we do not end up here, because the lookahead
        // will direct us over to parse_enum_variant()
        if self.token == token::LPAREN {
            self.span_fatal(
                self.last_span,
                "expected identifier, found enum pattern");
        }
        PatIdent(binding_mode, name, sub)
    }
fn parse_pat_ident ( & mut self , binding_mode : ast :: BindingMode ) -> ast :: Pat_ { if ! is_plain_ident ( & self . token ) { self . span_fatal ( self . last_span , " " ) ; } // why a path here, and not just an identifier? let name = self . parse_path ( NoTypesAllowed ) . path ; let sub = if self . eat ( & token :: AT ) { Some ( self . parse_pat ( ) ) } else { None } ; // just to be friendly, if they write something like //   ref Some(i) // we end up here with ( as the current token.  This shortly // leads to a parse error.  Note that if there is no explicit // binding mode then we do not end up here, because the lookahead // will direct us over to parse_enum_variant() if self . token == token :: LPAREN { self . span_fatal ( self . last_span , " " ) ; } PatIdent ( binding_mode , name , sub ) }
parse ident or ident @ pat
used by the copy foo and ref foo patterns to give a good
error message when parsing mistakes like ref foo(a,b)
parse ident or ident @ pat used by the copy foo and ref foo patterns to give a good error message when parsing mistakes like ref foo ( a b )
&mut self
binding_mode
ast::BindingMode
&mut self
binding_mode
ast::BindingMode