Documentation ¶
Overview ¶
Package swift implements Swift code generation from compiled VDL packages.
Package swift implements Swift code generation from compiled VDL packages.
Index ¶
Constants ¶
const V23SwiftFrameworkName = "VanadiumCore"
Variables ¶
This section is empty.
Functions ¶
func SetPkgPathXlator ¶
SetPkgPathXlator sets the function used to translate a VDL package path into a Swift package path.
Types ¶
type SwiftFileInfo ¶
SwiftFileInfo stores the name and contents of the generated Swift file.
func Generate ¶
func Generate(pkg *compile.Package, env *compile.Env, genPathToDir map[string]string) (ret []SwiftFileInfo)
Generate generates Swift files for all VDL files in the provided package, returning the list of generated Swift files as a slice. We generate Swift files to match the original VDL file layout, with the exception that constants are smushed into a <PackageName>.swift that consolidates the errors, package documentation (if any), and constants for a given package into a struct. This package struct provides a similar context to what would be provided by an import in VDL or Java. TODO(azinman): Run Swift formatters on the generated files.