class Ven::CLI

Included Modules

Defined in:

ven.cr

Constant Summary

BOOT = Path[{{ (env("BOOT")) || (raise("unable to get 'BOOT'")) }}]

BOOT is a compile-time environment variable containing the path to a boot module (the first to load & one which defines the internals.) Indeed, it is a directory that functions in the same way as origin modules do.

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def error(kind : String, message : String, quit = false) #

Prints a message of some kind and, if given true quit, quits with exit status 1.


[View source]
def error(message : String) #

Prints a message and quits with exit status 0.


[View source]
def error(this : VenError, quit = true) #

Chooses the appropriate kind and message for this, a Ven error, and #errors. If quit is true, exits with status 1 afterwards.


[View source]
def eval(filename : String, source : String) #

Evaluates source under the filename filename.


[View source]
def format_traces(traces : Traces, root_spaces = 2, code_spaces = 4) #

Returns a string of properly formatted traces. root_spaces is the number of spaces before each trace; code_spaces is the number of spaces before each source code excerpt.


[View source]
def open(path : String) #

Does the necessary negotiations with the world and runs the script/module path.


[View source]
def repl #

Starts a new read-eval-print loop.


[View source]
def run #

Parses the command-line arguments and dispatches further to #repl, #open, etc.


[View source]