perl-pragma
Pragma state tracking for Perl source analysis.
Overview
perl-pragma walks a perl-ast AST to track use strict, no strict,
use warnings, and no warnings statements. It builds a range-indexed
pragma map so callers can query the effective pragma state at any byte offset
in the source.
Public API
PragmaState-- tracksstrict_vars,strict_subs,strict_refs, andwarningsbooleans. Providesall_strict()andDefault.PragmaTracker-- walks an AST viabuild()to produce a sortedVec<(Range<usize>, PragmaState)>, and offersstate_for_offset()to query it.
Workspace Role
Tier 1 leaf crate. Depends only on perl-ast. Consumed by
perl-parser-core and perl-lsp-diagnostics to provide scope-aware
pragma analysis for parsing and diagnostic flows.
License
MIT OR Apache-2.0