aboutsummaryrefslogtreecommitdiff
path: root/nomsu.peg
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-06-28 14:12:24 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-06-28 14:13:01 -0700
commit0923b0192c8023a1a8d2304fa318cee08500d57d (patch)
tree2bc60e2b119cbd4b37b12251ab9e997447bfce01 /nomsu.peg
parent09d6bad6ac0d4509552d424471bcace649f69c8e (diff)
Improvements to nomsu codegen (comments are now retained) and some
improvements to handling of stdin and fixes for error reporting.
Diffstat (limited to 'nomsu.peg')
-rw-r--r--nomsu.peg4
1 files changed, 2 insertions, 2 deletions
diff --git a/nomsu.peg b/nomsu.peg
index 15d0444..13caa63 100644
--- a/nomsu.peg
+++ b/nomsu.peg
@@ -149,8 +149,8 @@ inline_dict_entry(DictEntry):
dict_key:
text_word / inline_expression
-comment: "#" [^%nl]* (%nl+ %indent [^%nl]* (%nl+ %nodent [^%nl]*)* %dedent)?
-eol_comment: "#" [^%nl]*
+comment: ("#" {} {~[^%nl]* (%nl+ (%indent -> '') [^%nl]* (%nl+ (%nodent -> '') [^%nl]*)* %dedent)?~} %userdata) => Comment
+eol_comment: ("#" {} {[^%nl]*} %userdata) => Comment
eol: %ws* eol_comment? (!. / &%nl)
ignored_line: (%nodent comment) / (%ws* (!. / &%nl))