I'm unsure what you mean. The trees have locations. The current map writer
just tries to detect when the input and output location has changed while
we write. I test at all levels of the tree because I don't know which
branches might have no info. So above I guess the only locations are from
the `tree.operand`.  I suppose that if all identifier tokens maintain
locations then this gives most of the map, and maybe it's good enough.


On Fri, Mar 7, 2014 at 2:13 PM, Erik Arvidsson <notifications@github.com>wrote:

> In src/codegeneration/ExplodeExpressionTransformer.js:
>
> > +
> > +    // What else do we need to support?
> > +    assert(tree.operand.type === IDENTIFIER_EXPRESSION);
> > +
> > +    // x++
> > +    // =>
> > +    // $0 = x, x = $0 + 1, $0
> > +
> > +    var operand = tree.operand
> > +    var tmp = this.addTempVar();
> > +    var operator = tree.operator.type === PLUS_PLUS ? PLUS : MINUS;
> > +
> > +    var expressions = [
> > +      createAssignmentExpression(tmp, operand),
> > +      createAssignmentExpression(operand,
> > +          new BinaryOperator(null, tmp, createOperatorToken(operator),
>
> In most cases the source mapping happens on the token level, doesn't it?
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/google/traceur-compiler/pull/831/files#r10402649>
> .
>