fix some typos
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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]));
|
||||
}
|
||||
|
||||
@@ -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.")]
|
||||
|
||||
@@ -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, _, _)) => (),
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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 },
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)?;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user