Skip to content

Instantly share code, notes, and snippets.

@d-t-w
Last active June 27, 2019 02:04
Show Gist options
  • 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