Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Mar 9, 2019
1 parent 0a505a7 commit f690821
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/libsyntax/parse/lexer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1451,11 +1451,10 @@ impl<'a> StringReader<'a> {
self.err_span_(
start_with_quote,
self.pos,
"lifetimes can't start with a number",
"lifetimes cannot start with a number",
);
}


return Ok(token::Lifetime(ident));
}

Expand Down Expand Up @@ -1892,7 +1891,7 @@ fn ident_start(c: Option<char>) -> bool {
None => return false,
};

(c.is_alphabetic() || c == '_' || (c > '\x7f' && c.is_xid_start()))
(c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_' || (c > '\x7f' && c.is_xid_start())
}

fn ident_continue(c: Option<char>) -> bool {
Expand All @@ -1901,7 +1900,8 @@ fn ident_continue(c: Option<char>) -> bool {
None => return false,
};

(c.is_alphabetic() || c.is_numeric() || c == '_' || (c > '\x7f' && c.is_xid_continue()))
(c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '_' ||
(c > '\x7f' && c.is_xid_continue())
}

#[inline]
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/parser/numeric-lifetime.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
struct S<'1> { s: &'1 usize }
//~^ ERROR lifetimes can't start with a number
//~| ERROR lifetimes can't start with a number
//~^ ERROR lifetimes cannot start with a number
//~| ERROR lifetimes cannot start with a number
fn main() {
// verify that the parse error doesn't stop type checking
let x: usize = "";
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/parser/numeric-lifetime.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: lifetimes can't start with a number
error: lifetimes cannot start with a number
--> $DIR/numeric-lifetime.rs:1:10
|
LL | struct S<'1> { s: &'1 usize }
| ^^

error: lifetimes can't start with a number
error: lifetimes cannot start with a number
--> $DIR/numeric-lifetime.rs:1:20
|
LL | struct S<'1> { s: &'1 usize }
Expand Down

0 comments on commit f690821

Please sign in to comment.