tracery 0.2.1

Text-expansion library
Documentation
rule = ${ (actions | (tag | text)+) }

actions = ${ (action)+ }

tag = ${ "#" ~ (action)* ~ tagname ~ (modifier)* ~ "#" }

tagname = @{ (nonspecial)+ }

modifier = ${ "." ~ tagname }

text = ${ (nonhash)+ }

action = ${ "[" ~ (unlabeled_action | labeled_action) ~ "]" }
unlabeled_action = _{ tag }
labeled_action = _{ tagname ~ ":" ~ (action_rhs)+ }
action_rhs = ${ (tag | action_text)+ }
action_text = ${ (action_char)+ }
action_char = _{ !("#" | "]") ~ ANY }

nonspecial = _{ !("#" | "[" | "]" | ":" | ".") ~ ANY }
nonhash = _{ !("#") ~ ANY }