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.