aboutsummaryrefslogtreecommitdiff
path: root/lib/text.nom
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-01-12 17:07:30 -0800
committerBruce Hill <bitbucket@bruce-hill.com>2018-01-12 17:07:35 -0800
commitb5ae7dac51821c89caa039e412dd5fbcc3b92d94 (patch)
treef570adcd16ed161e809093ce9f3349528d694b26 /lib/text.nom
parent90c72074dbb9026d1e56021317e460d9ccfc1e59 (diff)
Added indent action
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))"