mirror of
https://github.com/danog/parser.git
synced 2024-11-27 04:14:55 +01:00
lexer: produce increment tokens
This commit is contained in:
parent
129b4f9626
commit
212a46b2ac
@ -604,6 +604,12 @@ impl Lexer {
|
||||
it.next();
|
||||
|
||||
TokenKind::PlusEquals
|
||||
} else if let Some('+') = it.peek() {
|
||||
self.col += 1;
|
||||
|
||||
it.next();
|
||||
|
||||
TokenKind::Increment
|
||||
} else {
|
||||
TokenKind::Plus
|
||||
}
|
||||
|
@ -85,6 +85,7 @@ pub enum TokenKind {
|
||||
Identifier(String),
|
||||
If,
|
||||
Implements,
|
||||
Increment,
|
||||
InlineHtml(String),
|
||||
Int(i64),
|
||||
Interface,
|
||||
@ -215,6 +216,7 @@ impl Display for TokenKind {
|
||||
Self::Identifier(id) => &id[..],
|
||||
Self::If => "if",
|
||||
Self::Implements => "implements",
|
||||
Self::Increment => "++",
|
||||
Self::InlineHtml(_) => "InlineHtml",
|
||||
Self::Int(_) => "int",
|
||||
Self::LeftBrace => "{",
|
||||
|
Loading…
Reference in New Issue
Block a user