Skip to content

Definition of label unintentionally includes empty fragments #619

@esoterra

Description

@esoterra

I believe that because fragment -> word -> "" is valid, strange labels like a--b and a------------- are technically valid.

label             ::= <first-fragment> ( '-' <fragment> )*
first-fragment    ::= [a-z] <word>
                    | [A-Z] <acronym>
fragment          ::= <word>
                    | <acronym>
word              ::= [0-9a-z]*
acronym           ::= [0-9A-Z]*

I believe something like this would be more correct.

label             ::= <first-fragment> ( '-' <fragment> )*
first-fragment    ::= <first-word>
                    | <first-acronym>
first-word        ::= [a-z] [0-9a-z]*
first-acronym     ::= [A-Z] [0-9A-Z]*
fragment          ::= <word>
                    | <acronym>
word              ::= [0-9a-z]+
acronym           ::= [0-9A-Z]+

There are many other ways we could write it too, but this seems like it would be fairly consistent with the rest of the grammar.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions