paularmstrong/swig — pull request #483 by LtSquigs (2014-06-25 20:28:46+00:00)
Title: Support unicode in variable names

Right now swig only supports a subset of the full range of variable names that javascript can support. In compliance with EMCAScript 5.1, javascript can actually support a lot of unicode in variable names. This pull request changes the regex that is used to detect variable names to support the full range of unicode characters javascript supports.

The full description of what characters javascript supports in variable names can be found in the answer to this stack overflow question: http://stackoverflow.com/questions/1661197/valid-characters-for-javascript-variable-names

The regex that this uses is based off the regex in that answer. It is very long, but mostly because javascript lacks a good way to do unicode in regexs. The regex is split up on every line to keep js lint happy.

I've also added some tests to test for unicode support in variables.