mirror of
https://github.com/johnkerl/miller.git
synced 2026-08-01 04:01:58 +00:00
add for user-defined functions overriding built-in functions, as in the C impl
This commit is contained in:
parent
4fed370087
commit
828fc4129a
1 changed files with 9 additions and 0 deletions
|
|
@ -257,6 +257,15 @@ func (this *RootNode) BuildAndInstallUDF(astNode *dsl.ASTNode) error {
|
|||
|
||||
functionName := string(astNode.Token.Lit)
|
||||
|
||||
if BuiltinFunctionManagerInstance.LookUp(functionName) != nil {
|
||||
return errors.New(
|
||||
fmt.Sprintf(
|
||||
"Miller: function named \"%s\" must not override a built-in function of the same name.",
|
||||
functionName,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
if this.udfManager.ExistsByName(functionName) {
|
||||
return errors.New(
|
||||
fmt.Sprintf(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue