zaach/jison — pull request #150 by GerHobbelt (2013-02-16 01:52:07+00:00)
Title: Function() way of generating code breaks for slightly more complication %{...%} action snippets

(manual extract from #143)

* (SHA-1: 47206a3350d3359a8190c6ff342c42a17bc53d55) * patched the code generator as it broke on the offending line (where the action code is poured into a Function()) for action blocks such as this one:

... rule ...
| TAN '(' e ')'
{
$$ = {
token: FKW_FUNCTION,
token_attr: FKA_ABSOLUTE,
childs: [null, $3],
loc_info: @$,
type: FT_NUMBER,
unit: $3.unit,
value: Math.abs($3.value)
};
}

The object creation like that would produce a 'Unexpected symbol' error.