Sha256: 62e76267b47c84a9d55b397092b6b9663d0d359a46850a4fd6adf5e21a67ab90
Contents?: true
Size: 1.74 KB
Versions: 29
Compression:
Stored size: 1.74 KB
Contents
# Treetop (http://treetop.rubyforge.org/) grammar for package definitions in v2 # format. require 'treetop' require 'fig/grammar/base' require 'fig/grammar/v1_base' require 'fig/grammar/version' module Fig module Grammar grammar V2 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 / include_file / command / path / set end rule include_file statement_start:'include-file' ws_or_comment+ path:file_path config:(':' config_name:config_name)? { def to_config_statement(build_state) config_name = nil if config.respond_to? :config_name config_name = config.config_name end return build_state.new_include_file_statement( statement_start, path, config_name ) end } end rule file_path # This is like quoted_or_bare_string, but disallows unquoted colons so # that we can differentiate config names. '"' ( [^"\\] / '\\' . )* '"' / "'" ( [^'\\] / '\\' . )* "'" / [^\s#:]+ end end end end
Version data entries
29 entries across 29 versions & 1 rubygems