require_relative "../../../core_ext" class Ecu class LabelList A2LREGEXP = %r{/begin CHARACTERISTIC\s+([\S]+)\s+"([^"]*)"} def self.from_a2l(str) str.gsub!(%r{/\*.*?\*/}, "") labels = str.scan(A2LREGEXP).map do |name, description| # Ugly hack: Create dummy Festwert until better parsing # is implemented Ecu::Festwert.new(name: name, description: description, value: 0) end new(labels) end end end