class Mint::Compiler

Included Modules

Defined in:

compiler.cr
compilers/access.cr
compilers/argument.cr
compilers/array_access.cr
compilers/array_literal.cr
compilers/block.cr
compilers/bool_literal.cr
compilers/call.cr
compilers/call_expression.cr
compilers/case.cr
compilers/case_branch.cr
compilers/component.cr
compilers/constant.cr
compilers/decode.cr
compilers/destructuring.cr
compilers/directives/asset.cr
compilers/directives/documentation.cr
compilers/directives/format.cr
compilers/directives/highlight.cr
compilers/directives/inline.cr
compilers/directives/svg.cr
compilers/encode.cr
compilers/enum.cr
compilers/enum_id.cr
compilers/env.cr
compilers/for_expression.cr
compilers/function.cr
compilers/get.cr
compilers/here_doc.cr
compilers/html_attribute.cr
compilers/html_component.cr
compilers/html_element.cr
compilers/html_expression.cr
compilers/html_fragment.cr
compilers/if.cr
compilers/inline_function.cr
compilers/interpolation.cr
compilers/js.cr
compilers/locale_key.cr
compilers/member_access.cr
compilers/module.cr
compilers/module_access.cr
compilers/negated_expression.cr
compilers/next_call.cr
compilers/number_literal.cr
compilers/operation.cr
compilers/parenthesized_expression.cr
compilers/pipe.cr
compilers/property.cr
compilers/provider.cr
compilers/record.cr
compilers/record_constructor.cr
compilers/record_definition.cr
compilers/record_field.cr
compilers/record_update.cr
compilers/regexp_literal.cr
compilers/return_call.cr
compilers/route.cr
compilers/routes.cr
compilers/state.cr
compilers/statement.cr
compilers/store.cr
compilers/string_literal.cr
compilers/style.cr
compilers/suite.cr
compilers/test.cr
compilers/top_level.cr
compilers/tuple_literal.cr
compilers/unary_minus.cr
compilers/variable.cr
compilers/void.cr

Constant Summary

DEFAULT_OPTIONS = Options.new(web_components: {} of String => String, css_prefix: nil, optimize: false, relative: false, build: false)

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module Mint::Skippable

replace_skipped(result) replace_skipped, skip(&) skip

Constructor Detail

def self.new(artifacts : TypeChecker::Artifacts, optimize : Bool = false, css_prefix = nil, relative : Bool = false, build : Bool = false, web_components : Hash(String, String) = {} of String => String) #

[View source]

Class Method Detail

def self.compile(artifacts : TypeChecker::Artifacts, options = DEFAULT_OPTIONS) : String #

Compiles the application with the runtime and the rendering of the $Main component.


[View source]
def self.compile_bare(artifacts : TypeChecker::Artifacts, options = DEFAULT_OPTIONS) : String #

Compiles the application without the runtime.


[View source]
def self.compile_embed(artifacts : TypeChecker::Artifacts, options = DEFAULT_OPTIONS) : String #

[View source]
def self.compile_with_tests(artifacts : TypeChecker::Artifacts) : String #

Compiles the application with the runtime and the tests


[View source]

Instance Method Detail

def _compile(items : Array(Ast::CssDefinition), block : Proc(String, String) | Nil) #

[View source]
def _compile(node : Ast::Style, component : Ast::Component) : Nil #

[View source]
def _compile(node : Ast::Access) : String #

[View source]
def _compile(node : Ast::Argument) : String #

[View source]
def _compile(node : Ast::ArrayAccess) : String #

[View source]
def _compile(node : Ast::ArrayLiteral) : String #

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

[View source]
def _compile(node : Ast::BoolLiteral) : String #

[View source]
def _compile(node : Ast::Call) : String #

[View source]
def _compile(node : Ast::CallExpression) #

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

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

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

[View source]
def _compile(node : Ast::Decode) : String #

[View source]
def _compile(node : Ast::Encode) : String #

[View source]
def _compile(node : Ast::Enum) : String #

[View source]
def _compile(node : Ast::EnumId) : String #

[View source]
def _compile(node : Ast::For) : String #

[View source]
def _compile(node : Ast::Function, contents = "") : String #

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

[View source]
def _compile(node : Ast::HereDoc) : String #

[View source]
def _compile(node : Ast::HtmlComponent) : String #

[View source]
def _compile(node : Ast::HtmlElement) : String #

[View source]
def _compile(node : Ast::HtmlExpression) : String #

[View source]
def _compile(node : Ast::HtmlFragment) : String #

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

[View source]
def _compile(node : Ast::InlineFunction) : String #

[View source]
def _compile(node : Ast::Interpolation) : String #

[View source]
def _compile(node : Ast::Js) : String #

[View source]
def _compile(node : Ast::LocaleKey) : String #

[View source]
def _compile(node : Ast::MemberAccess) : String #

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

[View source]
def _compile(node : Ast::ModuleAccess) : String #

[View source]
def _compile(node : Ast::NegatedExpression) : String #

[View source]
def _compile(node : Ast::NextCall) : String #

[View source]
def _compile(node : Ast::NumberLiteral) : String #

[View source]
def _compile(node : Ast::Operation) : String #

[View source]
def _compile(node : Ast::ParenthesizedExpression) : String #

[View source]
def _compile(node : Ast::Pipe) : String #

[View source]
def _compile(node : Ast::Property) : String #

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

[View source]
def _compile(node : Ast::Record) : String #

[View source]
def _compile(node : Ast::RecordDefinition) : String #

[View source]
def _compile(node : Ast::RecordUpdate) : String #

[View source]
def _compile(node : Ast::RegexpLiteral) : String #

[View source]
def _compile(node : Ast::ReturnCall) : String #

[View source]
def _compile(node : Ast::Route) : String #

[View source]
def _compile(node : Ast::Routes) : String #

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

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

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

[View source]
def _compile(node : Ast::Suite) : String #

[View source]
def _compile(node : Ast::Test) : String #

[View source]
def _compile(node : Ast::TupleLiteral) : String #

[View source]
def _compile(node : Ast::UnaryMinus) : String #

[View source]
def _compile(node : Ast::Variable) : String #

[View source]
def _compile(node : Ast::Void) : String #

[View source]
def _compile(node : Ast::Directives::Asset) : String #

[View source]
def _compile(node : Ast::Directives::Documentation) : String #

[View source]
def _compile(node : Ast::Directives::Format) : String #

[View source]
def _compile(node : Ast::Directives::Highlight) : String #

[View source]
def _compile(node : Ast::Directives::Inline) : String #

[View source]
def _compile(node : Ast::Directives::Svg) : String #

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

[View source]
def _compile(node : Ast::RecordConstructor) : String #

[View source]
def _compile2(node : Ast::Statement) : Array(String) #

[View source]
def _compile_operation_test(operation : Ast::Operation) : String | Nil #

[View source]
def _compile_service_worker(node : Ast::Route) : String #

[View source]
def _compile_service_worker(node : Ast::Routes) : String #

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

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

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

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

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

[View source]
def build : Bool #

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

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

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

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

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

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

[View source]
def compile(nodes : Array(Ast::Style), component : Ast::Component) : Nil #

[View source]
def compile(node : Ast::Style, component : Ast::Component) : Nil #

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

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

[View source]
def compile(node : Ast::Function, contents = "") : String #

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

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

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

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

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

[View source]
def compile(include_tests : Bool = false) : String #

Compiles the application


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

[View source]
def compile_component_functions(node : Ast::Component) : Array(String) #

[View source]
def compile_component_store_data(node : Ast::Component) : Array(String) #

[View source]
def compile_constants(nodes : Array(Ast::Constant)) : Hash(String, String) #

[View source]
def compile_constructor(node : Ast::Store | Ast::Provider) : String #

[View source]
def compile_html_component(node : Ast::HtmlComponent) : String #

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

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

[View source]
def compile_svg_directive(node : Ast::Directives::Svg) : String | Nil #

[View source]
def compiled_locales #

[View source]
def compiled_web_components #

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

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

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

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

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

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

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

[View source]
def destructuring(node : Ast::EnumDestructuring, variables : Array(String)) #

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

[View source]
def err #

[View source]
def escape_for_javascript(value : String) #

[View source]
def js : Mint::Js #

[View source]
def just #

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

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

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

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

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

[View source]
def maybe #

[View source]
def nothing #

[View source]
def ok #

[View source]
def parse_svg(contents) #

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

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

[View source]
def relative : Bool #

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

[View source]
def resolve(node : Ast::RecordField) : Hash(String, String) #

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

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

[View source]
def result #

[View source]
def static_components : Hash(String, String) #

[View source]
def static_components_pool : Mint::NamePool(String, Nil) #

[View source]
def style_builder : Mint::StyleBuilder #

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

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

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

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

[View source]
def wrap_runtime(body, main = "") #

Wraps the application with the runtime


[View source]