Struct gluon::Compiler [] [src]

pub struct Compiler { /* fields omitted */ }

Type which makes parsing, typechecking and compiling an AST into bytecode

Methods

impl Compiler
[src]

Creates a new compiler with default settings

Sets wheter the implicit prelude should be include when compiling a file using this compiler (default: true)

Parse expr_str, returning an expression if successful

Parse input, returning an expression if successful

Parse and typecheck expr_str returning the typechecked expression and type of the expression

Compiles expr into a function which can be added and run by the vm

Parses and typechecks expr_str followed by extracting metadata from the created expression

Compiles input and if it is successful runs the resulting code and stores the resulting value in the vm.

If at any point the function fails the resulting error is returned and nothing is added to the VM.

Loads filename and compiles and runs its input by calling load_script

Compiles and runs the expression in expr_str. If successful the value from running the expression is returned

Compiles and runs expr_str. If the expression is of type IO a the action is evaluated and a value of type a is returned