blob: 6412d552742e2fbdd1c6550e48378166c64f9459 [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Package builtins defines starlark Bulitins that are globally accessible to all starlark
// programs.
package builtins
import (
"go.starlark.net/starlark"
"go.starlark.net/starlarkstruct"
)
// All returns a starlark.StringDict used to register all builtin functions as a set of
// predeclared starlark modules.
func All() starlark.StringDict {
return starlark.StringDict{
"struct": starlark.NewBuiltin(starlarkstruct.Default.String(), starlarkstruct.Make),
"fxicfg": starlarkstruct.FromStringDict(starlark.String("fxicfg"), starlark.StringDict{
"set_output_dir": starlark.NewBuiltin("set_output_dir", setOutputDir),
"add_output_file": starlark.NewBuiltin("add_output_file", addOutputFile),
}),
}
}