From 2cd161a43f0e3a25b9613663b6979ea514447a14 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Tue, 5 Mar 2019 16:36:12 +0100 Subject: Parse single quote literals --- dhall_parser/src/dhall.abnf | 9 +++++---- dhall_parser/src/dhall.pest.visibility | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'dhall_parser') diff --git a/dhall_parser/src/dhall.abnf b/dhall_parser/src/dhall.abnf index 391741f..e311aa6 100644 --- a/dhall_parser/src/dhall.abnf +++ b/dhall_parser/src/dhall.abnf @@ -100,9 +100,10 @@ ; ; For simplicity this supports Unix and Windows line-endings, which are the most ; common -end-of-line = +end-of-line-silent = %x0A ; "\n" / %x0D.0A ; "\r\n" +end-of-line = end-of-line-silent tab = %x09 ; "\t" @@ -112,7 +113,7 @@ block-comment-chunk = block-comment / %x20-10FFFF / tab - / end-of-line + / end-of-line-silent block-comment-continue = "-}" / block-comment-chunk block-comment-continue @@ -120,12 +121,12 @@ not-end-of-line = %x20-10FFFF / tab ; NOTE: Slightly different from Haskell-style single-line comments because this ; does not require a space after the dashes -line-comment = "--" *not-end-of-line end-of-line +line-comment = "--" *not-end-of-line end-of-line-silent whitespace-chunk = " " / tab - / end-of-line + / end-of-line-silent / line-comment / block-comment diff --git a/dhall_parser/src/dhall.pest.visibility b/dhall_parser/src/dhall.pest.visibility index a2dedde..e9bf241 100644 --- a/dhall_parser/src/dhall.pest.visibility +++ b/dhall_parser/src/dhall.pest.visibility @@ -1,4 +1,5 @@ -# end_of_line +end_of_line +# end_of_line_silent # tab # block_comment # block_comment_chunk @@ -21,7 +22,7 @@ label_raw label # double_quote_chunk double_quote_literal -# single_quote_continue +single_quote_continue single_quote_literal # text_literal_raw # if_raw -- cgit v1.2.3