~emersion/scfg

ref: 2824eccccfacff15e4b1d4307f3be444bd5102f8 scfg/README.md -rw-r--r-- 1.1 KiB
2824ecccSimon Ser Tweak grammar 9 months ago

#scfg

A simple configuration file format.

#Specification

Grammar in ABNF:

config = *directive

directive = directive-name [ 1*WSP directive-params ] [ 1*WSP block ] newline
directive-name = word
directive-params = [ word ] / word 1*( 1*WSP word )

block = "{" newline *directive "}"

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-5B / 0x5D-7A / %x7C / %x7E / %x80-10FFFF
	; any Unicode code point, excluding CTL, DQUOTE, "\", LF, "'", "{", "}", WSP
DQCHAR = ACHAR / "'" / "{" / "}" / WSP
	; any Unicode code point, excluding CTL, DQUOTE, "\", LF
SQCHAR = %x09 / %x20-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.