From de34592dbebfa8882f495694d73f2a8b1e2d0856 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 9 Jul 2018 19:22:40 -0700 Subject: Adding some compatibility stuff. --- nomsu.peg | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nomsu.peg') diff --git a/nomsu.peg b/nomsu.peg index 13caa63..2497e7c 100644 --- a/nomsu.peg +++ b/nomsu.peg @@ -1,10 +1,14 @@ -- Nomsu version 1 file: + shebang? (ignored_line %nl)* (file_chunks / block / action / expression)? (%nl ignored_line)* (!. / (({} (.* -> "Parse error") %userdata) => error)) +shebang: + ("#!" (!"nomsu" !%nl .)* "nomsu" ((%ws* "-V" %ws* {[0-9]+ ("." [0-9]+)*}) / {''}) %ws* (%nl / !.) %userdata) => Version + file_chunks (FileChunks): {| (block/action/expression) (nodent chunk_delimeter nodent (block/action/expression))+ |} chunk_delimeter: "~~~" (("~")*) -- cgit v1.2.3