mamacdon/mamacdon.github.com — Issue #4: Grammar converter does not escape rule names
Author: mamacdon
Created: 2011-10-18 13:37:08+00:00
State: open

Grammar rules can have names containing special characters. The converter currently does not escape these when it spits out the JavaScript object literal, so you end up with syntax errors.

For example, the Java grammar that comes with TextMate produces this:

```repository: {
all-types: { // bad
...
}
}```

Also, JS reserved words may be present as keys (```class```, ```char```). They must be escaped as well.