[Developers] quoting in par-file strings

Jonathan Thornburg jthorn at aei.mpg.de
Sat Jun 4 05:33:22 CDT 2005


I wrote:
> So, it seems that we could in fact get away with a simpler set of rules
> for par files:
>
> * strings are delimited by double quotes (")
> * inside a string, \" gives a double-quote character, \\ gives a backslash
>  character, and \ followed by any other character gives a backslash
>  followed by that other character


I should also point one other important string-parsing "rule".  Strictly 
speaking this is implied by the two previous rules, but it's probably
important enough to state explicitly:

* A string starts with a double quote, and continues to the next
   (unescaped) double quote.  In particular, a string may include newline
   characters, eg
 	MyThorn::MyPar = "
 	  this is a very long
 	  string value which will
 	  be assigned to this parameter
 	  and which will include
 	  6 newline characters
 			 "

Cactus already implements this last rule for par files (abeit with
level-1 warnings), and lots of existing par files contain such multiline
strings.  I'm not sure what Cactus currently does for such multiline
strings in ccl files.

ciao,

-- 
-- Jonathan Thornburg <jthorn at aei.mpg.de>
    Max-Planck-Institut fuer Gravitationsphysik (Albert-Einstein-Institut),
    Golm, Germany, "Old Europe"     http://www.aei.mpg.de/~jthorn/home.html
    "Washing one's hands of the conflict between the powerful and the
     powerless means to side with the powerful, not to be neutral."
                                       -- quote by Freire / poster by Oxfam




More information about the Developers mailing list