Skip to content

String interpolation changed in v10? #5742

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
davesnx opened this issue Oct 18, 2022 · 2 comments
Closed

String interpolation changed in v10? #5742

davesnx opened this issue Oct 18, 2022 · 2 comments

Comments

@davesnx
Copy link
Contributor

davesnx commented Oct 18, 2022

Hi, in rescript v9 I used to generate the syntax from Reason for string interpolation with js extension: {js||js}, I believe looked something like js``.

Currently, this fails with ReScript 10. After checking the changelog I don't see any breaking change regarding this.

This issue for a code example is: davesnx/styled-ppx#308

The cx() generates `js.`

@davesnx
Copy link
Contributor Author

davesnx commented Feb 20, 2023

Update on this issue. Looking at the parsetree I'm able to see and debug what's the issue:

$ yarn bsc -dparsetree -e 'let a = %css(`content: " "`)'

  Warning number 108
  /var/folders/yq/h17dmhjj3rz_6dqsnrd950gc0000gn/T/evala23d0e.res:1:14-27

  1 │ let a = %css(`content: " "`)

  Uninterpreted delimiters js

[
  structure_item
    Pstr_value Nonrec
    [
      <def>
        pattern
          Ppat_var "a"
        expression
          Pexp_extension "css"
          [
            structure_item
              Pstr_eval
              expression
                attribute  "res.template"
                  []
                Pexp_constant PConst_string ("content: \" \"",Some "js")
          ]
    ]
]
  We've found a bug for you!
  /Users/davesnx/Code/github/davesnx/styled-ppx/packages/demo/rescript/src/index.res

  Unexpected error Attributes not allowed here

@davesnx
Copy link
Contributor Author

davesnx commented Feb 20, 2023

So, it's the same issue as zth/rescript-relay#372.

@davesnx davesnx closed this as completed Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant