From 22d011a270827aa44802134343ff60bb90ecd6fb Mon Sep 17 00:00:00 2001 From: Huck Boles Date: Sun, 14 May 2023 13:14:12 -0500 Subject: [PATCH] grammar update for header blocks --- src/meta.pest | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/meta.pest b/src/meta.pest index b951124..3a2a686 100644 --- a/src/meta.pest +++ b/src/meta.pest @@ -1,7 +1,7 @@ WHITESPACE = _{ " " | "\t" | NEWLINE } COMMENT = _{ "-{" ~ (!"}" ~ ANY)* ~ "}" } -sigil = _{ ("$" | "@" | "&") ~ "{" } +sigil = _{ ("$" | "@" | "&" | "#") ~ "{" } raw_char = _{ !(sigil) ~ ANY } char_seq = { raw_char+ } @@ -31,6 +31,7 @@ var_def = { &("$") ~ def_block } arr_def = { &("@") ~ def_block } pat_def = { &("&") ~ def_block } definition = _{ var_def | arr_def | pat_def } +header = { &("#") ~ def_block } substitution = _{ sigil ~ key ~ "}" } var_sub = { &("$") ~ substitution } @@ -41,5 +42,5 @@ identifier = _{ var_sub | pat_sub | arr_sub } source = { (identifier | char_seq)* } file = { - SOI ~ definition* ~ source? ~ EOI + SOI ~ header? ~ definition* ~ source? ~ EOI } -- 2.45.2