-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start testing and reporting code coverage in the CI (#1052)
- Loading branch information
Showing
8 changed files
with
107 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
[run] | ||
omit = pyquil/tests/*,pyquil/_parser/gen2/*,pyquil/_parser/gen3/* | ||
omit = | ||
pyquil/_parser/gen3/* | ||
pyquil/external/* | ||
pyquil/tests/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,29 @@ | ||
# Quil Parser | ||
The Quil Parser | ||
=============== | ||
|
||
## Introduction | ||
Introduction | ||
------------ | ||
|
||
This package contains a number of items useful for parsing Quil programs, both with or without PyQuil. It uses the | ||
ANTLR4 parser generator framework. | ||
This package contains a number of items useful for parsing Quil programs, both with or without | ||
pyQuil. It uses the ANTLR4 parser generator framework. | ||
|
||
`Quil.g4` - This is the definitive reference grammar for Quil as described in the Quil paper. It is used to generate | ||
the Python parser as well as parsers in other programming languages. | ||
`Quil.g4` - This is the definitive reference grammar for Quil as described in the Quil paper. | ||
It is used to generate the Python parser as well as parsers in other programming languages. | ||
|
||
`PyQuilListener.py` - When the parser successfully consumes a Quil program it invokes various callbacks after | ||
encountering different parts of the AST (gates, expressions, etc). This is the code that creates the PyQuil instructions. | ||
`PyQuilListener.py` - When the parser successfully consumes a Quil program it invokes various | ||
callbacks after encountering different parts of the AST (gates, expressions, etc). This is the | ||
code that creates the pyQuil instructions. | ||
|
||
`gen3/` - Generated parser code for Python 3. Should be checked in but not hand modified. | ||
|
||
## Running ANTLR | ||
Running ANTLR | ||
------------- | ||
|
||
1. Install ANTLR4 and alias it to `antlr4` | ||
2. cd to this directory | ||
1. Install [ANTLR4](http://www.antlr.org/) and alias it to `antlr4` | ||
2. Navigate to this directory (`pyquil/_parser`) | ||
3. Generate the Python 3 parser code: `antlr4 -Dlanguage=Python3 -o gen3 Quil.g4` | ||
|
||
## References | ||
References | ||
---------- | ||
|
||
Excellent ANTLR tutorial: https://tomassetti.me/antlr-mega-tutorial | ||
|
||
ANTLR download: http://www.antlr.org/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ rpcq >= 2.7.2 | |
|
||
# test deps | ||
pytest | ||
pytest-cov | ||
pytest-timeout | ||
pytest-rerunfailures | ||
requests-mock | ||
|