Skip to content

Define the grammar for EBNF-ish spec entries #692

@wking

Description

@wking

We currently have a digest grammar with no defined grammar syntax. I had previously floated transitioning that grammar to the well-defined ABNF, but #655 was rejected. There has recently been a lot of discussion about various grammar syntax in #671, but no consensus around picking an externally-defined grammar or adding local definition for the grammar. Many of the external grammars are very similar to the current digest grammar:

digest                := algorithm ":" encoded
algorithm             := algorithm-component [algorithm-separator algorithm-component]*
algorithm-component   := /[a-z0-9]+/
algorithm-separator   := /[+._-]/
encoded               := /[a-zA-Z0-9=_-]+/

being very similar to XML 1.0 EBNF:

digest                ::= algorithm ":" encoded
algorithm             ::= algorithm-component (algorithm-separator algorithm-component)*
algorithm-component   ::= [a-z0-9]+
algorithm-separator   ::= [+._-]
encoded               ::= [a-zA-Z0-9=_-]+

After extensive discussion on IRC today (starting here), @stevvooe offered to define the grammar if I filed an issue, so here it is.

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