Skip to main content

MacroTable

Struct MacroTable 

Source
pub struct MacroTable { /* private fields */ }
Expand description

マクロテーブル

Implementations§

Source§

impl MacroTable

Source

pub fn new() -> Self

新しいマクロテーブルを作成

Source

pub fn define( &mut self, def: MacroDef, interner: &StringInterner, ) -> Option<MacroDef>

マクロを定義(既存の定義があれば返す) __ で始まる builtin マクロは上書きされない

Source

pub fn undefine(&mut self, name: InternedStr) -> Option<MacroDef>

マクロを削除(削除された定義があれば返す)

Source

pub fn get(&self, name: InternedStr) -> Option<&MacroDef>

マクロ定義を取得

Source

pub fn is_defined(&self, name: InternedStr) -> bool

マクロが定義されているかどうか

Source

pub fn iter(&self) -> impl Iterator<Item = (&InternedStr, &MacroDef)>

全マクロをイテレート

Source

pub fn iter_target_macros(&self) -> impl Iterator<Item = &MacroDef>

ターゲットマクロのみをイテレート

Source

pub fn len(&self) -> usize

マクロ数を返す

Source

pub fn is_empty(&self) -> bool

テーブルが空かどうか

Source

pub fn user_defined(&self) -> impl Iterator<Item = (&InternedStr, &MacroDef)>

非ビルトインマクロのみをイテレート

Source

pub fn dump_filtered(&self, filter: &str, interner: &StringInterner)

特定のマクロを検索してダンプ(デバッグ用)

filter に含まれる文字列を名前に持つマクロを表示。 filter が空の場合は全マクロを表示。

Trait Implementations§

Source§

impl Debug for MacroTable

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MacroTable

Source§

fn default() -> MacroTable

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.