'use strict';

var stoke = require('../');

stoke('echo "foo `echo \'bar baz\'`"');
/* [
 *   {
 *     type: 'unquoted',
 *     body: 'echo'
 *   },
 *   {
 *     type: 'double-quoted',
 *     body: [
 *       {
 *         type: 'unquoted',
 *         body: 'foo '
 *       },
 *       {
 *         type: 'back-quoted',
 *         body: [
 *           {
 *             type: 'unquoted',
 *             body: 'echo'
 *           },
 *           {
 *             type: 'single-quoted',
 *             body: 'bar baz'
 *           }
 *         ]
 *       }
 *     ]
 *   }
 * ]
 */

@@ -12,20 +12,22 @@
 ';%0A%0Avar 
-stok
+permut
 e = requ
@@ -43,539 +43,275 @@
 );%0A%0A
-stoke('echo %22foo %60echo %5C'bar baz%5C'%60%22');%0A/* %5B%0A *   %7B%0A *     type: 'unquoted',%0A *     body: 'echo'%0A *   %7D,%0A *   %7B%0A *     type: 'double-quoted',%0A *     body: %5B%0A *       %7B%0A *         type: 'unquoted',%0A *         body: 'foo '%0A *       %7D,%0A *       %7B%0A *         type: 'back-quoted',%0A *         body: %5B%0A *           %7B%0A *             type: 'unquoted',%0A *             body: 'echo'%0A *           %7D,%0A *           %7B%0A *             type: 'single-quoted',%0A *             body: 'bar baz'%0A *           %7D%0A *         %5D%0A *       %7D%0A *     %5D%0A *   %7D%0A * %5D%0A */
+var iter = permute(%5B'foo', 'bar', 'baz'%5D);%0Awhile (iter.hasNext()) %7B%0A  iter.next();%0A  //=%3E %5B 'foo', 'bar', 'baz' %5D%0A  //=%3E %5B 'foo', 'baz', 'bar' %5D%0A  //=%3E %5B 'baz', 'foo', 'bar' %5D%0A  //=%3E %5B 'baz', 'bar', 'foo' %5D%0A  //=%3E %5B 'bar', 'baz', 'foo' %5D%0A  //=%3E %5B 'bar', 'foo', 'baz' %5D%0A%7D
 %0A

Add example