File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -545,7 +545,7 @@ impl<'a> Parser<'a> {
545
545
}
546
546
547
547
pub fn parse_ident ( & mut self ) -> PResult < ast:: Ident > {
548
- self . check_strict_keywords ( ) ;
548
+ try! ( self . check_strict_keywords ( ) ) ;
549
549
try!( self . check_reserved_keywords ( ) ) ;
550
550
match self . token {
551
551
token:: Ident ( i, _) => {
@@ -640,13 +640,13 @@ impl<'a> Parser<'a> {
640
640
}
641
641
642
642
/// Signal an error if the given string is a strict keyword
643
- pub fn check_strict_keywords ( & mut self ) {
643
+ pub fn check_strict_keywords ( & mut self ) -> PResult < ( ) > {
644
644
if self . token . is_strict_keyword ( ) {
645
645
let token_str = self . this_token_to_string ( ) ;
646
- let span = self . span ;
647
- self . span_err ( span ,
648
- & format ! ( "expected identifier, found keyword `{}`" ,
649
- token_str ) ) ;
646
+ Err ( self . fatal ( & format ! ( "expected identifier, found keyword `{}`" ,
647
+ token_str ) ) )
648
+ } else {
649
+ Ok ( ( ) )
650
650
}
651
651
}
652
652
You can’t perform that action at this time.
0 commit comments