From d82c4f85d8cdb1d4cdf97e90b2715d2fb06b4bef Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 15 Jan 2018 15:50:18 -0800 Subject: Added support for translating comments instead of dropping them. --- nomsu.peg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nomsu.peg') diff --git a/nomsu.peg b/nomsu.peg index 9920665..0011924 100644 --- a/nomsu.peg +++ b/nomsu.peg @@ -92,8 +92,8 @@ dict_line: inline_dict_item: {| {:dict_key: inline_expression / word :} %ws* "=" %ws* {:dict_value: inline_functioncall / inline_expression :} |} -block_comment: "#.." [^%nl]* (%nl (%ws* &%nl))* %nl %indented [^%nl]+ (%nl ((%ws* ((!.) / &%nl)) / (!%dedented [^%nl]+)))* -line_comment: "#" [^%nl]* +block_comment(Comment): "#.." { [^%nl]* (%nl (%ws* &%nl))* %nl %indented [^%nl]+ (%nl ((%ws* ((!.) / &%nl)) / (!%dedented [^%nl]+)))* } +line_comment(Comment): "#" { [^%nl]* } eol: %ws* line_comment? (!. / &%nl) ignored_line: (%nodented (block_comment / line_comment)) / (%ws* (!. / &%nl)) -- cgit v1.2.3