Remove char.is_identifier_single()
This commit is contained in:
parent
af73947ffd
commit
0675f17e32
3 changed files with 2 additions and 10 deletions
|
@ -15,7 +15,6 @@ pub trait Lexable {
|
|||
|
||||
fn is_identifier_initial(&self) -> bool;
|
||||
fn is_identifier_subsequent(&self) -> bool;
|
||||
fn is_identifier_single(&self) -> bool;
|
||||
fn is_identifier_delimiter(&self) -> bool;
|
||||
|
||||
fn is_boolean_true(&self) -> bool;
|
||||
|
@ -73,10 +72,6 @@ impl Lexable for char {
|
|||
charset::identifier_subsequents().contains(&self)
|
||||
}
|
||||
|
||||
fn is_identifier_single(&self) -> bool {
|
||||
charset::identifier_singles().contains(&self)
|
||||
}
|
||||
|
||||
fn is_identifier_delimiter(&self) -> bool {
|
||||
self.is_whitespace()
|
||||
|| self.is_comment_initial()
|
||||
|
|
|
@ -41,7 +41,3 @@ pub fn identifier_subsequents() -> CharSet {
|
|||
subsequents.extend(extras.iter());
|
||||
subsequents
|
||||
}
|
||||
|
||||
pub fn identifier_singles() -> CharSet {
|
||||
CharSet::from_iter("+-".chars())
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ mod str;
|
|||
use self::char::Lexable;
|
||||
use self::number::NumberBuilder;
|
||||
use self::number::Radix;
|
||||
use self::number::Sign;
|
||||
use self::str::CharAt;
|
||||
use self::str::RelativeIndexable;
|
||||
use self::token::Lex;
|
||||
|
@ -110,7 +111,7 @@ impl Lexer {
|
|||
self.advance();
|
||||
}
|
||||
|
||||
else if c.is_identifier_single() {
|
||||
else if let Some(sign) = Sign::from_char(c) {
|
||||
*token = Some(Token::Identifier(c.to_string()));
|
||||
}
|
||||
else if c.is_identifier_initial() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue