Skip to content

Create README.md #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# cvldoc_parser
This program parses Certora's `CVLDoc` comments. It contains the following modules:
* [`parse`](/src/parse), which lexes and parses the subset of `CVL` required to be compatible with `CVLDoc`, including the `CVLDoc` documentation blocks
* [`python_wrapper`](/src/python_wrapper), which exports the Python package `cvldoc_parser` using [`PyO3`](https://pyo3.rs). This is also used by [`cvldocTool`](https://github.com/Certora/cvldocTool).
16 changes: 9 additions & 7 deletions src/python_wrapper/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# CVLDoc Parser: Python module
Exposes a Python API for the CVLDoc module. WIP.
Exposes a Python API for the CVLDoc module.
Currently exposes a single function, `cvldoc_parser.parse(path)`. It takes a single path, and returns a list of parsed CVLDoc objects.

## Usage
First, make sure **Rust 1.62** or newer is installed.
## Install
Up-to-date builds (built by the CircleCI script) are available on Test `PyPI`:

`pip install --pre --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple cvldoc_parser`

## Build
First, [install Rust](https://rustup.rs/).
Clone [the entire repo](https://github.com/Certora/cvldoc_parser), then from the project base:
```bash
$ cd src/python_wrapper
Expand All @@ -22,7 +28,3 @@ It is now possible to import the module:
$ python
>>> import cvldoc_parser
```

## API
Currently exposes a single function, `cvldoc_parser.parse(paths)`. It takes a list of file paths as strings, and returns a list of parsed CVLDoc objects for each path.
A parsed CVLDoc object is either a `Documentation` or a `FreeForm`. They both support a `diagnostics()` method, that returns a list of warnings or errors associated with that object.