Fixed unparenthesized comma-sequences in for(;;) variable initializer expressions...
commitdcf452393bf51285b41f2439f049988d6f1ad74e
authorBoris Smilga <boris.smilga@gmail.com>
Sun, 4 Jan 2015 12:25:57 +0000 (4 15:25 +0300)
committerBoris Smilga <boris.smilga@gmail.com>
Sun, 4 Jan 2015 12:45:24 +0000 (4 15:45 +0300)
tree0d96df2495fd484f148f183472f393014c4d82b5
parentc28bdfe3df0708af891f9db1ba05c40a24cc57d4
Fixed unparenthesized comma-sequences in for(;;) variable initializer expressions inside blocks.

E. g.

    (ps (lambda (y)
          (for ((x (let ((x0 (foo y)))
                     (bar x0))))
               () ()
            (xyzzy x))))

was producing

    (function (y) {
        var x0;
        for (var x = x0 = foo(y), bar(x0); ; ) {
            xyzzy(x);
        };
    });

A JavaScript parser would then treat the comma as the separator in
VariableDeclarationListNoIn production, so bar(x0) would be occuring
in the position of an Identifier, which is a syntax error (see
ECMA-262 ed. 5.1, ss. 12.6.3, 12.2).
src/printer.lisp