aboutsummaryrefslogtreecommitdiff
path: root/nomsu.peg
diff options
context:
space:
mode:
Diffstat (limited to 'nomsu.peg')
-rw-r--r--nomsu.peg4
1 files changed, 4 insertions, 0 deletions
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: "~~~" (("~")*)