[Developers] quoting in ccl-file strings

Tom Goodale goodale at cct.lsu.edu
Fri Jun 3 10:23:10 CDT 2005



On Fri, 3 Jun 2005, Jonathan Thornburg wrote:

> In a recent message to this list, I proposed the rules
>
>> * A string is delimited by either single-quotes ('...')
>>  or double-quotes ("...").
>> * Within a string delimited by single-quotes, double-quotes may be
>>  used with no need for special quoting
>> * Within a string delimited by double-quotes, single-quotes may be
>>  used with no need for special quoting
>> * Backslash quotes the next character, i.e.
>>  * \' gives a single-quote character without delimiting the string
>>  * \" gives a double-quote character without delimiting the string
>>  * \\ gives a backslash character in the string
>
> for string quoting in par files.
>
>
> In this message I'd like to address the related issue of string quoting
> in ccl files.  As a design principle, I'd say it makes sense to use a
> consistent set of rules across all of Cactus, i.e. I'd like to propose
> the same set of rules for CCL files.

It's definitely good to be consistent, so I'd be happy with this.

> As an implementation bug...  try putting the string
>   "compute $\partial_x \beta$"
> in a CCL string, and you'll discover that the current CST dumps that
> verbatim into a C string... and \p and \b aren't legal in a C string.
> Oops.

Yep, definitely bad.  We should also have a check that anything we are 
going to turn into a C string is a valid C string.

Tom



More information about the Developers mailing list