Sha256: 23c29a3b987f016c174f625e50f3e79ca2f4bf34d6f7b0b9eee4c97e9fc11a57

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

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 UserDefinedLicense < Treetop::Runtime::SyntaxNode
  end

  class LicenseRef < Treetop::Runtime::SyntaxNode
  end

  class DocumentRef < Treetop::Runtime::SyntaxNode
  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

2 entries across 2 versions & 1 rubygems

Version Path
spdx-3.0.1 lib/spdx_grammar.rb
spdx-3.0.0 lib/spdx_grammar.rb