forked from rosa/hakurei
internal/rosa/package: migrate python packages
This also migrates LLVM LIT via the newly implemented special case. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -451,6 +451,30 @@ func (s *S) getFrame() azalea.Frame {
|
||||
return
|
||||
}},
|
||||
|
||||
k("split"): {F: func(
|
||||
args azalea.FArgs,
|
||||
) (v any, set bool, err error) {
|
||||
var p, sep string
|
||||
var n int64
|
||||
if err = args.Apply(map[unique.Handle[azalea.Ident]]any{
|
||||
k("s"): &p,
|
||||
k("sep"): &sep,
|
||||
k("n"): &n,
|
||||
}); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if n < 0 {
|
||||
n = 0
|
||||
} else if n == 0 {
|
||||
n = -1
|
||||
}
|
||||
|
||||
v = strings.SplitN(p, sep, int(n))
|
||||
set = true
|
||||
return
|
||||
}},
|
||||
|
||||
// intenral/pkg built-ins
|
||||
|
||||
k("remoteTar"): {F: func(
|
||||
|
||||
Reference in New Issue
Block a user