Skip to content

Instantly share code, notes, and snippets.

@d-t-w
Last active June 27, 2019 02:04
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 d-t-w/9a49a1333034f50e2ab58abceef8c100 to your computer and use it in GitHub Desktop.
Save d-t-w/9a49a1333034f50e2ab58abceef8c100 to your computer and use it in GitHub Desktop.
<S> = template
<FWS> = #'[ \t\r\n]*'
when = <'~='> #'[a-zA-Z0-9\-]+'
when-not = <'~!'> #'[a-zA-Z0-9\-]+'
repeated = <'~*'>
text = #'[^~]*'
variable = <'~$'> #'[a-zA-Z0-9\-]+'
metadata = (when | when-not | repeated | <FWS>)* <FWS> <":">
script = (variable | text)*
<template> = [metadata] <FWS> script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment