1
Fork 0

add a few more operators: % & ^ | ~

This commit is contained in:
Jake Wheat 2013-12-17 16:15:19 +02:00
parent b2728ec9bf
commit 89a4dd0e3e
2 changed files with 9 additions and 8 deletions

View file

@ -322,8 +322,10 @@ keyword.
> binOpSymbolNames :: [String] > binOpSymbolNames :: [String]
> binOpSymbolNames = > binOpSymbolNames =
> ["=", "<=", ">=", "!=", "<>", "<", ">" > ["=", "<=", ">=", "!=", "<>", "<", ">"
> ,"*", "/", "+", "-" > ,"*", "/", "+", "-", "%"
> ,"||", "."] > ,"||", "."
> ,"^", "|", "&"
> ]
> binOpKeywordNames :: [String] > binOpKeywordNames :: [String]
> binOpKeywordNames = ["and", "or", "like", "overlaps"] > binOpKeywordNames = ["and", "or", "like", "overlaps"]
@ -347,7 +349,7 @@ There aren't any multi keyword prefix operators currently supported.
> prefixUnOpKeywordNames = ["not"] > prefixUnOpKeywordNames = ["not"]
> prefixUnOpSymbolNames :: [String] > prefixUnOpSymbolNames :: [String]
> prefixUnOpSymbolNames = ["+", "-"] > prefixUnOpSymbolNames = ["+", "-", "~"]
There aren't any single keyword postfix operators currently There aren't any single keyword postfix operators currently
supported. Maybe all these 'is's can be left factored? supported. Maybe all these 'is's can be left factored?
@ -408,7 +410,7 @@ associativity. This is fixed with a separate pass over the AST.
> ++ postfixOpKeywords > ++ postfixOpKeywords
> -- these are the ops with the highest precedence in order > -- these are the ops with the highest precedence in order
> highPrec = [infixl_ ["."] > highPrec = [infixl_ ["."]
> ,infixl_ ["*","/"] > ,infixl_ ["*","/", "%"]
> ,infixl_ ["+", "-"] > ,infixl_ ["+", "-"]
> ,infixl_ ["<=",">=","!=","<>","||","like"] > ,infixl_ ["<=",">=","!=","<>","||","like"]
> ] > ]

7
TODO
View file

@ -1,7 +1,6 @@
next release: next release:
more symbolic operators, array access a[5]? don't think this is more symbolic operators, array access a[5]? don't think this is
standard sql, if not, leave for now. There is something about standard sql, if not, leave for now. There is something about
arrays in sql:2008 arrays in sql:2008
@ -9,11 +8,9 @@ more symbolic operators, array access a[5]? don't think this is
row ctor: row(a,b) is fine, but also when there is 2 or more elements, row ctor: row(a,b) is fine, but also when there is 2 or more elements,
the word row can be omitted: (a,b) the word row can be omitted: (a,b)
fix lateral binding issue fix lateral binding issue
window frames
window frames and named windows
review tests to copy from hssqlppp review tests to copy from hssqlppp
@ -60,6 +57,8 @@ Later general tasks:
sql server top syntax sql server top syntax
named windows
extended string literals, escapes and other flavours (like pg and extended string literals, escapes and other flavours (like pg and
oracle custom delimiters) oracle custom delimiters)