• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Qiskit / qiskit / 28841436517
88%
main: 88%

Build:
Build:
LAST BUILD BRANCH: truncate_label
DEFAULT BRANCH: main
Ran 07 Jul 2026 04:58AM UTC
Jobs 1
Files 952
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

07 Jul 2026 04:24AM UTC coverage: 87.64% (+0.003%) from 87.637%
28841436517

push

github

web-flow
Rewrite OpenQASM 2 expression parser as iterative (#16425)

* Rewrite OpenQASM 2 expression parser as iterative

The previous parser was just an extension of the recursive-descent
parsing of the outer structural parser, with extra operator-precedence
logic added in to resolve binding and associativity.  However, unlike
the outer OpenQASM 2 structure, the potential recursive depth of an
expression is unbounded; as an easy example, consider

    1.0 + (1.0 + (1.0 + ...))

where the brackets force the evaluation to proceed against the natural
associativity of the `+` operation.

Using a fully recursive parser here is pedagogically convenient for
describing the grammar, but rather less convenient for memory use in
deeply nested expressions; we're always going to end up limited by the
stack space allocated to our process, and in the worst case we'll
overflow it.

Instead, we can manually break the recursion into an iteration with our
new "stack" stored in a heap-allocated `Vec` instead.  We have to do a
little extra work to define an `enum` containing all possibilities of
the state we would otherwise have held over a recursive call, but with a
sufficiently simple grammar, that's not too onerous.  The actual parsing
logic is unchanged, just the memory-use / function-call patterns.

* Restore precedence on new subexpression

* Fix typos

* Enforce handling of `power_min`

---------

Co-authored-by: Miriyala Jeevan Kumar <miriyala.jeevan.kumar@ibm.com>

138 of 140 new or added lines in 1 file covered. (98.57%)

16 existing lines in 3 files now uncovered.

112894 of 128815 relevant lines covered (87.64%)

999089.97 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
94.87
0.3% crates/qasm2/src/expr.rs

Coverage Regressions

Lines Coverage ∆ File
10
74.76
-0.37% crates/circuit/src/parameter/symbol_expr.rs
5
91.52
-0.51% crates/qasm2/src/lex.rs
1
90.33
0.0% crates/circuit/src/parameter/parameter_expression.rs
Jobs
ID Job ID Ran Files Coverage
1 28841436517.1 07 Jul 2026 04:58AM UTC 952
87.64
GitHub Action Run
Source Files on build 28841436517
  • Tree
  • List 952
  • Changed 8
  • Source Changed 5
  • Coverage Changed 8
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #28841436517
  • 2c882555 on github
  • Prev Build on gh-readonly-queue/main/pr-16433-2cf97b58e5a1e4e086792a4306582fea39fe562f (#28790522058)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc