UnNeg
}
+/// A statement
pub type Stmt = Spanned<Stmt_>;
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
pub struct Local {
pub pat: P<Pat>,
pub ty: Option<P<Ty>>,
+ /// Initializer expression to set the value, if any
pub init: Option<P<Expr>>,
pub id: NodeId,
pub span: Span,
UserProvided,
}
+/// An expression
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
pub struct Expr {
pub id: NodeId,
/// The RHS of an MBE macro is the only place `SubstNt`s are substituted.
/// Nothing special happens to misnamed or misplaced `SubstNt`s.
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
-#[doc="For macro invocations; parsing is delegated to the macro"]
pub enum TokenTree {
/// A single token
TtToken(Span, token::Token),
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)]
pub enum StrStyle {
+ /// A regular string, like `"fooo"`
CookedStr,
+ /// A raw string, like `r##"foo"##`
+ /// The uint is the number of `#` symbols used
RawStr(usize)
}
+/// A literal
pub type Lit = Spanned<Lit_>;
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)]
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
pub enum Lit_ {
+ /// A string literal (`"foo"`)
LitStr(InternedString, StrStyle),
+ /// A byte string (`b"foo"`)
LitBinary(Rc<Vec<u8>>),
+ /// A byte char (`b'f'`)
LitByte(u8),
+ /// A character literal (`'a'`)
LitChar(char),
+ /// An integer liteal (`1u8`)
LitInt(u64, LitIntType),
+ /// A float literal (`1f64` or `1E10f64`)
LitFloat(InternedString, FloatTy),
+ /// A float literal without a suffix (`1.0 or 1.0E10`)
LitFloatUnsuffixed(InternedString),
+ /// A boolean literal
LitBool(bool),
}