Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit a2ed763

Browse files
authored
Fix parser for IN and NOT (#24)
1 parent afcbac3 commit a2ed763

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/SqlSquared/Parser.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ unaryOperator = PC.try do
424424
(operator "-" $> Sig.Negative)
425425
<|> (operator "+" $> Sig.Positive)
426426
<|> (keyword "distinct" $> Sig.Distinct)
427-
<|> (keyword "not" $> Sig.Distinct)
427+
<|> (keyword "not" $> Sig.Not)
428428
<|> (keyword "exists" $> Sig.Distinct)
429429
e ← primaryExpression
430430
pure $ embed $ Sig.Unop { op, expr: e}
@@ -532,7 +532,7 @@ negatableSuffix = PC.try do
532532
_ ← keyword "is"
533533
n ← PC.optionMaybe $ keyword "not"
534534
pure $ isNothing n
535-
let inv = fromMaybe true mbInv
535+
let inv = fromMaybe false mbInv
536536
suffix ← betweenSuffix <|> inSuffix <|> likeSuffix
537537
pure \e → (if inv then _NOT else id) $ suffix e
538538

src/SqlSquared/Signature.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ printSqlDeclF = case _ of
501501
FunctionDecl { ident, args, body } →
502502
"CREATE FUNCTION "
503503
<> ID.printIdent ident
504-
<> "(" <> F.intercalate "," (map (":" <> _) args) <> ") BEGIN "
504+
<> "(" <> F.intercalate ", " (map (":" <> _) args) <> ") BEGIN "
505505
<> body
506506
<> " END"
507507
Import s →

0 commit comments

Comments
 (0)