Documentation ¶
Index ¶
- Variables
- func CheckPCRE(re string) (string, error)
- func ConvertCSON(data []byte) ([]byte, error)
- func ConvertProto(path, ext string, data []byte) (*grammar.Rule, []string, error)
- type ConversionError
- type Converter
- func (conv *Converter) AddGrammar(source string) error
- func (conv *Converter) AllScopes() map[string]bool
- func (conv *Converter) ConvertGrammars(update bool) error
- func (conv *Converter) Load(src string) *Repository
- func (conv *Converter) Report(verbose bool) error
- func (conv *Converter) WriteGrammarList() error
- func (conv *Converter) WriteJSON(rulePath string) error
- func (conv *Converter) WriteProto(path string) error
- type DuplicateScopeError
- type InvalidRegexError
- type LoadedFile
- type MissingIncludeError
- type MissingScopeError
- type Repository
- func (repo *Repository) AddFile(path string, rule *grammar.Rule, uk []string)
- func (repo *Repository) CompareScopes(scopes []string)
- func (repo *Repository) Fail(err error)
- func (repo *Repository) FixRules(knownScopes map[string]bool)
- func (repo *Repository) Scopes() (scopes []string)
- func (repo *Repository) String() string
- type UndeclaredScopeError
- type UnexpectedScopeError
- type UnknownKeysError
Constants ¶
This section is empty.
Variables ¶
View Source
var GrammarAliases = map[string]string{
"source.erb": "text.html.erb",
"source.cpp": "source.c++",
"source.less": "source.css.less",
"text.html.markdown": "text.md",
"source.gfm": "text.md",
"source.php": "text.html.php",
"text.plain": "",
"source.asciidoc": "text.html.asciidoc",
"source.perl6": "source.raku",
"source.scss": "source.css.scss",
"source.git-config": "source.gitconfig",
"source.smarty": "text.html.smarty",
"text.slm": "text.slim",
"text.pug": "text.jade",
}
View Source
var GrammarsInNonStdPath = map[string]bool{ "conllu-linguist-grammar": true, "hy.tmLanguage": true, "abl-tmlanguage": true, "avro.tmLanguage": true, }
GrammarsInNonStdPath is a list of grammars known to have their syntax .cson or .json files in non-standard directories.
View Source
var IgnoredFiles = map[string]bool{ "ballerina-grammar/syntaxes/ballerina.monarch.json": true, "oz-tmbundle/Originals/Oz.tmLanguage": true, "abl-tmlanguage/package-lock.json": true, "abl-tmlanguage/package.json": true, "avro.tmLanguage/package-lock.json": true, "avro.tmLanguage/package.json": true, "avro.tmLanguage/avro-avsc-json-schema.json": true, "liquid-tm-grammar/tests/syntaxes/css.tmLanguage.json": true, "liquid-tm-grammar/tests/syntaxes/html.tmLanguage.json": true, "liquid-tm-grammar/tests/syntaxes/javascript.tmLanguage.json": true, "liquid-tm-grammar/tests/syntaxes/json.tmLanguage.json": true, "godot-vscode-plugin/syntaxes/.prettierrc.json": true, }
IgnoredFiles is a list of files that look like syntax files but aren't, or are known to be broken and never likely to be fixed.
View Source
var KnownFields = map[string]bool{ "$schema": true, "comment": true, "uuid": true, "author": true, "comments": true, "macros": true, "fileTypes": true, "firstLineMatch": true, "keyEquivalent": true, "foldingStopMarker": true, "foldingStartMarker": true, "foldingEndMarker": true, "maxTokensPerLine": true, "limitLineLength": true, "hideFromUser": true, "injectionSelector": true, "swallow": true, "foregroundColor": true, "backgroundColor": true, "increaseIndentPattern": true, "beginComment": true, "endComment": true, }
Functions ¶
func ConvertCSON ¶
Types ¶
type ConversionError ¶
func (*ConversionError) Error ¶
func (err *ConversionError) Error() string
type Converter ¶
type Converter struct { Loaded map[string]*Repository // contains filtered or unexported fields }
func NewConverter ¶
func (*Converter) AddGrammar ¶
func (*Converter) ConvertGrammars ¶
func (*Converter) Load ¶
func (conv *Converter) Load(src string) *Repository
func (*Converter) WriteGrammarList ¶
func (*Converter) WriteProto ¶
type DuplicateScopeError ¶
type DuplicateScopeError struct { Original *Repository Duplicate string }
func (*DuplicateScopeError) Error ¶
func (err *DuplicateScopeError) Error() string
type InvalidRegexError ¶
type InvalidRegexError struct { File *LoadedFile Err error }
func (*InvalidRegexError) Error ¶
func (err *InvalidRegexError) Error() string
type LoadedFile ¶
func (*LoadedFile) String ¶
func (f *LoadedFile) String() string
type MissingIncludeError ¶
type MissingIncludeError struct { File *LoadedFile Include string }
func (*MissingIncludeError) Error ¶
func (err *MissingIncludeError) Error() string
type MissingScopeError ¶
type MissingScopeError struct {
Scope string
}
func (*MissingScopeError) Error ¶
func (err *MissingScopeError) Error() string
type Repository ¶
type Repository struct { Source string Upstream string Files map[string]*LoadedFile Errors []error }
func LoadFromFilesystem ¶
func LoadFromFilesystem(root, src string) *Repository
func LoadFromURL ¶
func LoadFromURL(src string) *Repository
func (*Repository) AddFile ¶
func (repo *Repository) AddFile(path string, rule *grammar.Rule, uk []string)
func (*Repository) CompareScopes ¶
func (repo *Repository) CompareScopes(scopes []string)
func (*Repository) Fail ¶
func (repo *Repository) Fail(err error)
func (*Repository) FixRules ¶
func (repo *Repository) FixRules(knownScopes map[string]bool)
func (*Repository) Scopes ¶
func (repo *Repository) Scopes() (scopes []string)
func (*Repository) String ¶
func (repo *Repository) String() string
type UndeclaredScopeError ¶
type UndeclaredScopeError struct {
Path string
}
func (*UndeclaredScopeError) Error ¶
func (err *UndeclaredScopeError) Error() string
type UnexpectedScopeError ¶
type UnexpectedScopeError struct { File *LoadedFile Scope string }
func (*UnexpectedScopeError) Error ¶
func (err *UnexpectedScopeError) Error() string
type UnknownKeysError ¶
type UnknownKeysError struct { File *LoadedFile Keys []string }
func (*UnknownKeysError) Error ¶
func (err *UnknownKeysError) Error() string
Click to show internal directories.
Click to hide internal directories.