Improve doc comments for compiler phases

This commit is contained in:
collin 2020-11-02 09:19:11 -08:00
parent 4da923eec4
commit 2fdcb043fc
5 changed files with 11 additions and 3 deletions

View File

@ -66,7 +66,7 @@ use leo_grammar::Grammar;
/// The [`LeoAst`] type represents a Leo program as a series of recursive data types.
/// These data types form a tree that begins from a [`Program`] type root.
///
/// A new [`LeoAst`] can be created from a [`Grammar`] generated by the pest parser in the `ast` module.
/// A new [`LeoAst`] can be created from a [`Grammar`] generated by the pest parser in the `grammar` module.
#[derive(Debug, Eq, PartialEq)]
pub struct LeoAst {
ast: Program,

View File

@ -14,7 +14,9 @@
// You should have received a copy of the GNU General Public License
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
//! Module containing structs and types that make up a Leo program.
//! The compiler for Leo programs.
//!
//! The [`Compiler`] type compiles Leo programs into R1CS circuits.
#![allow(clippy::module_inception)]

View File

@ -59,7 +59,8 @@ use std::{fs, path::Path};
/// The [`Grammar`] type represents a Leo program as a series of recursive data types.
/// These data types form a tree that begins from a [`File`] type root.
///
/// A new [`Grammar`] can be created from a `*.leo` file at a [`Path`].
/// A new [`Grammar`] type can be created from a `*.leo` file at a [`Path`].
/// A [`Grammar`] type can be used to create a new [`LeoAst`] type.
pub struct Grammar<'ast> {
ast: files::File<'ast>,
}

View File

@ -18,6 +18,9 @@
//!
//! This module contains the [`SymbolTable`] type, an abstract data type that tracks the current
//! bindings for functions and circuits in a Leo program.
//!
//! A new [`Symbol Table`] type can be created from a reference to a [`LeoAst`].
//! A [`Symbol Table`] type can be used to create a new [`TypeInference`] type.
#[macro_use]
extern crate thiserror;

View File

@ -18,6 +18,8 @@
//!
//! This module contains the [`TypeInference`] type, which stores information needed to run a type
//! inference check over a program.
//!
//! A new [`TypeInference`] type can be created from a [`LeoAst`] type and a [`Symbol Table`].
#[macro_use]
extern crate thiserror;