tree-sitter / tree-sitter-css

CSS grammar for Tree-sitter
MIT License
85 stars 34 forks source link

bug: `apply_directive` node with `rem` unit #44

Closed aspeddro closed 7 months ago

aspeddro commented 9 months ago

Did you check existing issues?

Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)

tree-sitter 0.20.8 (0c49d6745b3fc4822ab02e0018770cd6383a779c)

Describe the bug

Apply directive with rem unit

.hl-title {
  @apply text-[2.5rem];
}

AST:

(rule_set) ; [1:1 - 3:1]
 (selectors) ; [1:1 - 9]
  (class_selector) ; [1:1 - 9]
   (class_name) ; [1:2 - 9]
 (block) ; [1:11 - 3:1]
  (apply_directive) ; [2:3 - 23]
   (class_name) ; [2:10 - 22]
    (identifier) ; [2:10 - 14]
    (ERROR) ; [2:16 - 17]
    (integer_value) ; [2:18 - 21]
     (unit) ; [2:19 - 21]

Steps To Reproduce/Bad Parse Tree

  1. Create CSS file
  2. Add code above
  3. Run parser

Expected Behavior/Parse Tree

rem unit should be parsed

Repro

.hl-title {
  @apply text-[2.5rem];
}
savetheclocktower commented 7 months ago

This appears to be fixed on latest master.

Screenshot 2024-01-28 at 11 32 15 PM