mirror of
https://github.com/Open-Argon/argon-v3.git
synced 2025-12-06 08:56:07 +00:00
add * import
This commit is contained in:
21
src/path.go
21
src/path.go
@@ -73,4 +73,25 @@ var ArPath = Map(
|
||||
EXISTS: true,
|
||||
}
|
||||
}},
|
||||
"parent": builtinFunc{
|
||||
"parent",
|
||||
func(args ...any) (any, ArErr) {
|
||||
if len(args) != 1 {
|
||||
return nil, ArErr{
|
||||
TYPE: "runtime",
|
||||
message: "parent takes exactly 1 argument, got " + fmt.Sprint(len(args)),
|
||||
EXISTS: true,
|
||||
}
|
||||
}
|
||||
args[0] = ArValidToAny(args[0])
|
||||
if typeof(args[0]) != "string" {
|
||||
return nil, ArErr{
|
||||
TYPE: "runtime",
|
||||
message: "parent argument must be a string, got " + typeof(args[0]),
|
||||
EXISTS: true,
|
||||
}
|
||||
}
|
||||
return path.Dir(args[0].(string)), ArErr{}
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user