davesnx / styled-ppx

Type-safe styled components for ReScript, Melange and native with type-safe CSS
https://styled-ppx.vercel.app
BSD 2-Clause "Simplified" License
401 stars 32 forks source link

Some style blocks containing special chars can't be parsed anymore (and error locations are wrong) #383

Closed jchavarri closed 11 months ago

jchavarri commented 11 months ago

With latest version (in main), this style block fails to parse:

let listItem = [%cx {|
  :before {
    content: "•";
  }
|}]

While it used to work before. The error message is also quite cryptic, and shows the wrong location:

File "foo/bar.ml", line 3, characters 11-12:
Error: Parse error while reading token ':'

here is where it points to:

let listItem = [%cx {|
           ^- error location (just this char)
  :before {
    content: "•";
  }
|}]