perl-pragma 0.12.2

Perl pragma extraction and analysis primitives
Documentation
  • Coverage
  • 100%
    10 out of 10 items documented0 out of 5 items with examples
  • Size
  • Source code size: 52.38 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.84 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 52s Average build duration of successful builds.
  • all releases: 54s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • EffortlessMetrics/perl-lsp
    7 2 114
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • EffortlessSteven

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 -- tracks strict_vars, strict_subs, strict_refs, and warnings booleans. Provides all_strict() and Default.
  • PragmaTracker -- walks an AST via build() to produce a sorted Vec<(Range<usize>, PragmaState)>, and offers state_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