Skip to content

Commit

Permalink
Fix some typos reported by codespell
Browse files Browse the repository at this point in the history
  • Loading branch information
dburgener committed Nov 27, 2024
1 parent 51e9590 commit a3ca2d4
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ impl Virtualable for FuncDecl {
pub struct IfBlock {
pub keyword_range: Range<usize>,
// TODO: boolean expression
// TODO: populate statments
// TODO: populate statements
pub if_statements: Vec<Statement>,
pub else_statements: Vec<Statement>,
}
Expand Down
14 changes: 7 additions & 7 deletions src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ pub fn validate_machines<'a>(
_ => {
errors.append(CascadeErrors::from(
ErrorItem::make_compile_or_internal_error(
&format!("{} is not a supprted configuration", c.name.as_ref()),
&format!("{} is not a supported configuration", c.name.as_ref()),
Some(file),
c.name.get_range(),
&format!(
Expand Down Expand Up @@ -1318,7 +1318,7 @@ pub fn get_reduced_infos(
ret.into_result(WithWarnings::new(new_cil_tree, warnings))
}

// This is a recusive function that gets only the relevant types from the type map.
// This is a recursive function that gets only the relevant types from the type map.
// The reduced types are the types in the module and the types in any of that modules' child modules.
// Parents of those types are also automatically included.
// The types are cloned so that each machine TypeMap can own its own types.
Expand Down Expand Up @@ -1463,7 +1463,7 @@ fn get_all_function_names(
ret
}

// If a type couldn't be organized, it is either a cycle or a non-existant parent somewhere
// If a type couldn't be organized, it is either a cycle or a non-existent parent somewhere
// The claim that a type must have at least one parent is enforced by the parser
// This function walks the tree from a given type and determines which of these cases we are in
// Return a Vector of found errors. This Vector can be empty in internal calls, but should not be
Expand Down Expand Up @@ -1609,8 +1609,8 @@ fn create_synthetic_resource(
new_decl.is_extension = false;
// The synthetic resource keeps some, but not all annotations from its parent.
// Specifically, Makelist and derive are kept from the parent
// TODO: This would be cleaner if we convert to AnnotationInfos first and implent the logic as
// a member funtion in AnnotationInfo
// TODO: This would be cleaner if we convert to AnnotationInfos first and implement the logic as
// a member function in AnnotationInfo
// See https://github.com/dburgener/cascade/pull/39#discussion_r999510493 for fuller discussion
new_decl.annotations.annotations = classes
.iter()
Expand Down Expand Up @@ -2058,7 +2058,7 @@ fn organize_type_map(types: &TypeMap) -> Result<Vec<&TypeInfo>, CascadeErrors> {
}
}
if current_pass_types.is_empty() && !tmp_types.is_empty() {
// We can't satify the parents for all types
// We can't satisfy the parents for all types
return Err(generate_type_no_parent_errors(
tmp_types.values().copied().collect(),
types,
Expand Down Expand Up @@ -2589,7 +2589,7 @@ mod tests {

let _type_vec = organize_type_map(&types).unwrap();

// TODO: reenable this. The built in sid types break the ordering assumptions here
// TODO: re-enable this. The built in sid types break the ordering assumptions here
// Once they have been removed, the below checks should work again
// Skip built in types
//assert_eq!(type_vec[type_vec.len() - 3].name, "foo");
Expand Down
2 changes: 1 addition & 1 deletion src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl<'a> Context<'a> {
}

// Returns whether a symbol refers to a list. If the symbol does not exist, returns false.
// Use symbol_in_context to determine existance
// Use symbol_in_context to determine existence
pub fn symbol_is_list(&self, arg: &str) -> bool {
let arg = self.convert_arg_this(arg);
match self.symbols.get(&CascadeString::from(&arg as &str)) {
Expand Down
4 changes: 2 additions & 2 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ pub enum ErrorItem {
Internal(#[from] InternalError),
#[error("Parsing error: {0}")]
Parse(#[from] ParseError),
// TODO: Replace IO() with semantic errors wraping io::Error.
// TODO: Replace IO() with semantic errors wrapping io::Error.
#[error("I/O error: {0}")]
IO(#[from] io::Error),
#[error("Invalid machine error: {0}")]
Expand Down Expand Up @@ -341,7 +341,7 @@ impl CascadeErrors {

/// Enables to easily stop a workflow after a failed major step. This is
/// useful to avoid accumulating more errors that may be hard to understand
/// because of unsatisfied prerequiste.
/// because of unsatisfied prerequisite.
///
/// For a multi-step workflow, it works as follow:
/// 1. creates an accumulator with `let mut errors = CascadeErrors::new();`
Expand Down
8 changes: 4 additions & 4 deletions src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ fn is_collapsed_class(class: &str) -> bool {
["capability", "process", "cap_userns"].contains(&class)
}

// TODO: This can be converted into a TryFrom for more compile time gaurantees
// TODO: This can be converted into a TryFrom for more compile time guarantees
// Returns a set of AV Rules, because one Cascade allow() call could generate multiple CIL level AV
// rules, for example when intermixing capability and capability2 permissions
fn call_to_av_rule<'a>(
Expand Down Expand Up @@ -2641,7 +2641,7 @@ impl From<&DeferredStatement> for sexp::Sexp {
// unambiguously resolvable
//
// A DeferredCall inside a function, generates a DeferredCall in the parent, which may propagate up
// until the symbol we are deferring on is unambigously resolvable.
// until the symbol we are deferring on is unambiguously resolvable.
// Functions calls are resolvable if we can unambiguously assign one function name to them. A
// function call using an argument (eg "source.read()", where "source" is an argument name) can't
// be unambiguously resolved (even if the function has only one caller, there may be
Expand Down Expand Up @@ -3617,7 +3617,7 @@ fn validate_argument_error_handler(
func_map: Option<&FunctionMap>,
) -> ErrorItem {
// If func_info is none, which means we are validating a built in and cannot be an associated call,
// or the call is not an asociated one fall through and return the "standard" error.
// or the call is not an associated one fall through and return the "standard" error.
// If this is the associated call we need to do some more digging to give the user a better
// error message.
// Unwraps of func_info are safe in this block because of the false return on map_or
Expand Down Expand Up @@ -3842,7 +3842,7 @@ pub fn initialize_terminated<'a>(
// Context it is called in and FunctionMap (all FunctionInfos).
// If the function call needs to be cast this will handle that. This function will not
// validate the cast that is done else where.
// If the function call has a "this" class or no class, it will substitue the class of
// If the function call has a "this" class or no class, it will substitute the class of
// the caller
// Lastely if the function is type aliased this function will resolve the alias.
fn resolve_true_cil_name(
Expand Down
2 changes: 1 addition & 1 deletion src/parser.lalrpop
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ PortRange: Port = {
}

Port: Port = {
<start: @L> <p: PortRegex> <end: @R> => Port::new(p.parse().unwrap(), Some(start..end)) // TODO: report parse error instead of panicing
<start: @L> <p: PortRegex> <end: @R> => Port::new(p.parse().unwrap(), Some(start..end)) // TODO: report parse error instead of panicking
}

IPAddr: AstIpAddr = {
Expand Down
2 changes: 1 addition & 1 deletion src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ fn permissions_test() {
"(allow foo foo (capability2 (wake_alarm)))",
"(allow foo bar (file (all)))",
],
&["(capabilty (mac_override", "(capability (wake_alarm"],
&["(capability (mac_override", "(capability (wake_alarm"],
0,
);
}
Expand Down

0 comments on commit a3ca2d4

Please sign in to comment.