You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the semantic analyser stops at the first error and emits out an error message to the user about the about location and the error.
This might be good for a small number of semantic errors but for a lot of errors, the user experience would degrade. They would have to run the analyser as many times as the number of errors which is not desirable.
Moreover, if the user has a very large number of errors, spitting out all errors at once could be confusing.
A good feature would be to add an error threshold in the analyser. With this, we can keep a list of errors and as soon as the number of errors reach this predefined threshold, we stop and emit all of these errors.
Error Codes
Adding unique identifiers to the messages would help locate the line of code quicker than parsing through the python traceback. Eg - OSA_ERR_123: <<error message>> ( OSA: openqasm semantic analyser )
Implementation (Optional)
Questions
How to handle the "state" of the analyser once an error is found? Eg. -
OPENQASM 3.0;
array[int[32], 2, 2] my_arr = { {1,2}, {3,4}};
int[32] a = my_arr[0]; // this is semantically incorrect
qubit q;
if( a == 4) { // what do we refer as "a" here?
for int[32] i in [:a] {
rx(pi * i ) q;
}
}
In the above example, do we treat a as undefined or invalid? What does "invalid" exactly mean here? How to continue semantic analysis in this erroneous state?
What is a good threshold level for errors?
The text was updated successfully, but these errors were encountered:
Feature Description
Error Emission
Error Codes
OSA_ERR_123: <<error message>>
(OSA
: openqasm semantic analyser )Implementation (Optional)
Questions
In the above example, do we treat
a
as undefined or invalid? What does "invalid" exactly mean here? How to continue semantic analysis in this erroneous state?The text was updated successfully, but these errors were encountered: