Coverage::SourceFile
Inherits MacroUtils / Crystal::Visitor / Reference / Object
Constants
CRYSTAL_KEYWORDS = ["abstract", "do", "if", "nil?", "self", "unless", "alias", "else", "of", "sizeof", "until", "as", "elsif", "include", "struct", "when", "as?", "end", "instance_sizeof", "pointerof", "super", "while", "asm", "ensure", "is_a?", "private", "then", "with", "begin", "enum", "lib", "protected", "true", "yield", "break", "extend", "macro", "require", "case", "false", "module", "rescue", "typeof", "class", "for", "next", "return", "uninitialized", "def", "fun", "nil", "select", "union"] of ::String
List of keywords which are trouble with variable name. Some keywoards are not and won't be present in this list. Since this can break the code replacing the variable by a underscored version of it, and I'm not sure about this list, we will need to add/remove stuff to not break the code.
Constructors
new(path : String, source : String, required_at : Int32 = 0)
Class methods
already_covered_file_name
cover_file(file, &)
file_list
final_operations
outputter
outputter=(outputter : String)
prelude_operations
project_path
project_path?
register_file(f)
relative_path_to_project(path)
require_expanders
use_require
use_require=(use_require : String)
Instance methods
already_covered_locations
astree
astree?
enriched_source
enriched_source?
id
inject_cover(node : Crystal::ASTNode)
lines
md5_signature
path
process
Inject in AST tree if required.
required_at
source
to_covered_source
visit(node : Crystal::Require)
Management of required file is nasty and should be improved Since I've hard time to replace node on visit, I change the file argument to a number linked to an array of files Then on finalization, we replace each require "xxx" by the proper file.
visit(node : Crystal::OpAssign | Crystal::BinaryOp)
Do not visit sub elements of inlined computations
visit(node : Crystal::Arg)
visit(node : Crystal::Assign)
Placeholder for bug #XXX
visit(node : Crystal::Expressions)
visit(node : Crystal::Block | Crystal::While)
visit(node : Crystal::MacroExpression)
visit(node : Crystal::MacroLiteral)
visit(node : Crystal::MacroIf)
visit(node : Crystal::MacroFor)
visit(node : Crystal::MacroVar)
visit(node : Crystal::Asm)
visit(node : Crystal::Def)
visit(node : Crystal::Select)
visit(node : Crystal::Case)
visit(node : Crystal::If)
visit(node : Crystal::Unless)
visit(node : Crystal::ASTNode)
Ignore other nodes for now
visit(node : Macro)