Delimiter in rustc_ast::token - Rust (original) (raw)

pub enum Delimiter {
    Parenthesis,
    Brace,
    Bracket,
    Invisible(InvisibleOrigin),
}

Expand description

Describes how a sequence of token trees is delimited. Cannot use proc_macro::Delimiter directly because this structure should implement some additional traits.

§

( ... )

§

{ ... }

§

[ ... ]

§

∅ ... ∅An invisible delimiter, that may, for example, appear around tokens coming from a “macro variable” $var. It is important to preserve operator priorities in cases like$var * 3 where $var is 1 + 2. Invisible delimiters might not survive roundtrip of a token stream through a string.

§

§

§

§

§

§

§

§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 3 bytes

Size for each variant: