Expand description
Breakpoint Validation for Perl DAP
This crate provides AST-based breakpoint validation for the Perl Debug Adapter Protocol. It validates breakpoint locations against parsed source code to ensure breakpoints are set on executable lines, not on comments, blank lines, or inside heredoc content.
§Features
- AST-Based Validation: Uses the Perl parser AST to validate breakpoint locations
- Line Suggestion: Suggests the nearest valid line when a breakpoint is on an invalid location
- Validation Reasons: Provides detailed reasons for why a breakpoint was rejected or adjusted
§Example
ⓘ
use perl_dap_breakpoint::{BreakpointValidator, AstBreakpointValidator};
let source = "# comment\nmy $x = 1;\n";
let validator = AstBreakpointValidator::new(source)?;
let result = validator.validate(1); // Line 1 is a comment
assert!(!result.verified);
assert_eq!(result.reason, Some(ValidationReason::CommentLine));Structs§
- AstBreakpoint
Validator - AST-based breakpoint validator
- Breakpoint
Validation - Result of breakpoint validation
Enums§
- Breakpoint
Error - Error type for breakpoint validation operations
- Search
Direction - Direction to search for a valid line
- Validation
Reason - Reason why a breakpoint was rejected or adjusted
Traits§
- Breakpoint
Validator - Trait for breakpoint validation
Functions§
- find_
nearest_ valid_ line - Find the nearest valid line to the given line number