spdx-spec icon indicating copy to clipboard operation
spdx-spec copied to clipboard

license expressions grammar

Open zvr opened this issue 5 years ago • 3 comments

This is about Annex D, where we define the license expressions.

The ABNF grammar does not look correct to me...

In both definitions of compound-expression and license-expression we can delete the superfluous initial 1*1, which says "minimum 1, maximum 1", which of course is the same as omitting it ("exactly 1").

Then, the definition of license-expression includes both simple-expression and compound-expression, but compound-expression can already be a single simple-expression, so there is no need to have them both.

zvr avatar Jul 07 '20 16:07 zvr

  • 1*1 is superfluous (and should be removed) I agree completely. +1

[EDIT] (I misunderstood the second point)

  • license-expression is redundant I agree that there's a lot of redundancy here. (simple-expression / compound-expression) is logically equivalent to compound-expression, and that also means that license-expression is effectively just a synonym for compound-expression. On the other hand, I feel like the current definition has some value, just for the sake of readability.

Cynical-Optimist avatar Sep 23 '20 11:09 Cynical-Optimist

Two more issues:

  • Redundant 1* The definition of license-ref involves 1*(idstring), but the definition of idstring already used a 1*. so the second 1* is redundant.

[EDIT] removed the section about using triple backticks and ensuring correct line spacing. I see this is already done in development/v2.2.1

  • Incorrect backslash license-ref definition includes the text 1\*(idstring). I believe the backslash is incorrect. I think it was originally there to escape the asterisk, and stop it being interpreted as markdown markup. But the whole section is now inside triple backticks so the backslash is actually being rendered as part of the text.

Cynical-Optimist avatar Sep 23 '20 11:09 Cynical-Optimist

It looks like this was partially resolved in 2.3, but we still have the redundant expressions.

Since we're past the review period for 2.3, I'm pushing this to a 3.0 fix.

goneall avatar Aug 11 '22 17:08 goneall

Closing this, as the grammar of 3.0 has the fixes already integrated.

zvr avatar Apr 04 '24 20:04 zvr