File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -842,7 +842,7 @@ private function makeTokenizeRegexes(): array
842842
843843 return [
844844 Token::TOKEN_TYPE_WHITESPACE => '\s+ ' ,
845- Token::TOKEN_TYPE_COMMENT => '(?:--|#) [^\n]*+ ' ,
845+ Token::TOKEN_TYPE_COMMENT => '(?:--|#(?!>)) [^\n]*+ ' , // #>, #>> and <#> are PostgreSQL operators
846846 Token::TOKEN_TYPE_BLOCK_COMMENT => '/\*(?:[^*]+|\*(?!/))*+(?:\*|$)(?:/|$) ' ,
847847 // 1. backtick quoted string using `` to escape
848848 // 2. square bracket quoted string (SQL Server) using ]] to escape
Original file line number Diff line number Diff line change @@ -1658,6 +1658,20 @@ public static function tokenizeData(): Generator
16581658 ],
16591659 '/* foo... ' ,
16601660 ];
1661+
1662+ yield 'PostgreSQL operator ' => [
1663+ [
1664+ new Token (Token::TOKEN_TYPE_RESERVED_TOPLEVEL , 'select ' ),
1665+ new Token (Token::TOKEN_TYPE_WHITESPACE , ' ' ),
1666+ new Token (Token::TOKEN_TYPE_WORD , 'json ' ),
1667+ new Token (Token::TOKEN_TYPE_WHITESPACE , ' ' ),
1668+ new Token (Token::TOKEN_TYPE_BOUNDARY , '# ' ),
1669+ new Token (Token::TOKEN_TYPE_BOUNDARY , '> ' ),
1670+ new Token (Token::TOKEN_TYPE_WHITESPACE , ' ' ),
1671+ new Token (Token::TOKEN_TYPE_RESERVED , 'null ' ),
1672+ ],
1673+ 'select json #> null ' ,
1674+ ];
16611675 }
16621676
16631677 public function testTokenizeLongConcat (): void
You can’t perform that action at this time.
0 commit comments