[ABNF] Add some comments.

Add to the rule for package names, as a comment, the same exclusion added to the
rule for identifiers. Also add a few lines to describe it.

Also discuss the disambiguation of identifiers and package names.
This commit is contained in:
Alessandro Coglio 2021-07-14 22:09:28 -07:00
parent 64ad6a67f3
commit baace61e21

View File

@ -452,9 +452,15 @@ identifier = letter *( letter / digit / "_" ) ; but not a keyword or aleo1...
; A package name consists of one or more segments separated by single dashes,
; where each segment is a non-empty sequence of lowercase letters and digits.
; Similarly to an identifier, a package name must not be keyword
; and must not be or start with `aleo1`.
package-name = lowercase-letter *( lowercase-letter / digit )
*( "-" 1*( lowercase-letter / digit ) )
; but not a keyword or aleo1...
; Note that, grammatically, identifiers are also package names.
; They are disambiguated from context, based on the syntactic grammar.
; Annotations have names, which are identifiers immediately preceded by `@`.