Documentation
¶
Overview ¶
Package sourceparse shares read-only source input and syntax between classifiers and literal previews.
Index ¶
- Variables
- func Call(node *sitter.Node) (*sitter.Node, []*sitter.Node)
- func GlobExpression(pattern string) (string, bool)
- func JavaScriptString(source string) (string, bool)
- func JavaScriptValue(node *sitter.Node, source []byte) (any, bool)
- func Open(path string) (*os.File, error)
- func Parse(data []byte, language *sitter.Language, canceled func() bool) (*sitter.Tree, error)
- func Path(cwd, path string) string
- type IgnoreRule
Constants ¶
This section is empty.
Variables ¶
View Source
var JavaScript = sitter.NewLanguage(treeSitterJavaScript.Language())
View Source
var Python = sitter.NewLanguage(python.Language())
View Source
var TypeScript = sitter.NewLanguage(typescript.LanguageTypescript())
Functions ¶
func GlobExpression ¶
GlobExpression translates gitignore glob syntax to a regular expression over slash-separated relative paths.
func JavaScriptString ¶
Types ¶
type IgnoreRule ¶
type IgnoreRule struct {
Pattern *regexp.Regexp
Negate bool
DirOnly bool
// basename rules have no inner slash and match an entry at any depth.
Basename bool
}
IgnoreRule is one pattern from an ignore file, matched against paths relative to the directory that holds the file.
func ParseIgnore ¶
func ParseIgnore(line string) (IgnoreRule, bool)
Click to show internal directories.
Click to hide internal directories.