class Coverage::SourceFile
- Coverage::SourceFile
- Crystal::Visitor
- Reference
- Object
Included Modules
Defined in:
coverage/inject/source_file.crConstant Summary
-
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
Class Method Summary
- .already_covered_file_name
- .cover_file(file, &)
- .file_list
- .final_operations
- .outputter : String
- .outputter=(outputter : String)
- .prelude_operations
- .project_path : String
- .project_path? : String | Nil
- .register_file(f)
- .relative_path_to_project(path)
- .require_expanders
- .use_require : String
- .use_require=(use_require : String)
Instance Method Summary
- #already_covered_locations : Set(Crystal::Location?)
- #astree : Crystal::ASTNode
- #astree? : Crystal::ASTNode | Nil
- #enriched_source : String
- #enriched_source? : String | Nil
- #id : Int32
- #inject_cover(node : Crystal::ASTNode)
- #lines : Array(Int32)
- #md5_signature : String
- #path : String
-
#process
Inject in AST tree if required.
- #required_at : Int32
- #source : String
- #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)
Instance methods inherited from module MacroUtils
propagate_location_in_macro(node : Crystal::ASTNode, location : Nil)propagate_location_in_macro(node : Crystal::Nop, location : Crystal::Location)
propagate_location_in_macro(node : Crystal::MacroIf, location : Crystal::Location)
propagate_location_in_macro(node : Crystal::MacroFor, location : Crystal::Location)
propagate_location_in_macro(node : Crystal::MacroLiteral, location : Crystal::Location)
propagate_location_in_macro(node : Crystal::Expressions, location)
propagate_location_in_macro(node : Crystal::ASTNode, location : Crystal::Location) propagate_location_in_macro
Constructor Detail
Class Method Detail
Instance Method Detail
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.
Do not visit sub elements of inlined computations