Fix module docs

This commit is contained in:
Sofia 2025-07-09 20:07:30 +03:00
parent 9710d17e00
commit a907fec967
10 changed files with 52 additions and 42 deletions

View File

@ -1,5 +1,6 @@
/// This module contains simply [`Builder`] and it's related utility Values.
/// Builder is the actual struct being modified when building the LLIR.
//! This module contains simply [`Builder`] and it's related utility Values.
//! Builder is the actual struct being modified when building the LLIR.
use std::{cell::RefCell, rc::Rc};
use crate::{

View File

@ -1,6 +1,7 @@
/// This module contains all of the relevant code that is needed to compile the
/// LLIR ([`Context`]) into LLVM IR. This module is the only one that interfaces
/// with the LLVM API.
//! This module contains all of the relevant code that is needed to compile the
//! LLIR ([`Context`]) into LLVM IR. This module is the only one that interfaces
//! with the LLVM API.
use std::{collections::HashMap, ffi::CString, ptr::null_mut};
use llvm_sys::{

View File

@ -1,4 +1,5 @@
/// Debug implementations for relevant types
//! Debug implementations for relevant types
use std::fmt::{Debug, Write};
use crate::{CmpPredicate, InstructionData, InstructionKind, TerminatorKind, builder::*};

View File

@ -1,6 +1,7 @@
/// Reid LLVM Lib is an ergonomic Rust'y API which is used to produce a
/// Low-Level IR (LLIR) using [`Context`] and [`Builder`]. This Builder can then
/// be used at the end to compile said LLIR into LLVM IR.
//! Reid LLVM Lib is an ergonomic Rust'y API which is used to produce a
//! Low-Level IR (LLIR) using [`Context`] and [`Builder`]. This Builder can then
//! be used at the end to compile said LLIR into LLVM IR.
use std::marker::PhantomData;
use builder::{BlockValue, Builder, FunctionValue, InstructionValue, ModuleValue};

View File

@ -1,5 +1,7 @@
/// In this module are defined structs that are used for performing passes on
/// Reid. It contains a simplified version of Reid which can be e.g. typechecked.
//! In this module are defined structs that are used for performing passes on
//! Reid. It contains a simplified version of Reid which can be e.g.
//! typechecked.
use crate::token_stream::TokenRange;
mod display;

View File

@ -1,5 +1,6 @@
/// This module contains relevant code for [`Pass`] and shared code between
/// passes. Passes can be performed on Reid MIR to e.g. typecheck the code.
//! This module contains relevant code for [`Pass`] and shared code between
//! passes. Passes can be performed on Reid MIR to e.g. typecheck the code.
use std::collections::HashMap;
use std::error::Error as STDError;

View File

@ -1,5 +1,5 @@
/// This module contains code relevant to doing a type checking pass on the MIR.
/// During typechecking relevant types are also coerced if possible.
//! This module contains code relevant to doing a type checking pass on the MIR.
//! During typechecking relevant types are also coerced if possible.
use std::{convert::Infallible, iter};
use crate::{mir::*, util::try_all};

View File

@ -1,25 +1,26 @@
/// Copied from
/// https://github.com/rust-lang/rust/blob/6b3ae3f6e45a33c2d95fa0362c9b2593e567fd34/library/core/src/fmt/builders.rs#L102
///
/// Copyright (c) The Rust Project Contributors
///
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to
/// deal in the Software without restriction, including without limitation the
/// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
/// sell copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
/// IN THE SOFTWARE.
//! Copied from
//! https://github.com/rust-lang/rust/blob/6b3ae3f6e45a33c2d95fa0362c9b2593e567fd34/library/core/src/fmt/builders.rs#L102
// Copyright (c) The Rust Project Contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
use std::fmt;
pub struct PadAdapter<'buf, 'state> {

View File

@ -1,5 +1,6 @@
/// Contains relevant code for parsing tokens received from
/// Lexing/Tokenizing-stage.
//! Contains relevant code for parsing tokens received from
//! Lexing/Tokenizing-stage.
use crate::{
ast::parse::Parse,
lexer::{FullToken, Position, Token},

View File

@ -1,6 +1,7 @@
/// Take a list of Results, and try to unwrap all of them. Returns a Result
/// which either contains every Result unwrapped, or every error that exists
/// within the array.
//! Take a list of Results, and try to unwrap all of them. Returns a Result
//! which either contains every Result unwrapped, or every error that exists
//! within the array.
pub fn try_all<U, E>(list: Vec<Result<U, E>>) -> Result<Vec<U>, Vec<E>> {
let mut successes = Vec::with_capacity(list.len());
let mut failures = Vec::with_capacity(list.len());