File tree Expand file tree Collapse file tree 4 files changed +5
-47
lines changed
Expand file tree Collapse file tree 4 files changed +5
-47
lines changed Original file line number Diff line number Diff line change 11Type
22 ::= Atomic (Union | Intersection )?
3- | Complement
43
54Union
65 ::= (' |' Atomic )+
76
87Intersection
98 ::= (' &' Atomic )+
109
11- Complement
12- ::= ' ~' Atomic
13-
1410Atomic
1511 ::= Identifier (Generic | Array )?
1612 | ' (' Type ' )' Array ?
Original file line number Diff line number Diff line change 11Type
22 = Atomic (Union / Intersection)?
3- / Complement
43
54Union
65 = ('|' Atomic)+
76
87Intersection
98 = ('&' Atomic)+
109
11- Complement
12- = '~' Atomic
13-
1410Atomic
1511 = Identifier (Generic / Array)?
1612 / '(' Type ')' Array?
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -67,18 +67,13 @@ private function tearDown(): void
6767
6868 private function parseType (): Ast \Node
6969 {
70- if ($ this ->tokenType === Lexer::TOKEN_COMPLEMENT ) {
71- $ type = $ this ->parseComplement ();
70+ $ type = $ this ->parseAtomic ();
7271
73- } else {
74- $ type = $ this ->parseAtomic ();
75-
76- if ($ this ->tokenType === Lexer::TOKEN_UNION ) {
77- $ type = $ this ->parseUnion ($ type );
72+ if ($ this ->tokenType === Lexer::TOKEN_UNION ) {
73+ $ type = $ this ->parseUnion ($ type );
7874
79- } elseif ($ this ->tokenType === Lexer::TOKEN_INTERSECTION ) {
80- $ type = $ this ->parseIntersection ($ type );
81- }
75+ } elseif ($ this ->tokenType === Lexer::TOKEN_INTERSECTION ) {
76+ $ type = $ this ->parseIntersection ($ type );
8277 }
8378
8479 return $ type ;
@@ -140,13 +135,6 @@ private function parseIntersection(Ast\Node $type): Ast\Node
140135 }
141136
142137
143- private function parseComplement (): Ast \Node
144- {
145- $ this ->consume (Lexer::TOKEN_COMPLEMENT );
146- return new Ast \ComplementNode ($ this ->parseAtomic ());
147- }
148-
149-
150138 private function parseGeneric (Ast \SimpleNode $ baseType ): Ast \Node
151139 {
152140 $ this ->consume (Lexer::TOKEN_OPEN_ANGLE_BRACKET );
You can’t perform that action at this time.
0 commit comments