WHITESPACE = _{ " " | "\t" | NEWLINE }
COMMENT = _{ "-{" ~ (!"}" ~ ANY)* ~ "}" }
-sigil = _{ ("$" | "@" | "&" | "#") ~ "{" }
+sigil = _{ ("$" | "@" | "&" | "#" | "-") ~ "{" }
raw_char = _{ !(sigil) ~ ANY }
-char_seq = { raw_char+ }
+char_seq = ${ raw_char+ }
string = { escaped_string | raw_string }
escaped_string = @{ "\"" ~ char+ ~ "\"" }
char = _{
!("\"" | "\\") ~ ANY
| "\\" ~ ("\"" | "\\" | "/" | "b" | "f" | "n" | "r" | "t")
- | "\\" ~ ("u" ~ ASCII_HEX_DIGIT{4})
}
array = _{
key = @{ key_chars }
value = ${ string | array | "BLANK" | "DEFAULT" }
-assign = { key ~ "=" ~ value }
+assign = { "*"? ~ key ~ "=" ~ value }
def_block = _{ sigil ~ assign* ~ "}" }
var_def = { &("$") ~ def_block }
arr_def = { &("@") ~ def_block }
pat_def = { &("&") ~ def_block }
definition = _{ var_def | arr_def | pat_def }
-header = { &("#") ~ def_block }
+
+header_assign = { "!"? ~ key ~ "=" ~ value }
+header_block = _{ sigil ~ header_assign* ~ "}" }
+header = { &("#") ~ header_block }
substitution = _{ sigil ~ key ~ "}" }
var_sub = { &("$") ~ substitution }