class Mint::TypeChecker

Defined in:

macros.cr
type_checker.cr
type_checker/artifacts.cr
type_checker/comparer.cr
type_checker/partial_record.cr
type_checker/record.cr
type_checker/scope.cr
type_checker/type.cr
type_checker/variable.cr
type_checkers/access.cr
type_checkers/argument.cr
type_checkers/array_access.cr
type_checkers/array_literal.cr
type_checkers/block.cr
type_checkers/bool_literal.cr
type_checkers/call.cr
type_checkers/case.cr
type_checkers/case_branch.cr
type_checkers/comment.cr
type_checkers/component.cr
type_checkers/connect.cr
type_checkers/constant.cr
type_checkers/css_definition.cr
type_checkers/css_font_face.cr
type_checkers/css_interpolation.cr
type_checkers/css_keyframes.cr
type_checkers/css_nested_at.cr
type_checkers/css_selector.cr
type_checkers/decode.cr
type_checkers/destructuring.cr
type_checkers/directives/asset.cr
type_checkers/directives/documentation.cr
type_checkers/directives/format.cr
type_checkers/directives/highlight.cr
type_checkers/directives/inline.cr
type_checkers/directives/svg.cr
type_checkers/encode.cr
type_checkers/enum.cr
type_checkers/enum_id.cr
type_checkers/enum_option.cr
type_checkers/enum_record_definition.cr
type_checkers/env.cr
type_checkers/for_expression.cr
type_checkers/function.cr
type_checkers/get.cr
type_checkers/here_doc.cr
type_checkers/html_attribute.cr
type_checkers/html_component.cr
type_checkers/html_content.cr
type_checkers/html_element.cr
type_checkers/html_expression.cr
type_checkers/html_fragment.cr
type_checkers/html_style.cr
type_checkers/if.cr
type_checkers/inline_function.cr
type_checkers/js.cr
type_checkers/locale.cr
type_checkers/locale_key.cr
type_checkers/member_access.cr
type_checkers/module.cr
type_checkers/module_access.cr
type_checkers/negated_expression.cr
type_checkers/next_call.cr
type_checkers/number_literal.cr
type_checkers/operation.cr
type_checkers/parenthesized_expression.cr
type_checkers/pipe.cr
type_checkers/property.cr
type_checkers/provider.cr
type_checkers/record.cr
type_checkers/record_constructor.cr
type_checkers/record_definition.cr
type_checkers/record_definition_field.cr
type_checkers/record_field.cr
type_checkers/record_update.cr
type_checkers/regexp_literal.cr
type_checkers/return_call.cr
type_checkers/route.cr
type_checkers/routes.cr
type_checkers/state.cr
type_checkers/statement.cr
type_checkers/store.cr
type_checkers/string_literal.cr
type_checkers/style.cr
type_checkers/suite.cr
type_checkers/test.cr
type_checkers/top_level.cr
type_checkers/tuple_literal.cr
type_checkers/type.cr
type_checkers/type_variable.cr
type_checkers/unary_minus.cr
type_checkers/use.cr
type_checkers/variable.cr
type_checkers/void.cr

Constant Summary

ARRAY = Type.new("Array", [Variable.new("a")] of Checkable)
BOOL = Type.new("Bool")
CSS_PROPERTY_NAMES = ({{ read_file("/srv/crystaldoc.info/github-mint-lang-mint-0.19.0/src/type_checkers/../assets/css_properties") }}).strip.lines
EVENT = Type.new("Html.Event")
EVENT_FUNCTION = Type.new("Function", [EVENT, Variable.new("a")] of Checkable)
HTML = Type.new("Html")
HTML_CHILDREN = Type.new("Array", [HTML] of Checkable)
MAP = Type.new("Map", [Variable.new("a"), Variable.new("a")] of Checkable)
MAYBE = Type.new("Maybe", [Variable.new("a")] of Checkable)
NUMBER = Type.new("Number")
OBJECT = Type.new("Object")
OBJECT_ERROR = Type.new("Object.Error")
REGEXP = Type.new("Regexp")
RESERVED = ["break", "case", "class", "const", "continue", "debugger", "default", "delete", "do", "else", "export", "extends", "for", "if", "import", "in", "instanceof", "new", "return", "super", "switch", "this", "throw", "typeof", "var", "void", "while", "yield", "state"] of ::String
RESULT = Type.new("Result", [Variable.new("a"), Variable.new("b")] of Checkable)
SET = Type.new("Set", [Variable.new("a")] of Checkable)
STRING = Type.new("String")
STYLE_MAP = Type.new("Map", [STRING, STRING] of Checkable)
TEST_CONTEXT = Type.new("Test.Context", [Variable.new("a")] of Checkable)
TEXT_CHILDREN = Type.new("Array", [STRING] of Checkable)
TIME = Type.new("Time")
VALID_IF_TYPES = [VOID_PROMISE, STRING, ARRAY, MAYBE, VOID, HTML] of Checkable
VOID = Type.new("Void")
VOID_FUNCTION = Type.new("Function", [Variable.new("a")] of Checkable)
VOID_PROMISE = Type.new("Promise", [VOID] of Checkable)

Constructors

Class Method Summary

Instance Method Summary

Macro Summary

Constructor Detail

def self.new(ast : Ast, check_env : Bool = true, web_components : Array(String) = [] of String) #

[View source]

Class Method Detail

def self.check(node : Ast) : Artifacts #

[View source]

Instance Method Detail

def add_record(record : Record, node) #

[View source]
def add_record(record, node) #

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

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

[View source]

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

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

[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 check(parameters : Array(Ast::Node), names : Array(Ast::TypeVariable), used_parameters : Set(Ast::TypeVariable)) #

[View source]
def check(node : Ast::CaseBranch, condition : Checkable) : Checkable #

[View source]
def check(node : Ast::EnumId, parent : Ast::Enum) #

[View source]
def check(node : Ast::HtmlAttribute, element : Ast::HtmlFragment) #

[View source]
def check(node : Ast::HtmlAttribute, element : Ast::HtmlElement) : Checkable #

[View source]
def check(node : Ast::HtmlAttribute, component : Ast::Component) : Checkable #

[View source]
def check(node : Ast::EnumId, record : Record) : Checkable #

[View source]
def check(node : Ast::Access) : Checkable #

[View source]
def check(node : Ast::Argument) : Checkable #

[View source]
def check(node : Ast::ArrayAccess) : Checkable #

[View source]
def check(node : Ast::ArrayLiteral) : Checkable #

[View source]
def check(node : Ast::Block) : Checkable #

[View source]
def check(node : Ast::BoolLiteral) : Checkable #

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

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

[View source]
def check(node : Ast::Case) : Checkable #

[View source]
def check(node : Ast::Comment) : Checkable #

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

[View source]
def check(node : Ast::Connect) : Checkable #

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

[View source]
def check(node : Ast::CssDefinition) : Checkable #

[View source]
def check(node : Ast::CssFontFace) : Checkable #

[View source]
def check(node : Ast::Interpolation) : Checkable #

[View source]
def check(node : Ast::CssKeyframes) : Checkable #

[View source]
def check(node : Ast::CssNestedAt) : Checkable #

[View source]
def check(node : Ast::CssSelector) : Checkable #

[View source]
def check(node : Ast::Decode) : Checkable #

[View source]
def check(node : Ast::Encode) : Checkable #

[View source]
def check(node : Ast::Enum) : Checkable #

[View source]
def check(node : Ast::EnumId) : Checkable #

This checks all entities that starts with an uppercase character

  • enums
  • record constructors
  • constants

[View source]
def check(node : Ast::EnumOption) : Checkable #

[View source]
def check(node : Ast::EnumRecordDefinition) : Checkable #

[View source]
def check(node : Ast::Env) : Checkable #

[View source]
def check(node : Ast::For) : Checkable #

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

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

[View source]
def check(node : Ast::HereDoc) : Checkable #

[View source]
def check(node : Ast::HtmlComponent) : Checkable #

[View source]
def check(node : Ast::HtmlElement) : Checkable #

[View source]
def check(node : Ast::HtmlExpression) : Checkable #

[View source]
def check(node : Ast::HtmlFragment) : Checkable #

[View source]
def check(node : Ast::HtmlStyle) : Checkable #

[View source]
def check(node : Ast::If) : Checkable #

[View source]
def check(node : Ast::InlineFunction) : Checkable #

[View source]
def check(node : Ast::Js) : Checkable #

[View source]
def check(node : Ast::LocaleKey) : Checkable #

[View source]
def check(node : Ast::MemberAccess) : Checkable #

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

[View source]
def check(node : Ast::ModuleAccess) : Checkable #

[View source]
def check(node : Ast::NegatedExpression) : Checkable #

[View source]
def check(node : Ast::NextCall) : Checkable #

[View source]
def check(node : Ast::NumberLiteral) : Checkable #

[View source]
def check(node : Ast::Operation) : Checkable #

[View source]

[View source]
def check(node : Ast::Pipe) : Checkable #

[View source]
def check(node : Ast::Property) : Checkable #

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

[View source]
def check(node : Ast::Record, should_create_record : Bool = false) : Checkable #

[View source]
def check(node : Ast::RecordDefinition) : Checkable #

[View source]
def check(node : Ast::RecordDefinitionField) : Checkable #

[View source]
def check(node : Ast::RecordField, should_create_record : Bool = false) : Checkable #

[View source]
def check(node : Ast::RecordUpdate) : Checkable #

[View source]
def check(node : Ast::RegexpLiteral) : Checkable #

[View source]
def check(node : Ast::ReturnCall) : Checkable #

[View source]
def check(node : Ast::Route) : Checkable #

[View source]
def check(node : Ast::Routes) : Checkable #

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

[View source]
def check(node : Ast::Statement) : Checkable #

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

[View source]
def check(node : Ast::StringLiteral) : Checkable #

[View source]
def check(node : Ast::Style) : Checkable #

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

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

[View source]
def check(node : Ast) : Checkable #

[View source]
def check(node : Ast::TupleLiteral) : Checkable #

[View source]
def check(node : Ast::Type) : Checkable #

[View source]
def check(node : Ast::TypeVariable) : Checkable #

[View source]
def check(node : Ast::UnaryMinus) : Checkable #

[View source]
def check(node : Ast::Use) : Checkable #

[View source]
def check(node : Ast::Variable) : Checkable #

[View source]
def check(node : Ast::Void) : Checkable #

[View source]
def check(node : Ast::Directives::Asset) : Checkable #

[View source]

[View source]
def check(node : Ast::Directives::Format) : Checkable #

[View source]
def check(node : Ast::Directives::Highlight) : Checkable #

[View source]
def check(node : Ast::Directives::Inline) : Checkable #

[View source]
def check(node : Ast::Directives::Svg) : Checkable #

[View source]
def check(node : Checkable) : Checkable #

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

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

[View source]
def check : Artifacts #

[View source]
def check!(node) #

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

Check all nodes that were not checked before


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

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

[View source]
def check_arguments(arguments : Array(Ast::Argument)) #

[View source]
def check_array_access(lhs, type) #

[View source]
def check_call(node, function_type) : Checkable #

[View source]
def check_decode(type : Checkable) #

[View source]
def check_global_names(name : String, node : Ast::Node) : Nil #

[View source]
def check_global_types(name : String, node : Ast::Node) : Nil #

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

[View source]
def check_locale(node : Ast::Locale) #

[View source]
def check_locale_record(node : Ast::RecordField, prefix : String | Nil, language : String) #

[View source]
def check_names(nodes : Array(Ast::Function | Ast::Get | Ast::Property | Ast::State), error : Mint::TypeError.class, resolved = {} of String => Ast::Node) : Nil #

[View source]
def check_variable(variable) #

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

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

[View source]
def checking=(checking : Bool) #

[View source]
def checking? : Bool #

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

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

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

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

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

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

[View source]
def create_record(fields) #

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

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

[View source]
def debug #

[View source]
def destructure(node : Nil, condition : Checkable, variables : Array(VariableScope) = [] of VariableScope) #

[View source]
def destructure(node : Ast::Variable, condition : Checkable, variables : Array(VariableScope) = [] of VariableScope) #

This is for the let statement when it's a single assignment


[View source]
def destructure(node : Ast::ArrayDestructuring, condition : Checkable, variables : Array(VariableScope) = [] of VariableScope) #

[View source]
def destructure(node : Ast::TupleDestructuring, condition : Checkable, variables : Array(VariableScope) = [] of VariableScope) #

[View source]
def destructure(node : Ast::EnumDestructuring, condition : Checkable, variables : Array(VariableScope) = [] of VariableScope) #

[View source]
def destructure(node : Ast::Node, condition : Checkable, variables : Array(VariableScope) = [] of VariableScope) #

[View source]
def extract_variables(node : Checkable) : Hash(String, Checkable) #

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

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

[View source]
def formatter : Mint::Formatter #

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

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

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

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

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

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

[View source]
def ordinal(number) #

[View source]
def print_stack #

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

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

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

[View source]

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

[View source]
def resolve(node : Ast::Node | Checkable, *args) : Checkable #

[View source]
def resolve(nodes : Array(Ast::Node), *args) : Array(Checkable) #

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

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

[View source]
def resolve_record_definition(name) #

[View source]
def resolve_records #

[View source]
def resolve_type(node : Record | Variable) #

[View source]
def resolve_type(node : Js) #

[View source]
def resolve_type(node : Type) #

[View source]

[View source]
def scope(node : Scope::Node, &) #

[View source]
def scope(nodes, &) #

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

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

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

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

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

[View source]
def static_type_signature(node : Ast::HtmlElement) : Checkable #

[View source]
def static_type_signature(node : Ast::InlineFunction) : Checkable #

[View source]
def static_type_signature(node : Ast::Property) : Checkable #

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

[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 web_components : Array(String) #

[View source]
def with_restricted_top_level_entity(referee : Mint::Ast::Node | Nil, &) #

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

[View source]

Macro Detail

macro type_error(name) #

[View source]