class Mint::Compiler::Renderer

Overview

This class is responsible to render Compiled code.

Defined in:

compiler/renderer.cr

Constructors

Instance Method Summary

Constructor Detail


[View source]

Instance Method Detail

def asset_path : Proc(Ast::Node, String) #

A method to get the path of an asset.


[View source]
def base : Set(Ast::Node) | Bundle #

The current bundle.


[View source]
def builtins : Set(Mint::Compiler::Builtin) #

A set to track used builtins which will be imported.


[View source]
def bundles : Hash(Set(Ast::Node) | Bundle, Set(Ast::Node)) #

The bundles which we use to get their filename.


[View source]
def class_pool : NamePool(Ast::Node | Builtin, Set(Ast::Node) | Bundle) #

The pool for class variables (uppercase).


[View source]
def deferred_path : Proc(Set(Ast::Node) | Bundle, String) #

A method to get the deffered path of a bundle.


[View source]
def depth : Int32 #

The current indentation depth.


[View source]
def depth=(depth : Int32) #

The current indentation depth.


[View source]
def import(imports : Hash(String, String), optimize : Bool, path : String) #

[View source]

The pool for variables (lowercase).


[View source]
def render(items : Compiled, io : IO) : Nil #

[View source]
def render(items : Compiled) : String #

[View source]
def render(item : Item, io : IO = IO::Memory.new) #

We are using a string builder to build the final compiled code.


[View source]

A set to track nodes which we rendered.


[View source]