~emersion/scfg

0e1b10bd9d2ae45139e5687dde3de4d86c0ec1b6 — Simon Ser 7 months ago
Initial commit
1 files changed, 45 insertions(+), 0 deletions(-)

A README.md
A  => README.md +45 -0
@@ 1,45 @@
# scfg

A simple configuration file format.

## Specification

Grammar in [ABNF]:

```abnf
config = *directive

directive = directive-name 1*WSP directive-params 1*WSP *1block newline
directive-name = word
directive-params = *word

block = "{" newline *directive newline "}"

word = atom / dquote-word / squote-word
atom = 1*(ACHAR / esc-pair)
dquote-word = DQUOTE *(DQCHAR / esc-pair) DQUOTE
squote-word = "'" *SQCHAR "'"
esc-pair = "\" VCHAR

newline = *WSP LF *WSP

ACHAR = %x21 / %x23-26 / %x28-7A / %x7C / %x7E / %x80-10FFFF
	; any Unicode code point, excluding CTL, DQUOTE, "'", "{", "}", WSP
DQCHAR = %x21 / %x23-5B / %x5D-7E / %x80-10FFFF
	; any Unicode code point, excluding CTL, DQUOTE, "\", LF
SQCHAR = %x21-26 / %x28-7E / %x80-10FFFF
	; any Unicode code point, excluding CTL, "'", LF
VCHAR = SQCHAR / "'"
	; any Unicode code point, excluding CTL, LF
```

## Implementations

[go-scfg]

## License

This specification text is licensed with CC-BY-SA.

[ABNF]: https://tools.ietf.org/html/rfc5234
[go-scfg]: https://git.sr.ht/~emersion/go-scfg