reference: align docs and variables with grammar

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-11-11 11:19:43 +01:00
parent 32a4d8e39f
commit a7e7ff933c
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -90,11 +90,11 @@ var (
// end of the matched string.
anchoredDigestRegexp = regexp.MustCompile(anchored(digestPat))
// nameComponent restricts registry path component names to start
// with at least one letter or number, with following parts able to be
// separated by one period, one or two underscore and multiple dashes.
nameComponent = expression(alphanumeric, optional(repeated(separator, alphanumeric)))
namePat = expression(optional(domain, literal(`/`)), nameComponent, optional(repeated(literal(`/`), nameComponent)))
// pathComponent restricts registry path-components to start with at least
// one letter or number, with following parts able to be separated by one
// period, one or two underscore and multiple dashes.
pathComponent = expression(alphanumeric, optional(repeated(separator, alphanumeric)))
namePat = expression(optional(domain, literal(`/`)), pathComponent, optional(repeated(literal(`/`), pathComponent)))
// NameRegexp is the format for the name component of references, including
// an optional domain and port, but without tag or digest suffix.
@ -102,7 +102,7 @@ var (
// anchoredNameRegexp is used to parse a name value, capturing the
// domain and trailing components.
anchoredNameRegexp = regexp.MustCompile(anchored(optional(capture(domain), literal(`/`)), capture(nameComponent, optional(repeated(literal(`/`), nameComponent)))))
anchoredNameRegexp = regexp.MustCompile(anchored(optional(capture(domain), literal(`/`)), capture(pathComponent, optional(repeated(literal(`/`), pathComponent)))))
referencePat = anchored(capture(namePat), optional(literal(":"), capture(tag)), optional(literal("@"), capture(digestPat)))