add a string replace method

This commit is contained in:
Aidan 2020-08-26 22:32:01 -07:00
parent 591402b428
commit 12caeedf68
No known key found for this signature in database
GPG key ID: 327711E983899316
4 changed files with 36 additions and 3 deletions

View file

@ -178,6 +178,16 @@ func GenFuncTable() ast.FuncTable {
},
},
"replace": &ast.Function{
Function: Replace,
Name: "replace",
Args: []ast.Token_t{
ast.STRING,
ast.STRING,
ast.STRING,
},
},
"substr": &ast.Function{
Function: Substr,
Name: "substr",
@ -283,6 +293,7 @@ func GenFuncTable() ast.FuncTable {
"cd": &ast.Function{
Function: Cd,
Name: "changedir",
SymLazy: true,
Args: []ast.Token_t{
ast.STRING,
},