textmate

package
v0.0.0-...-d780bf0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2014 License: BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Overview

This package enables support for Textmate Language Syntax definitions (tmLanguage) and Textmate Colour Schemes (tmTheme).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Capture

type Capture struct {
	Key int
	Named
}

type Captures

type Captures []Capture

func (*Captures) Len

func (c *Captures) Len() int

func (*Captures) Less

func (c *Captures) Less(i, j int) bool

func (*Captures) Swap

func (c *Captures) Swap(i, j int)

func (*Captures) UnmarshalJSON

func (c *Captures) UnmarshalJSON(data []byte) error

type Color

type Color color.RGBA

func (Color) String

func (c Color) String() string

func (*Color) UnmarshalJSON

func (c *Color) UnmarshalJSON(data []byte) error

type Language

type Language struct {
	UnpatchedLanguage
}

func (*Language) String

func (s *Language) String() string

func (*Language) UnmarshalJSON

func (l *Language) UnmarshalJSON(data []byte) error

type LanguageParser

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

func NewLanguageParser

func NewLanguageParser(scope string, data string) (*LanguageParser, error)

func (*LanguageParser) Data

func (d *LanguageParser) Data(a, b int) string

func (*LanguageParser) Parse

func (lp *LanguageParser) Parse() (*parser.Node, error)

type LanguageProvider

type LanguageProvider struct {
	sync.Mutex
	// contains filtered or unexported fields
}
var (
	Provider LanguageProvider
)

func (*LanguageProvider) GetLanguage

func (t *LanguageProvider) GetLanguage(id string) (*Language, error)

func (*LanguageProvider) LanguageFromFile

func (t *LanguageProvider) LanguageFromFile(fn string) (*Language, error)

func (*LanguageProvider) LanguageFromScope

func (t *LanguageProvider) LanguageFromScope(id string) (*Language, error)

type MatchObject

type MatchObject []int

type Named

type Named struct {
	Name string
}

type Pattern

type Pattern struct {
	Named
	Include       string
	Match         Regex
	Captures      Captures
	Begin         Regex
	BeginCaptures Captures
	End           Regex
	EndCaptures   Captures
	Patterns      []Pattern
	// contains filtered or unexported fields
}

func (*Pattern) Cache

func (p *Pattern) Cache(data string, pos int) (pat *Pattern, ret MatchObject)

func (*Pattern) CreateCaptureNodes

func (p *Pattern) CreateCaptureNodes(data string, pos int, d parser.DataSource, mo MatchObject, parent *parser.Node, capt Captures)

func (*Pattern) CreateNode

func (p *Pattern) CreateNode(data string, pos int, d parser.DataSource, mo MatchObject) (ret *parser.Node)

func (*Pattern) FirstMatch

func (p *Pattern) FirstMatch(data string, pos int) (pat *Pattern, ret MatchObject)

func (Pattern) String

func (p Pattern) String() (ret string)

type Regex

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

func (*Regex) Find

func (r *Regex) Find(data string, pos int) MatchObject

func (Regex) String

func (r Regex) String() string

func (*Regex) UnmarshalJSON

func (r *Regex) UnmarshalJSON(data []byte) error

type RootPattern

type RootPattern struct {
	Pattern
}

func (*RootPattern) String

func (r *RootPattern) String() (ret string)

func (*RootPattern) UnmarshalJSON

func (r *RootPattern) UnmarshalJSON(data []byte) error

type ScopeSetting

type ScopeSetting struct {
	Name     string
	Scope    string
	Settings Settings
}

func (ScopeSetting) String

func (s ScopeSetting) String() (ret string)

type Settings

type Settings map[string]Color

TODO(q): personally I don't care about the font style attributes

func (*Settings) UnmarshalJSON

func (s *Settings) UnmarshalJSON(data []byte) error

type Theme

type Theme struct {
	GutterSettings Settings
	Name           string
	Settings       []ScopeSetting
	UUID           UUID
}

func LoadTheme

func LoadTheme(filename string) (*Theme, error)

func (*Theme) ClosestMatchingSetting

func (t *Theme) ClosestMatchingSetting(scope string) *ScopeSetting

func (*Theme) Spice

func (t *Theme) Spice(vr *render.ViewRegions) (ret render.Flavour)

func (Theme) String

func (t Theme) String() (ret string)

type UUID

type UUID string

TODO(q)

type UnpatchedLanguage

type UnpatchedLanguage struct {
	FileTypes      []string
	FirstLineMatch string
	RootPattern    RootPattern `json:"patterns"`
	Repository     map[string]*Pattern
	ScopeName      string
}

Jump to

Keyboard shortcuts

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