Sha256: 15539baecf5548f9c2055865bfada379e55c549aa64eec119695ba9774605ef7

Contents?: true

Size: 931 Bytes

Versions: 5

Compression:

Stored size: 931 Bytes

Contents

# frozen_string_literal: true

module SpdxGrammar
  class CompoundExpression < Treetop::Runtime::SyntaxNode
    def licenses
      elements[0].licenses
    end
  end

  class LogicalOr < Treetop::Runtime::SyntaxNode
  end

  class LogicalAnd < Treetop::Runtime::SyntaxNode
  end

  class With < Treetop::Runtime::SyntaxNode
  end

  class None < Treetop::Runtime::SyntaxNode
    def licenses
      []
    end
  end

  class NoAssertion < Treetop::Runtime::SyntaxNode
    def licenses
      []
    end
  end

  class License < Treetop::Runtime::SyntaxNode
    def licenses
      text_value
    end
  end

  class LicenseException < Treetop::Runtime::SyntaxNode
    # TODO: actually do license exceptions
  end

  class Body < Treetop::Runtime::SyntaxNode
    def licenses
      elements.map { |node| node.licenses if node.respond_to?(:licenses) }.flatten.uniq.compact
    end
  end

  class SpdxParseError < StandardError
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spdx-2.0.12 lib/spdx_grammar.rb
spdx-2.0.11 lib/spdx_grammar.rb
spdx-2.0.10 lib/spdx_grammar.rb
spdx-2.0.9 lib/spdx_grammar.rb
spdx-2.0.5 lib/spdx_grammar.rb