Skip to content

Commit

Permalink
chore: apply spelling fixes (#1073)
Browse files Browse the repository at this point in the history
* chore: apply spelling fixes

* Update errors.rs
  • Loading branch information
TomAFrench authored Mar 31, 2023
1 parent 9a43f85 commit ce61349
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion crates/nargo_cli/tests/test_data/4_sub/src/main.nr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Test unsafe integer substraction with underflow: 12 - 2418266113 = 1876701195 modulo 2^32
// Test unsafe integer subtraction with underflow: 12 - 2418266113 = 1876701195 modulo 2^32
fn main(mut x: u32, y: u32, z: u32) {
x -= y;
constrain x == z;
Expand Down
2 changes: 1 addition & 1 deletion crates/noirc_evaluator/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl RuntimeError {
}

// Keep one of the two location which is Some, if possible
// This is used when we optimise instructions so that we do not loose track of location
// This is used when we optimize instructions so that we do not lose track of location
pub fn merge_location(a: Option<Location>, b: Option<Location>) -> Option<Location> {
match (a, b) {
(Some(loc), _) | (_, Some(loc)) => Some(loc),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,23 @@ pub(crate) fn evaluate(

let outputs;
match opcode {
Opcode::ToBits(endianess) => {
Opcode::ToBits(endianness) => {
// TODO: document where `0` and `1` are coming from, for args[0], args[1]
let bit_size = ctx.get_as_constant(args[1]).unwrap().to_u128() as u32;
let l_c =
acir_gen.var_cache.get_or_compute_internal_var_unwrap(args[0], evaluator, ctx);
outputs = to_radix_base(l_c.expression(), 2, bit_size, endianess, evaluator);
outputs = to_radix_base(l_c.expression(), 2, bit_size, endianness, evaluator);
if let ObjectType::Pointer(a) = res_type {
acir_gen.memory.map_array(a, &outputs, ctx);
}
}
Opcode::ToRadix(endianess) => {
Opcode::ToRadix(endianness) => {
// TODO: document where `0`, `1` and `2` are coming from, for args[0],args[1], args[2]
let radix = ctx.get_as_constant(args[1]).unwrap().to_u128() as u32;
let limb_size = ctx.get_as_constant(args[2]).unwrap().to_u128() as u32;
let l_c =
acir_gen.var_cache.get_or_compute_internal_var_unwrap(args[0], evaluator, ctx);
outputs = to_radix_base(l_c.expression(), radix, limb_size, endianess, evaluator);
outputs = to_radix_base(l_c.expression(), radix, limb_size, endianness, evaluator);
if let ObjectType::Pointer(a) = res_type {
acir_gen.memory.map_array(a, &outputs, ctx);
}
Expand Down
4 changes: 2 additions & 2 deletions crates/noirc_evaluator/src/ssa/acir_gen/operations/sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub(crate) fn evaluate_permutation_with_witness(
// in_expr: inputs of the sorting network
// if generate_witness is false, it uses the witness provided in bits instead of generating them
// in both cases it returns the witness of the network configuration
// if generate_witnes is true, bits is ignored
// if generate_witness is true, bits is ignored
fn permutation_layer(
in_expr: &Vec<Expression>,
bits: &[Witness],
Expand Down Expand Up @@ -93,7 +93,7 @@ fn permutation_layer(
let (w1, b1) = permutation_layer(&in_sub1, bits1, generate_witness, evaluator);
let bits2 = if generate_witness { bits } else { &bits[n1 + (n - 1) / 2 + w1.len()..] };
let (w2, b2) = permutation_layer(&in_sub2, bits2, generate_witness, evaluator);
// apply the output swithces
// apply the output switches
for i in 0..(n - 1) / 2 {
let c = if generate_witness { evaluator.add_witness_to_cs() } else { bits[n1 + i] };
conf.push(c);
Expand Down
2 changes: 1 addition & 1 deletion crates/noirc_frontend/src/hir/resolution/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ impl<'a> Resolver<'a> {
// Don't issue a warning if these are unused
//
// We can fail to find the generic in self.generics if it is an implicit one created
// by the compiler. This can happen when, e.g. elliding array lengths using the slice
// by the compiler. This can happen when, e.g. eliding array lengths using the slice
// syntax [T].
if let Some((name, _, span)) =
self.generics.iter().find(|(name, _, _)| name.as_ref() == &name_to_find)
Expand Down
2 changes: 1 addition & 1 deletion crates/noirc_frontend/src/hir_def/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Noir's Hir is the result of the name resolution step (defined in the
//! hir module) and is essentially identical to the Ast with some small transformations.
//! The HIR is the input to the name resolution pass, the type checking pass, and the
//! monomorphisation pass.
//! monomorphization pass.
//!
//! Name Resolution takes the AST as input and produces the initial Hir which strongly
//! resembles the Ast except:
Expand Down
2 changes: 1 addition & 1 deletion crates/noirc_frontend/src/hir_def/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub enum Type {
/// E.g. `u32` would be `Integer(CompTime::No(None), Unsigned, 32)`
Integer(CompTime, Signedness, u32),

/// The primitive `bool` type. Like other primitive types, whether bools are known at CompTime
/// The primitive `bool` type. Like other primitive types, whether booleans are known at CompTime
/// is also tracked. Unlike the other primitives however, it isn't as useful since it is
/// primarily only used when converting between a bool and an integer type for indexing arrays.
Bool(CompTime),
Expand Down
5 changes: 5 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
"blackbox",
"codegen",
"coeff",
"combinators",
"comptime",
"desugared",
"endianness",
"forall",
"foralls",
"Guillaume",
Expand All @@ -27,10 +29,12 @@
"krate",
"lvalue",
"merkle",
"metas",
"monomorphization",
"monomorphize",
"monomorphized",
"monomorphizer",
"monomorphizes",
"pedersen",
"peekable",
"preprocess",
Expand All @@ -41,6 +45,7 @@
"stdlib",
"struct",
"subexpression",
"subtyping",
"typevar",
"typevars",
"udiv",
Expand Down

0 comments on commit ce61349

Please sign in to comment.