class Mint::Compiler
- Mint::Compiler
- Reference
- Object
Included Modules
Defined in:
compiler.crcompiler/decoder.cr
compiler/encoder.cr
compiler/js.cr
compiler/record.cr
compiler/renderer.cr
compilers/access.cr
compilers/argument.cr
compilers/array_literal.cr
compilers/await.cr
compilers/block.cr
compilers/bool_literal.cr
compilers/bracket_access.cr
compilers/builtin.cr
compilers/call.cr
compilers/case.cr
compilers/case_branch.cr
compilers/commented_expression.cr
compilers/component.cr
compilers/constant.cr
compilers/dbg.cr
compilers/decode.cr
compilers/defer.cr
compilers/destructuring.cr
compilers/directives/asset.cr
compilers/directives/format.cr
compilers/directives/highlight.cr
compilers/directives/highlight_file.cr
compilers/directives/inline.cr
compilers/directives/svg.cr
compilers/emit.cr
compilers/encode.cr
compilers/env.cr
compilers/field.cr
compilers/field_access.cr
compilers/for_expression.cr
compilers/function.cr
compilers/get.cr
compilers/here_document.cr
compilers/html_attribute.cr
compilers/html_component.cr
compilers/html_element.cr
compilers/html_fragment.cr
compilers/if.cr
compilers/inline_function.cr
compilers/interpolation.cr
compilers/js.cr
compilers/locale_key.cr
compilers/map.cr
compilers/map_field.cr
compilers/module.cr
compilers/negated_expression.cr
compilers/next_call.cr
compilers/number_literal.cr
compilers/operation.cr
compilers/parenthesized_expression.cr
compilers/pipe.cr
compilers/provider.cr
compilers/record.cr
compilers/record_update.cr
compilers/regexp_literal.cr
compilers/return_call.cr
compilers/route.cr
compilers/signal.cr
compilers/state.cr
compilers/state_setter.cr
compilers/statement.cr
compilers/store.cr
compilers/string.cr
compilers/string_literal.cr
compilers/suite.cr
compilers/test.cr
compilers/tuple_literal.cr
compilers/type_definition.cr
compilers/unary_minus.cr
compilers/variable.cr
Constructors
Instance Method Summary
-
#add(node : Ast::Node, id : Id, value : Compiled)
Adds a compiled entity.
-
#add(items : Array(Tuple(Ast::Node, Id, Compiled) | Nil))
Adds multiple compiled entities.
-
#artifacts : TypeChecker::Artifacts
The type checker artifacts.
- #ast(*args, **options)
- #ast(*args, **options, &)
- #cache(*args, **options)
- #cache(*args, **options, &)
- #checked(*args, **options)
- #checked(*args, **options, &)
- #compile(items : Array(Ast::CssDefinition), block : Proc(String, String) | Nil) : Compiled
-
#compile(nodes : Array(Ast::Node), separator : String) : Compiled
Compiles multiple nodes and joins them with the separator.
- #compile(node : Ast::Access) : Compiled
- #compile(node : Ast::Argument) : Compiled
- #compile(node : Ast::ArrayLiteral) : Compiled
- #compile(node : Ast::Await) : Compiled
- #compile(node : Ast::Block, for_function = false) : Compiled
- #compile(node : Ast::BoolLiteral) : Compiled
- #compile(node : Ast::BracketAccess) : Compiled
- #compile(node : Ast::Builtin) : Compiled
- #compile(node : Ast::Call) : Compiled
- #compile(node : Ast::Case, block : Proc(String, String) | Nil = nil) : Compiled
- #compile(node : Ast::CaseBranch, block : Proc(String, String) | Nil = nil) : Compiled
- #compile(node : Ast::CommentedExpression) : Compiled
- #compile(node : Ast::Dbg) : Compiled
- #compile(node : Ast::Decode) : Compiled
- #compile(node : Ast::Defer) : Compiled
- #compile(node : Ast::Emit) : Compiled
- #compile(node : Ast::Encode) : Compiled
- #compile(node : Ast::Env) : Compiled
- #compile(node : Ast::Field)
- #compile(node : Ast::FieldAccess) : Compiled
- #compile(node : Ast::For) : Compiled
- #compile(node : Ast::HereDocument) : Compiled
- #compile(node : Ast::HtmlComponent) : Compiled
- #compile(node : Ast::HtmlElement) : Compiled
- #compile(node : Ast::HtmlFragment) : Compiled
- #compile(node : Ast::If, block : Proc(String, String) | Nil = nil) : Compiled
- #compile(node : Ast::InlineFunction) : Compiled
- #compile(node : Ast::Interpolation) : Compiled
- #compile(node : Ast::Js) : Compiled
- #compile(node : Ast::LocaleKey) : Compiled
- #compile(node : Ast::Map) : Compiled
- #compile(node : Ast::MapField)
- #compile(node : Ast::NegatedExpression) : Compiled
- #compile(node : Ast::NextCall) : Compiled
- #compile(node : Ast::NumberLiteral) : Compiled
- #compile(node : Ast::Operation) : Compiled
- #compile(node : Ast::ParenthesizedExpression) : Compiled
- #compile(node : Ast::Pipe) : Compiled
- #compile(node : Ast::Record) : Compiled
- #compile(node : Ast::RecordUpdate) : Compiled
- #compile(node : Ast::RegexpLiteral) : Compiled
- #compile(node : Ast::ReturnCall) : Compiled
- #compile(node : Ast::Route) : Compiled
- #compile(node : Ast::StateSetter) : Compiled
- #compile(node : Ast::Statement) : Compiled
- #compile(value : String) : Compiled
- #compile(node : Ast::StringLiteral, quote : Bool = false) : Compiled
- #compile(node : Ast::Suite) : Compiled
- #compile(node : Ast::Test) : Compiled
- #compile(node : Ast::TupleLiteral) : Compiled
- #compile(node : Ast::UnaryMinus) : Compiled
- #compile(node : Ast::Variable) : Compiled
- #compile(node : Ast::Directives::Asset) : Compiled
- #compile(node : Ast::Directives::Format) : Compiled
- #compile(node : Ast::Directives::Highlight) : Compiled
- #compile(node : Ast::Directives::HighlightFile) : Compiled
- #compile(node : Ast::Directives::Inline) : Compiled
- #compile(node : Ast::Directives::Svg) : Compiled
-
#compile(nodes : Array(Ast::Node)) : Array(Compiled)
Compiles multiple nodes.
-
#compile(node : Ast::Node) : Compiled
Fallback for compiling a node.
- #compile(value : Array(Ast::Node | String), *, quote_string : Bool = false) : Compiled
-
#compile(node : Ast::Node, &) : Compiled
Compiles a node.
- #compile_function(node : Ast::Function)
- #compile_function(node : Ast::Function, *, contents : Compiled | Nil = nil, args : Array(Compiled) | Nil = nil, skip_const : Bool = false) : Compiled
-
#compiled : Array({Mint::Ast::Node, Mint::Ast::Node | Mint::Compiler::Decoder | Mint::Compiler::Encoder | Mint::Compiler::Record | Mint::Compiler::Variable, Array(Mint::Ast::Node | Mint::Compiler::Asset | Mint::Compiler::Await | Mint::Compiler::Builtin | Mint::Compiler::Decoder | Mint::Compiler::Deferred | Mint::Compiler::Encoder | Mint::Compiler::Function | Mint::Compiler::Indent | Mint::Compiler::Raw | Mint::Compiler::Record | Mint::Compiler::Ref | Mint::Compiler::Signal | Mint::Compiler::SourceMapped | Mint::Compiler::Variable | String)})
Contains the compiled JavaScript tree.
- #components_touched(*args, **options)
- #components_touched(*args, **options, &)
-
#config : Bundler::Config
The compiler config.
- #decoder(type : TypeChecker::Record) : Compiled
- #decoder(type : TypeChecker::Type) : Compiled
- #decoder(node : TypeChecker::Variable)
-
#decoders : Hash(Mint::TypeChecker::Record | Mint::TypeChecker::Type | Mint::TypeChecker::Variable, Array(Mint::Ast::Node | Mint::Compiler::Asset | Mint::Compiler::Await | Mint::Compiler::Builtin | Mint::Compiler::Decoder | Mint::Compiler::Deferred | Mint::Compiler::Encoder | Mint::Compiler::Function | Mint::Compiler::Indent | Mint::Compiler::Raw | Mint::Compiler::Record | Mint::Compiler::Ref | Mint::Compiler::Signal | Mint::Compiler::SourceMapped | Mint::Compiler::Variable | String))
Contains the generated decoders.
- #defer(node : Ast::Node, compiled : Compiled)
- #destructuring(node : Ast::ArrayDestructuring, variables : Array(Compiled)) : Compiled
- #destructuring(node : Ast::TupleDestructuring, variables : Array(Compiled)) : Compiled
- #destructuring(node : Ast::Variable, variables : Array(Compiled)) : Compiled
- #destructuring(node : Ast::Discard, variables : Array(Compiled)) : Compiled
- #destructuring(node : Ast::Spread, variables : Array(Compiled)) : Compiled
- #destructuring(node : Ast::TypeDestructuring, variables : Array(Compiled)) : Compiled
- #destructuring(node : Ast::Node, variables : Array(Compiled)) : Compiled
- #destructuring(node : Nil, variables : Array(Compiled)) : Compiled
- #encoder(type : TypeChecker::Record) : Compiled
- #encoder(type : TypeChecker::Type) : Compiled
- #encoder(node : TypeChecker::Variable)
-
#encoders : Hash(Mint::TypeChecker::Record | Mint::TypeChecker::Type | Mint::TypeChecker::Variable, Array(Mint::Ast::Node | Mint::Compiler::Asset | Mint::Compiler::Await | Mint::Compiler::Builtin | Mint::Compiler::Decoder | Mint::Compiler::Deferred | Mint::Compiler::Encoder | Mint::Compiler::Function | Mint::Compiler::Indent | Mint::Compiler::Raw | Mint::Compiler::Record | Mint::Compiler::Ref | Mint::Compiler::Signal | Mint::Compiler::SourceMapped | Mint::Compiler::Variable | String))
Contains the generated encoders.
- #err
- #gather_used(items : Compiled, used : Used)
- #gather_used(item : Item, used : Used)
- #gather_used(items : Array(Compiled))
-
#js : Js
The JavaScript builder instance.
- #just
- #lookups(*args, **options)
- #lookups(*args, **options, &)
- #match(condition : Ast::Node, branches : Array(Tuple(Ast::Node | Nil, Compiled))) : Compiled
- #maybe
- #nothing
- #ok
-
#program : Compiled
Compiles the program call.
- #record(name : String) : Compiled
- #record_field_lookup(*args, **options)
- #record_field_lookup(*args, **options, &)
-
#records : Hash(String, Array(Mint::Ast::Node | Mint::Compiler::Asset | Mint::Compiler::Await | Mint::Compiler::Builtin | Mint::Compiler::Decoder | Mint::Compiler::Deferred | Mint::Compiler::Encoder | Mint::Compiler::Function | Mint::Compiler::Indent | Mint::Compiler::Raw | Mint::Compiler::Record | Mint::Compiler::Ref | Mint::Compiler::Signal | Mint::Compiler::SourceMapped | Mint::Compiler::Variable | String))
Contains the generated record constructors.
- #resolve(node : Ast::Component)
- #resolve(node : Ast::Constant)
- #resolve(node : Ast::Field) : Hash(Item, Compiled)
- #resolve(node : Ast::Function)
- #resolve(node : Ast::Get)
- #resolve(node : Ast::Module)
- #resolve(node : Ast::Provider)
- #resolve(node : Ast::Signal)
- #resolve(node : Ast::State)
- #resolve(node : Ast::Store)
- #resolve(node : Ast::TypeDefinition)
-
#resolve(nodes : Array(Ast::Node))
Resolves top-level nodes.
-
#resolve(node : Ast::Node)
Fallback resolving nodes.
- #resolve(node : Ast::HtmlAttribute, *, is_element = true) : Hash(Item, Compiled)
-
#resolve(node : Ast::Node, &)
Resolves a top-level node.
- #resolve_order(*args, **options)
- #resolve_order(*args, **options, &)
- #result
-
#style_builder : StyleBuilder
The style builder instance.
-
#test(*, url, id, glob) : Compiled
Compile test runner.
-
#tokenize(ast : Ast) : Compiled
Semantic tokenizes the given AST.
-
#touched : Set(Ast::Node)
A set to track already rendered nodes.
-
#translations : Array(Compiled)
Translations
- #variables(*args, **options)
- #variables(*args, **options, &)
Instance methods inherited from module Mint::Helpers
owns?(node : Ast::Node, parent : Ast::Node) : Bool
owns?,
static?(nodes : Array(Ast::Node)) : Boolstatic?(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
Instance methods inherited from module Mint::Errorable
error!(name : Symbol, &)
error!,
unreachable!(message : String)
unreachable!
Constructor Detail
Instance Method Detail
Adds multiple compiled entities.
Compiles multiple nodes and joins them with the separator.
Compiles a node. If the node is already compiled or not checked it returns an empty compiled node.
Contains the compiled JavaScript tree.
Contains the generated decoders.
Contains the generated encoders.
Contains the generated record constructors.