diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-01-12 17:07:30 -0800 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-01-12 17:07:35 -0800 |
| commit | b5ae7dac51821c89caa039e412dd5fbcc3b92d94 (patch) | |
| tree | f570adcd16ed161e809093ce9f3349528d694b26 /lib | |
| parent | 90c72074dbb9026d1e56021317e460d9ccfc1e59 (diff) | |
Added indent action
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/text.nom | 3 |
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))" |
