Skip to content

Commit

Permalink
update bq2cst. fix #224
Browse files Browse the repository at this point in the history
  • Loading branch information
kitta65 committed Aug 14, 2023
1 parent f12fb5a commit b591a1e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
2 changes: 2 additions & 0 deletions expected_output/core.sql
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ SELECT 1 IN UNNEST([1, 2]);
-- LIKE
SELECT 'a' LIKE 'abc', 'a' NOT LIKE 'abc';

SELECT 'a' LIKE ANY 'abc', 'a' NOT LIKE SOME 'abc';

-- IS
SELECT TRUE IS NULL, TRUE IS NOT NULL, TRUE IS NOT FALSE;

Expand Down
5 changes: 5 additions & 0 deletions input/core.sql
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ select
'a' not like 'abc'
;

select
'a' like any 'abc',
'a' not like some 'abc'
;

-- IS
select
true is null,
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"typescript": "^4.3.2"
},
"dependencies": {
"bq2cst": "0.4.28"
"bq2cst": "0.4.29"
},
"peerDependencies": {
"prettier": "^2.3.0"
Expand Down
3 changes: 3 additions & 0 deletions src/printer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1457,6 +1457,7 @@ const printBinaryOperator: PrintFunc<bq2cst.BinaryOperator> = (
not: p.child("not", undefined, "all"),
self: logical ? p.self("upper") : p.self("upper", true),
trailing_comments: printTrailingComments(path, options, print, node),
quantifier: p.child("quantifier", undefined, "all"),
right: p.child("right", undefined, "all"),
as: "", // eslint-disable-line unicorn/no-unused-properties
alias: printAlias(path, options, print, node),
Expand Down Expand Up @@ -1499,6 +1500,8 @@ const printBinaryOperator: PrintFunc<bq2cst.BinaryOperator> = (
printLeadingComments(path, options, print, node),
docs.self,
p.has("not") && p.includedIn(["IS"]) ? [" ", docs.not] : "",
p.has("quantifier") ? " " : "",
docs.quantifier,
" ",
docs.trailing_comments,
right,
Expand Down

0 comments on commit b591a1e

Please sign in to comment.