Struct rslint_regex::Parser[][src]

pub struct Parser<'pat> {
    pub pattern: &'pat str,
    pub file_id: usize,
    pub ecma_version: EcmaVersion,
    // some fields omitted
}

The actual parser that is responsible for parsing regex.

Fields

pattern: &'pat strfile_id: usizeecma_version: EcmaVersion

Implementations

impl<'pat> Parser<'pat>[src]

pub fn new(
    pattern: &'pat str,
    file_id: usize,
    offset: usize,
    ecma_version: EcmaVersion,
    strict: bool
) -> Result<Self>
[src]

Creates a new Parser from a given full pattern.

The given offset is used to convert the relative position in the pattern into an absolute position inside a file. The pattern must be the pattern without the leading and trailing /

Panics

Panics if there is no leading or trailing /

Returns

Returns a Result from parsing flags

pub fn new_from_pattern_and_flags(
    pattern: &'pat str,
    file_id: usize,
    offset: usize,
    ecma_version: EcmaVersion,
    strict: bool,
    flags: Flags
) -> Self
[src]

impl Parser<'_>[src]

pub fn parse(mut self: Self) -> Result<Regex>[src]

The main entrypoint for parsing a RegEx pattern.

Auto Trait Implementations

impl<'pat> RefUnwindSafe for Parser<'pat>[src]

impl<'pat> Send for Parser<'pat>[src]

impl<'pat> Sync for Parser<'pat>[src]

impl<'pat> Unpin for Parser<'pat>[src]

impl<'pat> UnwindSafe for Parser<'pat>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.