Conversation
32049cf to
0a144bd
Compare
Signed-off-by: Jan Kowalleck <[email protected]>
0a144bd to
6ca8acd
Compare
|
The ABNF is done according to latest spec, ready for review. possible followup: have a pipeline that checks the test-suite against that ABNF. |
ppkarwasz
left a comment
There was a problem hiding this comment.
@jkowalleck, thanks for submitting this!
I'll check it in detail later, right now these two problems show up:
Signed-off-by: Jan Kowalleck <[email protected]>
Signed-off-by: Jan Kowalleck <[email protected]>
There was a problem hiding this comment.
Thanks again for the PR! 🎉
I only spotted a couple of issues, the rest looks solid.
Random thought while reading: what if we defined a common set of productions for the basic character sequences, and then split things into two separate ABNF grammars: one for canonical PURLs and one for non-canonical PURLs?
The spec is very lenient about repeated slashes /: they’re allowed not just at the start, but also smack in the middle of a namespace or subpath. Basically, you could take a nap with your finger on the / key and still be fully PURL-compliant. 😴///😴///😴
If you fall asleep, you'll need a bigger screen to display the PURL, though. 😉
tha's not what the current spec says. purl-spec/PURL-SPECIFICATION.rst Line 149 in c53ba0e but not on the middle: purl-spec/PURL-SPECIFICATION.rst Lines 147 to 148 in c53ba0e |
Signed-off-by: Jan Kowalleck <[email protected]>
Co-authored-by: Piotr P. Karwasz <[email protected]>
Signed-off-by: Jan Kowalleck <[email protected]>
|
Hi @jkowalleck,
The spec doesn’t mention slashes in the middle explicitly, but the spec instructs parsers to ignore empty path segments, which are precisely what repeated slashes (///) represent. purl-spec/PURL-SPECIFICATION.rst Lines 390 to 398 in c53ba0e So in practice, multiple slashes are allowed anywhere (start, middle, or end), since they collapse during parsing. |
I understand, but this is not the right scope for your concerns. I've built the grammar based on the spec, and not on the parser-rules. |
Signed-off-by: Jan Kowalleck <[email protected]>
Signed-off-by: Jan Kowalleck <[email protected]>
| [ "/" namespace-canonical ] "/" name | ||
| [ "@" version ] [ "?" qualifiers-canonical ] [ "#" subpath-canonical ] | ||
|
|
||
| scheme = %x70.6B.67 ; lowercase string "pkg" |
There was a problem hiding this comment.
if you dont like this original ABNF case-sensitive notation, we could use RFC7405's case-sensitive notation:
| scheme = %x70.6B.67 ; lowercase string "pkg" | |
| scheme = %s"pkg" |
|
need to check whether anything in the grammar changed since the last commit here (Oct 1, 2025) (-> see this diff ) PS: since the PURL core-spec is a standard now, I'd rather have the core-grammar be part of that standard, too. |
Signed-off-by: Jan Kowalleck <[email protected]>
Signed-off-by: Jan Kowalleck <[email protected]>
Signed-off-by: Jan Kowalleck <[email protected]>
Signed-off-by: Jan Kowalleck <[email protected]>
Signed-off-by: Jan Kowalleck <[email protected]>
Signed-off-by: Jan Kowalleck <[email protected]>
Signed-off-by: Jan Kowalleck <[email protected]>
Signed-off-by: Jan Kowalleck <[email protected]>
Signed-off-by: Jan Kowalleck <[email protected]>
a474572 to
8102c22
Compare
Signed-off-by: Jan Kowalleck <[email protected]>
|
re: #578 (comment) reviewed/revisited the grammar according to Ecma standard. |
There was a problem hiding this comment.
Pull request overview
This PR adds a formal ABNF grammar specification for Package-URL (PURL), addressing issue #535. The grammar defines the structure and character encoding rules for both regular and canonical PURL formats.
- Introduces comprehensive ABNF grammar rules for PURL components (scheme, type, namespace, name, version, qualifiers, and subpath)
- Defines character encoding rules and permitted character classes following RFC5234
- Specifies both canonical and non-canonical forms of PURL strings
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Jan Kowalleck <[email protected]>
Signed-off-by: Jan Kowalleck <[email protected]>
Signed-off-by: Jan Kowalleck <[email protected]>
Co-authored-by: Piotr P. Karwasz <[email protected]>
Signed-off-by: Jan Kowalleck <[email protected]>
|
@mjherzog @pombredanne please review |
Uh oh!
There was an error while loading. Please reload this page.