Closed pmonks closed 10 months ago
Fixed in rev ffcbd9b9144f6ac4032bda1521f5c58ce22b20e4, and released in v1.0.107.
Note: as part of this change, operators were made prefix in the parse tree, rather than infix (as was previously the case).
So the example above gets parsed to:
[:or {license-id "GPL-3.0-only"} [:and {license-id "MIT"} {license-id "Apache-2.0"}]]
Currently the parse trees returned from
spdx.expressions/parse
don't represent the precedence order for AND and OR (as specified in Annex D of the SPDX specification). Rather than leaving this to users ofclj-spdx
, the library should explicitly represent operator precedence (i.e. by introducing grouping where it didn't exist in the original expression) to make it explicit.For example, this SPDX expression:
should be parsed to: