aboutsummaryrefslogtreecommitdiff
path: root/lib/text.nom
diff options
context:
space:
mode:
Diffstat (limited to 'lib/text.nom')
-rw-r--r--lib/text.nom3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/text.nom b/lib/text.nom
index a1331ef..9db8a07 100644
--- a/lib/text.nom
+++ b/lib/text.nom
@@ -20,6 +20,9 @@ compile [%str with %patt replaced with %sub, %str s/%patt/%sub] to:
compile [%str with %patt replaced with %sub %n times, %str s/%patt/%sub/%n] to:
"((\(%str as lua)):gsub(\(%patt as lua), \(%sub as lua), \(%n as lua)))"
+compile [indent %str] to: "\%str:gsub('\\n','\\n'..(' '))"
+compile [indent %str %n times, indent %str %n x] to: "\%str:gsub('\\n','\\n'..(' '):rep(\%n))"
+
# Substring
# TODO: improve this syntax
compile [%str |%start|] to: "\(%str as lua):sub(\(%start as lua), \(%start as lua))"