mical-cli-syntax 0.0.1

Internal syntax definitions for mical-cli
Documentation
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:('+' | '-')?