Sha256: de9e30288486eb0c89ca36528d209e8063a0ad924a51176d2b1462d5d467f881

Contents?: true

Size: 554 Bytes

Versions: 5

Compression:

Stored size: 554 Bytes

Contents

require 'polyglot'
require 'treetop'

require 'fig/grammar'
require 'fig/logging'
require 'fig/packageerror'

module Fig
  class Parser
    def initialize
      @parser = FigParser.new
    end

    def parse_package(package_name, version_name, directory, input)
      input = input.gsub(/#.*$/, '')
      result = @parser.parse(" #{input} ")
      if result.nil?
        Fig::Logging.fatal "#{directory}: #{@parser.failure_reason}"
        raise PackageError.new
      end
      result.to_package(package_name, version_name, directory)
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
fig-0.1.41-java lib/fig/parser.rb
fig-0.1.41 lib/fig/parser.rb
fig18-0.1.41-x86_64-linux lib/fig/parser.rb
fig18-0.1.41 lib/fig/parser.rb
fig18-0.1.40 lib/fig/parser.rb