diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-01-30 15:13:04 -0800 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-01-30 15:13:13 -0800 |
| commit | 78c15a5d5e9336f0164161c77c0441b41c226895 (patch) | |
| tree | 236e1fd1a1018cfd844cc9b0373a30c26fe888f0 | |
| parent | 056357162551993e3e7d3a0ac778ed46aafdc083 (diff) | |
Removed indented interpolations for inline strings.
| -rw-r--r-- | nomsu.peg | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -39,7 +39,7 @@ inline_text (Text): !('".."' eol) '"' {| ({~ (('\"' -> '"') / ('\\' -> '\') / %escaped_char / [^%nl\"])+ ~} - / text_interpolation)* + / inline_text_interpolation)* |} '"' -- Have to use "%indent" instead of "indent" etc. to avoid messing up text lines that start with "#" indented_text (Text): @@ -50,14 +50,20 @@ indented_text (Text): / (%nl+ {~ %nodent -> "" ~}) / [^%nl\])+ ~} / text_interpolation)* |} (((!.) &%dedent) / (&(%nl %dedent)) / (("" -> "Error while parsing Text") => error)) -text_interpolation: +inline_text_interpolation: "\" ( variable / inline_list / inline_dict / inline_text / ("(" %ws* (inline_functioncall / inline_expression) %ws* ")") + ) +text_interpolation: + inline_text_interpolation / + ("\" ( + variable / inline_list / inline_dict / inline_text + / ("(" %ws* (inline_functioncall / inline_expression) %ws* ")") / (%ws* (block_comment / line_comment)? nodent "..") / (indented_text %nl+ %nodent "..") / ((indented_list / indented_block) nodent "..") - ) + )) number (Number): (("-"? (([0-9]+ "." [0-9]+) / ("." [0-9]+) / ([0-9]+)))-> tonumber) |
