mirror of
https://github.com/danog/parser.git
synced 2024-11-30 04:29:13 +01:00
fix: allow self/parent as identifier
This commit is contained in:
parent
72f2588509
commit
d85b682d4f
@ -423,6 +423,8 @@ pub enum Expression {
|
||||
},
|
||||
Identifier(Identifier),
|
||||
Static,
|
||||
Self_,
|
||||
Parent,
|
||||
Array {
|
||||
items: Vec<ArrayItem>,
|
||||
},
|
||||
|
@ -108,6 +108,8 @@ pub fn is_reserved_ident(kind: &TokenKind) -> bool {
|
||||
matches!(
|
||||
kind,
|
||||
TokenKind::Static
|
||||
| TokenKind::Parent
|
||||
| TokenKind::Self_
|
||||
| TokenKind::Abstract
|
||||
| TokenKind::Final
|
||||
| TokenKind::For
|
||||
|
@ -1112,7 +1112,15 @@ impl Parser {
|
||||
TokenKind::Static => {
|
||||
state.next();
|
||||
Expression::Static
|
||||
}
|
||||
},
|
||||
TokenKind::Self_ => {
|
||||
state.next();
|
||||
Expression::Self_
|
||||
},
|
||||
TokenKind::Parent => {
|
||||
state.next();
|
||||
Expression::Parent
|
||||
},
|
||||
TokenKind::LiteralString(s) => {
|
||||
let e = Expression::LiteralString { value: s.clone() };
|
||||
state.next();
|
||||
|
Loading…
Reference in New Issue
Block a user