Skip to content

Commit

Permalink
Format comments (#711)
Browse files Browse the repository at this point in the history
  • Loading branch information
raviqqe authored Jan 30, 2022
1 parent 0cff70c commit 3376869
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 15 deletions.
4 changes: 2 additions & 2 deletions cmd/pen/src/package_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ pub fn build(target_triple: Option<&str>, verbose: bool) -> Result<(), Box<dyn s
infrastructure::create(file_path_converter.clone(), &main_package_directory)?;
let main_package_directory =
file_path_converter.convert_to_file_path(&main_package_directory)?;
// TODO Share an external package directory to avoid initializing them multiple times for
// different targets.
// TODO Share an external package directory to avoid initializing them multiple
// times for different targets.
let output_directory = main_package_directory.join(&app::infra::FilePath::new([
OUTPUT_DIRECTORY,
target_triple.unwrap_or(DEFAULT_TARGET_DIRECTORY),
Expand Down
15 changes: 8 additions & 7 deletions lib/mir/src/analysis/reference_count/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ fn convert_definition(
definition: &Definition,
global: bool,
) -> Result<Definition, ReferenceCountError> {
// Backend is expected to clone a function itself and its free variables at the very beginning
// of the function.
// Backend is expected to clone a function itself and its free variables at the
// very beginning of the function.
let owned_variables = if global {
None
} else {
Expand Down Expand Up @@ -59,13 +59,14 @@ fn convert_definition(
))
}

// Here, we convert expressions tracking moved variables and cloning variables moved already.
// The basic rules are listed below.
// Here, we convert expressions tracking moved variables and cloning variables
// moved already. The basic rules are listed below.
//
// - The returned values of functions are moved.
// - Every input of expressions is moved including conditions of if expressions and records of record
// field operations.
// - Newly bound variables in let expressions are dropped if they are not moved in their expressions.
// - Every input of expressions is moved including conditions of if expressions
// and records of record field operations.
// - Newly bound variables in let expressions are dropped if they are not moved
// in their expressions.
fn convert_expression(
expression: &Expression,
owned_variables: &FnvHashMap<String, Type>,
Expand Down
6 changes: 3 additions & 3 deletions lib/mir/src/ir/let_recursive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ use std::sync::Arc;
// function calls.
// - This requirement can be potentially removed by dropping every functions
// used in function calls inside the functions themselves.
// - This is safe because only global function definitions can be
// recursive.
// - This recursion is necessary to compile "anonymous" loops in HIR effectively.
// - This is safe because only global function definitions can be recursive.
// - This recursion is necessary to compile "anonymous" loops in HIR
// effectively.
// - e.g. list comprehension
#[derive(Clone, Debug, PartialEq)]
pub struct LetRecursive {
Expand Down
3 changes: 2 additions & 1 deletion lib/os-sync/ffi/library/src/open_file_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ impl From<OpenFileOptions> for OpenOptions {
fn from(options: OpenFileOptions) -> Self {
let mut open_options = Self::new();

// Set the create option after the create_new option because the latter is prioritized.
// Set the create option after the create_new option because the latter is
// prioritized.
open_options
.append(options.append)
.create_new(options.create_new)
Expand Down
3 changes: 2 additions & 1 deletion lib/os/ffi/application/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ unsafe extern "C" fn _pen_os_main(_: &mut Stack, _: ContinuationFunction) -> ffi
}

fn main() {
// HACK Is it OK to call the _pen_os_main function with an extra argument of a closure environment?
// HACK Is it OK to call the _pen_os_main function with an extra argument of a
// closure environment?
let code: ffi::Number =
Runtime::new()
.unwrap()
Expand Down
3 changes: 2 additions & 1 deletion lib/os/ffi/library/src/open_file_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ impl From<OpenFileOptions> for OpenOptions {
fn from(options: OpenFileOptions) -> Self {
let mut open_options = Self::new();

// Set the create option after the create_new option because the latter is prioritized.
// Set the create option after the create_new option because the latter is
// prioritized.
open_options
.append(options.append)
.create_new(options.create_new)
Expand Down

0 comments on commit 3376869

Please sign in to comment.