keyword

package
v0.4.28 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeywordRedefined = errors.New("keyword redefined")
	ErrDuplicateKeyword = errors.New("duplicate keyword")
)
View Source
var IDName = map[ID]string{
	MatchPrefix: "match",
	Prefix:      "prefix",
	Profile:     "profile",
	Locale:      "locale",
	Config:      "config",
	Sort:        "sort",
	Delete:      "delete",
	Clear:       "clear",
	Fill:        "fill",
	Place:       "place",
	Move:        "move",
	Insert:      "insert",
	Append:      "append",
	Before:      "before",
	After:       "after",
	With:        "with",
	First:       "first",
	Last:        "last",
}
View Source
var TypeName = map[Type]string{
	CommandType:     "Command",
	PrepositionType: "Preposition",
	ColumnNameType:  "Column Name",
}

Functions

This section is empty.

Types

type ID

type ID int
const (
	// commands
	MatchPrefix ID = iota
	Prefix
	Profile
	Locale
	Config
	Sort
	Delete
	Clear
	Fill
	Place
	Move
	Insert
	Append
	// prepositions
	Before
	After
	With
	// column identifiers
	First
	Last
)

type Keyword

type Keyword struct {
	ID
	Type  Type
	Names []string
}

func (*Keyword) Aliases

func (kw *Keyword) Aliases() []string

func (*Keyword) Is

func (kw *Keyword) Is(name string) bool

func (*Keyword) Name

func (kw *Keyword) Name() string

func (*Keyword) String

func (kw *Keyword) String() string

type Set

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

func NewSet

func NewSet(keywords ...*Keyword) *Set

TODO: 2026-03-06 identify missing keywords!

func (*Set) Find

func (s *Set) Find(name string) *Keyword

func (*Set) FindCommand

func (s *Set) FindCommand(name string) *Keyword

func (*Set) FindPreposition

func (s *Set) FindPreposition(name string) *Keyword

func (*Set) IsCommand

func (s *Set) IsCommand(name string) bool

func (*Set) IsPreposition

func (s *Set) IsPreposition(name string) bool

func (*Set) WithID

func (s *Set) WithID(id ID) *Keyword

type Type

type Type int
const (
	CommandType Type = iota
	PrepositionType
	ColumnNameType
)

Jump to

Keyboard shortcuts

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