Skip to main content

LanguageSpec

Struct LanguageSpec 

Source
pub struct LanguageSpec {
Show 14 fields pub name: &'static str, pub extensions: &'static [&'static str], pub grammar: fn() -> Language, pub query_source: &'static str, pub comment_kinds: &'static [&'static str], pub module_path: fn(&str) -> Vec<String>, pub path_separators: &'static [&'static str], pub absolutize: fn(path: &str, file: &str) -> Vec<String>, pub receivers: &'static [&'static str], pub doc_skip_kinds: &'static [&'static str], pub manifest: Option<&'static ManifestSpec>, pub inline: Option<&'static InlineSpec>, pub file_refs: bool, pub implicit_interfaces: bool,
}

Fields§

§name: &'static str§extensions: &'static [&'static str]§grammar: fn() -> Language§query_source: &'static str§comment_kinds: &'static [&'static str]§module_path: fn(&str) -> Vec<String>

Maps a repo-relative file path to its module/package path segments — what import statements are matched against. Pure data transform; the resolver stays language-blind.

§path_separators: &'static [&'static str]

Splits an import/reference path into segments (:: vs / vs .).

§absolutize: fn(path: &str, file: &str) -> Vec<String>

Turns a raw import/reference path into absolute module segments, resolving language-relative forms (super::, leading dots, ./) against the path’s own file. Data transform; resolver stays blind.

§receivers: &'static [&'static str]

Receiver keywords (self, this): a qualified reference through one binds within the reference’s enclosing type.

§doc_skip_kinds: &'static [&'static str]

Node kinds the doc-comment walk may step over (max 2) between a definition and its doc — e.g. Unreal’s UCLASS(...) line, which parses as an expression_statement between comment and class.

§manifest: Option<&'static ManifestSpec>

Package manifest shape, when the language has one that names module roots (see ManifestSpec).

§inline: Option<&'static InlineSpec>

Secondary inline grammar applied to designated container-node ranges, whose captures merge into the file’s facts (markdown’s block/inline split).

§file_refs: bool

References in this language are document paths naming corpus files ([text](docs/guide.md#setup)), not symbol paths: the resolver binds them by exact file path — with or without the language’s extensions, #fragment to the target file’s unique def whose name slugifies to the fragment — and never through the symbol tiers. Evidence or nothing: a dead link stays unresolved.

§implicit_interfaces: bool

Interface satisfaction is implicit (Go): no syntax names the interface at the implementing type, so the resolver runs a structural method-set pass instead of @trait/@trait.impl pairing. Pure data; the engine never branches on language name.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.