pub struct MacroTable { /* private fields */ }Expand description
マクロテーブル
Implementations§
Source§impl MacroTable
impl MacroTable
Sourcepub fn define(
&mut self,
def: MacroDef,
interner: &StringInterner,
) -> Option<MacroDef>
pub fn define( &mut self, def: MacroDef, interner: &StringInterner, ) -> Option<MacroDef>
マクロを定義(既存の定義があれば返す)
__ で始まる builtin マクロは上書きされない
Sourcepub fn undefine(&mut self, name: InternedStr) -> Option<MacroDef>
pub fn undefine(&mut self, name: InternedStr) -> Option<MacroDef>
マクロを削除(削除された定義があれば返す)
Sourcepub fn get(&self, name: InternedStr) -> Option<&MacroDef>
pub fn get(&self, name: InternedStr) -> Option<&MacroDef>
マクロ定義を取得
Sourcepub fn is_defined(&self, name: InternedStr) -> bool
pub fn is_defined(&self, name: InternedStr) -> bool
マクロが定義されているかどうか
Sourcepub fn iter(&self) -> impl Iterator<Item = (&InternedStr, &MacroDef)>
pub fn iter(&self) -> impl Iterator<Item = (&InternedStr, &MacroDef)>
全マクロをイテレート
Sourcepub fn iter_target_macros(&self) -> impl Iterator<Item = &MacroDef>
pub fn iter_target_macros(&self) -> impl Iterator<Item = &MacroDef>
ターゲットマクロのみをイテレート
Sourcepub fn user_defined(&self) -> impl Iterator<Item = (&InternedStr, &MacroDef)>
pub fn user_defined(&self) -> impl Iterator<Item = (&InternedStr, &MacroDef)>
非ビルトインマクロのみをイテレート
Sourcepub fn dump_filtered(&self, filter: &str, interner: &StringInterner)
pub fn dump_filtered(&self, filter: &str, interner: &StringInterner)
特定のマクロを検索してダンプ(デバッグ用)
filter に含まれる文字列を名前に持つマクロを表示。
filter が空の場合は全マクロを表示。
Trait Implementations§
Source§impl Debug for MacroTable
impl Debug for MacroTable
Source§impl Default for MacroTable
impl Default for MacroTable
Source§fn default() -> MacroTable
fn default() -> MacroTable
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MacroTable
impl RefUnwindSafe for MacroTable
impl Send for MacroTable
impl Sync for MacroTable
impl Unpin for MacroTable
impl UnsafeUnpin for MacroTable
impl UnwindSafe for MacroTable
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