sdmx-twg / vtl

This repository is used for maintaining the SDMX-VTL specification
11 stars 7 forks source link

String escaping #395

Open NicoLaval opened 8 months ago

NicoLaval commented 8 months ago

Issue Description

How to define a string containing "?

G4 token file defines:

STRING_CONSTANT
  :
  '"' (~'"')* '"'
  ;

Which means including " is not valid?

Is there a way to use this symbol, with an escaping character?

vpinna80 commented 8 months ago

Apparently not. It should be corrected to allow for example a double double quotation mark like in SAS:

"Valentino says: ""double double quotes"""
NicoLaval commented 8 months ago

Not super readable. Backslash would be better no?

In any case, if the escaping does not exist, it should be added I think.

vpinna80 commented 8 months ago

Yeah, but backslash is for programmers :) As it doesn't exist now, we could discuss it, perhaps considering users backgrond. In SQL you have double single quotes either.

NicoLaval commented 8 months ago

True :) So we can define it during the next meeting.

romaintailhurat commented 7 months ago

What about using simple markers like simple quote ' or even backtick `?

In Python for example, this is a valid string:

"a string with 'quote'"