mirror of
https://github.com/sharkdp/bat.git
synced 2024-11-24 16:53:55 +01:00
Clarify syntax selection algorithm behaviour
This commit is contained in:
parent
37fd050100
commit
52f94b4623
@ -19,7 +19,8 @@ by the TOML files within this directory, and embed them into the binary.
|
|||||||
## File syntax
|
## File syntax
|
||||||
|
|
||||||
Each TOML file should contain a single section named `mappings`, with each of
|
Each TOML file should contain a single section named `mappings`, with each of
|
||||||
its keys being a language identifier (first column of `bat -L`).
|
its keys being a language identifier (first column of `bat -L`; also referred to
|
||||||
|
as "target").
|
||||||
|
|
||||||
The value of each key should be an array of strings, with each item being a glob
|
The value of each key should be an array of strings, with each item being a glob
|
||||||
matcher. We will call each of these items a "rule".
|
matcher. We will call each of these items a "rule".
|
||||||
@ -104,5 +105,6 @@ mapping `*.conf` files to unknown.
|
|||||||
Generally this should not be much of a concern, since rules should be written as
|
Generally this should not be much of a concern, since rules should be written as
|
||||||
specifically as possible for each application.
|
specifically as possible for each application.
|
||||||
|
|
||||||
Rules within each TOML file are inserted (and therefore processed) in the order
|
Rules within each TOML file are processed (and therefore matched) in the order
|
||||||
in which they are defined.
|
in which they are defined. At runtime, the syntax selection algorithm will
|
||||||
|
short-circuit and return the target of the first matching rule.
|
||||||
|
Loading…
Reference in New Issue
Block a user