Documentation
¶
Overview ¶
Package language adapts each supported source language to a common shape: its file extensions, its tree-sitter grammar, and the small set of node kinds the parser and taint walker need to recognize (a function, a call, an assignment, a string literal)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsUnsupportedSource ¶
IsUnsupportedSource reports whether lowercased ext is a known source-language extension whose missing adapter creates a coverage gap. Unrelated extensions also lack adapters but return false.
Types ¶
type Adapter ¶
type Adapter struct {
ID ID
Extensions []string // includes the leading dot
Grammar Grammar
// contains filtered or unexported fields
}
Adapter is everything the source pipeline needs for one language
func All ¶
func All() []*Adapter
All returns every supported language's adapter, sorted by ID. Every adapter is always returned, even one whose grammar fails to load: callers must report that as a coverage skip, never drop the language silently.
func ForExt ¶
ForExt returns the adapter that owns extension ext (including the dot), or nil if no language claims it
func (*Adapter) HasQuery ¶
HasQuery reports whether a query file exists for this language, for optional queries such as decorators
type Grammar ¶
type Grammar struct {
FunctionKinds []string // function/method definitions
ClassKinds []string // class definitions; empty for languages with none
CallKinds []string // call-shaped expressions (includes constructors)
AssignKinds []string // assignment and declaration-with-initializer nodes
StringKinds []string // string literal node kinds
MemberKinds []string // member/attribute/field access expressions
ReturnKinds []string
ForKinds []string // loop constructs, used for "registration in a loop"
}
Grammar is the node-kind vocabulary the parser and the taint walker use to recognize a construct without caring which grammar produced it