Skip to content

Commit

Permalink
Added straight_join to $reservedNewline (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximilianKresse authored Aug 5, 2024
1 parent 7c0096a commit 7f83911
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Tokenizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ final class Tokenizer
'OUTER JOIN',
'RIGHT JOIN',
'RIGHT OUTER JOIN',
'STRAIGHT_JOIN',
'XOR',
];

Expand Down
6 changes: 6 additions & 0 deletions tests/clihighlight.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1036,3 +1036,9 @@ MY_NON_TOP_LEVEL_KEYWORD_FX_5();
);
MY_NON_TOP_LEVEL_KEYWORD_FX_6();
END;
---
SELECT
a
FROM
test
STRAIGHT_JOIN test2 ON test.id = test2.id
2 changes: 2 additions & 0 deletions tests/compress.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,5 @@ SELECT a, GROUP_CONCAT(b, '.') OVER (ORDER BY c GROUPS BETWEEN UNBOUNDED PRECEDI
SELECT 1::text;
---
MY_NON_TOP_LEVEL_KEYWORD_FX_1(); MY_NON_TOP_LEVEL_KEYWORD_FX_2(); SELECT x FROM (SELECT 1 as x); MY_NON_TOP_LEVEL_KEYWORD_FX_3(); BEGIN MY_NON_TOP_LEVEL_KEYWORD_FX_4(); MY_NON_TOP_LEVEL_KEYWORD_FX_5(); END; BEGIN SELECT x FROM (SELECT 1 as x); MY_NON_TOP_LEVEL_KEYWORD_FX_6(); END;
---
SELECT a FROM test STRAIGHT_JOIN test2 ON test.id = test2.id
6 changes: 6 additions & 0 deletions tests/format-highlight.html
Original file line number Diff line number Diff line change
Expand Up @@ -1036,3 +1036,9 @@
)<span >;</span>
<span style="color: #333;">MY_NON_TOP_LEVEL_KEYWORD_FX_6</span>()<span >;</span>
<span style="font-weight:bold;">END</span><span >;</span></pre>
---
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">SELECT</span>
<span style="color: #333;">a</span>
<span style="font-weight:bold;">FROM</span>
<span style="color: #333;">test</span>
<span style="font-weight:bold;">STRAIGHT_JOIN</span> <span style="color: #333;">test2</span> <span style="font-weight:bold;">ON</span> <span style="color: #333;">test</span><span >.</span><span style="color: #333;">id</span> <span >=</span> <span style="color: #333;">test2</span><span >.</span><span style="color: #333;">id</span></pre>
6 changes: 6 additions & 0 deletions tests/format.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1034,3 +1034,9 @@ FROM
);
MY_NON_TOP_LEVEL_KEYWORD_FX_6();
END;
---
SELECT
a
FROM
test
STRAIGHT_JOIN test2 ON test.id = test2.id
2 changes: 2 additions & 0 deletions tests/highlight.html
Original file line number Diff line number Diff line change
Expand Up @@ -324,3 +324,5 @@
(<span style="font-weight:bold;">SELECT</span> <span style="color: green;">1</span> <span style="font-weight:bold;">as</span> <span style="color: #333;">x</span>)<span >;</span>
<span style="color: #333;">MY_NON_TOP_LEVEL_KEYWORD_FX_6</span>()<span >;</span>
<span style="font-weight:bold;">END</span><span >;</span></pre>
---
<pre style="color: black; background-color: white;"><span style="font-weight:bold;">SELECT</span> <span style="color: #333;">a</span> <span style="font-weight:bold;">FROM</span> <span style="color: #333;">test</span> <span style="font-weight:bold;">STRAIGHT_JOIN</span> <span style="color: #333;">test2</span> <span style="font-weight:bold;">ON</span> <span style="color: #333;">test</span><span >.</span><span style="color: #333;">id</span> <span >=</span> <span style="color: #333;">test2</span><span >.</span><span style="color: #333;">id</span></pre>
2 changes: 2 additions & 0 deletions tests/sql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -324,3 +324,5 @@ BEGIN
(SELECT 1 as x);
MY_NON_TOP_LEVEL_KEYWORD_FX_6();
END;
---
SELECT a FROM test STRAIGHT_JOIN test2 ON test.id = test2.id

0 comments on commit 7f83911

Please sign in to comment.