mirror of
https://github.com/leafo/moonscript.git
synced 2024-11-22 02:44:23 +00:00
10 lines
229 B
Plaintext
10 lines
229 B
Plaintext
|
|
||
|
-- remove front indentation from a multiline string, making it suitable to be
|
||
|
-- parsed
|
||
|
unindent = (str) ->
|
||
|
indent = str\match "^%s+"
|
||
|
return str unless indent
|
||
|
(str\gsub("\n#{indent}", "\n")\gsub "%s+$", "")
|
||
|
|
||
|
{ :unindent }
|