aboutsummaryrefslogtreecommitdiff
path: root/nomsu.peg
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-05-15 16:36:21 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-05-15 16:36:38 -0700
commit01aa199f7acfe9af57c5970793259b36e060fd11 (patch)
tree0af9fd009d820053f83dd60eed862886bfb3eb5c /nomsu.peg
parent28cd9ae0b7a09d8f2cd0cd929f1ebdce4b081502 (diff)
Adding support for coroutines, and cleaning up comment syntax.
Diffstat (limited to 'nomsu.peg')
-rw-r--r--nomsu.peg10
1 files changed, 5 insertions, 5 deletions
diff --git a/nomsu.peg b/nomsu.peg
index 4deb4ef..4ebf6c2 100644
--- a/nomsu.peg
+++ b/nomsu.peg
@@ -124,12 +124,12 @@ inline_dict_item:
dict_key:
text_word / inline_expression
-block_comment: "#.." [^%nl]* (%nl+ %indent [^%nl]* (%nl+ %nodent [^%nl]*)* %dedent)?
-line_comment: "#" [^%nl]*
+comment: "#" [^%nl]* (%nl+ %indent [^%nl]* (%nl+ %nodent [^%nl]*)* %dedent)?
+eol_comment: "#" [^%nl]*
-eol: %ws* line_comment? (!. / &%nl)
-ignored_line: (%nodent (block_comment / line_comment)) / (%ws* (!. / &%nl))
-indent: eol (%nl ignored_line)* %nl %indent ((block_comment/line_comment) (%nl ignored_line)* nodent)?
+eol: %ws* eol_comment? (!. / &%nl)
+ignored_line: (%nodent comment) / (%ws* (!. / &%nl))
+indent: eol (%nl ignored_line)* %nl %indent (comment (%nl ignored_line)* nodent)?
nodent: eol (%nl ignored_line)* %nl %nodent
dedent: eol (%nl ignored_line)* (((!.) &%dedent) / (&(%nl %dedent)))
non_dedent_error: (!dedent .)* eol (%nl ignored_line)* (!. / &%nl)