quil-rs
quil-rs copied to clipboard
Expose Parsing Errors from Within Block
Consider the following program:
DEFCAL MEASURE 0 addr:
CAPTURE 0 \"ro_rx\" custom
It's invalid because a memory identifier is missing from the CAPTURE
. However, when parsed by quil-rs
into a program, the error message reads as follows:
"error while parsing: at line 2, column 1 (COMMAND(DEFCAL)): failed to parse arguments for DEFCAL"'
This stands to improve in three ways:
- It says "parsing arguments for DEFCAL" but the block isn't what we might usually consider an argument here. If it instead said "failed to parse block within DEFCAL" that would be less of a red herring.
- The error should probably tell us about the failure to parse the
CAPTURE
within the block. - This isn't parsing arguments for a
DEFCAL
but for aDEFCAL MEASURE
, which is its own instruction variant. This is a minor problem though.