From 0923b0192c8023a1a8d2304fa318cee08500d57d Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 28 Jun 2018 14:12:24 -0700 Subject: Improvements to nomsu codegen (comments are now retained) and some improvements to handling of stdin and fixes for error reporting. --- nomsu.peg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nomsu.peg') 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)) -- cgit v1.2.3