Skip to content

Commit f4a91af

Browse files
authored
Exclude >, |, , from TOKEN_OTHER
fixes phpstan#45
1 parent 486b638 commit f4a91af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Lexer/Lexer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ private function initialize(): void
153153

154154
self::TOKEN_HORIZONTAL_WS => '[\\x09\\x20]++',
155155

156-
// anything but TOKEN_CLOSE_PHPDOC or TOKEN_HORIZONTAL_WS or TOKEN_EOL
157-
self::TOKEN_OTHER => '(?:(?!\\*/)[^\\s])++',
156+
// anything but TOKEN_CLOSE_PHPDOC or TOKEN_HORIZONTAL_WS or TOKEN_EOL or TOKEN_UNION or TOKEN_CLOSE_ANGLE_BRACKET or TOKEN_COMMA
157+
self::TOKEN_OTHER => '(?:(?!\\*/)[^\\s\\|>,])++',
158158
];
159159

160160
$this->regexp = '~(' . implode(')|(', $patterns) . ')~Asi';

0 commit comments

Comments
 (0)