lexical

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CompressionLevelMin = 0
	CompressionLevelMax = 2
)

Variables

This section is empty.

Functions

func FindSpellingInconsistencies

func FindSpellingInconsistencies(ids []string) [][]string

FindSpellingInconsistencies finds spelling inconsistencies in identifiers. The identifiers are considered to be the same if they are spelled the same when expressed in UpperCamelCase. For example, `left_paren` and `LeftParen` are spelled the same in UpperCamelCase. Thus they are considere to be spelling inconsistency.

func SnakeCaseToUpperCamelCase

func SnakeCaseToUpperCamelCase(snake string) string

Types

type CompileError

type CompileError struct {
	Kind     spec.LexKindName
	Fragment bool
	Cause    error
	Detail   string
}

func Compile

func Compile(lexspec *LexSpec, compLv int) (*spec.LexicalSpec, error, []*CompileError)

type LexEntry

type LexEntry struct {
	Kind     spec.LexKindName
	Pattern  string
	Modes    []spec.LexModeName
	Push     spec.LexModeName
	Pop      bool
	Fragment bool
}

type LexSpec

type LexSpec struct {
	Entries []*LexEntry
}

func (*LexSpec) Validate

func (s *LexSpec) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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