SourceFile =
'$shebang'?
items:Item*
Item =
Entry
| PrefixBlock
| Directive
Entry =
Key Value
PrefixBlock =
Key '{'
items:Item*
'}'
Directive =
'#'
name:'$word'
args:LineString
Key =
WordKey
| QuotedKey
WordKey =
'$word'
QuotedKey =
open_quote:('"' | '\'')
'$string'
close_quote:('"' | '\'')
Value =
Integer
| Boolean
| QuotedString
| LineString
| BlockString
Integer =
sign:('+' | '-')?
'$numeral'
Boolean =
'$true'
| '$false'
QuotedString =
open_quote:('"' | '\'')
'$string'
close_quote:('"' | '\'')
LineString =
'$string'
BlockString =
header:BlockStringHeader
lines:LineString*
BlockStringHeader =
style:('|' | '>')
chomp:('+' | '-')?