pub struct Pragma {
pub before: u32,
pub tokens: Vec<Token>,
pub span: Span,
}Expand description
One #pragma line, and where in the token stream it stood.
The line is kept beside the tokens rather than in them. A pragma can appear anywhere a
line can, which is between any two tokens at all, so leaving it in the stream would mean
every rule in the parser had to know about a token that is not part of any grammar. What a
consumer needs instead is where it was, and Pragma::before is that.
Nothing acts on one yet. The record is here so that when something does, #pragma pack
most likely, the position it has to be applied at has not already been thrown away.
Fields§
§before: u32The index in Tokens::tokens of the token this line came before.
tokens: Vec<Token>The tokens of the line, with the # and the pragma taken off.
span: SpanThe #, which is where a diagnostic about the line points.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Pragma
impl RefUnwindSafe for Pragma
impl Send for Pragma
impl Sync for Pragma
impl Unpin for Pragma
impl UnsafeUnpin for Pragma
impl UnwindSafe for Pragma
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