Skip to content

Commit

Permalink
[Parser] Restore support of parameter expressions like pi*-0.25
Browse files Browse the repository at this point in the history
  • Loading branch information
xumingkuan committed Jan 28, 2025
1 parent ef1f661 commit 8971681
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/quartz/parser/qasm_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,13 @@ int ParamParser::parse_expr(std::stringstream &ss, bool is_halved) {
// Determines where the expression splits into terms, when applicable.
// The right-most (last) deliminator will identify the next term to parse.
size_t pos = token.find_last_of("+-");
while (pos != std::string::npos && pos > 0) {
if (token[pos - 1] == '*') {
// Case: t*-e (negative sign), ignored here
std::cout << pos << std::endl;
pos = token.find_last_of("+-", pos - 1);
}
}

// Determines which case this corresponds to.
int tid;
Expand Down

0 comments on commit 8971681

Please sign in to comment.