Skip to content

Instantly share code, notes, and snippets.

@dz4k
Last active September 30, 2020 20:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dz4k/b59914c352c0cba3567dca352ae2b249 to your computer and use it in GitHub Desktop.
Save dz4k/b59914c352c0cba3567dca352ae2b249 to your computer and use it in GitHub Desktop.
TAML EBNF
(*
# Tokens
* newline: one or more CR or CRLF
* tab: one or more tab characters not following a newline
* string: one or more characters none of which are tabs or newlines
The following tokens relate to indentation tracking:
* newrecord: a newline followed by the same number of tabs as the previous
newline in the input.
* indent: a newline followed by more tabs than the previous newline in the
input.
* dedent: either a newline followed by fewer tabs than the previous
newline in the input, or EOF.
*)
taml
= string | composite ;
composite
= dict | list ;
dict
= keyval
| dict , newrecord , keyval ;
list
= string
| list , newrecord , string ;
keyval
= string , tab , string
| string , tab
| string , indent , composite , dedent ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment