0

For example, the following ReScript does not compile:

%%raw(`
const s = 'world';
const msg = `Hello ${s}!`;
console.log(s);
`)

The ReScript compiler (10.0.1) errors out at the backtick before Hello:

Syntax error!

3 | const msg = `Hello ${s}!`;

consecutive statements on a line must be separated by ';' or a newline
weakish
  • 28,682
  • 5
  • 48
  • 60

1 Answers1

0

This is being worked on, but you should be able to replace the outer backticks with double quotes:

%%raw("
const s = 'world';
const msg = `Hello ${s}!`;
console.log(msg);
")
const s = 'world';
const msg = `Hello ${s}!`;
console.log(msg);
;

//Hello world!

export {
  
}
/*  Not a pure module */

playground: https://rescript-lang.org/try?code=KTBOEMHcAoCICgDGB7AdgZwC4AJ3YLzYDkkyoANgCZEDcSaW2AtugOYHYAGAEgKbnlk2ACQBvdAF8AhJzooMycrwB0g1tBasAlHVhagA

James South
  • 534
  • 4
  • 15