Skip to content

Commit

Permalink
Add more documentation on contributing (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlapeyre authored Mar 26, 2024
1 parent dac0d7a commit ea3ab9c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
34 changes: 34 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
## Pull Requests

### Debugging / Developing

Set the environment variable `QASM3_PATH` to the directory containing the QASM 3 example you are working on.
Alternatively, in the examples below, you can use the fully qualified path to `example.qasm`.

Use `semdemo` to see how the parser/analyzer handles your example in `example.qasm`.
You will usually be concerned with two data structures, which we call the AST and the ASG.
In order to test construction of the ASG, the AST must be constructed without errors.

#### The AST

Run
```shell
cargo run --color always --example semdemo -- parse example.qasm
```
If parsing was successful, you should see something like
```
Found 3 stmts
Found 0 parse errors:
[]
```
followed by a representation of the AST.

### The ASG
If running `semdemo` with the option `parse` as above prints no syntax errors, then
you can proceed to the ASG. Run
```shell
cargo run --color always --example semdemo -- semantic example.qasm
```
If there were in fact syntax errors in producing the AST, then this command will
pretty-print those errors, but will not attempt to construct the ASG.
Otherwise the ASG will be constructed, and any *semantic* errors found will be
printed.

### Continuous Integration (CI)

All pull requests must pass a CI check before being merged. You can check if CI will pass locally with
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Issues with the tag include a bit more context than some other issues in order t
planning on working on these issues in the immediate future.
However, this does not mean you can't tackle an issue without this tag if is a better fit.

There are a few more tips in [CONTRIBUTING.md](./CONTRIBUTING.md), as well as some later in this README.

### Crates (roughly one installable library per crate)

The first three crates are based on tools for `rust` and `rust-analyzer`.
Expand Down

0 comments on commit ea3ab9c

Please sign in to comment.