compiler

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRouteRegexps

func GetRouteRegexps(routes []RouteInfo) routeRegexps

func ParseRouteFile

func ParseRouteFile(input io.Reader, casePolicy CasePolicy) ([]RouteFileEntry, []RouteError)

func ProcessRouteFile

func ProcessRouteFile(files [][]RouteFileEntry, filenames []string, nameSeparator string, groupObserver func([]RouteWithParents)) ([]RouteInfo, []RouteError)

func RouteRegexpsToJSON

func RouteRegexpsToJSON(rrs *routeRegexps, tagGlobs []IncludeSpec) ([]byte, int)

Types

type CasePolicy added in v0.4.0

type CasePolicy int
const (
	AllowUpperCase    CasePolicy = iota
	DisallowUpperCase CasePolicy = iota
)

type IncludeSpec

type IncludeSpec struct {
	Include bool
	// One of these is "", the other is not
	TagGlob string
	Method  string
}

type RouteError

type RouteError struct {
	Kind          RouteErrorKind
	Line          int
	Col           int
	DuplicateName string
	OtherLine     int
	IOError       error
	Filenames     []string
}

func ParseRouteFiles

func ParseRouteFiles(inputFiles []string, inputReaders []io.Reader, casePolicy CasePolicy) ([][]RouteFileEntry, []RouteError)

func (RouteError) Error

func (e RouteError) Error() string

type RouteErrorKind

type RouteErrorKind int
const (
	MissingNameOrRoute                RouteErrorKind = iota
	DuplicateRouteName                RouteErrorKind = iota
	RootMustStartWithSlash            RouteErrorKind = iota
	OverlappingRoutes                 RouteErrorKind = iota
	MisplacedDot                      RouteErrorKind = iota
	RouteContainsBadCodePoint         RouteErrorKind = iota
	QuestionMarkInRoute               RouteErrorKind = iota
	HashInRoute                       RouteErrorKind = iota
	WhitespaceInRoute                 RouteErrorKind = iota
	IllegalCharInParamName            RouteErrorKind = iota
	IllegalBackslashEscape            RouteErrorKind = iota
	IllegalBackslashEscapeInRouteName RouteErrorKind = iota
	NontabspaceIndentationCharacter   RouteErrorKind = iota
	BadCharacterInMethodName          RouteErrorKind = iota
	MissingCommaBetweenMethodNames    RouteErrorKind = iota
	TwoCommasInSequenceInMethodNames  RouteErrorKind = iota
	IndentLessThanFirstLine           RouteErrorKind = iota
	OnlyNoTrailingSlash               RouteErrorKind = iota
	NoTrailingSlashAfterSlash         RouteErrorKind = iota
	MultipleSlashesInARow             RouteErrorKind = iota
	UpperCaseCharInRoute              RouteErrorKind = iota
	IOError                           RouteErrorKind = iota
	EmptyMethodList                   RouteErrorKind = iota
)

type RouteFileEntry

type RouteFileEntry struct {
	// contains filtered or unexported fields
}

type RouteInfo

type RouteInfo struct {
	Name     string
	Line     int
	Filename string
	// contains filtered or unexported fields
}

type RouteWithParents

type RouteWithParents struct {
	Route   *RouteInfo
	Parents []*RouteInfo
}

Jump to

Keyboard shortcuts

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