Class: AppMap::Parser
- Inherits:
-
Object
- Object
- AppMap::Parser
- Defined in:
- lib/appmap/parser.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(file_path: nil, code: nil) ⇒ Parser
constructor
A new instance of Parser.
-
#parse ⇒ Object
Parse the contents of a file into a list of features.
- #to_s ⇒ Object
Constructor Details
#initialize(file_path: nil, code: nil) ⇒ Parser
Returns a new instance of Parser.
6 7 8 9 |
# File 'lib/appmap/parser.rb', line 6 def initialize(file_path: nil, code: nil) @file_path = file_path @code = code end |
Instance Method Details
#parse ⇒ Object
Parse the contents of a file into a list of features.
16 17 18 19 20 |
# File 'lib/appmap/parser.rb', line 16 def parse parse_tree, comments = parse_code_and_comments parse_nodes = build_parse_nodes parse_tree [ parse_nodes, comments ] end |
#to_s ⇒ Object
11 12 13 |
# File 'lib/appmap/parser.rb', line 11 def to_s "Parse code #{file_path.inspect}" end |