summaryrefslogtreecommitdiff
path: root/docs/c1/grammar/peg.txt
diff options
context:
space:
mode:
authorTaylan Kammer <taylan.kammer@gmail.com>2026-05-31 17:35:35 +0200
committerTaylan Kammer <taylan.kammer@gmail.com>2026-05-31 17:35:35 +0200
commita6040abeac8cdcba8a139a9d5b52ce28e94a14ef (patch)
treef912bad73ae644b9f3c9042b95e2ea1aea09df7a /docs/c1/grammar/peg.txt
parenta779b91e730ba68c1f38cfdadbcb0fa3de041597 (diff)
Allow blanks after hash-bang; update grammar files.
Diffstat (limited to 'docs/c1/grammar/peg.txt')
-rw-r--r--docs/c1/grammar/peg.txt20
1 files changed, 13 insertions, 7 deletions
diff --git a/docs/c1/grammar/peg.txt b/docs/c1/grammar/peg.txt
index c391162..465123f 100644
--- a/docs/c1/grammar/peg.txt
+++ b/docs/c1/grammar/peg.txt
@@ -21,28 +21,28 @@ SkipLine <- (!'\n' .)* '\n'?
OneDatum <- BareString / CladDatum
-
-BareString <- ( '.' / '+' / '-' / DIGIT ) ( BareChar / '.' )*
+BareString <- SpecBareChar ( BareChar / JoinChar )*
/ BareChar+
CladDatum <- PipeStr / QuoteStr / HashExpr / QuoteExpr / List
PipeStr <- '|' ( PipeStrChar / '\' StringEsc )* '|'
QuoteStr <- '"' ( QuotStrChar / '\' StringEsc )* '"'
-HashExpr <- '#' ( RuneExpr / LabelExpr / HashDatum )
+HashExpr <- '#' ( RuneExpr / HashBang / LabelExpr / HashDatum )
QuoteExpr <- "'" Datum / '`' Datum / ',' Datum
List <- ParenList / SquareList / BraceList
+SpecBareChar <- '+' / '-' / JoinChar / DIGIT
+
BareChar <- ALPHA / DIGIT
- / '!' / '$' / '%' / '*' / '+'
- / '-' / '/' / '<' / '=' / '>'
- / '?' / '@' / '^' / '_' / '~'
+ / '!' / '$' / '%' / '*' / '+' / '-' / '/'
+ / '<' / '=' / '>' / '?' / '^' / '_' / '~'
PipeStrChar <- (![|\\] .)
QuotStrChar <- (!["\\] .)
StringEsc <- '\' / '|' / '"' / ( HTAB / SP )* LF ( HTAB / SP )*
- / 'a' / 'b' / 't' / 'n' / 'v' / 'f' / 'r' / 'e'
+ / '0' / 'a' / 'b' / 't' / 'n' / 'v' / 'f' / 'r' / 'e'
/ 'x' HexByte* ';'
/ 'u' UnicodeSV ';'
@@ -50,6 +50,7 @@ HexByte <- HEXDIG HEXDIG
UnicodeSV <- HEXDIG+
RuneExpr <- Rune ( '\' BareString / CladDatum )?
+HashBang <- '!' [\t ]* BareString
LabelExpr <- '%' Label ( '%' / '=' Datum )
HashDatum <- '\' BareString / CladDatum
@@ -76,3 +77,8 @@ HEXDIG <- [0-9a-fA-F]
# Due to a quirk in the peg tool this file is used with, the grammar
# must not allow an empty stream. Therefore, the Unit rule has its
# Datum declared as mandatory rather than optional.
+
+
+# Local Variables:
+# eval: (flyspell-mode -1)
+# End: