compiler

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvalTagExpr added in v0.5.1

func EvalTagExpr(expr *TagExpr, tags map[string]struct{}, methods map[string]struct{}) bool

func GetRouteRegexps

func GetRouteRegexps(routes []RouteInfo, filter *TagExpr) 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, filter *TagExpr) ([]byte, int)

Types

type CasePolicy added in v0.4.0

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

type InclusionStatus added in v0.5.1

type InclusionStatus int
const (
	Include InclusionStatus = iota
	Exclude InclusionStatus = iota
	Union   InclusionStatus = iota
)

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
}

type TagExpr added in v0.5.1

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

func ParseTagExpr added in v0.5.1

func ParseTagExpr(input string) (expr *TagExpr, err error)

Jump to

Keyboard shortcuts

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