File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -121,9 +121,7 @@ public function parseType(): ?Node\SuperiorTypeNode
121121 */
122122 public function tryConsumeSeparatedToken (string ...$ kind ): ?Token
123123 {
124- $ token = $ this ->stream ->peek ();
125- return $ token ->is (...$ kind ) // is followed by whitespace
126- && $ this ->stream ->peek (1 )->position ->offset > $ token ->position ->offset + strlen ($ token ->text )
124+ return $ this ->stream ->is (...$ kind ) && $ this ->isFollowedByWhitespace ()
127125 ? $ this ->stream ->consume ()
128126 : null ;
129127 }
@@ -135,6 +133,13 @@ public function isEnd(): bool
135133 }
136134
137135
136+ public function isFollowedByWhitespace (): bool
137+ {
138+ $ token = $ this ->stream ->peek ();
139+ return $ this ->stream ->peek (1 )->position ->offset > $ token ->position ->offset + strlen ($ token ->text );
140+ }
141+
142+
138143 /** @throws Latte\CompileException */
139144 private function parse (string $ schema , bool $ recovery = false ): mixed
140145 {
You can’t perform that action at this time.
0 commit comments