aboutsummaryrefslogtreecommitdiff
path: root/nomsu.6.peg
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-12-30 23:56:28 -0800
committerBruce Hill <bruce@bruce-hill.com>2018-12-30 23:58:43 -0800
commitec69ee6f62016a2edcc13e3183cbe4cadd75717f (patch)
tree24e04f77c7390d379f2fb372611ac468a67aed03 /nomsu.6.peg
parent435eae7c0ab10577431bb943a6f48873e5ecdf7c (diff)
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).
Diffstat (limited to 'nomsu.6.peg')
-rw-r--r--nomsu.6.peg6
1 files changed, 2 insertions, 4 deletions
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" ~} :}