Sha256: 89fcfc94c0ae164048e125c59e8a885738513fb8ff509d8a4df01807a4891536

Contents?: true

Size: 1002 Bytes

Versions: 29

Compression:

Stored size: 1002 Bytes

Contents

# Treetop (http://treetop.rubyforge.org/) grammar for package definitions in v1
# format.

require 'treetop'

require 'fig/grammar/base'
require 'fig/grammar/v1_base'
require 'fig/grammar/version'

module Fig
  module Grammar
    grammar V1
      include Fig::Grammar::Base
      include Fig::Grammar::Version
      include Fig::Grammar::V1Base

      # It would nice to be able to put this into Fig::Grammar::V1Base, but it
      # looks like the root has to be declared in the concrete grammar.
      rule package
        optional_ws_or_comment
        grammar_version:grammar_version?
        statements:(package_statement_with_ws*)
        optional_ws_or_comment
        {
          def to_package(unparsed_package, build_state)
            return build_state.new_package_statement(
              unparsed_package, grammar_version, statements
            )
          end
        }
      end

      rule config_statement
        override / include / command / path / set
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
fig-1.10.0 lib/fig/grammar/v1.treetop
fig-1.9.0 lib/fig/grammar/v1.treetop
fig-1.8.0 lib/fig/grammar/v1.treetop
fig-1.7.0 lib/fig/grammar/v1.treetop
fig-1.6.0 lib/fig/grammar/v1.treetop
fig-1.5.0 lib/fig/grammar/v1.treetop
fig-1.4.0 lib/fig/grammar/v1.treetop
fig-1.3.0 lib/fig/grammar/v1.treetop
fig-1.2.0 lib/fig/grammar/v1.treetop