From 37ff7af18cd2e896506e6d228058204525b4a6eb Mon Sep 17 00:00:00 2001 From: Taylan Kammer Date: Sun, 31 May 2026 20:58:42 +0200 Subject: More proper shebang line parsing. --- docs/c1/1-parse.md | 14 ++++++++++++++ docs/c1/grammar/abnf.txt | 32 ++++++++++++++++++++++++++------ docs/c1/grammar/peg.txt | 6 +++++- docs/c1/grammar/zbnf.txt | 5 ++++- 4 files changed, 49 insertions(+), 8 deletions(-) (limited to 'docs/c1') diff --git a/docs/c1/1-parse.md b/docs/c1/1-parse.md index 0fc0da5..4eb5776 100644 --- a/docs/c1/1-parse.md +++ b/docs/c1/1-parse.md @@ -590,6 +590,20 @@ Notes: further decoding of enclosed data. This is not so, since quoting is related to code evaluation, not decoding. + +## Shebang + +There is one final "syntax sugar" translation whose sole purpose is to allow a +shebang line at the start of a file: + + #!interpreter -> (#SHBANG & interpreter) + + #!interpreter argline -> (#SHBANG interpreter & argline) + +Under default settings, the decoder will allow this datum to appear once at the +beginning of a per-file decoding sequence, and simply discard it. + +