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 append(io : IO, value : String | Char) #

[View source]
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 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 column : Int32 #

The current column.


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

The current column.


[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 generate_source_maps? : Bool #

Whether or not to generate source map mappings.


[View source]
def last_line : Int32 #

The last line index.


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

The last line index.


[View source]
def line : Int32 #

The current line.


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

The current line.


[View source]
def mappings : Deque(Mapping) #

[View source]
def mappings=(mappings : Deque(Mapping)) #

[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]
def stack : Deque(Ast::Node) #

A mapping and stack for generating source maps. We use Deque because we push and pop to the stack frequently.


[View source]
def stack=(stack : Deque(Ast::Node)) #

A mapping and stack for generating source maps. We use Deque because we push and pop to the stack frequently.


[View source]