Pygments tools for OpenQASM
Project description
Pygments tools for OpenQASM
This repository provides the Python package openqasm-pygments
, which provides
a lexer for syntax highlighting OpenQASM code with Pygments.
There are current three lexers included, all of which register themselves with
Pygments when this package is installed:
OpenQASM3Lexer
(Pygments aliasesopenqasm3
andqasm3
), for parsing OpenQASM 3 code. Most OpenQASM 2 programs will lex acceptably with this lexer as well, except for some keyword differences.OpenQASM2Lexer
(aliasesopenqasm2
andqasm2
), for lexing OpenQASM 2 programs.OpenPulseLexer
(aliasesopenpulse
), for lexing the OpenPulse pulse calibration dialect also defined in the OpenQASM 3 specification. For the most part, this lexer will not be used as a root, but theOpenQASM3Lexer
will delegate lexing of calibration blocks to it, when required.
Installation
Install the latest release of openqasm-pygments
package from pip:
pip install openqasm-pygments
This will automatically install all the dependencies as well (Pygments, for example) if they are not already installed.
Developing
If you're looking to contribute to this project, please first read our contributing guidelines.
Set up your development environment by installing the development requirements with pip:
pip install -r requirements-dev.txt tox
This installs a few more packages than the dependencies of the package at
runtime, because there are some tools we use for testing also included, such as
tox
and pytest
.
After the development requirements are installed, you can install an editable version of the package with
pip install -e .
After this, any changes you make to the library code will immediately be present when you open a new Python interpreter session.
License
This project is licensed under version 2.0 of the Apache License. This is a Qiskit project.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file openqasm-pygments-0.1.0.tar.gz
.
File metadata
- Download URL: openqasm-pygments-0.1.0.tar.gz
- Upload date:
- Size: 55.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 491a2dd2f15c0baed8b0fc1ffc3efce6fc4e073cc61e02240b28b98338ba37fe |
|
MD5 | a78a59d2928ae2ea11b4c57c67ecb71f |
|
BLAKE2b-256 | d6555d1f158a7abedf8871829532ee66427da45ced4d5538a4401f7ae5604a7a |
File details
Details for the file openqasm_pygments-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: openqasm_pygments-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7786f7cb405acb57ee79806ba21674424ca5f8877e50d44eb1daa4cb28f3fd13 |
|
MD5 | 0b46c17b05f3cd7dd089787e19ccc430 |
|
BLAKE2b-256 | 9244fb7644587bf41ee5ec007dd59b296e8afe0acedb53af127cae5860acf2a2 |