Skip to content

Commit 0ecd5c0

Browse files
committed
Treat ~* as operator
1 parent c11d07b commit 0ecd5c0

7 files changed

Lines changed: 16 additions & 0 deletions

File tree

src/Tokenizer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,7 @@ final class Tokenizer
743743
'>',
744744
'+',
745745
'-',
746+
'~*', // https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-POSIX-REGEXP
746747
'*',
747748
'/',
748749
'!',

tests/clihighlight.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,3 +1211,6 @@ MY_NON_TOP_LEVEL_KEYWORD_FX_3();
12111211
---
12121212
SELECT
12131213
vector1 <#> vector2
1214+
---
1215+
SELECT
1216+
text ~* '\w+'

tests/compress.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,5 @@ CREATE TABLE t (c VARCHAR(20)) DEFAULT CHARACTER SET utf8mb4 ENGINE = InnoDB
115115
SELECT '{}'::json #> '{}'
116116
---
117117
SELECT vector1 <#> vector2
118+
---
119+
SELECT text ~* '\w+'

tests/format-highlight.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,3 +1211,6 @@
12111211
---
12121212
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">SELECT</span>
12131213
<span style="color: #333;">vector1</span> <span >&lt;</span><span >#</span><span >&gt;</span> <span style="color: #333;">vector2</span></pre>
1214+
---
1215+
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">SELECT</span>
1216+
<span style="color: #333;">text</span> <span >~*</span> <span style="color: blue;">'\w+'</span></pre>

tests/format.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,3 +1209,6 @@ SELECT
12091209
---
12101210
SELECT
12111211
vector1 <#> vector2
1212+
---
1213+
SELECT
1214+
text ~* '\w+'

tests/highlight.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,3 +429,5 @@
429429
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">SELECT</span> <span style="color: blue;">'{}'</span><span >::</span><span style="color: #333;">json</span> <span >#</span><span >&gt;</span> <span style="color: blue;">'{}'</span></pre>
430430
---
431431
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">SELECT</span> <span style="color: #333;">vector1</span> <span >&lt;</span><span >#</span><span >&gt;</span> <span style="color: #333;">vector2</span></pre>
432+
---
433+
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">SELECT</span> <span style="color: #333;">text</span> <span >~*</span> <span style="color: blue;">'\w+'</span></pre>

tests/sql.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,3 +429,5 @@ CREATE TABLE t (c VARCHAR(20)) DEFAULT CHARACTER SET utf8mb4 ENGINE = InnoDB
429429
SELECT '{}'::json #> '{}'
430430
---
431431
SELECT vector1 <#> vector2
432+
---
433+
SELECT text ~* '\w+'

0 commit comments

Comments
 (0)