class Mint::Compiler2

Included Modules

Defined in:

compiler2.cr
compiler2/decoder.cr
compiler2/encoder.cr
compiler2/js.cr
compiler2/renderer.cr
compiler2/utils.cr
compilers2/access.cr
compilers2/argument.cr
compilers2/array_literal.cr
compilers2/block.cr
compilers2/bool_literal.cr
compilers2/bracket_access.cr
compilers2/builtin.cr
compilers2/call.cr
compilers2/case.cr
compilers2/case_branch.cr
compilers2/component.cr
compilers2/constant.cr
compilers2/decode.cr
compilers2/defer.cr
compilers2/destructuring.cr
compilers2/directives/asset.cr
compilers2/directives/documentation.cr
compilers2/directives/format.cr
compilers2/directives/highlight.cr
compilers2/directives/highlight_file.cr
compilers2/directives/inline.cr
compilers2/directives/svg.cr
compilers2/encode.cr
compilers2/env.cr
compilers2/field.cr
compilers2/field_access.cr
compilers2/for_expression.cr
compilers2/function.cr
compilers2/get.cr
compilers2/here_document.cr
compilers2/html_attribute.cr
compilers2/html_component.cr
compilers2/html_element.cr
compilers2/html_fragment.cr
compilers2/if.cr
compilers2/inline_function.cr
compilers2/interpolation.cr
compilers2/js.cr
compilers2/locale_key.cr
compilers2/map.cr
compilers2/map_field.cr
compilers2/module.cr
compilers2/negated_expression.cr
compilers2/next_call.cr
compilers2/number_literal.cr
compilers2/operation.cr
compilers2/parenthesized_expression.cr
compilers2/pipe.cr
compilers2/provider.cr
compilers2/record.cr
compilers2/record_update.cr
compilers2/regexp_literal.cr
compilers2/return_call.cr
compilers2/route.cr
compilers2/state.cr
compilers2/state_setter.cr
compilers2/statement.cr
compilers2/store.cr
compilers2/string.cr
compilers2/string_literal.cr
compilers2/suite.cr
compilers2/test.cr
compilers2/tuple_literal.cr
compilers2/type_definition.cr
compilers2/unary_minus.cr
compilers2/variable.cr
utils/markd_vdom_renderer2.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module Mint::Helpers

async?(node : Ast::Node) : Bool async?, covers?(node : Ast::ArrayDestructuring, length : Int32) : Bool covers?, exhaustive?(node : Ast::Node) : Bool exhaustive?, owns?(node : Ast::Node, parent : Ast::Node) : Bool owns?, spread?(node : Ast::ArrayDestructuring) : Bool spread?, static?(nodes : Array(Ast::Node)) : Bool
static?(node : Ast::Node | Nil) : Bool
static?
, static_value(nodes : Array(Ast::Node), separator : Char | Nil = nil) : String
static_value(node : Ast::Node | Nil) : String | Nil
static_value

Constructor Detail

def self.new(artifacts : Mint::TypeChecker::Artifacts, css_prefix, config : Mint::Bundler::Config) #

[View source]

Class Method Detail

def self.tokens_to_lines(ast : Ast) #

[View source]

Instance Method Detail

def add(node : Ast::Node, id : Id, value : Compiled) #

Adds a compiled entity.


[View source]
def add(items : Array(Tuple(Ast::Node, Id, Compiled) | Nil)) #

Adds multiple compiled entities.


[View source]
def artifacts : TypeChecker::Artifacts #

The type checker artifacts.


[View source]
def ast(*args, **options) #

[View source]
def ast(*args, **options, &) #

[View source]
def cache(*args, **options) #

[View source]
def cache(*args, **options, &) #

[View source]
def compile(items : Array(Ast::CssDefinition), block : Proc(String, String) | Nil) : Compiled #

[View source]
def compile(nodes : Array(Ast::Node), separator : String) : Compiled #

Compiles multiple nodes and joins them with the separator.


[View source]
def compile(node : Ast::Access) : Compiled #

[View source]
def compile(node : Ast::Argument) : Compiled #

[View source]
def compile(node : Ast::ArrayLiteral) : Compiled #

[View source]
def compile(node : Ast::Block, for_function = false) : Compiled #

[View source]
def compile(node : Ast::BoolLiteral) : Compiled #

[View source]
def compile(node : Ast::BracketAccess) : Compiled #

[View source]
def compile(node : Ast::Builtin) : Compiled #

[View source]
def compile(node : Ast::Call) : Compiled #

[View source]
def compile(node : Ast::Case, block : Proc(String, String) | Nil = nil) : Compiled #

[View source]
def compile(node : Ast::CaseBranch, block : Proc(String, String) | Nil = nil) : Compiled #

[View source]
def compile(node : Ast::Decode) : Compiled #

[View source]
def compile(node : Ast::Defer) : Compiled #

[View source]
def compile(node : Ast::Encode) : Compiled #

[View source]
def compile(node : Ast::Env) : Compiled #

[View source]
def compile(node : Ast::Field) #

[View source]
def compile(node : Ast::FieldAccess) : Compiled #

[View source]
def compile(node : Ast::For) : Compiled #

[View source]
def compile(node : Ast::Function) #

[View source]
def compile(node : Ast::HereDocument) : Compiled #

[View source]
def compile(node : Ast::HtmlComponent) : Compiled #

[View source]
def compile(node : Ast::HtmlElement) : Compiled #

[View source]
def compile(node : Ast::HtmlFragment) : Compiled #

[View source]
def compile(node : Ast::If, block : Proc(String, String) | Nil = nil) : Compiled #

[View source]
def compile(node : Ast::InlineFunction) : Compiled #

[View source]
def compile(node : Ast::Interpolation) : Compiled #

[View source]
def compile(node : Ast::Js) : Compiled #

[View source]
def compile(node : Ast::LocaleKey) : Compiled #

[View source]
def compile(node : Ast::Map) : Compiled #

[View source]
def compile(node : Ast::MapField) #

[View source]
def compile(node : Ast::NegatedExpression) : Compiled #

[View source]
def compile(node : Ast::NextCall) : Compiled #

[View source]
def compile(node : Ast::NumberLiteral) : Compiled #

[View source]
def compile(node : Ast::Operation) : Compiled #

[View source]
def compile(node : Ast::ParenthesizedExpression) : Compiled #

[View source]
def compile(node : Ast::Pipe) : Compiled #

[View source]
def compile(node : Ast::Record) : Compiled #

[View source]
def compile(node : Ast::RecordUpdate) : Compiled #

[View source]
def compile(node : Ast::RegexpLiteral) : Compiled #

[View source]
def compile(node : Ast::ReturnCall) : Compiled #

[View source]
def compile(node : Ast::Route) : Compiled #

[View source]
def compile(node : Ast::StateSetter) : Compiled #

[View source]
def compile(node : Ast::Statement) : Compiled #

[View source]
def compile(value : String) : Compiled #

[View source]
def compile(node : Ast::StringLiteral, quote : Bool = false) : Compiled #

[View source]
def compile(node : Ast::Suite) : Compiled #

[View source]
def compile(node : Ast::Test) : Compiled #

[View source]
def compile(node : Ast::TupleLiteral) : Compiled #

[View source]
def compile(node : Ast::UnaryMinus) : Compiled #

[View source]
def compile(node : Ast::Variable) : Compiled #

[View source]
def compile(node : Ast::Directives::Asset) : Compiled #

[View source]
def compile(node : Ast::Directives::Documentation) : Compiled #

[View source]
def compile(node : Ast::Directives::Format) : Compiled #

[View source]
def compile(node : Ast::Directives::Highlight) : Compiled #

[View source]
def compile(node : Ast::Directives::HighlightFile) : Compiled #

[View source]
def compile(node : Ast::Directives::Inline) : Compiled #

[View source]
def compile(node : Ast::Directives::Svg) : Compiled #

[View source]
def compile(nodes : Array(Ast::Node)) : Array(Compiled) #

Compiles multiple nodes.


[View source]
def compile(node : Ast::Node) : Compiled #

Fallback for compiling a node.


[View source]
def compile(node : Ast::Function, *, contents : Compiled | Nil = nil, args : Array(Compiled) | Nil = nil, skip_const : Bool = false) : Compiled #

[View source]
def compile(value : Array(Ast::Node | String), *, quote_string : Bool = false) : Compiled #

[View source]
def compile(node : Ast::Node, &) : Compiled #

Compiles a node. If the node is already compiled or not checked it returns an empty compiled node.


[View source]

Contains the compiled JavaScript tree.


[View source]
def components_touched(*args, **options) #

[View source]
def components_touched(*args, **options, &) #

[View source]
def config : Bundler::Config #

The compiler config.


[View source]
def decoder(type : TypeChecker::Record) #

[View source]
def decoder(type : TypeChecker::Type) : Compiled #

[View source]
def decoder(node : TypeChecker::Variable) #

[View source]

Contains the generated decoders.


[View source]
def defer(node : Ast::Node, compiled : Compiled) #

[View source]
def destructuring(node : Ast::ArrayDestructuring, variables : Array(Compiled)) : Compiled #

[View source]
def destructuring(node : Ast::TupleDestructuring, variables : Array(Compiled)) : Compiled #

[View source]
def destructuring(node : Ast::Variable, variables : Array(Compiled)) : Compiled #

[View source]
def destructuring(node : Ast::Spread, variables : Array(Compiled)) : Compiled #

[View source]
def destructuring(node : Ast::TypeDestructuring, variables : Array(Compiled)) : Compiled #

[View source]
def destructuring(node : Ast::Node, variables : Array(Compiled)) : Compiled #

[View source]
def destructuring(node : Nil, variables : Array(Compiled)) : Compiled #

[View source]
def encoder(type : TypeChecker::Record) : Compiled #

[View source]
def encoder(type : TypeChecker::Type) : Compiled #

[View source]
def encoder(node : TypeChecker::Variable) #

[View source]

Contains the generated encoders.


[View source]
def err #

[View source]
def inject_css(css : String) #

[View source]
def js : Js #

The JavaScript builder instance.


[View source]
def just #

[View source]
def lookups(*args, **options) #

[View source]
def lookups(*args, **options, &) #

[View source]
def main #

[View source]
def match(condition : Ast::Node, branches : Array(Tuple(Ast::Node | Nil, Compiled)), await : Bool) : Compiled #

[View source]
def maybe #

[View source]
def nothing #

[View source]
def ok #

[View source]
def parse_svg(contents) #

[View source]
def program #

Compiles the program call.


[View source]
def record_field_lookup(*args, **options) #

[View source]
def record_field_lookup(*args, **options, &) #

[View source]
def resolve(node : Ast::Component) #

[View source]
def resolve(node : Ast::Constant) #

[View source]
def resolve(node : Ast::Field) : Hash(Item, Compiled) #

[View source]
def resolve(node : Ast::Function) #

[View source]
def resolve(node : Ast::Get) #

[View source]
def resolve(node : Ast::Module) #

[View source]
def resolve(node : Ast::Provider) #

[View source]
def resolve(node : Ast::State) #

[View source]
def resolve(node : Ast::Store) #

[View source]
def resolve(node : Ast::TypeDefinition) #

[View source]
def resolve(nodes : Array(Ast::Node)) #

Resolves top-level nodes.


[View source]
def resolve(node : Ast::Node) #

Fallback resolving nodes.


[View source]
def resolve(node : Ast::HtmlAttribute, *, is_element = true) : Hash(Item, Compiled) #

[View source]
def resolve(node : Ast::Node, &) #

Resolves a top-level node.


[View source]
def resolve_order(*args, **options) #

[View source]
def resolve_order(*args, **options, &) #

[View source]
def result #

[View source]
def style_builder : StyleBuilder #

The style builder instance.


[View source]
def test(url, id) #

Compile test runner.


[View source]
def tokenize(ast : Ast) #

[View source]
def touched : Set(Ast::Node) #

A set to track already rendered nodes.


[View source]
def translations #

Translations


[View source]
def variables(*args, **options) #

[View source]
def variables(*args, **options, &) #

[View source]