Skip to content

Commit d393c3f

Browse files
committed
Changes to consistent referencing of operators
Signed-off-by: Alexios Zavras (zvr) <github@zvr.gr>
1 parent 5e9d4e9 commit d393c3f

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

docs/annexes/spdx-license-expressions.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## Overview
44

5-
Often a single license can be used to represent the licensing terms of a source code or binary file, but there are situations where a single license identifier is not sufficient. A common example is when software is offered under a choice of one or more licenses (e.g., GPL-2.0-only OR BSD-3-Clause). Another example is when a set of licenses is needed to represent a binary program constructed by compiling and linking two (or more) different source files each governed by different licenses (e.g., LGPL-2.1-only AND BSD-3-Clause).
5+
Often a single license can be used to represent the licensing terms of a source code or binary file, but there are situations where a single license identifier is not sufficient. A common example is when software is offered under a choice of one or more licenses (e.g., `GPL-2.0-only OR BSD-3-Clause`). Another example is when a set of licenses is needed to represent a binary program constructed by compiling and linking two (or more) different source files each governed by different licenses (e.g., `LGPL-2.1-only AND BSD-3-Clause`).
66

7-
SPDX License Expressions provide a way for one to construct expressions that more accurately represent the licensing terms typically found in open source software source code. A license expression could be a single license identifier found on the SPDX License List; a user defined license reference denoted by the `LicenseRef-(idstring)`; a license identifier combined with an SPDX exception; or some combination of license identifiers, license references and exceptions constructed using a small set of defined operators (e.g., `AND`, `OR`, `WITH` and `+`). We provide the definition of what constitutes a valid SPDX License Expression in this section.
7+
SPDX License Expressions provide a way for one to construct expressions that more accurately represent the licensing terms typically found in open source software source code. A license expression could be a single license identifier found on the SPDX License List; a user defined license reference denoted by the "LicenseRef-(idstring)"; a license identifier combined with an SPDX exception; or some combination of license identifiers, license references and exceptions constructed using a small set of defined operators (e.g., "AND", "OR", "WITH" and "+"). We provide the definition of what constitutes a valid SPDX License Expression in this section.
88

99
The general format of license expressions is described below in ABNF, as defined
1010
in [RFC 5234](https://datatracker.ietf.org/doc/rfc5234/) and expanded
@@ -46,17 +46,17 @@ A valid `<license-expression>` string consists of either:
4646

4747
(ii) a more complex expression constructed by combining smaller valid expressions using Boolean license operators.
4848

49-
There shall not be any space between a license-id and any following `+`. This supports easy parsing and backwards compatibility.
49+
There shall not be any space between a license-id and any following "+". This supports easy parsing and backwards compatibility.
5050

51-
There shall be at least one space on either side of the operators `AND`, `OR`, and "WITH".
51+
There shall be at least one space on either side of the operators "AND", "OR", and "WITH".
5252

5353
A license expression shall be on a single line, and shall not include a line break in the middle of the expression.
5454

5555
## Case sensitivity
5656

57-
In SPDX-3, license expressions are completely *case-insensitive*.
57+
In SPDX 3, license expressions are completely *case-insensitive*.
5858

59-
That includes the operators (`AND`, `OR`, `WITH`), the special identifiers (`NONE` and `NOASSERTION`), as well as the license identifiers, including the user-defined ones.
59+
That includes the operators ("AND", "OR", "WITH"), the special identifiers ("NONE" and "NOASSERTION"), as well as the license identifiers, including the user-defined ones.
6060

6161
For example, the expressions `MIT AND NOASSERTION AND (BSD-3-Clause OR LicenseRef-Name)` and `mit aNd NoaSSerTion AnD (bSd-3-clausE OR licenseref-NAME)` are equivalent.
6262

@@ -111,7 +111,7 @@ An example representing a choice between three different licenses would be:
111111
LGPL-2.1-only OR MIT OR BSD-3-Clause
112112
```
113113

114-
The special identifiers "NONE" or "NOASSERTION" shall not be used with the OR operator.
114+
The special identifiers "NONE" or "NOASSERTION" shall not be used with the "OR" operator.
115115

116116
### Conjunctive "AND" operator
117117

@@ -153,7 +153,7 @@ GPL-2.0-or-later WITH Bison-exception-2.2
153153

154154
The current set of valid license exceptions identifiers can be found in [spdx.org/licenses](https://spdx.org/licenses).
155155

156-
The special identifiers "NONE" or "NOASSERTION" shall not be used with the WITH operator.
156+
The special identifiers "NONE" or "NOASSERTION" shall not be used with the "WITH" operator.
157157

158158
### Order of precedence and parentheses
159159

@@ -174,7 +174,7 @@ For example, the following expression:
174174
LGPL-2.1-only OR BSD-3-Clause AND MIT
175175
```
176176

177-
represents a license choice between either LGPL-2.1-only or the expression "BSD-3-Clause AND MIT" because the AND operator takes precedence over (is applied before) the OR operator.
177+
represents a license choice between either LGPL-2.1-only or the expression "BSD-3-Clause AND MIT" because the "AND" operator takes precedence over (is applied before) the "OR" operator.
178178

179179
When required to express an order of precedence that is different from the default order a `<license-expression>` can be encapsulated in pairs of parentheses: ( ), to indicate that the operators found inside the parentheses takes precedence over operators outside. This is also similar to the use of parentheses in an algebraic expression e.g., (5+7)/2.
180180

@@ -184,15 +184,15 @@ For instance, the following expression:
184184
(LGPL-2.1-or-later OR BSD-3-Clause) AND MIT
185185
```
186186

187-
states the OR operator should be applied before the AND operator. That is, one should first select between the LGPL-2.1-or-later or the BSD-3-Clause license before applying the MIT license.
187+
states the "OR" operator should be applied before the "AND" operator. That is, one should first select between the LGPL-2.1-or-later or the BSD-3-Clause license before applying the MIT license.
188188

189189
## Complete grammar
190190

191191
The complete syntax of license expressions,
192192
including precedence and whitespace,
193193
is described by the following ABNF:
194194

195-
``` ABNF
195+
```ABNF
196196
; ABNF Grammar for License Expressions
197197
198198
SPSX-license-expression = (or-operand *( required-ws "OR" required-ws or-operand )) / special-identifier
@@ -207,7 +207,7 @@ with-expression = identifier required-ws "WITH" required-ws addition-identifier
207207
208208
addition-identifier = license-exception-id / addition-ref
209209
210-
identifier = license-id / or-later-expression / licesnse-ref
210+
identifier = license-id / or-later-expression / license-ref
211211
212212
or-later-expression = license-id PLUS
213213

0 commit comments

Comments
 (0)