diff --git a/sqlog/compiler.fnl b/sqlog/compiler.fnl index e2ec9e2..c116c64 100644 --- a/sqlog/compiler.fnl +++ b/sqlog/compiler.fnl @@ -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]] diff --git a/sqlog/macros.fnl b/sqlog/macros.fnl index 419f902..992b57d 100644 --- a/sqlog/macros.fnl +++ b/sqlog/macros.fnl @@ -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))