pub struct Lexer<'a, R: IdentResolver> { /* private fields */ }Expand description
Lexer(ジェネリック版)
Implementations§
Source§impl<'a> Lexer<'a, Interning<'a>>
impl<'a> Lexer<'a, Interning<'a>>
Sourcepub fn new(
source: &'a [u8],
file_id: FileId,
interner: &'a mut StringInterner,
) -> Self
pub fn new( source: &'a [u8], file_id: FileId, interner: &'a mut StringInterner, ) -> Self
新しいLexerを作成(通常モード)
Source§impl<'a> Lexer<'a, LookupOnly<'a>>
impl<'a> Lexer<'a, LookupOnly<'a>>
Sourcepub fn new_readonly(
source: &'a [u8],
file_id: FileId,
interner: &'a StringInterner,
) -> Self
pub fn new_readonly( source: &'a [u8], file_id: FileId, interner: &'a StringInterner, ) -> Self
新しいLexerを作成(読み取り専用モード)
このモードでは、既に intern 済みの識別子のみを認識する。 未知の識別子を検出した場合は LexError::UnknownIdentifier を返す。
Source§impl<'a, R: IdentResolver> Lexer<'a, R>
impl<'a, R: IdentResolver> Lexer<'a, R>
Sourcepub fn set_return_spaces(&mut self, enabled: bool)
pub fn set_return_spaces(&mut self, enabled: bool)
スペースをトークンとして返すかどうかを設定
Sourcepub fn return_spaces(&self) -> bool
pub fn return_spaces(&self) -> bool
現在のスペース返却モードを取得
Sourcepub fn current_location(&self) -> SourceLocation
pub fn current_location(&self) -> SourceLocation
現在位置を取得
Sourcepub fn next_token(&mut self) -> Result<Token>
pub fn next_token(&mut self) -> Result<Token>
次のトークンを取得
Auto Trait Implementations§
impl<'a, R> Freeze for Lexer<'a, R>where
R: Freeze,
impl<'a, R> RefUnwindSafe for Lexer<'a, R>where
R: RefUnwindSafe,
impl<'a, R> Send for Lexer<'a, R>where
R: Send,
impl<'a, R> Sync for Lexer<'a, R>where
R: Sync,
impl<'a, R> Unpin for Lexer<'a, R>where
R: Unpin,
impl<'a, R> UnsafeUnpin for Lexer<'a, R>where
R: UnsafeUnpin,
impl<'a, R> UnwindSafe for Lexer<'a, R>where
R: UnwindSafe,
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