typeFilepath and typeDirpath renamed as paramFilepath and paramDirpath respectively

This commit is contained in:
Celestino Amoroso 2024-06-02 11:32:47 +02:00
parent e4b4b4fb79
commit 4f432da2b9
2 changed files with 5 additions and 14 deletions

View File

@ -16,15 +16,6 @@ const (
paramEnd = "end" paramEnd = "end"
paramValue = "value" paramValue = "value"
paramEllipsis = "..." paramEllipsis = "..."
typeFilepath = "filepath" paramFilepath = "filepath"
typeDirpath = "dirpath" paramDirpath = "dirpath"
) )
// const (
// typeInteger = "int"
// typeFloat = "float"
// typeString = "string"
// typeFraction = "fract"
// typeList = "list"
// typeDict = "dict"
// )

View File

@ -188,13 +188,13 @@ func readFileFunc(ctx ExprContext, name string, args []any) (result any, err err
func ImportOsFuncs(ctx ExprContext) { func ImportOsFuncs(ctx ExprContext) {
ctx.RegisterFunc("openFile", newGolangFunctor(openFileFunc), typeHandle, []ExprFuncParam{ ctx.RegisterFunc("openFile", newGolangFunctor(openFileFunc), typeHandle, []ExprFuncParam{
newFuncParam(typeFilepath), newFuncParam(paramFilepath),
}) })
ctx.RegisterFunc("appendFile", newGolangFunctor(appendFileFunc), typeHandle, []ExprFuncParam{ ctx.RegisterFunc("appendFile", newGolangFunctor(appendFileFunc), typeHandle, []ExprFuncParam{
newFuncParam(typeFilepath), newFuncParam(paramFilepath),
}) })
ctx.RegisterFunc("createFile", newGolangFunctor(createFileFunc), typeHandle, []ExprFuncParam{ ctx.RegisterFunc("createFile", newGolangFunctor(createFileFunc), typeHandle, []ExprFuncParam{
newFuncParam(typeFilepath), newFuncParam(paramFilepath),
}) })
ctx.RegisterFunc("writeFile", newGolangFunctor(writeFileFunc), typeInt, []ExprFuncParam{ ctx.RegisterFunc("writeFile", newGolangFunctor(writeFileFunc), typeInt, []ExprFuncParam{
newFuncParam(typeHandle), newFuncParam(typeHandle),