Commit 5c3f22f
committed
Sub-scope escapes inside quoted YAML keys
A double/single-quoted KEY (`"a\nb": v`) is scoped entity.name.tag, not string.*, so
it skipped the value-string region and emitted as a FLAT token — its `\n` / `''`
escapes were painted as part of the key name instead of constant.character.escape.
Emit the quoted key as a begin/end region (name = key scope, patterns = the escape)
gated on a begin lookahead that the close delim is followed by the key separator —
derived from the token's own body + key-sep lookahead (minus the open delim) — so a
quoted VALUE (no trailing separator) still falls through to its own string region.
The entity.name.tag precedence rank now also covers begin/end regions (not just flat
matches) so the keyed region out-ranks the value-string region on the shared `"`.
YAML scope-gap escape 25/28 -> 28/28 (gap to official +0.3). Parser untouched
(highlighter-only); other grammars byte-identical.
Refs #121 parent 9c0f6dd commit 5c3f22f
2 files changed
Lines changed: 66 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4529 | 4529 | | |
4530 | 4530 | | |
4531 | 4531 | | |
| 4532 | + | |
| 4533 | + | |
| 4534 | + | |
| 4535 | + | |
| 4536 | + | |
| 4537 | + | |
| 4538 | + | |
| 4539 | + | |
| 4540 | + | |
| 4541 | + | |
| 4542 | + | |
| 4543 | + | |
| 4544 | + | |
| 4545 | + | |
| 4546 | + | |
| 4547 | + | |
| 4548 | + | |
| 4549 | + | |
| 4550 | + | |
| 4551 | + | |
| 4552 | + | |
| 4553 | + | |
| 4554 | + | |
| 4555 | + | |
| 4556 | + | |
4532 | 4557 | | |
4533 | 4558 | | |
4534 | 4559 | | |
| |||
7152 | 7177 | | |
7153 | 7178 | | |
7154 | 7179 | | |
7155 | | - | |
| 7180 | + | |
| 7181 | + | |
| 7182 | + | |
| 7183 | + | |
7156 | 7184 | | |
7157 | 7185 | | |
7158 | 7186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
106 | 123 | | |
107 | 124 | | |
108 | 125 | | |
109 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
110 | 145 | | |
111 | 146 | | |
112 | 147 | | |
| |||
0 commit comments