pub struct PragmaTracker;Expand description
Pragma state tracking for use strict, use warnings, etc.
Tracks pragma state throughout a Perl file
Implementations§
Source§impl PragmaTracker
impl PragmaTracker
Sourcepub fn build(ast: &Node) -> Vec<(Range<usize>, PragmaState)>
pub fn build(ast: &Node) -> Vec<(Range<usize>, PragmaState)>
Build a range-indexed pragma map from an AST
Sourcepub fn state_for_offset(
pragma_map: &[(Range<usize>, PragmaState)],
offset: usize,
) -> PragmaState
pub fn state_for_offset( pragma_map: &[(Range<usize>, PragmaState)], offset: usize, ) -> PragmaState
Get the pragma state at a specific byte offset
Sourcepub fn final_state(pragma_map: &[(Range<usize>, PragmaState)]) -> PragmaState
pub fn final_state(pragma_map: &[(Range<usize>, PragmaState)]) -> PragmaState
Get the final top-level pragma state after all lexical scopes close.
Auto Trait Implementations§
impl Freeze for PragmaTracker
impl RefUnwindSafe for PragmaTracker
impl Send for PragmaTracker
impl Sync for PragmaTracker
impl Unpin for PragmaTracker
impl UnsafeUnpin for PragmaTracker
impl UnwindSafe for PragmaTracker
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