piraha incorrectly removes newline from first line of multi-line string

Create issue
Issue #2443 resolved
Roland Haas created an issue

This parfile:

ActiveThorns = "IOUtil
Cactus"

results in an error:

$ exe/cactus_sim -S firstline.par
[...]
Activating thorn Cactus...Success -> active implementation Cactus
Activation requested for
--->IOUtilCactus <---
Error: Thorn IOUtilCactus not found
Activation failed - 1 errors in activation sequence
WARNING level 0 from host ekohaes8 process 0
  in thorn Cactus, file /data/rhaas/postdoc/gr/cactus/ET_trunk/src/main/SetParams.c:93:
  -> CCTKi_SetParameter: Error at line 1 in parameter file firstline.par while activating thorns

since the parser incorrectly removed whitespace (a newline) at the end of the first line of the multi-line ActiveThorns value.

My (untested) guess is that these lines in par.peg is repsonsible:

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

since it will make the \n in (\n({stringcomment}|… not part of a stringcomment, a var, a name or an any group.

Comments (8)

  1. Roland Haas reporter

    @Steven R. Brandt this is piraha / PEG bug. Will you have time to look into it (you are most qualified)?

  2. Roland Haas reporter

    It also “normalizes” the activethorns list in the log output to be a single space separated list.

  3. Log in to comment