From 1444c9328df4e31e9eb355a97e450c8d51a6bca2 Mon Sep 17 00:00:00 2001 From: rvcas Date: Fri, 7 Apr 2023 16:51:18 -0400 Subject: [PATCH] fix some typos --- CONTRIBUTING.md | 6 +++--- crates/aiken-lang/src/format.rs | 4 ++-- crates/aiken-lang/src/gen_uplc/scope.rs | 8 ++++---- crates/aiken-lang/src/parser/error.rs | 2 +- crates/aiken-lang/src/tipo/environment.rs | 4 ++-- crates/aiken-lang/src/tipo/expr.rs | 2 +- crates/aiken-lang/src/tipo/hydrator.rs | 4 ++-- crates/aiken-project/src/blueprint/error.rs | 2 +- crates/flat-rs/src/encode/encoder.rs | 2 +- crates/uplc/src/machine.rs | 2 +- crates/uplc/src/machine/cost_model.rs | 2 +- crates/uplc/src/tx.rs | 2 +- examples/acceptance_tests/035/lib/aiken/dict.ak | 2 +- examples/acceptance_tests/043/lib/tests.ak | 4 ++-- examples/gift_card/islands/{App.tsx => Oneshot.tsx} | 2 +- examples/gift_card/routes/index.tsx | 4 ++-- 16 files changed, 26 insertions(+), 26 deletions(-) rename examples/gift_card/islands/{App.tsx => Oneshot.tsx} (99%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 879e0ace..d3d039e7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,7 +10,7 @@ 2. **Documentation** - Any updates, typo fixes, or expansion of the documention is more than welcome. At the moment, + Any updates, typo fixes, or expansion of the documentation is more than welcome. At the moment, we are using [nextra](https://nextra.site) to run https://github.com/aiken-lang/site. That can be considered user level documentation but that is not strict. There is also doc comments in the Rust code, which can be considered strictly developer level documentation. @@ -42,10 +42,10 @@ **Changelog** - Please add an entry into [CHANGLOG.md](./CHANGELOG.md) when submitting changes. New entries should go into the `[next] YYYY-MM-DD` section. This let's us keep track of unreleased changes + Please add an entry into [CHANGELOG.md](./CHANGELOG.md) when submitting changes. New entries should go into the `[next] YYYY-MM-DD` section. This let's us keep track of unreleased changes for use in release notes. - Once a release is ready `[next] YYYY-MM-DD` gets replaced with a verion number and a the release date `[0.0.0] 2009-01-03`. Usually the maintainers will handle the section renaming along with creating a new _empty_ `[next] YYYY-MM-DD` section at the top of the changelog. + Once a release is ready `[next] YYYY-MM-DD` gets replaced with a version number and a the release date `[0.0.0] 2009-01-03`. Usually the maintainers will handle the section renaming along with creating a new _empty_ `[next] YYYY-MM-DD` section at the top of the changelog. Each release section will be further broken down into three sections named `Added`, `Changed`, and `Removed`. Please put the associated crate's name in **bold** followed by a `:` as a prefix to the new entry. diff --git a/crates/aiken-lang/src/format.rs b/crates/aiken-lang/src/format.rs index 8bd474e2..79d1ad1a 100644 --- a/crates/aiken-lang/src/format.rs +++ b/crates/aiken-lang/src/format.rs @@ -603,8 +603,8 @@ impl<'comments> Formatter<'comments> { let count = expressions.len(); let mut documents = Vec::with_capacity(count * 2); for (i, expression) in expressions.iter().enumerate() { - let preceeding_newline = self.pop_empty_lines(expression.start_byte_index()); - if i != 0 && preceeding_newline { + let preceding_newline = self.pop_empty_lines(expression.start_byte_index()); + if i != 0 && preceding_newline { documents.push(lines(2)); } else if i != 0 { documents.push(lines(1)); diff --git a/crates/aiken-lang/src/gen_uplc/scope.rs b/crates/aiken-lang/src/gen_uplc/scope.rs index ead11bb2..fe58855a 100644 --- a/crates/aiken-lang/src/gen_uplc/scope.rs +++ b/crates/aiken-lang/src/gen_uplc/scope.rs @@ -61,9 +61,9 @@ mod test { fn common_ancestor_equal_vecs() { let ancestor = Scope(vec![1, 2, 3, 4, 5, 6]); - let decendant = Scope(vec![1, 2, 3, 4, 5, 6]); + let descendant = Scope(vec![1, 2, 3, 4, 5, 6]); - let result = ancestor.common_ancestor(&decendant); + let result = ancestor.common_ancestor(&descendant); assert_eq!(result, Scope(vec![1, 2, 3, 4, 5, 6])) } @@ -72,9 +72,9 @@ mod test { fn common_ancestor_equal_ancestor() { let ancestor = Scope(vec![1, 2, 3, 4]); - let decendant = Scope(vec![1, 2, 3, 4, 5, 6]); + let descendant = Scope(vec![1, 2, 3, 4, 5, 6]); - let result = ancestor.common_ancestor(&decendant); + let result = ancestor.common_ancestor(&descendant); assert_eq!(result, Scope(vec![1, 2, 3, 4])); } diff --git a/crates/aiken-lang/src/parser/error.rs b/crates/aiken-lang/src/parser/error.rs index 366a8c77..e45b3bda 100644 --- a/crates/aiken-lang/src/parser/error.rs +++ b/crates/aiken-lang/src/parser/error.rs @@ -169,7 +169,7 @@ pub enum Pattern { #[error("I found an unexpected type name.")] #[diagnostic(help("Try removing it!"))] TypeIdent, - #[error("I found an unexpected indentifier.")] + #[error("I found an unexpected identifier.")] #[diagnostic(help("Try removing it!"))] TermIdent, #[error("I found an unexpected end of input.")] diff --git a/crates/aiken-lang/src/tipo/environment.rs b/crates/aiken-lang/src/tipo/environment.rs index 8739a3b4..ebbe794a 100644 --- a/crates/aiken-lang/src/tipo/environment.rs +++ b/crates/aiken-lang/src/tipo/environment.rs @@ -427,12 +427,12 @@ impl<'a> Environment<'a> { match self .entity_usages .last_mut() - .expect("Attempted to access non-existant entity usages scope") + .expect("Attempted to access non-existent entity usages scope") .insert(name.to_string(), (kind, location, false)) { // Private types can be shadowed by a constructor with the same name // - // TODO: Improve this so that we can tell if an imported overriden + // TODO: Improve this so that we can tell if an imported overridden // type is actually used or not by tracking whether usages apply to // the value or type scope Some((ImportedType | ImportedTypeAndConstructor | PrivateType, _, _)) => (), diff --git a/crates/aiken-lang/src/tipo/expr.rs b/crates/aiken-lang/src/tipo/expr.rs index 36a8a62d..6563837e 100644 --- a/crates/aiken-lang/src/tipo/expr.rs +++ b/crates/aiken-lang/src/tipo/expr.rs @@ -1560,7 +1560,7 @@ impl<'a, 'b> ExprTyper<'a, 'b> { Some(tail) => { let tail = self.infer(*tail)?; - // Ensure the tail has the same type as the preceeding elements + // Ensure the tail has the same type as the preceding elements self.unify(tipo.clone(), tail.tipo(), location, false)?; Some(Box::new(tail)) diff --git a/crates/aiken-lang/src/tipo/hydrator.rs b/crates/aiken-lang/src/tipo/hydrator.rs index 84f87958..a06482c8 100644 --- a/crates/aiken-lang/src/tipo/hydrator.rs +++ b/crates/aiken-lang/src/tipo/hydrator.rs @@ -20,7 +20,7 @@ use super::{ /// It keeps track of any type variables created. This is useful for: /// /// - Determining if a generic type variable should be made into an -/// unbound type varable during type instantiation. +/// unbound type variable during type instantiation. /// - Ensuring that the same type is constructed if the programmer /// uses the same name for a type variable multiple times. /// @@ -146,7 +146,7 @@ impl Hydrator { .get_type_constructor(module, name, *location)? .clone(); - // Register the type constructor as being used if it is unqualifed. + // Register the type constructor as being used if it is unqualified. // We do not track use of qualified type constructors as they may be // used in another module. if module.is_none() { diff --git a/crates/aiken-project/src/blueprint/error.rs b/crates/aiken-project/src/blueprint/error.rs index c506fcca..d440b18c 100644 --- a/crates/aiken-project/src/blueprint/error.rs +++ b/crates/aiken-project/src/blueprint/error.rs @@ -37,7 +37,7 @@ pub enum Error { )] #[diagnostic(code("aiken::blueprint::address::parameterized"))] #[diagnostic(help( - "I can only compute addresses of validators that are fully applied. For example, a {keyword_spend} validator must have exactly 3 arguments: a datum, a redeemer and a context. If it has more, they need to be provided beforehand and applied directly in the validator. Applying parameters change the validator's compiled code, and thus the address.\n\nThis is why I need you to apply parmeters first.", + "I can only compute addresses of validators that are fully applied. For example, a {keyword_spend} validator must have exactly 3 arguments: a datum, a redeemer and a context. If it has more, they need to be provided beforehand and applied directly in the validator. Applying parameters change the validator's compiled code, and thus the address.\n\nThis is why I need you to apply parameters first.", keyword_spend = "spend".if_supports_color(Stdout, |s| s.purple())))] ParameterizedValidator { n: usize }, } diff --git a/crates/flat-rs/src/encode/encoder.rs b/crates/flat-rs/src/encode/encoder.rs index ea6eb0de..03cdd429 100644 --- a/crates/flat-rs/src/encode/encoder.rs +++ b/crates/flat-rs/src/encode/encoder.rs @@ -291,7 +291,7 @@ impl Encoder { } } /// Write out byte regardless of current buffer alignment. - /// Write most signifcant bits in remaining unused bits for the current byte, + /// Write most significant bits in remaining unused bits for the current byte, /// then write out the remaining bits at the beginning of the next byte. fn byte_unaligned(&mut self, x: u8) { let x_shift = self.current_byte | (x >> self.used_bits); diff --git a/crates/uplc/src/machine.rs b/crates/uplc/src/machine.rs index 221d74ad..dd50a36a 100644 --- a/crates/uplc/src/machine.rs +++ b/crates/uplc/src/machine.rs @@ -362,7 +362,7 @@ impl Machine { let mut unspent_step_budget = self.costs.machine_costs.get(StepKind::try_from(i as u8)?); - unspent_step_budget.occurences(self.unbudgeted_steps[i] as i64); + unspent_step_budget.occurrences(self.unbudgeted_steps[i] as i64); self.spend_budget(unspent_step_budget)?; diff --git a/crates/uplc/src/machine/cost_model.rs b/crates/uplc/src/machine/cost_model.rs index 766ee2ce..ad4293f9 100644 --- a/crates/uplc/src/machine/cost_model.rs +++ b/crates/uplc/src/machine/cost_model.rs @@ -25,7 +25,7 @@ pub struct ExBudget { } impl ExBudget { - pub fn occurences(&mut self, n: i64) { + pub fn occurrences(&mut self, n: i64) { self.mem *= n; self.cpu *= n; } diff --git a/crates/uplc/src/tx.rs b/crates/uplc/src/tx.rs index 643675be..6c0caa8c 100644 --- a/crates/uplc/src/tx.rs +++ b/crates/uplc/src/tx.rs @@ -65,7 +65,7 @@ pub fn eval_phase_two( &remaining_budget, )?; - // The substraction is safe here as ex units counting is done during evaluation. + // The subtraction is safe here as ex units counting is done during evaluation. // Redeemer would fail already if budget was negative. remaining_budget.cpu -= redeemer.ex_units.steps as i64; remaining_budget.mem -= redeemer.ex_units.mem as i64; diff --git a/examples/acceptance_tests/035/lib/aiken/dict.ak b/examples/acceptance_tests/035/lib/aiken/dict.ak index 3e8b8600..a333c240 100644 --- a/examples/acceptance_tests/035/lib/aiken/dict.ak +++ b/examples/acceptance_tests/035/lib/aiken/dict.ak @@ -1,5 +1,5 @@ /// An opaque `Dict`. The type is opaque because the module maintains some -/// invariant, namely: there's only one occurence of a given key in the dictionnary. +/// invariant, namely: there's only one occurrence of a given key in the dictionary. pub opaque type Dict { inner: List<(ByteArray, value)>, } diff --git a/examples/acceptance_tests/043/lib/tests.ak b/examples/acceptance_tests/043/lib/tests.ak index 4f1e5bad..8913ae31 100644 --- a/examples/acceptance_tests/043/lib/tests.ak +++ b/examples/acceptance_tests/043/lib/tests.ak @@ -1,7 +1,7 @@ -fn substract(x, y) { +fn subtract(x, y) { x - y } test flip_1() { - flip(substract)(3, 2) == -1 + flip(subtract)(3, 2) == -1 } diff --git a/examples/gift_card/islands/App.tsx b/examples/gift_card/islands/Oneshot.tsx similarity index 99% rename from examples/gift_card/islands/App.tsx rename to examples/gift_card/islands/Oneshot.tsx index c3f0aeef..8b5d32e5 100644 --- a/examples/gift_card/islands/App.tsx +++ b/examples/gift_card/islands/Oneshot.tsx @@ -132,7 +132,7 @@ export default function App({ validators }: AppProps) { const success = await lucid!.awaitTx(txHash); - // Wait a little bit longer so ExhuastedUTxOError doesn't happen + // Wait a little bit longer so ExhaustedUTxOError doesn't happen // in the next Tx setTimeout(() => { setWaitingLockTx(false); diff --git a/examples/gift_card/routes/index.tsx b/examples/gift_card/routes/index.tsx index f11c2e08..4be0e4bd 100644 --- a/examples/gift_card/routes/index.tsx +++ b/examples/gift_card/routes/index.tsx @@ -1,7 +1,7 @@ import { Head } from "$fresh/runtime.ts"; import { Handlers, PageProps } from "$fresh/server.ts"; -import App from "~/islands/App.tsx"; +import Oneshot from "~/islands/Oneshot.tsx"; import { readValidators, Validators } from "~/utils.ts"; @@ -43,7 +43,7 @@ export default function Home({ data }: PageProps) { - + );