Skip to content
This repository has been archived by the owner on May 4, 2024. It is now read-only.

fix the typos #1096

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion language/move-binary-format/src/check_bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ impl<'a> BoundsChecker<'a> {
check_bounds_impl(self.view.identifiers(), function_handle.name)?;
check_bounds_impl(self.view.signatures(), function_handle.parameters)?;
check_bounds_impl(self.view.signatures(), function_handle.return_)?;
// function signature type paramters must be in bounds to the function type parameters
// function signature type parameters must be in bounds to the function type parameters
let type_param_count = function_handle.type_parameters.len();
if let Some(sig) = self
.view
Expand Down
4 changes: 2 additions & 2 deletions language/move-model/src/builder/module_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ impl<'env, 'translator> ModuleBuilder<'env, 'translator> {

/// Creates a SpecBlockContext from the given SpecBlockTarget. The context is used during
/// definition analysis when visiting a schema block member (condition, invariant, etc.).
/// This returns None if the SpecBlockTarget cannnot be resolved; error reporting happens
/// This returns None if the SpecBlockTarget cannot be resolved; error reporting happens
/// at caller side.
fn get_spec_block_context<'pa>(
&self,
Expand Down Expand Up @@ -2925,7 +2925,7 @@ impl<'env, 'translator> ModuleBuilder<'env, 'translator> {
} else {
// This is calling a function from the module we are currently translating.
// Need to recursively ensure we have computed used_spec_vars because of
// arbitrary call graphs, including cyclic. If visted_opt is not set,
// arbitrary call graphs, including cyclic. If visited_opt is not set,
// we know we already computed this.
if let Some(visited) = &mut visited_opt {
self.compute_state_usage_and_callees_for_fun(visited, fid.as_usize());
Expand Down
4 changes: 2 additions & 2 deletions language/move-model/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub fn run_model_builder<
}

/// Build the move model with default compilation flags and custom options and a set of provided
/// named addreses.
/// named addresses.
/// This collects transitive dependencies for move sources from the provided directory list.
pub fn run_model_builder_with_options<
Paths: Into<MoveSymbol> + Clone,
Expand Down Expand Up @@ -386,7 +386,7 @@ fn script_into_module(compiled_script: CompiledScript) -> CompiledModule {
}
};

// Add a dummy adress if none exists.
// Add a dummy address if none exists.
let dummy_addr = AccountAddress::new([0xff; AccountAddress::LENGTH]);
let dummy_addr_idx = match script
.address_identifiers
Expand Down
10 changes: 5 additions & 5 deletions language/move-model/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ pub struct GlobalEnv {
pub intrinsics: IntrinsicsAnnotation,
/// A type-indexed container for storing extension data in the environment.
extensions: RefCell<BTreeMap<TypeId, Box<dyn Any>>>,
/// The address of the standard and extension libaries.
/// The address of the standard and extension libraries.
stdlib_address: Option<BigUint>,
extlib_address: Option<BigUint>,
}
Expand Down Expand Up @@ -2285,12 +2285,12 @@ impl<'env> ModuleEnv<'env> {
}

/// Converts a constant to the specified type. The type must correspond to the expected
/// cannonical representation as defined in `move_core_types::values`
/// canonical representation as defined in `move_core_types::values`
pub fn get_constant_value(&self, constant: &VMConstant) -> MoveValue {
VMConstant::deserialize_constant(constant).unwrap()
}

/// Return the `AccountAdress` of this module
/// Return the `AccountAddress` of this module
pub fn self_address(&self) -> &AccountAddress {
self.data.module.address()
}
Expand Down Expand Up @@ -3272,7 +3272,7 @@ impl<'env> FunctionEnv<'env> {
self.definition_view().visibility()
}

/// Return true if the function is an entry fucntion
/// Return true if the function is an entry function
pub fn is_entry(&self) -> bool {
self.definition_view().is_entry()
}
Expand Down Expand Up @@ -3308,7 +3308,7 @@ impl<'env> FunctionEnv<'env> {

/// Returns true if the function is a script function
pub fn is_script(&self) -> bool {
// The main function of a scipt is a script function
// The main function of a script is a script function
self.module_env.is_script_module() || self.definition_view().is_entry()
}

Expand Down
2 changes: 1 addition & 1 deletion language/move-model/src/simplifier/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ mod pass_inline;
pub use pass::SpecRewriter;
use pass_inline::SpecPassInline;

/// Available simplifications passes to run after tbe model is built
/// Available simplifications passes to run after the model is built
#[derive(Clone, Debug, Serialize, Deserialize)]
pub enum SimplificationPass {
Inline,
Expand Down
2 changes: 1 addition & 1 deletion language/move-prover/boogie-backend/src/boogie_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1518,7 +1518,7 @@ impl ModelValue {
let struct_name = &boogie_struct_name(struct_env, inst);
let values = self
.extract_list(struct_name)
// It appears sometimes keys are represented witout, sometimes with enclosing
// It appears sometimes keys are represented without, sometimes with enclosing
// bars?
.or_else(|| self.extract_list(&format!("|{}|", struct_name)))?;
struct_env
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ impl<'env> FunctionTranslator<'env> {
.iter()
.cloned()
.map(str_local)
// Add implict dest returns for &mut srcs:
// Add implicit dest returns for &mut srcs:
// f(x) --> x := f(x) if type(x) = &mut_
.chain(
srcs.iter()
Expand Down
2 changes: 1 addition & 1 deletion language/move-prover/bytecode/src/access_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ impl AbsStructType {
self.get_type().into_struct_tag(env)
}

/// Substitue the open types in self.types with caller `type_actuals`
/// Substitute the open types in self.types with caller `type_actuals`
pub fn substitute_footprint(&mut self, type_actuals: &[Type]) {
for t in self.types.iter_mut() {
*t = t.instantiate(type_actuals)
Expand Down
2 changes: 1 addition & 1 deletion language/move-prover/bytecode/src/dataflow_domains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ impl<K: Ord + Clone, V: AbstractDomain + Clone + PartialEq> MapDomain<K, V> {
/// but this is not available in OrdMap for obvious reasons (because entries are shared),
/// so we need to use this pattern here instead.
pub fn update_values(&mut self, mut f: impl FnMut(&mut V)) {
// Commpute the key-values which actually changed. If the change is small, we preserve
// Compute the key-values which actually changed. If the change is small, we preserve
// structure sharing.
let new_values = self
.iter()
Expand Down
14 changes: 7 additions & 7 deletions language/move-prover/bytecode/src/number_operation_analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ impl NumberOperationState {
}
}

fn vector_table_funs_name_propogate_to_dest(callee_name: &str) -> bool {
fn vector_table_funs_name_propagate_to_dest(callee_name: &str) -> bool {
callee_name.contains("borrow")
|| callee_name.contains("borrow_mut")
|| callee_name.contains("pop_back")
Expand All @@ -142,15 +142,15 @@ fn vector_table_funs_name_propogate_to_dest(callee_name: &str) -> bool {
|| callee_name.contains("spec_get")
}

fn vector_funs_name_propogate_to_srcs(callee_name: &str) -> bool {
fn vector_funs_name_propagate_to_srcs(callee_name: &str) -> bool {
callee_name == "contains"
|| callee_name == "index_of"
|| callee_name == "append"
|| callee_name == "push_back"
|| callee_name == "insert"
}

fn table_funs_name_propogate_to_srcs(callee_name: &str) -> bool {
fn table_funs_name_propagate_to_srcs(callee_name: &str) -> bool {
callee_name == "add" || callee_name == "borrow_mut_with_default" || callee_name == "upsert"
}

Expand Down Expand Up @@ -301,7 +301,7 @@ impl<'a> NumberOperationAnalysis<'a> {
let oper_first =
global_state.get_node_num_oper(args[0].node_id());
// First argument is the target vector and the return type has the same NumberOperation type
if vector_table_funs_name_propogate_to_dest(&callee_name) {
if vector_table_funs_name_propagate_to_dest(&callee_name) {
global_state.update_node_oper(*id, oper_first, true);
} else {
global_state.update_node_oper(*id, Bottom, allow_merge);
Expand Down Expand Up @@ -1035,7 +1035,7 @@ impl<'a> TransferFunctions for NumberOperationAnalysis<'a> {
.get_temp_index_oper(cur_mid, cur_fid, srcs[0], baseline_flag)
.unwrap();
// Bitwise is specified explicitly in the fun or struct spec
if vector_table_funs_name_propogate_to_dest(&callee_name) {
if vector_table_funs_name_propagate_to_dest(&callee_name) {
if *first_oper == Bitwise {
// Do not consider the method remove_return_key where the first return value is k
for dest in dests.iter() {
Expand All @@ -1050,7 +1050,7 @@ impl<'a> TransferFunctions for NumberOperationAnalysis<'a> {
let mut second_oper = first_oper;
let mut src_idx = 0;
if module_env.is_std_vector()
&& vector_funs_name_propogate_to_srcs(&callee_name)
&& vector_funs_name_propagate_to_srcs(&callee_name)
{
assert!(srcs.len() > 1);
second_oper = global_state
Expand All @@ -1062,7 +1062,7 @@ impl<'a> TransferFunctions for NumberOperationAnalysis<'a> {
)
.unwrap();
src_idx = 1;
} else if table_funs_name_propogate_to_srcs(&callee_name) {
} else if table_funs_name_propagate_to_srcs(&callee_name) {
assert!(srcs.len() > 2);
second_oper = global_state
.get_temp_index_oper(
Expand Down
4 changes: 2 additions & 2 deletions language/move-prover/bytecode/src/read_write_set_analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -899,8 +899,8 @@ impl ReadWriteSetState {
pub fn normalize(&self, env: &GlobalEnv) -> ReadWriteSet {
let mut analysis_result = ReadWriteSet::new();
self.accesses.iter_paths(|access_path, access| {
let access_pathes = access_path.normalize(env);
for concrete_access_path in access_pathes {
let access_paths = access_path.normalize(env);
for concrete_access_path in access_paths {
analysis_result.add_access_path(concrete_access_path, *access);
}
});
Expand Down
2 changes: 1 addition & 1 deletion language/move-prover/doc/user/docgen.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ decorated as follows:
positives, as the generator does not analyze the syntax right now.

- Identifiers are attempted to resolve against the documented code and on success, hyperlinked to the declaration.
For example, within the `DiemAccount` module, all occurences of `T`, `Self::T`, `DiemAccount::T`, and
For example, within the `DiemAccount` module, all occurrences of `T`, `Self::T`, `DiemAccount::T`, and
`0x1::DiemAccount:T` will resolve into a link to the declaration. This resolution is heuristic and may have
positive and negative false positives. Specifically, it currently does not consider aliases and use-declarations.

Expand Down
2 changes: 1 addition & 1 deletion language/move-prover/interpreter/src/concrete/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,7 @@ impl EvalState {
.cloned()
}

/// Populate a global state with the resources saved by the given memmory label
/// Populate a global state with the resources saved by the given memory label
pub fn register_memory(&self, label: &MemoryLabel, global_state: &mut GlobalState) {
for inst_map in self.saved_memory.get(label).unwrap().values() {
for (inst, account_map) in inst_map {
Expand Down
4 changes: 2 additions & 2 deletions language/move-stdlib/tests/vector_tests.move
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,9 @@ module std::vector_tests {
assert!(index == 1, 1);
}

// index_of will return the index first occurence that is equal
// index_of will return the index first occurrence that is equal
#[test]
fun index_of_nonempty_has_multiple_occurences() {
fun index_of_nonempty_has_multiple_occurrences() {
let v = V::empty();
V::push_back(&mut v, false);
V::push_back(&mut v, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ fn test_malformed_resource() {
let (changeset, _) = sess.finish().unwrap();
storage.apply(changeset).unwrap();

// Execut the second script and make sure it succeeds. This script simply checks
// that the published resource is what we expect it to be. This inital run is to ensure
// Execute the second script and make sure it succeeds. This script simply checks
// that the published resource is what we expect it to be. This initial run is to ensure
// the testing environment is indeed free of errors without external interference.
let mut script_blob = vec![];
s2.serialize(&mut script_blob).unwrap();
Expand Down
4 changes: 2 additions & 2 deletions language/move-vm/runtime/src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,14 +467,14 @@ impl Interpreter {
} else {
Err(self.set_location(PartialVMError::new(StatusCode::UNKNOWN_INVARIANT_VIOLATION_ERROR)
.with_message(
format!("Private/Friend function invokation error, caller: {:?}::{:?}, callee: {:?}::{:?}", caller_id, caller.name(), callee_id, callee.name()),
format!("Private/Friend function invocation error, caller: {:?}::{:?}, callee: {:?}::{:?}", caller_id, caller.name(), callee_id, callee.name()),
)))
}
}
_ => Err(self.set_location(
PartialVMError::new(StatusCode::UNKNOWN_INVARIANT_VIOLATION_ERROR)
.with_message(format!(
"Private/Friend function invokation error caller: {:?}, callee {:?}",
"Private/Friend function invocation error caller: {:?}, callee {:?}",
caller.name(),
callee.name()
)),
Expand Down
8 changes: 4 additions & 4 deletions language/move-vm/runtime/src/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2525,15 +2525,15 @@ struct FunctionInstantiation {
struct StructDef {
// struct field count
field_count: u16,
// `ModuelCache::structs` global table index
// `ModuleCache::structs` global table index
idx: CachedStructIndex,
}

#[derive(Debug)]
struct StructInstantiation {
// struct field count
field_count: u16,
// `ModuelCache::structs` global table index. It is the generic type.
// `ModuleCache::structs` global table index. It is the generic type.
def: CachedStructIndex,
instantiation: Vec<Type>,
}
Expand All @@ -2542,15 +2542,15 @@ struct StructInstantiation {
#[derive(Debug)]
struct FieldHandle {
offset: usize,
// `ModuelCache::structs` global table index. It is the generic type.
// `ModuleCache::structs` global table index. It is the generic type.
owner: CachedStructIndex,
}

// A field instantiation. The offset is the only used information when operating on a field
#[derive(Debug)]
struct FieldInstantiation {
offset: usize,
// `ModuelCache::structs` global table index. It is the generic type.
// `ModuleCache::structs` global table index. It is the generic type.
#[allow(unused)]
owner: CachedStructIndex,
instantiation: Vec<Type>,
Expand Down
4 changes: 2 additions & 2 deletions language/move-vm/runtime/src/move_vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ impl MoveVM {
/// Right now it is the caller's responsibility to ensure cache coherence of the Move VM Loader
/// - When a module gets published in a Move VM Session, and then gets used by another
/// transaction, it will be loaded into the code cache and stay there even if the resulted
/// effects do not get commited back to the storage when the Session ends.
/// effects do not get committed back to the storage when the Session ends.
/// - As a result, if one wants to have multiple sessions at a time, one needs to make sure
/// none of them will try to publish a module. In other words, if there is a module publishing
/// Session it must be the only Session existing.
/// - In general, a new Move VM needs to be created whenever the storage gets modified by an
/// outer envrionment, or otherwise the states may be out of sync. There are a few exceptional
/// outer environment, or otherwise the states may be out of sync. There are a few exceptional
/// cases where this may not be necessary, with the most notable one being the common module
/// publishing flow: you can keep using the same Move VM if you publish some modules in a Session
/// and apply the effects to the storage when the Session ends.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ fn call_missing_item() {
let module = empty_module();
let id = &module.self_id();
let function_name = IdentStr::new("foo").unwrap();
// mising module
// missing module
let move_vm = MoveVM::new(vec![]).unwrap();
let mut remote_view = RemoteStore::new();
let mut session = move_vm.new_session(&remote_view);
Expand Down
4 changes: 2 additions & 2 deletions language/move-vm/types/src/natives/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//! ) -> PartialVMResult<NativeResult>;`
//!
//! arguments are passed with first argument at position 0 and so forth.
//! Popping values from `arguments` gives the aguments in reverse order (last first).
//! Popping values from `arguments` gives the arguments in reverse order (last first).
//! This module contains the declarations and utilities to implement a native
//! function.

Expand Down Expand Up @@ -57,7 +57,7 @@ impl NativeResult {

/// Failed execution. The failure is a runtime failure in the function and not an invariant
/// failure of the VM which would raise a `PartialVMError` error directly.
/// The only thing the funciton can specify is its abort code, as if it had invoked the `Abort`
/// The only thing the function can specify is its abort code, as if it had invoked the `Abort`
/// bytecode instruction
pub fn err(cost: InternalGas, abort_code: u64) -> Self {
NativeResult::Abort { cost, abort_code }
Expand Down
4 changes: 2 additions & 2 deletions language/move-vm/types/src/values/values_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3225,7 +3225,7 @@ impl Value {
* Destructors
*
**************************************************************************************/
// Locals may contain reference values that points to the same cotnainer through Rc, hencing forming
// Locals may contain reference values that points to the same container through Rc, hencing forming
// a cycle. Therefore values need to be manually taken out of the Locals in order to not leak memory.
impl Drop for Locals {
fn drop(&mut self) {
Expand All @@ -3243,7 +3243,7 @@ impl Container {
use Container::*;

match self {
Locals(_) => unreachable!("Should not ba able to visit a Locals container directly"),
Locals(_) => unreachable!("Should not be able to visit a Locals container directly"),
Vec(r) => {
let r = r.borrow();
if visitor.visit_vec(depth, r.len()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ impl InstantiableModule {
/// An AbstractState represents an abstract view of the execution of the
/// Move VM. Rather than considering values of items on the stack or in
/// the locals, we only consider their type, represented by a `AbstractValue`
/// and their availibility, represented by the `BorrowState`.
/// and their availability, represented by the `BorrowState`.
#[derive(Debug, Clone)]
pub struct AbstractState {
/// A Vector of `AbstractValue`s representing the VM value stack
Expand Down
Loading