class Mint::Formatter

Included Modules

Defined in:

formatter.cr
formatters/access.cr
formatters/argument.cr
formatters/array_destructuring.cr
formatters/array_literal.cr
formatters/block.cr
formatters/bool_literal.cr
formatters/bracket_access.cr
formatters/builtin.cr
formatters/call.cr
formatters/case.cr
formatters/case_branch.cr
formatters/comment.cr
formatters/component.cr
formatters/connect.cr
formatters/connect_variable.cr
formatters/constant.cr
formatters/css_definition.cr
formatters/css_font_face.cr
formatters/css_keyframes.cr
formatters/css_nested_at.cr
formatters/css_selector.cr
formatters/decode.cr
formatters/defer.cr
formatters/directives/asset.cr
formatters/directives/documentation.cr
formatters/directives/format.cr
formatters/directives/highlight.cr
formatters/directives/highlight_file.cr
formatters/directives/inline.cr
formatters/directives/svg.cr
formatters/encode.cr
formatters/env.cr
formatters/field.cr
formatters/field_access.cr
formatters/for.cr
formatters/function.cr
formatters/get.cr
formatters/here_document.cr
formatters/html.cr
formatters/html_attribute.cr
formatters/html_component.cr
formatters/html_element.cr
formatters/html_fragment.cr
formatters/html_style.cr
formatters/id.cr
formatters/if.cr
formatters/inline_function.cr
formatters/interpolation.cr
formatters/js.cr
formatters/list.cr
formatters/locale.cr
formatters/locale_key.cr
formatters/map.cr
formatters/map_field.cr
formatters/module.cr
formatters/negated_expression.cr
formatters/next_call.cr
formatters/number_literal.cr
formatters/operation.cr
formatters/parenthesized_expression.cr
formatters/pipe.cr
formatters/property.cr
formatters/provider.cr
formatters/record.cr
formatters/record_update.cr
formatters/regexp_literal.cr
formatters/return_call.cr
formatters/route.cr
formatters/routes.cr
formatters/spread.cr
formatters/state.cr
formatters/state_setter.cr
formatters/statement.cr
formatters/store.cr
formatters/string_literal.cr
formatters/style.cr
formatters/suite.cr
formatters/test.cr
formatters/top_level.cr
formatters/tuple_destructuring.cr
formatters/tuple_literal.cr
formatters/type.cr
formatters/type_definition.cr
formatters/type_definition_field.cr
formatters/type_destructuring.cr
formatters/type_variable.cr
formatters/type_variant.cr
formatters/unary_minus.cr
formatters/use.cr
formatters/variable.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module Mint::Skippable

replace_skipped(result) replace_skipped, skip(&) skip

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(config : Mint::Formatter::Config = Config.new) #

[View source]

Class Method Detail

def self.format(file) : String #

[View source]

Instance Method Detail

def config : Config #

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

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

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

[View source]
def format(node : Ast::ArrayDestructuring) #

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

[View source]
def format(node : Ast::Block, format = BlockFormat::Block) : String #

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

[View source]
def format(node : Ast::BracketAccess) : String #

[View source]
def format(node : Ast::Builtin) : String #

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

[View source]
def format(node : Ast::Case) : String #

[View source]
def format(node : Ast::CaseBranch) : String #

[View source]
def format(node : Ast::Comment) : String #

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

[View source]
def format(node : Ast::Connect) : String #

[View source]
def format(node : Ast::ConnectVariable) : String #

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

[View source]
def format(node : Ast::CssDefinition) : String #

[View source]
def format(node : Ast::CssFontFace) : String #

[View source]
def format(node : Ast::CssKeyframes) : String #

[View source]
def format(node : Ast::CssNestedAt) : String #

[View source]
def format(node : Ast::CssSelector) : String #

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

[View source]
def format(node : Ast::Defer) : String #

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

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

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

[View source]
def format(node : Ast::FieldAccess) : String #

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

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

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

[View source]
def format(node : Ast::HereDocument) : String #

[View source]
def format(node : Ast::HtmlAttribute) : String #

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

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

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

[View source]
def format(node : Ast::HtmlStyle) : String #

[View source]
def format(node : Ast::Id) : String #

[View source]
def format(node : Ast::If) : String #

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

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

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

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

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

[View source]
def format(node : Ast::Map) : String #

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

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

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

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

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

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

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

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

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

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

[View source]
def format(node : Ast::Record, multiline = false) : String #

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

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

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

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

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

[View source]
def format(node : Ast::Spread) : String #

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

[View source]
def format(node : Ast::StateSetter) : String #

[View source]
def format(node : Ast::Statement, newline = true) : String #

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

[View source]
def format(node : Ast::StringLiteral) : String #

[View source]
def format(node : Ast::Style) : String #

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

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

[View source]
def format(ast : Ast) : String #

[View source]
def format(node : Ast::TupleDestructuring) #

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

[View source]
def format(node : Ast::Type) : String #

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

[View source]
def format(node : Ast::TypeDefinitionField) : String #

[View source]
def format(node : Ast::TypeDestructuring) #

[View source]
def format(node : Ast::TypeVariable) : String #

[View source]
def format(node : Ast::TypeVariant) #

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

[View source]
def format(node : Ast::Use) : String #

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

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

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

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

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

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

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

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

[View source]
def format(nodes : Array(Ast::Node | String)) : Array(String) #

[View source]
def format(node : String) : String #

[View source]
def format(node : Nil) : Nil #

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

[View source]
def format(*, node : Ast::HtmlElement | Ast::HtmlComponent, prefix : String, tag : String) : String #

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

[View source]
def format_parameters(parameters) #

[View source]
def indent(string : String) #

[View source]
def list(nodes : Array(Ast::Node), delimeter : String | Nil = nil) : String #

[View source]
def list(nodes : Array(Tuple(Ast::Node, String)), delimeter : String | Nil = nil) : String #

Formats a list of nodes while preserving whitespace between them


[View source]
def skip_string(string) #

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

[View source]