Class: Rigor::Scope::DiscoveryIndex

Inherits:
Data
  • Object
show all
Defined in:
lib/rigor/scope/discovery_index.rb,
lib/rigor/scope/discovery_index.rb

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_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
)

Instance Attribute Summary collapse

Instance Attribute Details

#class_cvarsObject (readonly)

Returns the value of attribute class_cvars

Returns:

  • (Object)

    the current value of class_cvars



16
17
18
# File 'lib/rigor/scope/discovery_index.rb', line 16

def class_cvars
  @class_cvars
end

#class_ivarsObject (readonly)

Returns the value of attribute class_ivars

Returns:

  • (Object)

    the current value of class_ivars



16
17
18
# File 'lib/rigor/scope/discovery_index.rb', line 16

def class_ivars
  @class_ivars
end

#data_member_layoutsObject (readonly)

Returns the value of attribute data_member_layouts

Returns:

  • (Object)

    the current value of data_member_layouts



16
17
18
# File 'lib/rigor/scope/discovery_index.rb', line 16

def data_member_layouts
  @data_member_layouts
end

#declared_typesObject (readonly)

Returns the value of attribute declared_types

Returns:

  • (Object)

    the current value of declared_types



16
17
18
# File 'lib/rigor/scope/discovery_index.rb', line 16

def declared_types
  @declared_types
end

#discovered_class_sourcesObject (readonly)

Returns the value of attribute discovered_class_sources

Returns:

  • (Object)

    the current value of discovered_class_sources



16
17
18
# File 'lib/rigor/scope/discovery_index.rb', line 16

def discovered_class_sources
  @discovered_class_sources
end

#discovered_classesObject (readonly)

Returns the value of attribute discovered_classes

Returns:

  • (Object)

    the current value of discovered_classes



16
17
18
# File 'lib/rigor/scope/discovery_index.rb', line 16

def discovered_classes
  @discovered_classes
end

#discovered_def_nodesObject (readonly)

Returns the value of attribute discovered_def_nodes

Returns:

  • (Object)

    the current value of discovered_def_nodes



16
17
18
# File 'lib/rigor/scope/discovery_index.rb', line 16

def discovered_def_nodes
  @discovered_def_nodes
end

#discovered_def_sourcesObject (readonly)

Returns the value of attribute discovered_def_sources

Returns:

  • (Object)

    the current value of discovered_def_sources



16
17
18
# File 'lib/rigor/scope/discovery_index.rb', line 16

def discovered_def_sources
  @discovered_def_sources
end

#discovered_includesObject (readonly)

Returns the value of attribute discovered_includes

Returns:

  • (Object)

    the current value of discovered_includes



16
17
18
# File 'lib/rigor/scope/discovery_index.rb', line 16

def discovered_includes
  @discovered_includes
end

#discovered_method_visibilitiesObject (readonly)

Returns the value of attribute discovered_method_visibilities

Returns:

  • (Object)

    the current value of discovered_method_visibilities



16
17
18
# File 'lib/rigor/scope/discovery_index.rb', line 16

def discovered_method_visibilities
  @discovered_method_visibilities
end

#discovered_methodsObject (readonly)

Returns the value of attribute discovered_methods

Returns:

  • (Object)

    the current value of discovered_methods



16
17
18
# File 'lib/rigor/scope/discovery_index.rb', line 16

def discovered_methods
  @discovered_methods
end

#discovered_superclassesObject (readonly)

Returns the value of attribute discovered_superclasses

Returns:

  • (Object)

    the current value of discovered_superclasses



16
17
18
# File 'lib/rigor/scope/discovery_index.rb', line 16

def discovered_superclasses
  @discovered_superclasses
end

#in_source_constantsObject (readonly)

Returns the value of attribute in_source_constants

Returns:

  • (Object)

    the current value of in_source_constants



16
17
18
# File 'lib/rigor/scope/discovery_index.rb', line 16

def in_source_constants
  @in_source_constants
end

#program_globalsObject (readonly)

Returns the value of attribute program_globals

Returns:

  • (Object)

    the current value of program_globals



16
17
18
# File 'lib/rigor/scope/discovery_index.rb', line 16

def program_globals
  @program_globals
end