Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parens for setting precedence #3

Open
withoutboats opened this issue Nov 28, 2015 · 0 comments
Open

Parens for setting precedence #3

withoutboats opened this issue Nov 28, 2015 · 0 comments

Comments

@withoutboats
Copy link
Collaborator

The spec supports paren enclosed sub-expressions, which this library would find invalid.

The correct grammar:

license        ::= SPDX-license | SPDX-license, '+'
license_with   ::= license | license, 'WITH', SPDX-exception | '(', license_expr, ')'
license_joiner ::= 'AND' | 'OR'
license_expr   ::= license_with, (license_joiner, license_with)*

The 1.2.0 version's grammar:

license        ::= SPDX-license | SPDX-license, '+'
license_with   ::= license | license, 'WITH', SPDX-exception
license_joiner ::= 'AND' | 'OR'
license_expr   ::= license_with, (license_joiner, license_with)*
wking added a commit to wking/cargo that referenced this issue Jan 4, 2018
wking added a commit to wking/licensee that referenced this issue Jan 9, 2018
Using a regex that is similar to the one in
lib/licensee/matchers/spdx.rb in allowing spaces and parens.  Parens
aren't currently supported by Cargo's crates.io backing [1,2], but
that's hopefully a temporary limitation.  And Cargo/crates.io already
supports OR forms [3].

Ideally licensee would return the full license expression in these
cases instead of 'other' [4].  But since that conversion is happening
outside the matcher this commit isn't making that any worse (although
it means this test isn't quite a unit test).

[1]: ehuss/license-exprs#3
[2]: rust-lang/cargo@c89dd64
[3]: rust-lang/cargo#4920
[4]: licensee#244
wking added a commit to wking/licensee that referenced this issue Jan 9, 2018
Using a regex that is similar to the one in
lib/licensee/matchers/spdx.rb in allowing spaces and parens.  Parens
aren't currently supported by Cargo's crates.io backing [1,2], but
that's hopefully a temporary limitation.  And Cargo/crates.io already
supports OR forms [3].

Ideally licensee would return the full license expression in these
cases instead of 'other' [4].  But since that conversion is happening
outside the matcher, this commit isn't making that any worse (although
it means this test isn't quite a unit test).

[1]: ehuss/license-exprs#3
[2]: rust-lang/cargo@c89dd64
[3]: rust-lang/cargo#4920
[4]: licensee#244
sunfishcode added a commit to bytecodealliance/wasi-rs that referenced this issue Aug 29, 2019
license-exprs doesn't yet support parens:

ehuss/license-exprs#3

so remove them for now. The parens were redundant by the license expression
precedence rules in

https://spdx.org/spdx-specification-21-web-version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant