databricks / sjsonnet

Apache License 2.0
267 stars 55 forks source link

Fix parsing of object key starting with `assert` #169

Closed lihaoyi-databricks closed 1 year ago

lihaoyi-databricks commented 1 year ago

Fixes https://github.com/databricks/sjsonnet/issues/152 and https://github.com/databricks/sjsonnet/issues/65. All the other places we parse keywords are followed by a ~~ break to ensure the keyword ends there, so "assert" should as well.

Added some tests to loop through all the keywords to make sure this behavior doesn't appear for any of the other ones, in the three distinct contexts I can think of where identifiers might appear (local variable declarations, expressions, and object keys)