mozilla/kumascript — pull request #22 by mbrubeck (2012-08-13 17:47:48+00:00)
Title: Strings in JSON arguments cannot contain ")"

The page at https://developer.mozilla.org/en-US/docs/Introduction_%28alternate%29 has a syntax error:
```
Syntax error at line 15, column 61: Expected valid JSON object as the parameter of the preceding macro but "{ \"fr\": \"fr/Introduction_(alternative" found.
15 |

{{ languages( { "fr": "fr/Introduction_(alternative)" }) }}

--------------------------------------------------------------------^
```

This happens because the Kumascript parser does not allow ")" anywhere in a JSON argument, even within a string. Here's a patch to fix this by adding a real JSON grammar based on the one at json.org.

This patch does *not* change any of the non-JSON parsing, but as a follow-up perhaps some of the non-JSON rules like Number and DoubleQuotedArgumentChars could be merged with the JSON equivalents.