SlimIt – multiline string support

by Ruslan Spivak on April 9, 2012

I made some changes to the lexer and now SlimiIt can handle JavaScript string literals that span multiple lines.
In JavaScript, as in Python, continuation lines can be used with a backslash as the last character on the line indicating that the next line is a continuation of the line.

Here is a simple example:

$ cat test.js
var s = "hello \
    \
    world\
    ";
$
$ cat test.js | slimit -m -t
var a="hello         world    ";
If you enjoyed this post why not subscribe via email or my RSS feed and get the latest updates immediately. You can also follow me on GitHub or Twitter.

Speak your mind

Previous post:

Next post: