Module: CSVPlusPlus::Runtime

Extended by:
T::Sig
Defined in:
lib/csv_plus_plus/runtime.rb,
lib/csv_plus_plus/runtime/graph.rb,
lib/csv_plus_plus/runtime/runtime.rb,
lib/csv_plus_plus/runtime/references.rb,
lib/csv_plus_plus/runtime/position_tracker.rb,
lib/csv_plus_plus/runtime/can_define_references.rb,
lib/csv_plus_plus/runtime/can_resolve_references.rb

Overview

All functionality needed to keep track of the runtime AKA execution context. This module has a lot of reponsibilities:

  • variables and function resolution and scoping

  • variable & function definitions

  • keeping track of the runtime state (the current cell being processed)

  • rewriting the input file that’s being parsed

Defined Under Namespace

Modules: CanDefineReferences, CanResolveReferences, Graph, PositionTracker Classes: References, Runtime

Class Method Summary collapse

Class Method Details

.new(source_code:, functions: {}, variables: {}) ⇒ Runtime::Runtime

Initialize a runtime instance with all the functionality we need. A runtime is one-to-one with a file being compiled.

Parameters:

  • source_code (SourceCode)

    The csv++ source code to be compiled

  • functions (Hash<Symbol, Function>) (defaults to: {})

    Pre-defined functions

  • variables (Hash<Symbol, Entity>) (defaults to: {})

    Pre-defined variables

Returns:



38
39
40
# File 'lib/csv_plus_plus/runtime.rb', line 38

def self.new(source_code:, functions: {}, variables: {})
  ::CSVPlusPlus::Runtime::Runtime.new(source_code:, functions:, variables:)
end