mita icon indicating copy to clipboard operation
mita copied to clipboard

string - verifiation rules? pair-rule ?

Open boaks opened this issue 5 years ago • 1 comments

The examples include two types of string definitions:

let text = "text";
let text = `text`;

and nested scenarios:

let text = `"text"`;

But it seems to be not possible, to use a " without a closing pair

let text = `"text`;
let text = `\"text`;

It seems, that there is a rule, the it must be always pairs. Is there a way to escape that assumed "pair-rule" ? Using "\" seems not to work.

boaks avatar Aug 16 '19 09:08 boaks

This is a limitation of the parser framework we are using and the way we are parsing string interpolations. We have not found a way to do this directly like you are doing, but what you can do is write

let text = `${'"'}text`;

wegendt-bosch avatar Sep 05 '19 06:09 wegendt-bosch