From ed70165294a6b846a9b0d513689dea03539755f7 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 9 Nov 2018 17:32:48 -0800 Subject: Better handling of shebangs and comments at the top of a file. --- nomsu.4.peg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nomsu.4.peg') 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? -- cgit v1.2.3