module

Flaw::SourcePrep

Pre-scan source normalisation. Currently masks heredoc bodies so string content doesn't trigger comment/regex rules. Line count is preserved — masked lines become empty strings.

Constants

HEREDOC_START = /<<-?"?([A-Z_][A-Z0-9_]*)"?/

Matches <<-IDENT / <<IDENT / <<-"IDENT" heredoc starts. Not exhaustive (ignores multiple heredocs on one line, heredoc-in-interp), but covers the dominant Crystal idiom.

Class methods

mask_heredocs(source : String) : String
Source