Skip to content

Relaxed parsing? #11

Description

@danielmoore

The structure of the ABNF documented in Appendix IV of SPDX 2.1 makes it impossible to recover from an expression like (MIT OR BSD) using a tool like spdx-correct. Would it be reasonable to assume that all license-id tokens are a subset of all valid id-string tokens so we could apply validation optionally at the parse phase instead of the lex phase?

That is, could we do something like this:

var parse = require('spdx-expression-parse');
var assert = require('assert');

assert.deepEqual(
  parse('(MIT OR BSD)', { relax: true }),
  {
    left: { license: 'MIT' },
    conjunction: 'or',
    right: { license: 'BSD' }
  }
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions