module Crylox

Defined in:

crylox.cr
crylox/ast.cr
crylox/token_type.cr

Constant Summary

VERSION = "0.1.0"

Class Method Summary

Macro Summary

Class Method Detail

def self.execute(source : String) : ExecResult #

[View source]
def self.execute(&) : ExecResult #

[View source]

Macro Detail

macro ast_module(name, &block) #

Macro for defining a module to hold AST types, utilizing the visitor architecture. If passed a block with ast_type calls, it will automatically insert the name as the first argument.

ast_module Expr do
  ast_type Lambda, params : Array(Token), body : Array(Stmt)
  # => ast_type Expr, Lambda, params : Array(Token), body : Array(Stmt)
end

[View source]
macro ast_type(ast_class, name, *properties) #

Macro for defining an AST type, utilizing the visitor architecture. If called within a block passed to ast_module, the first argument is not necessary


[View source]