From ec69ee6f62016a2edcc13e3183cbe4cadd75717f Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 30 Dec 2018 23:56:28 -0800 Subject: Fixes for: indented strings ending in ", peeking at code object text before modifying them, and major upgrades to the nomsu codegen, including support for indented inline arguments (instead of using "\n..") and just generally better line wrapping, including finally good rules for when to use indented text (for almost all cases). --- nomsu.6.peg | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'nomsu.6.peg') diff --git a/nomsu.6.peg b/nomsu.6.peg index b348c6f..6b4686d 100644 --- a/nomsu.6.peg +++ b/nomsu.6.peg @@ -148,8 +148,6 @@ inline_text_interpolation <- text_char <- %utf8_char / !["\] %print / %tab -nonterminal_quote <- '"' &([^%nl] / (%nl (ws* eol)?)+ =curr_indent [^%nl]) - indented_text (Text) <- '("' %nl {%nl*} ({| {:curr_indent: indent :} @@ -163,7 +161,7 @@ indented_plain_text (Text) <- {~ ((("\" blank_lines =curr_indent "..") -> "") / ('\\' -> '\') / ('\"' -> '"') / ('\;' -> '') / (!text_interpolation ((!("\n") escaped_char) / '\')) - / (nonterminal_quote / text_char)+)+ + / ('"' / text_char)+)+ blank_text_lines? ~} blank_text_lines <- @@ -255,7 +253,7 @@ missing_quote_err (Error) <- {:error: {~ eol -> "This text is missing a closing quotation mark." ~} :} {:hint: {~ "" -> "Put a quotation mark here." ~} :} missing_indented_quote_err (Error) <- - {:error: {~ &. -> 'This text is missing a closing ")-quotation mark.' ~} :} + {:error: {~ '' -> 'This text is missing a closing ")-quotation mark.' ~} :} {:hint: {~ "" -> 'Put a ") after this line, at the same level of indentation as the opening (".' ~} :} missing_bracket_error (Error) <- {:error: {~ eol -> "This list is missing a closing ]-bracket" ~} :} -- cgit v1.2.3