Module: Rigor::Inference::ProjectPatchedScanner
- Defined in:
- lib/rigor/inference/project_patched_scanner.rb
Overview
ADR-17 slice 2 — pre-pass scanner. Walks every file the user listed under ‘pre_eval:` and harvests every `def` / `def self.` declaration inside a class / module body into a ProjectPatchedMethods registry the dispatcher consults below the plugin tier.
The walker is intentionally a strict subset of ScopeIndexer‘s machinery: it only needs `class C; def m; end; end` shape recognition, not full inference. Parse errors degrade to a fail-soft `:warning` `pre-eval.parse-error` diagnostic accumulated alongside the registry; per ADR-17 § “Failure modes” a parse failure in a pre-eval file MUST NOT abort the rest of the run.
Defined Under Namespace
Classes: Result
Class Method Summary collapse
-
.scan(paths, buffer: nil) ⇒ Result
The populated registry plus any per-file warnings.
Class Method Details
.scan(paths, buffer: nil) ⇒ Result
Returns the populated registry plus any per-file warnings.
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/rigor/inference/project_patched_scanner.rb', line 49 def scan(paths, buffer: nil) entries = [] diagnostics = [] paths.each { |path| scan_file(path, entries, diagnostics, buffer) } diagnostics.concat(duplicate_declaration_diagnostics(entries)) Result.new( registry: ProjectPatchedMethods.new(entries: entries), diagnostics: diagnostics ) end |