<html>#2331: piraha accepts in-string comments on first line of string
<table style='border-spacing: 1ex 0pt; '>
<tr><td style='text-align:right'> Reporter:</td><td>Roland Haas</td></tr>
<tr><td style='text-align:right'>   Status:</td><td>new</td></tr>
<tr><td style='text-align:right'>Milestone:</td><td></td></tr>
<tr><td style='text-align:right'>  Version:</td><td></td></tr>
<tr><td style='text-align:right'>     Type:</td><td>bug</td></tr>
<tr><td style='text-align:right'> Priority:</td><td>major</td></tr>
<tr><td style='text-align:right'>Component:</td><td>Cactus</td></tr>
</table>

<p>Comment (by Roland Haas):</p>
<p>This seems incorrect to me. The C++ code uses <code>"stringfirstname"</code> while the peg file has <code>"stringfirstline"</code>.</p>
<p>Note that even when changing them to be consistent, this parameter file:</p>
<div class="codehilite"><pre><span></span>$bar = &quot;time&quot;
Cactus::terminate = &quot;$bar&quot;
</pre></div>


<p>fails with </p>
<div class="codehilite"><pre><span></span>WARNING[L1,P0] (Cactus): Major error in parameter file &#39;par/tov.par&#39; line 2: Range error setting parameter &#39;Cactus::terminate&#39; to &#39;$bar&#39;
</pre></div>


<p>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.</p>
<p>A better peg file (ignoring the C++ code for brevity of presentation) seems to me to be:</p>
<div class="codehilite"><pre><span></span>stringparser = ^({var}|{name}|{stringfirstline})*(\n({stringcomment}|{var}|{name}|{any})*)?$
</pre></div>


<p>I have updated the branch and pull request with this suggestion.</p>
<p>--<br/>
Ticket URL: <a href='https://bitbucket.org/einsteintoolkit/tickets/issues/2331/piraha-accepts-in-string-comments-on-first'>https://bitbucket.org/einsteintoolkit/tickets/issues/2331/piraha-accepts-in-string-comments-on-first</a></p>
</html>