qiskit/crates/qasm2
Jake Lishman 3075f14d66
Handle final comments with no terminating newline in OpenQASM 2 (#10773)
* Handle final comments with no terminating newline in OpenQASM 2

Previously, if an OpenQASM 2 program to be parsed ended in a comment
with no terminating '\n', the lexer would fail to notice the end of the
file and would instead attempt to emit the second '/' of the comment
introduction as a 'Slash` token.

* Run `cargo fmt`

* Testing extra cases

---------

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

---------

Co-authored-by: Luciano Bello <bel@zurich.ibm.com>
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
2023-09-05 21:20:29 +00:00
..
src Handle final comments with no terminating newline in OpenQASM 2 (#10773) 2023-09-05 21:20:29 +00:00
Cargo.toml Fail gracefully on bad `SabreDAG` construction (#10724) 2023-09-04 15:15:44 +00:00
README.md Add Rust-based OpenQASM 2 converter (#9784) 2023-04-12 16:00:54 +00:00

README.md

qiskit._qasm2

This crate is the bulk of the OpenQASM 2 parser. Since OpenQASM 2 is a simple language, it doesn't bother with an AST construction step, but produces a simple linear bytecode stream to pass to a small Python interpreter (in qiskit.qasm2). This started off life as a vendored version of the package qiskit-qasm2.