pub struct ArmTracker { /* private fields */ }Expand description
Tracks the lexical arm active at each token in a C-family source file.
This deliberately recognises only directive nesting and literal 0 / 1
conditions. It neither expands macros nor chooses an unknown arm; callers
use the resulting paths solely to avoid comparing two arms that cannot
coexist in one build.
Implementations§
Source§impl ArmTracker
impl ArmTracker
Sourcepub fn begin(&mut self, condition: StaticCondition)
pub fn begin(&mut self, condition: StaticCondition)
Start a preprocessor conditional and enter its first arm.
Sourcepub fn next_arm(&mut self, condition: StaticCondition)
pub fn next_arm(&mut self, condition: StaticCondition)
Advance to an #elif or #else arm.
A branch after a literal true arm is unreachable. Otherwise a literal
false #elif is unreachable while an unknown condition remains
possible, which is the conservative result without preprocessing.
Trait Implementations§
Source§impl Debug for ArmTracker
impl Debug for ArmTracker
Source§impl Default for ArmTracker
impl Default for ArmTracker
Source§fn default() -> ArmTracker
fn default() -> ArmTracker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ArmTracker
impl RefUnwindSafe for ArmTracker
impl Send for ArmTracker
impl Sync for ArmTracker
impl Unpin for ArmTracker
impl UnsafeUnpin for ArmTracker
impl UnwindSafe for ArmTracker
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