Commit 5ff6093
committed
Drive YAML highlighter scope-gap to 100% (the 0.3% residual: 3 fixes)
After the monogram#12 items, the YAML scope-gap metric (full-span, vs the neutral `yaml`-CST
oracle) had 7 Monogram-wrong tokens out of 2034 (99.66%, already ahead of the official 99.51%).
Three independent root causes, all highlighter-only (parser untouched — src-coverage-yaml stays
100% aligned; the other six grammars regenerate byte-identical; Onigmo diagnostics clean):
A. Line-start quoted scalar with an internal colon (`"foo: bar"`, `"foo: bar\": baz"`). The
#plain-continuation key-scan `[^\n{}[]]*?:` treated the colon INSIDE the quotes as a key
separator, so the line was mis-read as `key: value` and the opening `"` left unscoped. The scan
now consumes a leading/embedded quoted scalar as one whole escape-aware token (derived from the
grammar's quoted-scalar tokens), so the `:` separator is guaranteed outside quotes — a quoted
scalar no longer opens a fold (it falls to #dquote/#squote), while a real quoted KEY
(`"foo": bar`, colon outside) still folds its value. (2 tokens)
B. Multi-line explicit KEY (`? a\n true` = the one key "a true"). #plain-continuation opened on
the `? ` header but scoped the folded continuation as the VALUE plain scope; a new
#explicit-key-continuation region (same shape, pinned to the explicit-key indicator, ranked
above #plain-continuation) scopes it as the KEY (entity.name.tag), consistent with its first
line. A `- ` seq / `key:` value fold stays on #plain-continuation. (4 tokens)
C. Glued `#` after a directive (`%YAML 1.1#...`). YamlDirective's trailing lookahead accepted a
glued `#` (no preceding space) as a comment-ahead; per §6.6 a comment indicator needs a
preceding space, so the lookahead now requires it. A glued-`#` line then matches no directive
token and is scoped by #directive-malformed — which (with #4) now scopes a malformed directive
line as a directive (keyword.other.directive), highlighting it normally rather than splashing
invalid.illegal, matching the #12 #3 stance and the CST oracle. (1 token)
scope-gap-yaml: Monogram correct 100.0% / monogramWrong 0 (official 99.51%). yaml-issue12
regressions 10/10; src-coverage-yaml 100%; six grammars byte-identical; agnostic 9/9; sanity
15/15; tm-diagnostics clean; tsc clean.1 parent 8ff330a commit 5ff6093
4 files changed
Lines changed: 121 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4975 | 4975 | | |
4976 | 4976 | | |
4977 | 4977 | | |
4978 | | - | |
| 4978 | + | |
| 4979 | + | |
| 4980 | + | |
| 4981 | + | |
| 4982 | + | |
| 4983 | + | |
| 4984 | + | |
| 4985 | + | |
| 4986 | + | |
| 4987 | + | |
| 4988 | + | |
| 4989 | + | |
| 4990 | + | |
| 4991 | + | |
| 4992 | + | |
4979 | 4993 | | |
4980 | 4994 | | |
4981 | 4995 | | |
| |||
5015 | 5029 | | |
5016 | 5030 | | |
5017 | 5031 | | |
| 5032 | + | |
| 5033 | + | |
| 5034 | + | |
| 5035 | + | |
| 5036 | + | |
| 5037 | + | |
| 5038 | + | |
| 5039 | + | |
| 5040 | + | |
| 5041 | + | |
| 5042 | + | |
| 5043 | + | |
| 5044 | + | |
| 5045 | + | |
| 5046 | + | |
| 5047 | + | |
| 5048 | + | |
| 5049 | + | |
| 5050 | + | |
| 5051 | + | |
| 5052 | + | |
5018 | 5053 | | |
5019 | 5054 | | |
5020 | 5055 | | |
| |||
5126 | 5161 | | |
5127 | 5162 | | |
5128 | 5163 | | |
5129 | | - | |
5130 | | - | |
5131 | | - | |
5132 | | - | |
5133 | | - | |
| 5164 | + | |
| 5165 | + | |
| 5166 | + | |
| 5167 | + | |
| 5168 | + | |
| 5169 | + | |
| 5170 | + | |
| 5171 | + | |
5134 | 5172 | | |
5135 | 5173 | | |
5136 | 5174 | | |
5137 | 5175 | | |
5138 | 5176 | | |
5139 | 5177 | | |
5140 | 5178 | | |
5141 | | - | |
| 5179 | + | |
5142 | 5180 | | |
5143 | 5181 | | |
5144 | 5182 | | |
| |||
7648 | 7686 | | |
7649 | 7687 | | |
7650 | 7688 | | |
| 7689 | + | |
| 7690 | + | |
| 7691 | + | |
| 7692 | + | |
| 7693 | + | |
7651 | 7694 | | |
7652 | 7695 | | |
7653 | 7696 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
725 | 725 | | |
726 | 726 | | |
727 | 727 | | |
728 | | - | |
| 728 | + | |
729 | 729 | | |
730 | 730 | | |
731 | 731 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
80 | 83 | | |
81 | 84 | | |
82 | 85 | | |
| |||
231 | 234 | | |
232 | 235 | | |
233 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
234 | 240 | | |
235 | 241 | | |
236 | 242 | | |
| |||
323 | 329 | | |
324 | 330 | | |
325 | 331 | | |
326 | | - | |
| 332 | + | |
327 | 333 | | |
328 | 334 | | |
329 | 335 | | |
| |||
1723 | 1729 | | |
1724 | 1730 | | |
1725 | 1731 | | |
1726 | | - | |
| 1732 | + | |
1727 | 1733 | | |
1728 | 1734 | | |
1729 | 1735 | | |
| |||
1777 | 1783 | | |
1778 | 1784 | | |
1779 | 1785 | | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
1780 | 1841 | | |
1781 | 1842 | | |
1782 | 1843 | | |
| |||
1951 | 2012 | | |
1952 | 2013 | | |
1953 | 2014 | | |
1954 | | - | |
| 2015 | + | |
1955 | 2016 | | |
1956 | 2017 | | |
1957 | 2018 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
78 | 83 | | |
79 | 84 | | |
80 | 85 | | |
| |||
0 commit comments