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/scope.rb,
lib/csv_plus_plus/runtime/runtime.rb,
lib/csv_plus_plus/runtime/position.rb,
lib/csv_plus_plus/runtime/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: Graph Classes: Position, References, Runtime, Scope

Class Method Summary collapse

Class Method Details

.new(source_code:, position: nil, scope: nil) ⇒ 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

  • position (Position, nil) (defaults to: nil)
  • scope (Scope, nil) (defaults to: nil)

Returns:



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

def self.new(source_code:, position: nil, scope: nil)
  position ||= ::CSVPlusPlus::Runtime::Position.new(source_code.input)
  ::CSVPlusPlus::Runtime::Runtime.new(source_code:, position:, scope:)
end