pub struct Parser<'pat> {
pub pattern: &'pat str,
pub file_id: usize,
pub ecma_version: EcmaVersion,
/* private fields */
}Expand description
The actual parser that is responsible for parsing regex.
Fields§
§pattern: &'pat str§file_id: usize§ecma_version: EcmaVersionImplementations§
Source§impl<'pat> Parser<'pat>
impl<'pat> Parser<'pat>
Sourcepub fn new(
pattern: &'pat str,
file_id: usize,
offset: usize,
ecma_version: EcmaVersion,
strict: bool,
) -> Result<Self>
pub fn new( pattern: &'pat str, file_id: usize, offset: usize, ecma_version: EcmaVersion, strict: bool, ) -> Result<Self>
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
Auto Trait Implementations§
impl<'pat> Freeze for Parser<'pat>
impl<'pat> RefUnwindSafe for Parser<'pat>
impl<'pat> Send for Parser<'pat>
impl<'pat> Sync for Parser<'pat>
impl<'pat> Unpin for Parser<'pat>
impl<'pat> UnwindSafe for Parser<'pat>
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