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.
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/rigor/inference/project_patched_scanner.rb', line 40 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 |