Class: Rigor::Scope::DiscoveryIndex
- Inherits:
-
Data
- Object
- Data
- Rigor::Scope::DiscoveryIndex
- Defined in:
- lib/rigor/scope/discovery_index.rb,
lib/rigor/scope/discovery_index.rb,
sig/rigor/scope.rbs
Overview
ADR-53 Track A — the seed-time discovery context every Scope snapshot carries by a single reference. Holds
the tables the index-time pre-passes (Inference::ScopeIndexer per file, plus the cross-file project
pre-pass) populate and that no control-flow transition ever varies: Scope#== ignores them and
Scope#join copies them from the receiver unexamined, which is the membership litmus the ADR fixes.
Immutable (Data instances are frozen); deriving a seeded index goes through #with(table_name: table).
Scope exposes each table through its existing reader surface, so engine call sites and plugins are
unaffected by the extraction.
Constant Summary collapse
- EMPTY =
The shared all-empty index
Scope.empty(and every scope that never sees a seeding pass) points at — one allocation per process. new( declared_types: EMPTY_NODE_TABLE, class_ivars: EMPTY_TABLE, class_cvars: EMPTY_TABLE, program_globals: EMPTY_TABLE, discovered_classes: EMPTY_TABLE, in_source_constants: EMPTY_TABLE, discovered_methods: EMPTY_TABLE, discovered_def_nodes: EMPTY_TABLE, discovered_singleton_def_nodes: EMPTY_TABLE, discovered_def_sources: EMPTY_TABLE, discovered_method_visibilities: EMPTY_TABLE, discovered_superclasses: EMPTY_TABLE, discovered_includes: EMPTY_TABLE, discovered_class_sources: EMPTY_TABLE, data_member_layouts: EMPTY_TABLE, struct_member_layouts: EMPTY_TABLE, # ADR-67 WD3 — the call-site parameter-inference table, keyed by `[class_name, method_name, kind]` (the # same `(class, method, kind)` triple {Inference::ParameterInferenceCollector} records and that # `build_method_entry_scope` reconstructs from the lexical class path). The value is a # `{param_name(Symbol) => Rigor::Type}` map of the union of resolved call-site argument types. Empty on # every normal run; only the `coverage --protection` collection pass populates it today, so a `check` run # leaves it empty and seeds nothing (byte-identical). param_inferred_types: EMPTY_TABLE )
Instance Attribute Summary collapse
-
#class_cvars ⇒ Object
readonly
Returns the value of attribute class_cvars.
-
#class_ivars ⇒ Object
readonly
Returns the value of attribute class_ivars.
-
#data_member_layouts ⇒ Object
readonly
Returns the value of attribute data_member_layouts.
-
#declared_types ⇒ Object
readonly
Returns the value of attribute declared_types.
-
#discovered_class_sources ⇒ Object
readonly
Returns the value of attribute discovered_class_sources.
-
#discovered_classes ⇒ Object
readonly
Returns the value of attribute discovered_classes.
-
#discovered_def_nodes ⇒ Object
readonly
Returns the value of attribute discovered_def_nodes.
-
#discovered_def_sources ⇒ Object
readonly
Returns the value of attribute discovered_def_sources.
-
#discovered_includes ⇒ Object
readonly
Returns the value of attribute discovered_includes.
-
#discovered_method_visibilities ⇒ Object
readonly
Returns the value of attribute discovered_method_visibilities.
-
#discovered_methods ⇒ Object
readonly
Returns the value of attribute discovered_methods.
-
#discovered_singleton_def_nodes ⇒ Object
readonly
Returns the value of attribute discovered_singleton_def_nodes.
-
#discovered_superclasses ⇒ Object
readonly
Returns the value of attribute discovered_superclasses.
-
#in_source_constants ⇒ Object
readonly
Returns the value of attribute in_source_constants.
-
#param_inferred_types ⇒ Object
readonly
Returns the value of attribute param_inferred_types.
-
#program_globals ⇒ Object
readonly
Returns the value of attribute program_globals.
-
#struct_member_layouts ⇒ Object
readonly
Returns the value of attribute struct_member_layouts.
Instance Method Summary collapse
Instance Attribute Details
#class_cvars ⇒ Object (readonly)
Returns the value of attribute class_cvars
13 14 15 |
# File 'lib/rigor/scope/discovery_index.rb', line 13 def class_cvars @class_cvars end |
#class_ivars ⇒ Object (readonly)
Returns the value of attribute class_ivars
13 14 15 |
# File 'lib/rigor/scope/discovery_index.rb', line 13 def class_ivars @class_ivars end |
#data_member_layouts ⇒ Object (readonly)
Returns the value of attribute data_member_layouts
13 14 15 |
# File 'lib/rigor/scope/discovery_index.rb', line 13 def data_member_layouts @data_member_layouts end |
#declared_types ⇒ Object (readonly)
Returns the value of attribute declared_types
13 14 15 |
# File 'lib/rigor/scope/discovery_index.rb', line 13 def declared_types @declared_types end |
#discovered_class_sources ⇒ Object (readonly)
Returns the value of attribute discovered_class_sources
13 14 15 |
# File 'lib/rigor/scope/discovery_index.rb', line 13 def discovered_class_sources @discovered_class_sources end |
#discovered_classes ⇒ Object (readonly)
Returns the value of attribute discovered_classes
13 14 15 |
# File 'lib/rigor/scope/discovery_index.rb', line 13 def discovered_classes @discovered_classes end |
#discovered_def_nodes ⇒ Object (readonly)
Returns the value of attribute discovered_def_nodes
13 14 15 |
# File 'lib/rigor/scope/discovery_index.rb', line 13 def discovered_def_nodes @discovered_def_nodes end |
#discovered_def_sources ⇒ Object (readonly)
Returns the value of attribute discovered_def_sources
13 14 15 |
# File 'lib/rigor/scope/discovery_index.rb', line 13 def discovered_def_sources @discovered_def_sources end |
#discovered_includes ⇒ Object (readonly)
Returns the value of attribute discovered_includes
13 14 15 |
# File 'lib/rigor/scope/discovery_index.rb', line 13 def discovered_includes @discovered_includes end |
#discovered_method_visibilities ⇒ Object (readonly)
Returns the value of attribute discovered_method_visibilities
13 14 15 |
# File 'lib/rigor/scope/discovery_index.rb', line 13 def discovered_method_visibilities @discovered_method_visibilities end |
#discovered_methods ⇒ Object (readonly)
Returns the value of attribute discovered_methods
13 14 15 |
# File 'lib/rigor/scope/discovery_index.rb', line 13 def discovered_methods @discovered_methods end |
#discovered_singleton_def_nodes ⇒ Object (readonly)
Returns the value of attribute discovered_singleton_def_nodes
13 14 15 |
# File 'lib/rigor/scope/discovery_index.rb', line 13 def discovered_singleton_def_nodes @discovered_singleton_def_nodes end |
#discovered_superclasses ⇒ Object (readonly)
Returns the value of attribute discovered_superclasses
13 14 15 |
# File 'lib/rigor/scope/discovery_index.rb', line 13 def discovered_superclasses @discovered_superclasses end |
#in_source_constants ⇒ Object (readonly)
Returns the value of attribute in_source_constants
13 14 15 |
# File 'lib/rigor/scope/discovery_index.rb', line 13 def in_source_constants @in_source_constants end |
#param_inferred_types ⇒ Object (readonly)
Returns the value of attribute param_inferred_types
13 14 15 |
# File 'lib/rigor/scope/discovery_index.rb', line 13 def param_inferred_types @param_inferred_types end |
#program_globals ⇒ Object (readonly)
Returns the value of attribute program_globals
13 14 15 |
# File 'lib/rigor/scope/discovery_index.rb', line 13 def program_globals @program_globals end |
#struct_member_layouts ⇒ Object (readonly)
Returns the value of attribute struct_member_layouts
13 14 15 |
# File 'lib/rigor/scope/discovery_index.rb', line 13 def struct_member_layouts @struct_member_layouts end |
Instance Method Details
#with ⇒ DiscoveryIndex
61 |
# File 'sig/rigor/scope.rbs', line 61
def with: (?declared_types: Hash[untyped, Type::t], ?class_ivars: Hash[String, Hash[Symbol, Type::t]], ?class_cvars: Hash[String, Hash[Symbol, Type::t]], ?program_globals: Hash[Symbol, Type::t], ?discovered_classes: Hash[String, Type::Singleton], ?in_source_constants: Hash[String, Type::t], ?discovered_methods: Hash[String, Hash[Symbol, Symbol]], ?discovered_def_nodes: Hash[String, Hash[Symbol, untyped]], ?discovered_singleton_def_nodes: Hash[String, Hash[Symbol, untyped]], ?discovered_def_sources: Hash[String, Hash[Symbol, String]], ?discovered_method_visibilities: Hash[String, Hash[Symbol, Symbol]], ?discovered_superclasses: Hash[String, String], ?discovered_includes: Hash[String, Array[String]], ?discovered_class_sources: Hash[String, Set[String]], ?data_member_layouts: Hash[String, Array[Symbol]], ?struct_member_layouts: Hash[String, { members: Array[Symbol], keyword_init: bool }], ?param_inferred_types: Hash[[String, Symbol, Symbol], Hash[Symbol, Type::t]]) -> DiscoveryIndex
|