Skip to content

Commit

Permalink
Add unsupported input flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
taalexander committed Mar 15, 2024
1 parent b4e33d2 commit f7bd2b1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/API/errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ namespace qssc {

enum class ErrorCategory {
OpenQASM3ParseFailure,
OpenQASM3UnsupportedInput,
QSSCompilerError,
QSSCompilerNoInputError,
QSSCompilerCommunicationFailure,
Expand Down
4 changes: 4 additions & 0 deletions python_lib/qss_compiler/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,7 @@ class QSSControlSystemResourcesExceeded(QSSCompilerError):

class OpenQASM3ParseFailure(QSSCompilerError):
"""Raised when a parser failure is received"""


class OpenQASM3UnsupportedInput(QSSCompilerError):
"""Raised when provided Openqasm 3 input has semantics that are not supported by the compiler."""
1 change: 1 addition & 0 deletions python_lib/qss_compiler/lib_enums.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ void addErrorCategory(py::module &m) {
py::enum_<qssc::ErrorCategory>(m, "ErrorCategory", py::arithmetic())
.value("OpenQASM3ParseFailure",
qssc::ErrorCategory::OpenQASM3ParseFailure)
.value("OpenQASM3UnsupportedInput", qssc::ErrorCategory::OpenQASM3UnsupportedInput)
.value("QSSCompilerError", qssc::ErrorCategory::QSSCompilerError)
.value("QSSCompilerNoInputError",
qssc::ErrorCategory::QSSCompilerNoInputError)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
features:
- |
A new diagnostic has been added for unsupported OpenQASM 3 semantics - ``OpenQASM3UnsupportedInput``.
This should be raised when the input OpenQASM 3 semantics are not valid for the compiler.

0 comments on commit f7bd2b1

Please sign in to comment.