pub struct LangRust {}Expand description
Language Struct Definition
Implementations§
Source§impl LangRust
Language Constants
impl LangRust
Language Constants
pub const Text_fn: u16 = 96
pub const Text_LPAREN: u16 = 4
pub const Text_RPAREN: u16 = 5
pub const Text_LBRACE: u16 = 8
pub const Text_RBRACE: u16 = 9
pub const Text_let: u16 = 101
pub const Text_EQ: u16 = 70
pub const Text_SEMI: u16 = 2
pub const Text_COLON: u16 = 11
pub const Text_COMMA: u16 = 83
pub const Text_ARROW: u16 = 85
pub const Text_EQEQ: u16 = 71
pub const Text_NE: u16 = 72
pub const Text_LT: u16 = 74
pub const Text_GT: u16 = 73
pub const Text_LE: u16 = 76
pub const Text_GE: u16 = 75
pub const Text_AMPAMP: u16 = 56
pub const Text_PIPEPIPE: u16 = 57
pub const Text_PLUS: u16 = 14
pub const Text_MINUS: u16 = 49
pub const Text_STAR: u16 = 15
pub const Text_SLASH: u16 = 50
pub const Text_PERCENT: u16 = 51
pub const attribute_item: u16 = 170
pub const inner_attribute_item: u16 = 171
pub const attribute: u16 = 172
pub const integer_literal: u16 = 127
pub const float_literal: u16 = 151
pub const string_literal: u16 = 311
pub const boolean_literal: u16 = 313
pub const char_literal: u16 = 130
pub const type_identifier: u16 = 354
pub const scoped_identifier: u16 = 243
pub const scoped_type_identifier: u16 = 245
pub const field_identifier: u16 = 351
pub const shorthand_field_identifier: u16 = 353
pub const identifier: u16 = 1
pub const ordered_field_declaration_list: u16 = 183
pub const parameter: u16 = 213
pub const self_param: u16 = 211
pub const self_keyword: u16 = 143
pub const parameters: u16 = 210
pub const let_declaration: u16 = 203
pub const visibility_modifier: u16 = 215
pub const field_declaration: u16 = 182
pub const block: u16 = 293
pub const source_file: u16 = 157
pub const mod_item: u16 = 173
pub const struct_item: u16 = 176
pub const enum_item: u16 = 178
pub const enum_variant_list: u16 = 179
pub const associated_type: u16 = 195
pub const type_item: u16 = 187
pub const array_type: u16 = 220
pub const tuple_type: u16 = 223
pub const abstract_type: u16 = 235
pub const bounded_type: u16 = 228
pub const trait_bounds: u16 = 196
pub const lifetime: u16 = 219
pub const function_type: u16 = 222
pub const reference_type: u16 = 232
pub const pointer_type: u16 = 233
pub const generic_type: u16 = 226
pub const tuple_pattern: u16 = 296
pub const struct_pattern: u16 = 299
pub const or_pattern: u16 = 307
pub const slice_pattern: u16 = 297
pub const reference_pattern: u16 = 306
pub const mut_pattern: u16 = 302
pub const ref_pattern: u16 = 304
pub const text_node: u16 = 0
pub const generic_type_with_turbofish: u16 = 227
pub const index_expression: u16 = 286
pub const type_cast_expression: u16 = 253
pub const type_parameter: u16 = 201
pub const const_parameter: u16 = 200
pub const where_clause: u16 = 191
pub const where_predicate: u16 = 192
pub const enum_variant: u16 = 180
pub const impl_item: u16 = 193
pub const trait_item: u16 = 194
pub const const_item: u16 = 185
pub const static_item: u16 = 186
pub const function_item: u16 = 188
pub const function_signature_item: u16 = 189
pub const mutable_specifier: u16 = 122
pub const expression_statement: u16 = 160
pub const assignment_expression: u16 = 251
pub const binary_expression: u16 = 250
pub const operator: u16 = 0
pub const call_expression: u16 = 256
pub const reference_expression: u16 = 249
pub const field_expression: u16 = 288
pub const try_expression: u16 = 248
pub const await_expression: u16 = 287
pub const parenthesized_expression: u16 = 259
pub const macro_invocation: u16 = 239
pub const macro_definition: u16 = 161
pub const arguments: u16 = 257
pub const primitive_type: u16 = 32
pub const struct_expression: u16 = 262
pub const if_expression: u16 = 267
pub const match_expression: u16 = 272
pub const match_block: u16 = 273
pub const while_expression: u16 = 277
pub const loop_expression: u16 = 278
pub const for_expression: u16 = 279
pub const array_expression: u16 = 258
pub const tuple_expression: u16 = 260
pub const unit_expression: u16 = 261
pub const range_expression: u16 = 246
pub const unary_expression: u16 = 247
pub const tuple_struct_pattern: u16 = 298
pub const closure_expression: u16 = 281
pub const closure_parameters: u16 = 282
pub const super_token: u16 = 144
pub const crate_token: u16 = 145
pub const field_name: u16 = 19
pub const field_type: u16 = 28
pub const field_pattern: u16 = 24
pub const field_return_type: u16 = 25
pub const field_parameters: u16 = 22
pub const field_bounds: u16 = 6
pub const field_default_type: u16 = 9
pub const field_macro: u16 = 18
pub const field_body: u16 = 5
pub const field_left: u16 = 15
pub const field_right: u16 = 26
pub const field_operator: u16 = 20
pub const field_function: u16 = 13
pub const field_arguments: u16 = 4
pub const field_type_arguments: u16 = 29
pub const field_value: u16 = 31
pub const field_field: u16 = 12
pub const field_trait: u16 = 27
pub const field_element: u16 = 11
pub const field_length: u16 = 16
pub const field_consequence: u16 = 8
pub const field_argument: u16 = 3
pub const field_condition: u16 = 7
pub const field_path: u16 = 23
Trait Implementations§
Source§impl LanguageTrait for LangRust
Language Trait Implementation
impl LanguageTrait for LangRust
Language Trait Implementation
Source§fn parse(text: impl AsRef<[u8]>) -> Option<Box<dyn ParseTree>>
fn parse(text: impl AsRef<[u8]>) -> Option<Box<dyn ParseTree>>
Parse source code and return a generic parse tree.
First tries the custom parse_impl from LanguageTraitImpl. If that returns None, falls back to tree-sitter parsing if available.
Source§fn supported_extensions() -> &'static [&'static str]
fn supported_extensions() -> &'static [&'static str]
Return the list of supported file extensions for this language
Source§fn block_kind(kind_id: u16) -> BlockKind
fn block_kind(kind_id: u16) -> BlockKind
Get the Block kind for a given token ID
Source§fn block_kind_with_parent(
kind_id: u16,
field_id: u16,
parent_kind_id: u16,
) -> BlockKind
fn block_kind_with_parent( kind_id: u16, field_id: u16, parent_kind_id: u16, ) -> BlockKind
Get the Block kind for a given token ID with parent context
Source§fn is_test_attribute(node: &dyn ParseNode, source: &[u8]) -> bool
fn is_test_attribute(node: &dyn ParseNode, source: &[u8]) -> bool
Check if a parse node is a test attribute that should cause the next item to be skipped
Source§fn token_str(kind_id: u16) -> Option<&'static str>
fn token_str(kind_id: u16) -> Option<&'static str>
Get the string representation of a token ID
Source§fn is_valid_token(kind_id: u16) -> bool
fn is_valid_token(kind_id: u16) -> bool
Check if a token ID is valid
Source§fn manifest_name() -> &'static str
fn manifest_name() -> &'static str
Source§fn container_dirs() -> &'static [&'static str]
fn container_dirs() -> &'static [&'static str]
fn collect_init<'tcx>(cc: &'tcx CompileCtxt<'tcx>) -> ScopeStack<'tcx>
Source§fn collect_symbols<'tcx, C>(
unit: CompileUnit<'tcx>,
node: HirNode<'tcx>,
scope_stack: ScopeStack<'tcx>,
config: &C,
) -> &'tcx Scope<'tcx>
fn collect_symbols<'tcx, C>( unit: CompileUnit<'tcx>, node: HirNode<'tcx>, scope_stack: ScopeStack<'tcx>, config: &C, ) -> &'tcx Scope<'tcx>
fn bind_symbols<'tcx, C>( unit: CompileUnit<'tcx>, node: HirNode<'tcx>, globals: &'tcx Scope<'tcx>, config: &C, )
Source§fn name_field() -> u16
fn name_field() -> u16
Source§fn type_field() -> u16
fn type_field() -> u16
Source§fn trait_field() -> u16
fn trait_field() -> u16
impl Trait for Type { } to identify the trait being implemented.Source§fn is_container(name: &str) -> bool
fn is_container(name: &str) -> bool
Source§impl LanguageTraitImpl for LangRust
impl LanguageTraitImpl for LangRust
Source§fn block_kind_with_parent_impl(
kind_id: u16,
field_id: u16,
parent_kind_id: u16,
) -> BlockKind
fn block_kind_with_parent_impl( kind_id: u16, field_id: u16, parent_kind_id: u16, ) -> BlockKind
Block kind with parent context - handles tuple struct fields
Source§fn is_test_attribute_impl(node: &dyn ParseNode, source: &[u8]) -> bool
fn is_test_attribute_impl(node: &dyn ParseNode, source: &[u8]) -> bool
Check if the given parse node is a Rust test attribute. Detects: #test, #[cfg(test)], #[tokio::test], #[async_std::test], etc.
fn collect_init_impl<'tcx>(cc: &'tcx CompileCtxt<'tcx>) -> ScopeStack<'tcx>
Source§fn parse_impl(text: impl AsRef<[u8]>) -> Option<Box<dyn ParseTree>>
fn parse_impl(text: impl AsRef<[u8]>) -> Option<Box<dyn ParseTree>>
Source§fn supported_extensions_impl() -> &'static [&'static str]
fn supported_extensions_impl() -> &'static [&'static str]
Source§fn manifest_name_impl() -> &'static str
fn manifest_name_impl() -> &'static str
Source§fn container_dirs_impl() -> &'static [&'static str]
fn container_dirs_impl() -> &'static [&'static str]
fn collect_symbols_impl<'tcx, C>( unit: CompileUnit<'tcx>, node: HirNode<'tcx>, scope_stack: ScopeStack<'tcx>, config: &C, ) -> &'tcx Scope<'tcx>
fn bind_symbols_impl<'tcx, C>( unit: CompileUnit<'tcx>, node: HirNode<'tcx>, globals: &'tcx Scope<'tcx>, config: &C, )
Auto Trait Implementations§
impl Freeze for LangRust
impl RefUnwindSafe for LangRust
impl Send for LangRust
impl Sync for LangRust
impl Unpin for LangRust
impl UnwindSafe for LangRust
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more