#2331: piraha accepts in-string comments on first line of string
Reporter:Roland Haas
Status:new
Milestone:
Version:
Type:bug
Priority:major
Component:Cactus

Comment (by Roland Haas):

This seems incorrect to me. The C++ code uses "stringfirstname" while the peg file has "stringfirstline".

Note that even when changing them to be consistent, this parameter file:

$bar = "time"
Cactus::terminate = "$bar"

fails with

WARNING[L1,P0] (Cactus): Major error in parameter file 'par/tov.par' line 2: Range error setting parameter 'Cactus::terminate' to '$bar'

ie variables are not expanded on the first line (b/c it is always used literally). See #2333 though for whether or not expanding variables in strings is the right thing to do anyway.

A better peg file (ignoring the C++ code for brevity of presentation) seems to me to be:

stringparser = ^({var}|{name}|{stringfirstline})*(\n({stringcomment}|{var}|{name}|{any})*)?$

I have updated the branch and pull request with this suggestion.

--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2331/piraha-accepts-in-string-comments-on-first