1
Fork 0

fixes to operator precedence, introduced some bugs to fix also

This commit is contained in:
Jake Wheat 2015-08-05 22:38:44 +03:00
parent 666d1f877f
commit 136257bfd5

View file

@ -1060,34 +1060,50 @@ messages, but both of these are too important.
> [E.Postfix $ try quantifiedComparisonSuffix > [E.Postfix $ try quantifiedComparisonSuffix
> ,E.Postfix matchPredicateSuffix > ,E.Postfix matchPredicateSuffix
> ] > ]
> ,[binarySym "." E.AssocLeft] > ,[binarySym "." E.AssocLeft]
> ,[postfix' arraySuffix > ,[postfix' arraySuffix
> ,postfix' escapeSuffix > ,postfix' escapeSuffix
> ,postfix' collateSuffix] > ,postfix' collateSuffix]
> ,[prefixSym "+", prefixSym "-"] > ,[prefixSym "+", prefixSym "-"]
> ,[binarySym "^" E.AssocLeft] > ,[binarySym "^" E.AssocLeft]
> ,[binarySym "*" E.AssocLeft > ,[binarySym "*" E.AssocLeft
> ,binarySym "/" E.AssocLeft > ,binarySym "/" E.AssocLeft
> ,binarySym "%" E.AssocLeft] > ,binarySym "%" E.AssocLeft]
> ,[binarySym "+" E.AssocLeft > ,[binarySym "+" E.AssocLeft
> ,binarySym "-" E.AssocLeft] > ,binarySym "-" E.AssocLeft]
> ,[binarySym ">=" E.AssocNone
> ,binarySym "<=" E.AssocNone > ,[binarySym "||" E.AssocRight
> ,binarySym "!=" E.AssocRight
> ,binarySym "<>" E.AssocRight
> ,binarySym "||" E.AssocRight
> ,prefixSym "~" > ,prefixSym "~"
> ,binarySym "&" E.AssocRight > ,binarySym "&" E.AssocRight
> ,binarySym "|" E.AssocRight > ,binarySym "|" E.AssocRight]
> ,binaryKeyword "like" E.AssocNone > ,[binaryKeyword "overlaps" E.AssocNone]
> ,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
> -- between also has a try in it to deal with 'not'
> -- ambiguity
> ,E.Postfix $ try inSuffix
> ,E.Postfix betweenSuffix]
> -- todo: figure out where to put the try
> ++ [binaryKeywords $ makeKeywordTree > ++ [binaryKeywords $ makeKeywordTree
> ["not like" > ["not like"
> ,"is similar to" > ,"is similar to"
> ,"is not similar to" > ,"is not similar to"]]
> ,"is distinct from" > ++ [multisetBinOp]
> ,"is not distinct from"] > ,[binarySym "<" E.AssocNone
> ,postfixKeywords $ makeKeywordTree > ,binarySym ">" E.AssocNone
> ,binarySym ">=" E.AssocNone
> ,binarySym "<=" E.AssocNone
> ,binarySym "!=" E.AssocRight
> ,binarySym "<>" E.AssocRight
> ,binarySym "=" E.AssocRight]
> ,[postfixKeywords $ makeKeywordTree
> ["is null" > ["is null"
> ,"is not null" > ,"is not null"
> ,"is true" > ,"is true"
@ -1095,24 +1111,13 @@ messages, but both of these are too important.
> ,"is false" > ,"is false"
> ,"is not false" > ,"is not false"
> ,"is unknown" > ,"is unknown"
> ,"is not unknown"] > ,"is not unknown"
> ] > ,"is distinct from"
> ++ [multisetBinOp] > ,"is not distinct from"]]
> -- have to use try with inSuffix because of a conflict > ,[prefixKeyword "not"]
> -- with 'in' in position function, and not between > ,if bExpr then [] else [binaryKeyword "and" E.AssocLeft]
> -- between also has a try in it to deal with 'not' > ,[binaryKeyword "or" E.AssocLeft]
> -- ambiguity > ]
> ++ [E.Postfix $ try inSuffix,E.Postfix betweenSuffix]
> ]
> ++
> [[binarySym "<" E.AssocNone
> ,binarySym ">" E.AssocNone]
> ,[binarySym "=" E.AssocRight]
> ,[prefixKeyword "not"]]
> ++
> if bExpr then [] else [[binaryKeyword "and" E.AssocLeft]]
> ++
> [[binaryKeyword "or" E.AssocLeft]]
> where > where
> binarySym nm assoc = binary (symbol_ nm) nm assoc > binarySym nm assoc = binary (symbol_ nm) nm assoc
> binaryKeyword nm assoc = binary (keyword_ nm) nm assoc > binaryKeyword nm assoc = binary (keyword_ nm) nm assoc