paularmstrong/swig — pull request #388 by hegemonic (2014-01-10 03:13:07+00:00)
Title: Allow set tag to use bracket notation for object properties

In the current version of Swig, if you're using the `set` tag to assign a value to an object's property, you can't use bracket notation for the object property. For example, if you've already set the local variables `foo = {}` and `bar = 'bar'`, any of the following will cause Swig to complain about an unexpected assignment:

```
{% set foo[bar] = "baz" %}
{% set foo['bar'] = "baz" %}
{% set foo["bar"] = "baz" %}
```

This pull request makes all of those examples work as you'd expect. It still behaves correctly if a quoted property name includes an assignment operator.

If you have any feedback on this pull request, I'd be happy to amend it.

(P.S. Thanks for creating such an excellent template engine!)