Conversation
* Pulled standalone `- stuff` (aka tags without a colon) into its own match * This greatly simplifies the main tag match, meaning that we no longer have three nested non-capturing groups * Ensure that spaces follow the ending colon (fixes the second part of #52) * Use a consistent blacklist across tag matches (fixes the first part of #51) * Fix `constant.other.date.yaml` being misapplied to the entire match, rather than just the date * Integrate `!!omap` matching into the existing tag matches * Make variable matching stricter
And finish up comments
Also don't match leading whitespace as unquoted strings
grammars/yaml.cson
Outdated
| 'name': 'comment.line.number-sign.yaml' | ||
| '2': | ||
| 'name': 'punctuation.definition.comment.yaml' | ||
| 'include': '#comment' |
There was a problem hiding this comment.
@MaximSokolov: do you think this scope name is ok, or would switching it to a keyword like keyword.other.tag.non-specific.yaml be better?
There was a problem hiding this comment.
I don't know. Seems to me it's more than just a punctuation mark. According to documentation (3.3.2. Resolved Tags), there is also a ? tag, does it have a scope?
Makes dates and numbers work for quoted keys and also multiline matches
|
Continuing the conversation here so that it's more visible: no, it currently doesn't. The |
|
I am concerned about using As for |
|
punctuation.definition.tag.omap? |
👍 |
|
I think I'm going to avoid adding more scopes in this PR. Those can be added separately. |
Requirements
Description of the Change
For some reason whenever I work on language-yaml I end up rewriting the whole thing each time. Oh well. This PR should probably have been split up into like 10 different ones, but many of the changes depend on the others.
- stuff(aka tags without a colon) into its own matchconstant.other.date.yamlbeing misapplied to the entire match, rather than just the date!!omapmatching into the existing tag matcheskey: ! value)<<: *variable-to-merge)Alternate Designs
None. This is an overall rewrite to the grammar to hopefully make it easier to maintain in the future. Code duplication was getting out of hand, and many of the more obscure rules weren't working properly.
Benefits
Better overall code tokenization and accuracy.
Possible Drawbacks
Possible regressions, as is possible with any rewrite. Spec coverage has been improving each rewrite though, so the chance of severe regressions happening shouldn't be that large anymore.
Applicable Issues
Fixes #53