Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change object tokens, support bare key-values
This commit makes several changes to the proposed lexer. First, it changes the tokens used in JavaScript objects. It was proposed that keys be tokenised as `Str::Double` and that string values be tokenised as `Name::Tag`. The token `Name::Label` seems a more appropriate token for keys while `Str::Double` should be used for string values. Second, it remoeves the tokenisation of escape sequences inside object keys. While this is correct insofar as the keys are merely strings, it fits awkwardly with the tokenisation of keys with a non-string token. This commit tokenises all characters within the key as `Name::Label`. Third, it adds support for 'bare' key-value pairs, that is text of the form <string>: <value>. These 'bare' key-value pairs are not tokenised the same way as they would be within objects. Rather, keys are tokenised as ordinary strings. This preserves backwards compatability with how the JSON lexer previously worked.
- Loading branch information