Commit 5b2ae62
authored
breaking: add structured prelude property to AT_RULE and STYLE_RULE (#110)
breaking: add structured prelude property to AT_RULE and STYLE_RULE
BREAKING CHANGES:
1. AT_RULE.prelude now returns CSSNode|null instead of string
- Returns AT_RULE_PRELUDE wrapper node containing structured children
- Access text with .prelude?.text instead of .prelude
- Raw string still available via .value
- Returns null for at-rules without structured parsing (@charset,
@namespace)
2. STYLE_RULE.prelude now returns the selector list (CSSNode|null)
- Returns first child (SELECTOR_LIST node)
- Access selector text with .prelude?.text
- Enables walking/traversing selector structure
Changes:
- Added AT_RULE_PRELUDE (40) node type for wrapping at-rule prelude
children
- Updated prelude getter to support AT_RULE and STYLE_RULE
- Updated has_prelude getter to support AT_RULE, STYLE_RULE, and
DECLARATION
- Parser now wraps parsed prelude nodes in AT_RULE_PRELUDE wrapper
- Removed backwards compatibility code from clone()
- Updated all tests to use .prelude?.text instead of .prelude
- Updated CLAUDE.md documentation
Aligns with CSSTree API for better interoperability.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <[email protected]>1 parent 38bf8e5 commit 5b2ae62
2 files changed
+38
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
187 | 198 | | |
188 | 199 | | |
189 | 200 | | |
| |||
193 | 204 | | |
194 | 205 | | |
195 | 206 | | |
196 | | - | |
197 | | - | |
| 207 | + | |
198 | 208 | | |
199 | | - | |
200 | | - | |
201 | | - | |
| 209 | + | |
202 | 210 | | |
203 | 211 | | |
204 | 212 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
310 | | - | |
311 | | - | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
312 | 314 | | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
318 | 322 | | |
319 | | - | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
320 | 328 | | |
321 | 329 | | |
322 | 330 | | |
| |||
382 | 390 | | |
383 | 391 | | |
384 | 392 | | |
385 | | - | |
| 393 | + | |
386 | 394 | | |
387 | | - | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
388 | 402 | | |
389 | 403 | | |
390 | 404 | | |
| |||
0 commit comments