Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
FTRobbin committed Nov 6, 2024
1 parent a593155 commit dc42cd3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 28 deletions.
7 changes: 2 additions & 5 deletions src/ast/desugar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,7 @@ pub(crate) fn desugar_command(
Command::Include(span, file) => {
let s = std::fs::read_to_string(&file)
.unwrap_or_else(|_| panic!("{span} Failed to read file {file}"));
return desugar_program(
parse_program(Some(file), &s)?,
symbol_gen
);
return desugar_program(parse_program(Some(file), &s)?, symbol_gen);
}
Command::Rule {
ruleset,
Expand Down Expand Up @@ -328,7 +325,7 @@ fn desugar_simplify(
variants: 0,
expr: Expr::Var(span.clone(), lhs),
},
symbol_gen
symbol_gen,
)
.unwrap(),
);
Expand Down
4 changes: 2 additions & 2 deletions src/ast/remove_globals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,13 @@ impl<'a> GlobalRemover<'a> {
ruleset,
rule: new_rule,
}]
},
}
//Handle the corner case where a global command is wrap in (fail )
GenericNCommand::Fail(span, cmd) => {
let mut removed = self.remove_globals_cmd(*cmd);
let last = removed.pop().unwrap();
let boxed_last = Box::new(last);
let new_command = GenericNCommand::Fail (span, boxed_last);
let new_command = GenericNCommand::Fail(span, boxed_last);
removed.push(new_command);
removed
}
Expand Down
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1406,8 +1406,7 @@ impl EGraph {
}

fn process_command(&mut self, command: Command) -> Result<Vec<ResolvedNCommand>, Error> {
let program =
desugar::desugar_program(vec![command], &mut self.symbol_gen)?;
let program = desugar::desugar_program(vec![command], &mut self.symbol_gen)?;

let program = self
.type_info
Expand Down
2 changes: 1 addition & 1 deletion src/typechecking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ impl TypeInfo {
GenericAction::Set(_, _, _, Expr::Call(_, symbol, _)) => {
return Err(TypeError::LookupInRuleDisallowed(*symbol, span.clone()));
}
_ => ()
_ => (),
}
}

Expand Down
18 changes: 0 additions & 18 deletions tests/looking_up_global.rs

This file was deleted.

0 comments on commit dc42cd3

Please sign in to comment.