Sha256: e7b3cce7b62bd417f6e1c2296726986481513cfb734c254cefadf00cd0832f1f
Contents?: true
Size: 1.06 KB
Versions: 32
Compression:
Stored size: 1.06 KB
Contents
module CC module Analyzer class LocationDescription def initialize(location, suffix = "") @location = location @suffix = suffix end def to_s str = "" if location["lines"] str << render_lines elsif positions = location["positions"] str << render_position(positions["begin"]) if positions["end"] str << "-" str << render_position(positions["end"]) end end str << suffix unless str.blank? str end private attr_reader :location, :suffix def render_lines str = location["lines"]["begin"].to_s str << "-#{location["lines"]["end"]}" if location["lines"]["end"] str end def render_position(position) str = "" if position["line"] str << position["line"].to_s str << ":#{position["column"]}" if position["column"] elsif position["offset"] str << position["offset"].to_s end str end end end end
Version data entries
32 entries across 32 versions & 1 rubygems