From 2c817f4088a4c40f551010a3a6c70dfb4c22837a Mon Sep 17 00:00:00 2001 From: Jake Wheat Date: Wed, 5 Aug 2015 22:57:36 +0300 Subject: [PATCH] fix silly bug with is distinct from parsing --- Language/SQL/SimpleSQL/Parser.lhs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Language/SQL/SimpleSQL/Parser.lhs b/Language/SQL/SimpleSQL/Parser.lhs index 8d59c2b..4a7e644 100644 --- a/Language/SQL/SimpleSQL/Parser.lhs +++ b/Language/SQL/SimpleSQL/Parser.lhs @@ -1082,7 +1082,9 @@ messages, but both of these are too important. > ,prefixSym "~" > ,binarySym "&" E.AssocRight > ,binarySym "|" E.AssocRight] + > ,[binaryKeyword "overlaps" E.AssocNone] + > ,[binaryKeyword "like" E.AssocNone > -- have to use try with inSuffix because of a conflict > -- with 'in' in position function, and not between @@ -1090,12 +1092,13 @@ messages, but both of these are too important. > -- ambiguity > ,E.Postfix $ try inSuffix > ,E.Postfix betweenSuffix] -> -- todo: figure out where to put the try +> -- todo: figure out where to put the try? > ++ [binaryKeywords $ makeKeywordTree > ["not like" > ,"is similar to" > ,"is not similar to"]] > ++ [multisetBinOp] + > ,[binarySym "<" E.AssocNone > ,binarySym ">" E.AssocNone > ,binarySym ">=" E.AssocNone @@ -1103,6 +1106,7 @@ messages, but both of these are too important. > ,binarySym "!=" E.AssocRight > ,binarySym "<>" E.AssocRight > ,binarySym "=" E.AssocRight] + > ,[postfixKeywords $ makeKeywordTree > ["is null" > ,"is not null" @@ -1111,12 +1115,17 @@ messages, but both of these are too important. > ,"is false" > ,"is not false" > ,"is unknown" -> ,"is not unknown" -> ,"is distinct from" +> ,"is not unknown"]] +> ++ [binaryKeywords $ makeKeywordTree +> ["is distinct from" > ,"is not distinct from"]] + > ,[prefixKeyword "not"] + > ,if bExpr then [] else [binaryKeyword "and" E.AssocLeft] + > ,[binaryKeyword "or" E.AssocLeft] + > ] > where > binarySym nm assoc = binary (symbol_ nm) nm assoc