From 7f83911cc5eba870de7ebb11283972483f7e2891 Mon Sep 17 00:00:00 2001 From: Maximilian Kresse <545671+MaximilianKresse@users.noreply.github.com> Date: Mon, 5 Aug 2024 22:32:22 +0200 Subject: [PATCH] Added straight_join to $reservedNewline (#134) --- src/Tokenizer.php | 1 + tests/clihighlight.txt | 6 ++++++ tests/compress.txt | 2 ++ tests/format-highlight.html | 6 ++++++ tests/format.txt | 6 ++++++ tests/highlight.html | 2 ++ tests/sql.sql | 2 ++ 7 files changed, 25 insertions(+) diff --git a/src/Tokenizer.php b/src/Tokenizer.php index 35701d8..d0fdf74 100644 --- a/src/Tokenizer.php +++ b/src/Tokenizer.php @@ -409,6 +409,7 @@ final class Tokenizer 'OUTER JOIN', 'RIGHT JOIN', 'RIGHT OUTER JOIN', + 'STRAIGHT_JOIN', 'XOR', ]; diff --git a/tests/clihighlight.txt b/tests/clihighlight.txt index 32e74cb..4a846e7 100644 --- a/tests/clihighlight.txt +++ b/tests/clihighlight.txt @@ -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 diff --git a/tests/compress.txt b/tests/compress.txt index fd507ba..afe3a77 100644 --- a/tests/compress.txt +++ b/tests/compress.txt @@ -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 diff --git a/tests/format-highlight.html b/tests/format-highlight.html index 358b86b..8536ca8 100644 --- a/tests/format-highlight.html +++ b/tests/format-highlight.html @@ -1036,3 +1036,9 @@ ); MY_NON_TOP_LEVEL_KEYWORD_FX_6(); END; +--- +
SELECT
+  a
+FROM
+  test
+  STRAIGHT_JOIN test2 ON test.id = test2.id
diff --git a/tests/format.txt b/tests/format.txt index ffa5cb7..0b4cf0e 100644 --- a/tests/format.txt +++ b/tests/format.txt @@ -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 diff --git a/tests/highlight.html b/tests/highlight.html index b57624c..c49776c 100644 --- a/tests/highlight.html +++ b/tests/highlight.html @@ -324,3 +324,5 @@ (SELECT 1 as x); MY_NON_TOP_LEVEL_KEYWORD_FX_6(); END; +--- +
SELECT a FROM test STRAIGHT_JOIN test2 ON test.id = test2.id
diff --git a/tests/sql.sql b/tests/sql.sql index d57da6e..93db719 100644 --- a/tests/sql.sql +++ b/tests/sql.sql @@ -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