mirror of
https://github.com/leafo/moonscript.git
synced 2024-12-08 01:54:24 +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 }
|