pub struct SfcParser<'i, 'e, 'p> {
pub ignore_empty: bool,
/* private fields */
}Fields§
§ignore_empty: boolImplementations§
Source§impl SfcParser<'_, '_, '_>
impl SfcParser<'_, '_, '_>
Sourcepub fn process_element_attributes(
&mut self,
raw_attributes: Vec<Attribute>,
attrs_or_bindings: &mut Vec<AttributeOrBinding>,
vue_directives: &mut Option<Box<VueDirectives>>,
) -> bool
pub fn process_element_attributes( &mut self, raw_attributes: Vec<Attribute>, attrs_or_bindings: &mut Vec<AttributeOrBinding>, vue_directives: &mut Option<Box<VueDirectives>>, ) -> bool
Returns true when v-pre is discovered
Sourcepub fn try_parse_directive(
&mut self,
raw_attribute: Attribute,
attrs_or_bindings: &mut Vec<AttributeOrBinding>,
vue_directives: &mut Option<Box<VueDirectives>>,
) -> Result<(), Attribute>
pub fn try_parse_directive( &mut self, raw_attribute: Attribute, attrs_or_bindings: &mut Vec<AttributeOrBinding>, vue_directives: &mut Option<Box<VueDirectives>>, ) -> Result<(), Attribute>
Returns true if it was recognized as a directive (regardless if it was successfully parsed)
Source§impl SfcParser<'_, '_, '_>
impl SfcParser<'_, '_, '_>
pub fn parse_sfc_custom_block_element( &mut self, element: Element, ) -> Option<SfcCustomBlock>
Source§impl SfcParser<'_, '_, '_>
impl SfcParser<'_, '_, '_>
Sourcepub fn parse_sfc_script_element(
&mut self,
element: Element,
) -> Result<Option<SfcScriptBlock>, ParseError>
pub fn parse_sfc_script_element( &mut self, element: Element, ) -> Result<Option<SfcScriptBlock>, ParseError>
Parses the <script> and <script setup>, both in EcmaScript and TypeScript
pub fn parse_module( &mut self, raw: &str, syntax: Syntax, span: Span, ) -> Result<Module, ParseError>
pub fn parse_expr( &mut self, raw: &str, syntax: Syntax, span: Span, ) -> Result<Box<Expr>, ParseError>
pub fn parse_pat( &mut self, raw: &str, syntax: Syntax, span: Span, ) -> Result<Pat, ParseError>
Source§impl SfcParser<'_, '_, '_>
impl SfcParser<'_, '_, '_>
Sourcepub fn parse_sfc(&mut self) -> Result<SfcDescriptor, ParseError>
pub fn parse_sfc(&mut self) -> Result<SfcDescriptor, ParseError>
Parses self.input as an SFC, producing an SfcDescriptor.
When Err(ParseError) is returned, that means unrecoverable error was discovered.
Sourcepub fn parse_html_document_fragment(
&mut self,
) -> Result<DocumentFragment, Error>
pub fn parse_html_document_fragment( &mut self, ) -> Result<DocumentFragment, Error>
Adapted from swc_html_parser
Sourcepub fn use_rawtext_content(
&mut self,
element_content: Option<&DocumentFragment>,
element_children: &[Child],
) -> Option<(&str, Span)>
pub fn use_rawtext_content( &mut self, element_content: Option<&DocumentFragment>, element_children: &[Child], ) -> Option<(&str, Span)>
Gets the raw contents of Element and also clears errors related to parsing it
pub fn report_error(&mut self, error: ParseError)
Source§impl SfcParser<'_, '_, '_>
impl SfcParser<'_, '_, '_>
pub fn parse_sfc_style_element( &mut self, element: Element, ) -> Option<SfcStyleBlock>
Source§impl SfcParser<'_, '_, '_>
impl SfcParser<'_, '_, '_>
pub fn parse_template_to_ir( &mut self, root_element: Element, ) -> Option<SfcTemplateBlock>
Trait Implementations§
Auto Trait Implementations§
impl<'i, 'e, 'p> Freeze for SfcParser<'i, 'e, 'p>
impl<'i, 'e, 'p> !RefUnwindSafe for SfcParser<'i, 'e, 'p>
impl<'i, 'e, 'p> !Send for SfcParser<'i, 'e, 'p>
impl<'i, 'e, 'p> !Sync for SfcParser<'i, 'e, 'p>
impl<'i, 'e, 'p> Unpin for SfcParser<'i, 'e, 'p>
impl<'i, 'e, 'p> !UnwindSafe for SfcParser<'i, 'e, 'p>
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
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>
Converts
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>
Converts
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