diff options
Diffstat (limited to 'lib/expression/t.ml')
-rw-r--r-- | lib/expression/t.ml | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/expression/t.ml b/lib/expression/t.ml index 2df374f..80cff4f 100644 --- a/lib/expression/t.ml +++ b/lib/expression/t.ml @@ -43,6 +43,16 @@ let name_of_function = function | Trim -> "TRIM" | Cmp -> "CMP" +let function_of_name param f = + match (String.lowercase_ascii f, param) with + | "nvl", _ -> Nvl param + | "join", Literal sep :: tl -> Join (sep, tl) + | "join", Empty :: tl -> Join ("", tl) + | "upper", _ -> Function' (Upper, param) + | "trim", _ -> Function' (Trim, param) + | "cmp", _ -> Function' (Cmp, param) + | other, _ -> Function (other, param) + let name_of_operator = function | Equal -> "=" | Different -> "<>" |