Command Palette

Search for a command to run...

atypical
Commit grammar

Ambiguity

Grammars rejected before any header is read.

A grammar is validated on load. An invalid grammar exits 1 with one error and lints nothing.

An optional slot does not separate its neighbours: the slots on either side are checked against each other too.

Malformed slots

ErrorCause
slot `x` needs exactly one of `kind`, `delimiters` or `one-of` None of them, or more than one
slot `separator` is a `symbol`, so it cannot match `::` A spelling the kind cannot match
`gap` does not apply to slot `emoji`A misplaced key on a one-of

Indistinguishable slots

ErrorCauseResolution
`a` takes the whole run, leaving nothing for `b`A word, or unrestricted symbols, followed by the same kindA symbol or delimited slot between them
`a` and `b` both start with `x`Neighbouring spellings share a prefixDistinct first characters
`b` takes anything, `a`'s spellings includedA closed set before an unrestricted slot of the same alphabetClose the second slot's values
`a` and `b` carry the same delimitersTwo delimited slots with the same pair, at any distanceA different pair; a shared opener alone is allowed
`a` and `b` can start on the same inputOverlapping one-of optionsClose or separate the options
`a` is optional after a gap, so it can take the start of the descriptionAn optional word or unrestricted symbols slot after a gaprequired = true, or a delimited slot

word is one alphabet; symbols and symbol share the other.

Examples

Run
[[commit.slots]]
name = "type"
kind = "word"

[[commit.slots]]
name = "subtype"
kind = "word"
Shared prefix
[[commit.slots]]
name = "modifiers"
kind = "symbols"
values = ["!", ":"]

[[commit.slots]]
name = "separator"
kind = "symbol"
values = [":"]
Shadowed
[[commit.slots]]
name = "modifiers"
kind = "symbols"
values = ["!"]

[[commit.slots]]
name = "separator"
kind = "symbol"
Same delimiters
[[commit.slots]]
name = "scope"
delimiters = ["(", ")"]

[[commit.slots]]
name = "ticket"
delimiters = ["(", ")"]
Optional after a gap
[[commit.slots]]
name = "emoji"
kind = "symbols"
values = ["✨"]
required = true
gap = true

[[commit.slots]]
name = "keywords"
kind = "word"

On this page