<html>#2443: piraha incorrectly removes newline from first line of multi-line 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></td></tr>
</table>

<p>This parfile:</p>
<div class="codehilite"><pre><span></span>ActiveThorns = &quot;IOUtil
Cactus&quot;
</pre></div>


<p>results in an error:</p>
<div class="codehilite"><pre><span></span>$ exe/cactus_sim -S firstline.par
<span class="o">[</span>...<span class="o">]</span>
Activating thorn Cactus...Success -&gt; active implementation Cactus
Activation requested <span class="k">for</span>
---&gt;IOUtilCactus &lt;---
Error: Thorn IOUtilCactus not found
Activation failed - <span class="m">1</span> errors in activation sequence
WARNING level <span class="m">0</span> from host ekohaes8 process <span class="m">0</span>
  in thorn Cactus, file /data/rhaas/postdoc/gr/cactus/ET_trunk/src/main/SetParams.c:93:
  -&gt; CCTKi_SetParameter: Error at line <span class="m">1</span> in parameter file firstline.par <span class="k">while</span> activating thorns
</pre></div>


<p>since the parser incorrectly removed whitespace (a newline) at the end of the first line of the multi-line ActiveThorns value.</p>
<p>My (untested) guess is that these lines in <code>par.peg</code> is repsonsible:</p>
<div class="codehilite"><pre><span></span>stringfirstline = .
stringcomment = #.*
stringparser = ^({var}|{name}|{stringfirstline})*(\n({stringcomment}|{var}|{name}|{any})*)?$
</pre></div>


<p>since it will make  the <code>\n</code> in <code>(\n({stringcomment}|…</code> not part of a <code>stringcomment,</code> a <code>var</code>, a <code>name</code> or an <code>any</code> group.</p>
<p>--<br/>
Ticket URL: <a href='https://bitbucket.org/einsteintoolkit/tickets/issues/2443/piraha-incorrectly-removes-newline-from'>https://bitbucket.org/einsteintoolkit/tickets/issues/2443/piraha-incorrectly-removes-newline-from</a></p>
</html>