class PackageConfig

def parse_pc

def parse_pc
  raise ".pc for #{@name} doesn't exist." unless exist?
  @variables = {}
  @declarations = {}
  File.open(pc) do |input|
    input.each_line do |line|
      line = line.gsub(/#.*/, '').strip
      next if line.empty?
      case line
      when /^(#{IDENTIFIER_RE})=/
        @variables[$1] = $POSTMATCH.strip
      when /^(#{IDENTIFIER_RE}):/
        @declarations[$1] = $POSTMATCH.strip
      end
    end
  end
end