Trying to convert a JSON tmLanguage file to a CSON format, I ran in to a issue where the tmLanguage parser in Atom didn't like the file. Turns out there must be some kind of construct using a #{…} (or maybe its #{(…)}) notation (subexpression?) and my tmLanguage file happens to have 5 such patterns in it. I'm showing the entire section below, but the issue is towards the middle of the begin property.
Originally posted as https://github.com/bevry/cson/issues/91. Please excuse my unfamiliarity with CSON/Coffee at the time I posted this there. Since then, I have written my own crude CSON generator in PowerShell, https://github.com/msftrncs/PwshOutCSON, where as I had started with the JSON2CSON converter from https://github.com/bevry/cson.
Trying to convert a JSON tmLanguage file to a CSON format, I ran in to a issue where the tmLanguage parser in Atom didn't like the file. Turns out there must be some kind of construct using a
#{…}
(or maybe its#{(…)}
) notation (subexpression?) and my tmLanguage file happens to have 5 such patterns in it. I'm showing the entire section below, but the issue is towards the middle of thebegin
property.The value of the property is perfectly fine in JSON, but it needs the
#
(or the{
following it) escaped in CSON in order to be acceptable to Atom.I suspect its the CSON serializer that needs to catch the
#{
pattern in strings and escape it with\#{
.