registry

package
v0.0.0-...-34974eb Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2017 License: MIT Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLanguageNotFound = errors.New("can't find language in registry")

ErrLanguageNotFound is returned when a requested language is not present in the registry.

Functions

func Languages

func Languages() []string

Languages returns an slice of all the language names.

func Register

func Register(names []string, json string)

Register registers a specific language with the highlighter.

Types

type Contains

type Contains struct {
	CaseInsensitive bool
	Aliases         []string
	Illegal         string

	ClassName   string
	Contains    []*Contains
	Variants    []*Contains
	Starts      *Contains
	SubLanguage []string

	Begin         *pcre.Regexp
	End           *pcre.Regexp
	BeginKeywords []string
	Keywords      *Keywords
	ExcludeEnd    bool
	Relevance     float64

	// Ref and IsArray are used for resolving circular references within the
	// definitions.
	Ref     []string
	IsArray bool
}

Contains represents a subsection that can match different parts of the code.

func Lookup

func Lookup(name string) (Contains, error)

Lookup finds and returns the parsed Language that has been saved in the registry.

func (*Contains) UnmarshalJSON

func (c *Contains) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals.

type Keywords

type Keywords struct {
	Keyword []string
	Literal []string
	BuiltIn []string
}

Keywords represents a set of keywords that should be matched and highlighted.

func (*Keywords) UnmarshalJSON

func (k *Keywords) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals.

Jump to

Keyboard shortcuts

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