class Savi::AST::Format
- Savi::AST::Format
- Savi::AST::Visitor
- Reference
- Object
Defined in:
savi/ast/format.crConstructors
Class Method Summary
-
.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.
-
.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.
Instance Method Summary
- #edits : Array(Savi::AST::Format::Edit)
- #finalize
- #observe(ctx, group : AST::Group)
- #observe(ctx, relate : AST::Relate)
-
#observe(ctx, node)
For all other nodes, we analyze nothing.
- #observe_group_brackets(ctx, group : AST::Group)
- #observe_group_commas(ctx, group : AST::Group)
-
#observe_group_term_parens(ctx, group : AST::Group)
Check for unnecessary parens within the terms of a Group.
- #observe_relate_dot(ctx, relate : AST::Relate)
-
#observe_relate_term_parens(ctx, relate : AST::Relate)
Check for unnecessary parens within the terms of a Relate.
- #parent
- #violates(rule, pos, replacement = "")
- #visit(ctx, node : AST::Node)
- #visit_pre(ctx, node : AST::Node)
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
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.
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.
Instance Method Detail
def observe_group_term_parens(ctx, group : AST::Group)
#
Check for unnecessary parens within the terms of a Group.
def observe_relate_term_parens(ctx, relate : AST::Relate)
#
Check for unnecessary parens within the terms of a Relate.