class Savi::AST::Format

Defined in:

savi/ast/format.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class Savi::AST::Visitor

visit(ctx : Compiler::Context, node : Node) visit, visit_any?(ctx : Compiler::Context, node : Node) visit_any?, visit_children?(ctx : Compiler::Context, node : Node) visit_children?, visit_pre(ctx : Compiler::Context, node : Node) visit_pre

Constructor Detail

def self.new(package : Program::Package::Link, doc : AST::Document) #

[View source]

Class Method Detail

def self.check(ctx : Compiler::Context, package : Program::Package::Link, docs : Array(AST::Document)) #

Emit errors to the context for any formatting issues in the given document.


[View source]
def self.run(ctx : Compiler::Context, package : Program::Package::Link, docs : Array(AST::Document)) #

Return a list of edits that should be applied to the given document.


[View source]

Instance Method Detail


[View source]
def finalize #

[View source]
def observe(ctx, group : AST::Group) #

[View source]
def observe(ctx, relate : AST::Relate) #

[View source]
def observe(ctx, node) #

For all other nodes, we analyze nothing.


[View source]
def observe_group_brackets(ctx, group : AST::Group) #

[View source]
def observe_group_commas(ctx, group : AST::Group) #

[View source]
def observe_group_term_parens(ctx, group : AST::Group) #

Check for unnecessary parens within the terms of a Group.


[View source]
def observe_relate_dot(ctx, relate : AST::Relate) #

[View source]
def observe_relate_term_parens(ctx, relate : AST::Relate) #

Check for unnecessary parens within the terms of a Relate.


[View source]
def parent #

[View source]
def violates(rule, pos, replacement = "") #

[View source]
def visit(ctx, node : AST::Node) #

[View source]
def visit_pre(ctx, node : AST::Node) #

[View source]