implement SQL function calls, unquote
This commit is contained in:
parent
f33b0cd695
commit
35d9fc10e7
|
@ -175,6 +175,7 @@
|
|||
[:set column subexpr] (.. column " = " (self:gen-expr analysis subexpr))
|
||||
(where [:var name] (. analysis.variable-mapping name)) (self:gen-expr analysis (. analysis.variable-mapping name))
|
||||
(where [op lhs rhs] (. infix-ops op)) (.. "(" (self:gen-expr analysis lhs) " " op " " (self:gen-expr analysis rhs) ")")
|
||||
[funcname & args] (.. funcname "(" (cat args ", " #(self:gen-expr analysis $1)) ")")
|
||||
_ (error (.. "Unrecognized expression " (fv expr)))))
|
||||
|
||||
(fn Compiler.gen-rule-clause [self analysis-parent [head & literals]]
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
(fn clause [c]
|
||||
(match c
|
||||
(where [escape expr] (list? c) (= (tostring escape) :unquote)) expr
|
||||
(where [escape expr] (list? c) (= (tostring escape) :hashfn)) `[:const ,expr]
|
||||
(where [name & params] (sequence? c)) `[:literal ,(tostring name) ,(icollect [_ param (ipairs params)] (clause param))]
|
||||
(where [head & args] (list? c) (sym? head)) (icollect [_ expr (ipairs args) :into [(tostring head)]] (clause expr))
|
||||
|
|
Loading…
Reference in a new issue