Commit f999e46
committed
refactor(parser): drop redundant hasTopLevelBareVariable scan
#4462 added a hand-rolled hasTopLevelBareVariable() that re-scanned prelude text
with a paren-depth counter to flag a top-level bare @variable. It duplicated
machinery the parser already has and was subtly wrong:
- permissiveValue's entity loop already reports a bare @var structurally (it
parses a Variable entity and warns), covering every real case — bare, glued
(bar-@baz), post-keyword (@A and @b), and comma lists — verified.
- the hand-rolled scan only tracked (), not []/{} or strings, unlike the
existing nesting-aware $parseUntil, so a bare @var inside […] could be
mis-flagged.
Remove the function and suppress the value-context 'variable-in-unknown-value'
notice for at-rule preludes (the entity loop owns that warning). Behaviour is
unchanged: the at-rule-variable-deprecated fixture renders byte-identically and
emits the same 5 prelude warnings; @foo (x:@v) still does not warn.1 parent 92c62bb commit f999e46
1 file changed
Lines changed: 7 additions & 33 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | 109 | | |
135 | 110 | | |
136 | 111 | | |
| |||
1838 | 1813 | | |
1839 | 1814 | | |
1840 | 1815 | | |
1841 | | - | |
1842 | | - | |
1843 | | - | |
1844 | | - | |
1845 | | - | |
1846 | | - | |
1847 | | - | |
1848 | | - | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
1849 | 1823 | | |
1850 | 1824 | | |
1851 | 1825 | | |
| |||
0 commit comments