pub struct TSLanguage { /* private fields */ }

Implementations§

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
tree sitter language to parse the source
Return the file language from path. Return None if the file type is not supported.
Create an AstGrep instance for the language
ignore trivial tokens in language matching
normalize pattern code before matching e.g. remove expression_statement, or prefer parsing {} to object over block
Configure meta variable special character By default $ is the metavar char, but in PHP it can be #
Some language does not accept $ as the leading char for identifiers. We need to change $ to other char at run-time to make parser happy, thus the name expando. By default this is the same as meta_var char so replacement is done at runtime.
extract MetaVariable from a given source string At runtime we need to use expand_char
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.