mirror of
https://github.com/danog/parser.git
synced 2025-01-22 13:01:32 +01:00
lexer: produce nullsafe -> tokens
This commit is contained in:
parent
529bc6f40f
commit
489cb0e884
@ -229,6 +229,10 @@ impl Lexer {
|
||||
self.col += 1;
|
||||
self.next();
|
||||
TokenKind::QuestionColon
|
||||
} else if self.try_read("->") {
|
||||
self.col += 1;
|
||||
self.skip(3);
|
||||
TokenKind::NullsafeArrow
|
||||
} else {
|
||||
TokenKind::Question
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ pub enum TokenKind {
|
||||
Array,
|
||||
ArrayCast,
|
||||
Arrow,
|
||||
NullsafeArrow,
|
||||
As,
|
||||
Asterisk,
|
||||
Attribute,
|
||||
@ -162,6 +163,7 @@ impl Display for TokenKind {
|
||||
Self::And => "&&",
|
||||
Self::AndEqual => "&=",
|
||||
Self::Arrow => "->",
|
||||
Self::NullsafeArrow => "?->",
|
||||
Self::Array => "array",
|
||||
Self::ArrayCast => "(array)",
|
||||
Self::As => "as",
|
||||
|
Loading…
x
Reference in New Issue
Block a user