Skip to content

Commit 279f271

Browse files
meretparmintaenzertng
authored andcommitted
[issue-788] fix tag-value parser to allow NONE and NOASSERTION for package source info as they are valid strings
Signed-off-by: Meret Behrens <[email protected]>
1 parent f6fcf20 commit 279f271

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/spdx_tools/spdx/parser/tagvalue/parser.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def p_current_element_error(self, p):
180180
"file_comment : FILE_COMMENT text_or_line\n "
181181
"file_license_concluded : FILE_LICENSE_CONCLUDED license_or_no_assertion_or_none\n "
182182
"package_name : PKG_NAME LINE\n description : PKG_DESCRIPTION text_or_line\n "
183-
"summary : PKG_SUMMARY text_or_line\n source_info : PKG_SOURCE_INFO text_or_line_including_no_assertion\n "
183+
"summary : PKG_SUMMARY text_or_line\n source_info : PKG_SOURCE_INFO text_or_line\n "
184184
"homepage : PKG_HOMEPAGE line_or_no_assertion_or_none\n "
185185
"download_location : PKG_DOWNLOAD_LOCATION line_or_no_assertion_or_none\n "
186186
"originator : PKG_ORIGINATOR actor_or_no_assertion\n supplier : PKG_SUPPLIER actor_or_no_assertion\n "
@@ -212,14 +212,13 @@ def p_generic_value(self, p):
212212
def p_unknown_tag(self, p):
213213
self.logger.append(f"Unknown tag provided in line {p.lineno(1)}")
214214

215-
@grammar_rule("text_or_line : TEXT")
215+
@grammar_rule("text_or_line : TEXT\n line_or_no_assertion_or_none : TEXT")
216216
def p_text(self, p):
217217
p[0] = str_from_text(p[1])
218218

219219
@grammar_rule(
220-
"text_or_line : LINE\n line_or_no_assertion : LINE\nline_or_no_assertion_or_none : text_or_line\n"
221-
"text_or_line_including_no_assertion : text_or_line\ntext_or_line_including_no_assertion : NO_ASSERTION\n"
222-
"text_or_line_including_no_assertion : NONE"
220+
"text_or_line : LINE\n line_or_no_assertion : LINE\nline_or_no_assertion_or_none : LINE\n"
221+
"text_or_line : NO_ASSERTION\n text_or_line : NONE"
223222
)
224223
def p_line(self, p):
225224
p[0] = p[1]

0 commit comments

Comments
 (0)