pub struct JavaScriptLanguage {
pub jsx: bool,
pub typescript: bool,
pub experimental: bool,
pub strict_mode: bool,
pub ecma_version: EcmaVersion,
}Expand description
JavaScript 语言实现
Fields§
§jsx: bool是否允许 JSX 语法
typescript: bool是否允许 TypeScript 语法
experimental: bool是否允许实验性语
strict_mode: bool是否严格模式
ecma_version: EcmaVersionECMAScript 版本
Implementations§
Trait Implementations§
Source§impl Builder<JavaScriptLanguage> for JavaScriptBuilder
impl Builder<JavaScriptLanguage> for JavaScriptBuilder
Source§fn build<'a, S: Source + ?Sized>(
&self,
source: &S,
_edits: &[TextEdit],
_cache: &'a mut impl BuilderCache<JavaScriptLanguage>,
) -> BuildOutput<JavaScriptLanguage>
fn build<'a, S: Source + ?Sized>( &self, source: &S, _edits: &[TextEdit], _cache: &'a mut impl BuilderCache<JavaScriptLanguage>, ) -> BuildOutput<JavaScriptLanguage>
Builds the structure from the source text.
Source§impl Clone for JavaScriptLanguage
impl Clone for JavaScriptLanguage
Source§fn clone(&self) -> JavaScriptLanguage
fn clone(&self) -> JavaScriptLanguage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for JavaScriptLanguage
impl Debug for JavaScriptLanguage
Source§impl Default for JavaScriptLanguage
impl Default for JavaScriptLanguage
Source§impl Language for JavaScriptLanguage
impl Language for JavaScriptLanguage
Source§const CATEGORY: LanguageCategory = LanguageCategory::Programming
const CATEGORY: LanguageCategory = LanguageCategory::Programming
The category of the language.
Source§type TokenType = JavaScriptSyntaxKind
type TokenType = JavaScriptSyntaxKind
The token type used to represent different token and node types in the language. Read more
Source§type ElementType = JavaScriptSyntaxKind
type ElementType = JavaScriptSyntaxKind
The element type used to represent composite structures in the parsed tree. Read more
Source§type TypedRoot = JavaScriptRoot
type TypedRoot = JavaScriptRoot
The root type for the parsed tree that represents the top-level structure of the language. Read more
Source§impl Lexer<JavaScriptLanguage> for JavaScriptLexer
impl Lexer<JavaScriptLanguage> for JavaScriptLexer
Source§fn lex<'a, S: Source + ?Sized>(
&self,
text: &S,
_edits: &[TextEdit],
cache: &'a mut impl LexerCache<JavaScriptLanguage>,
) -> LexOutput<JavaScriptLanguage>
fn lex<'a, S: Source + ?Sized>( &self, text: &S, _edits: &[TextEdit], cache: &'a mut impl LexerCache<JavaScriptLanguage>, ) -> LexOutput<JavaScriptLanguage>
Tokenizes the given source text into a sequence of tokens. Read more
Source§impl Parser<JavaScriptLanguage> for JavaScriptParser
impl Parser<JavaScriptLanguage> for JavaScriptParser
Source§fn parse<'a, S: Source + ?Sized>(
&self,
text: &'a S,
edits: &[TextEdit],
cache: &'a mut impl ParseCache<JavaScriptLanguage>,
) -> ParseOutput<'a, JavaScriptLanguage>
fn parse<'a, S: Source + ?Sized>( &self, text: &'a S, edits: &[TextEdit], cache: &'a mut impl ParseCache<JavaScriptLanguage>, ) -> ParseOutput<'a, JavaScriptLanguage>
The core parsing entry point. Read more
Source§impl PartialEq for JavaScriptLanguage
impl PartialEq for JavaScriptLanguage
Source§impl Pratt<JavaScriptLanguage> for JavaScriptParser
impl Pratt<JavaScriptLanguage> for JavaScriptParser
Source§fn primary<'a, S: Source + ?Sized>(
&self,
state: &mut ParserState<'a, JavaScriptLanguage, S>,
) -> &'a GreenNode<'a, JavaScriptLanguage>
fn primary<'a, S: Source + ?Sized>( &self, state: &mut ParserState<'a, JavaScriptLanguage, S>, ) -> &'a GreenNode<'a, JavaScriptLanguage>
Parses a primary expression (e.g., literals, identifiers, group).
Source§fn infix<'a, S: Source + ?Sized>(
&self,
state: &mut ParserState<'a, JavaScriptLanguage, S>,
left: &'a GreenNode<'a, JavaScriptLanguage>,
min_precedence: u8,
) -> Option<&'a GreenNode<'a, JavaScriptLanguage>>
fn infix<'a, S: Source + ?Sized>( &self, state: &mut ParserState<'a, JavaScriptLanguage, S>, left: &'a GreenNode<'a, JavaScriptLanguage>, min_precedence: u8, ) -> Option<&'a GreenNode<'a, JavaScriptLanguage>>
Handles infix and postfix operators. Read more
impl Copy for JavaScriptLanguage
impl Eq for JavaScriptLanguage
impl StructuralPartialEq for JavaScriptLanguage
Auto Trait Implementations§
impl Freeze for JavaScriptLanguage
impl RefUnwindSafe for JavaScriptLanguage
impl Send for JavaScriptLanguage
impl Sync for JavaScriptLanguage
impl Unpin for JavaScriptLanguage
impl UnwindSafe for JavaScriptLanguage
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
Mutably borrows from an owned value. Read more