mirror of
https://github.com/pikami/cosmium.git
synced 2025-12-20 09:20:11 +00:00
Implement ToString function
This commit is contained in:
@@ -309,6 +309,7 @@ BooleanLiteral <- ("true"i / "false"i) {
|
||||
FunctionCall <- StringFunctions / IsDefined
|
||||
|
||||
StringFunctions <- StringEqualsExpression
|
||||
/ ToStringExpression
|
||||
/ ConcatExpression
|
||||
/ ThreeArgumentStringFunctionExpression
|
||||
|
||||
@@ -316,6 +317,10 @@ StringEqualsExpression <- StringEquals ws "(" ws ex1:SelectItem ws "," ws ex2:Se
|
||||
return parsers.FunctionCall{Type: parsers.FunctionCallStringEquals, Arguments: []interface{}{ex1, ex2, ignoreCase}}, nil
|
||||
}
|
||||
|
||||
ToStringExpression <- "TOSTRING"i ws "(" ws ex:SelectItem ws ")" {
|
||||
return parsers.FunctionCall{Type: parsers.FunctionCallToString, Arguments: []interface{}{ex}}, nil
|
||||
}
|
||||
|
||||
ConcatExpression <- "CONCAT"i ws "(" ws ex1:SelectItem others:(ws "," ws ex:SelectItem { return ex, nil })+ ws ")" {
|
||||
arguments := append([]interface{}{ex1}, others.([]interface{})...)
|
||||
return parsers.FunctionCall{Type: parsers.FunctionCallConcat, Arguments: arguments}, nil
|
||||
|
||||
Reference in New Issue
Block a user