aboutsummaryrefslogtreecommitdiff
path: root/nomsu.4.peg
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-11-09 17:32:48 -0800
committerBruce Hill <bruce@bruce-hill.com>2018-11-09 17:33:04 -0800
commited70165294a6b846a9b0d513689dea03539755f7 (patch)
tree5f81723db4638e322d2b9d1a8d07000b2c5cb59d /nomsu.4.peg
parente96ae0c78dc511d361d37bc69259d18a68648b8f (diff)
Better handling of shebangs and comments at the top of a file.
Diffstat (limited to 'nomsu.4.peg')
-rw-r--r--nomsu.4.peg4
1 files changed, 2 insertions, 2 deletions
diff --git a/nomsu.4.peg b/nomsu.4.peg
index e0a5781..bbff67d 100644
--- a/nomsu.4.peg
+++ b/nomsu.4.peg
@@ -6,13 +6,13 @@ file:
{:curr_indent: %nil :}
!.
-shebang: "#!" (!"nomsu" [^%nl])* "nomsu" ws+ "-V" ws* {:version: [0-9.]+ :} [^%nl]*
+shebang: "#!" (!"nomsu" [^%nl])* "nomsu" ws+ "-V" ws* {:version: [0-9.]+ :} [^%nl]* (%nl / !.)
eof: !.
file_chunks (FileChunks):
{:curr_indent: ' '* :}
- shebang? comment? blank_lines?
+ {:shebang: shebang :}?
(top_block (nl_nodent section_division top_block)*)
blank_lines?
ws* unexpected_chunk?