class Ven::Input

Included Modules

Defined in:

ven/input.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(file : String, source : String, passes : Int32 = 8) #

[View source]

Class Method Detail

def self.context #

Returns the class-level (aka common, super-Input) context hub (see Context::Hub).


[View source]
def self.run(file, source, until step = :eval, passes = 8) #

Makes an instance of Input, runs it up to step and returns the result.

puts Input.run("foo", "2 + 2") # 4 : Num

[View source]

Instance Method Detail

def distinct : Distinct | Nil #

This Input's distinct.


[View source]
def exposes : Array(Array(String)) #

The distincts this Input exposes.


[View source]
def file : String #

The name of the file this Input is in.


[View source]
def inspect : Bool #

Whether to run inspector after this input evaluates.


[View source]
def inspect=(inspect : Bool) #

Whether to run inspector after this input evaluates.


[View source]
def measure : Bool #

Whether to record the timetable.


[View source]
def measure=(measure : Bool) #

Whether to record the timetable.


[View source]
def quotes : Array(Ven::Suite::Quote) #

This Input's quotes.


[View source]
def run(until step = :eval) #

Evaluates this input up until some step.

Raises if step is not a valid step.

a = Input.new("a", "1 + 1")
a.run(:read) # -> Quotes
a.run(:compile) # -> Chunks
a.run(:optimize) # -> Chunks
a.run(:eval) # -> Model

[View source]
def source : String #

The source code for this Input.


[View source]
def timetable : Machine::Timetable | Nil #

This Input's timetable.


[View source]
def to_s(io) #

[View source]