aboutsummaryrefslogtreecommitdiff
path: root/nomsu.peg
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-07-11 14:13:43 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-07-11 14:14:16 -0700
commitba2b83d5669f9fcf6f49fcd2adac5997eb07f7d8 (patch)
tree55d0ecaafd6c5c871bd987a28a2b61fca16b250c /nomsu.peg
parentb32634faf8eb0fe1448ca44ddf9b3a6bfaf20b68 (diff)
Fixed nomsu codegen for indented text and improved text parsing. Also
moved some more tests inline.
Diffstat (limited to 'nomsu.peg')
-rw-r--r--nomsu.peg6
1 files changed, 3 insertions, 3 deletions
diff --git a/nomsu.peg b/nomsu.peg
index 8b4d9ec..4598598 100644
--- a/nomsu.peg
+++ b/nomsu.peg
@@ -101,11 +101,11 @@ inline_text_interpolation:
indented_text (Text):
'".."' eol %nl {|
{~ (%nl*) (%indent -> "") ~}
- (indented_plain_text / text_interpolation / {~ ("\" nodent "..") -> "" ~} / {~ %nl+ (%nodent -> "") ~})*
+ (indented_plain_text / text_interpolation / {~ %nl+ (%nodent -> "") ~})*
|} (((!.) %dedent) / (&(%nl %dedent)) / (({} (non_dedent_error -> "Unexpected character while parsing Text") %userdata) => error))
indented_plain_text (Text):
- {| ({~ "\\" -> "\" ~} / {[^%nl\]+} / {!(text_interpolation / "\" nodent "..") "\"})+
- {~ (%nl+ (%nodent -> "")) / (("\" nodent "..") -> "") ~}* |}
+ {| {~ (("\\" -> "\") / (("\" nodent "..") -> "") / (!text_interpolation "\") / [^%nl\]+)+
+ (%nl+ (%nodent -> ""))* ~} |}
text_interpolation:
inline_text_interpolation / ("\" indented_expression nodent "..")