Bug Description
A constructor split across two lines in a .qp file fails as a bare ValueError: substring not found, with no line number and outside the QProgramError hierarchy. The cause is an unguarded rindex(")") in the parser's argument slicing. The .wfl reader hits the identical failure and wraps it into a line-tagged ParseError, so the two formats report the same mistake very differently.
Minimal Reproducible Example
import qprogram as qp
qp.loads(
'#!QProgram 1.0\n'
'\n'
'body:\n'
' play "d" Gaussian(amplitude=0.5,\n'
' duration=40, sigma=8)\n'
)
Expected Behavior
A ParseError carrying the line number, the way the .wfl reader already reports it: Line 2: invalid waveform: substring not found. Multi-line constructors are not supported (.qp has no line continuation), but the refusal should be diagnosable.
Actual Behavior
ValueError: substring not found
.qp Text
#!QProgram 1.0
body:
play "d" Gaussian(amplitude=0.5,
duration=40, sigma=8)
System Information
qprogram 0.1.0
python 3.14.7 | Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.43
vendors none
Bug Description
A constructor split across two lines in a
.qpfile fails as a bareValueError: substring not found, with no line number and outside theQProgramErrorhierarchy. The cause is an unguardedrindex(")")in the parser's argument slicing. The.wflreader hits the identical failure and wraps it into a line-taggedParseError, so the two formats report the same mistake very differently.Minimal Reproducible Example
Expected Behavior
A
ParseErrorcarrying the line number, the way the.wflreader already reports it:Line 2: invalid waveform: substring not found. Multi-line constructors are not supported (.qphas no line continuation), but the refusal should be diagnosable.Actual Behavior
.qp Text
System Information
qprogram 0.1.0 python 3.14.7 | Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.43 vendors none