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

Qiskit / qiskit / 28841436517 / 1
88%
main: 88%

Build:
Build:
LAST BUILD BRANCH: port-synth_cnot_phase_aam-to-rust
DEFAULT BRANCH: main
Ran 07 Jul 2026 04:58AM UTC
Files 952
Run time 30s
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.1

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>

112894 of 128815 relevant lines covered (87.64%)

999089.97 hits per line

Source Files on job 28841436517.1
  • Tree
  • List 952
  • Changed 8
  • Source Changed 5
  • Coverage Changed 8
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 28841436517
  • 2c882555 on github
  • Prev Job for on gh-readonly-queue/main/pr-16425-2268c16fa1432b6ba01478e07642da12c3092b95 (#28790522058.1)
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