RScript lexer exception when inserting double quotes in a built string

Hi everyone,

I’m developing a URCap and hit a lexer exception in PolyScope when trying to generate a string that includes a tag in double quotes.
Target structure (example):

["testtag",2,3,4,5,6]

When building this dynamically, PolyScope fails before execution with a lexer error.

Where it happens (minimal repro):

assignment = str_cat(str_cat("[\"", tag), "\",")

Error shown by PolyScope:

Lexer ...:
assignment = str_cat(str_cat("[\"", tag), "\",")

From my observations, this is a tokenization (lexical parsing) issue: URScript’s lexer struggles with escaped double quotes (\") in certain concatenation contexts, even though the code looks syntactically valid.

Has anyone found a reliable workaround to safely insert double quotes into dynamically constructed strings in URScript?

Thanks,
Halit

Doesn’t seem like UR has ever implemented this Feature. Posts from years ago mention just making 2 single quotes. No idea if what you’re using it for will interpret that properly.

You said you’re using a URCap, is it possible to have the CAP do whatever dynamic generation you’re trying to achieve?

Thanks, Eric!
Yes, I’m using a URCap. The issue happens before runtime when PolyScope’s lexer hits escaped quotes in str_cat().
Even simple cases like

["testtag",2,3,4]

fail to parse.
I’ll probably build the full string on the Java side instead.