swift

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2019 License: BSD-3-Clause Imports: 19 Imported by: 4

Documentation

Overview

Package swift implements Swift code generation from compiled VDL packages.

Package swift implements Swift code generation from compiled VDL packages.

Index

Constants

View Source
const V23SwiftFrameworkName = "VanadiumCore"

Variables

This section is empty.

Functions

func SetPkgPathXlator

func SetPkgPathXlator(xlator func(vdlPath string) string)

SetPkgPathXlator sets the function used to translate a VDL package path into a Swift package path.

Types

type SwiftFileInfo

type SwiftFileInfo struct {
	Data   []byte
	Dir    string
	Name   string
	Module string
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL