jscc icon indicating copy to clipboard operation
jscc copied to clipboard

Error: Invalid regular expression

Open RedHatter opened this issue 4 years ago • 2 comments
trafficstars

Single line directives capture the comment ending token as part of the expression.

/* #if process.env.TARGET === 'chrome' */
Error: Invalid regular expression: missing / in expression "process.env.TARGET === 'chrome' */"

For languages such as css that don't have single line comments this means that directions must be two lines.

/* #if process.env.TARGET === 'chrome'
*/

RedHatter avatar Jan 01 '21 13:01 RedHatter

This can be fixed by adding a jscc comment, like so:

/*#set _COLOR = "red" //*/
.hi {
    /*#if _COLOR === "red" //*/
    color: red; 
    /*#endif //*/
}

BobVarioa avatar May 04 '21 16:05 BobVarioa

This is a better work around but sill sub-optimal. Any reason the pattern can't ignore the comment end tag?

RedHatter avatar May 30 '21 15:05 RedHatter