Class: RSpectre::SourceMap::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/rspectre/source_map/parser.rb

Instance Method Summary collapse

Instance Method Details

#populate(map) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/rspectre/source_map/parser.rb', line 8

def populate(map)
  walk(parsed_source) { |node| map.add(node) }

  map.freeze
rescue ::Parser::SyntaxError => error
  warn Color.yellow("Warning! Skipping #{file} due to parsing error!")
  warn error.diagnostic.render
  Null.new
end