File tree Expand file tree Collapse file tree 5 files changed +22
-1
lines changed
Expand file tree Collapse file tree 5 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ TypesList -> {
140140
141141PrimaryType
142142 : ::T_PARENTHESIS_OPEN:: Type() ::T_PARENTHESIS_CLOSE::
143+ | ThisLiteral()
143144 | Literal()
144145 | CallableType()
145146 | NamedType()
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ OptionalCallableParameter -> {
4646
4747NamedCallableParameter -> {
4848 if (\count($children) === 1) {
49+
4950 return $children[0];
5051 }
5152
Original file line number Diff line number Diff line change 1717
1818%token T_NEQ (?i)is\h+not(?![a-zA-Z0-9\-_\x80-\xff])
1919%token T_EQ (?i)is(?![a-zA-Z0-9\-_\x80-\xff])
20+ %token T_THIS \$this\b
2021%token T_VARIABLE \$[a-zA-Z_\x80-\xff][a-zA-Z0-9\-_\x80-\xff]*
2122%token T_NAME_WITH_SPACE [a-zA-Z_\x80-\xff][a-zA-Z0-9\-_\x80-\xff]*\s+?
2223%token T_NAME [a-zA-Z_\x80-\xff][a-zA-Z0-9\-_\x80-\xff]*
2324
2425// Special Chars
2526
27+ %token T_LTE <=
28+ %token T_GTE >=
2629%token T_ANGLE_BRACKET_OPEN <
2730%token T_ANGLE_BRACKET_CLOSE >
2831%token T_PARENTHESIS_OPEN \(
Original file line number Diff line number Diff line change @@ -22,6 +22,13 @@ VariableLiteral -> {
2222 return Node\Literal\VariableLiteralNode::parse($token->getValue());
2323}
2424 : <T_VARIABLE>
25+ | <T_THIS>
26+ ;
27+
28+ ThisLiteral -> {
29+ return Node\Literal\VariableLiteralNode::parse($token->getValue());
30+ }
31+ : <T_THIS>
2532 ;
2633
2734StringLiteral -> { return $this->stringPool[$token] ??= $children; }
Original file line number Diff line number Diff line change @@ -40,7 +40,16 @@ OptionalTernaryExpressionSuffix
4040 ;
4141
4242TernaryExpressionSuffix
43- : (<T_EQ>|<T_NEQ>) (VariableLiteral()| Type() )
43+ : TernaryExpressionOperator() Type()
4444 ::T_QMARK:: Type()
4545 ::T_COLON:: Type()
4646 ;
47+
48+ TernaryExpressionOperator
49+ : <T_EQ>
50+ | <T_NEQ>
51+ | <T_LTE>
52+ | <T_GTE>
53+ | <T_ANGLE_BRACKET_OPEN>
54+ | <T_ANGLE_BRACKET_CLOSE>
55+ ;
You can’t perform that action at this time.
0 commit comments