Skip to content

Commit

Permalink
rename executable to simplac
Browse files Browse the repository at this point in the history
  • Loading branch information
FilippoRanza committed Oct 20, 2020
1 parent 493adf4 commit 32a35ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "simpla"
name = "simplac"
version = "0.1.0"
authors = ["Filippo Ranza <filipporanza@gmail.com>"]
edition = "2018"
Expand Down
9 changes: 7 additions & 2 deletions src/semantic_analysis/stat_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fn stat_check<'b, 'a: 'b>(
syntax_tree::StatType::IfStat(if_stat) => {
check_if_stat(if_stat, table, contex, loop_contex, &stat.loc)
}
syntax_tree::StatType::ReadStat(read_stat) => check_read_stat(read_stat, table),
syntax_tree::StatType::ReadStat(read_stat) => check_read_stat(read_stat, table, loop_contex),
syntax_tree::StatType::ReturnStat(return_stat) => {
check_return_stat(return_stat, table, contex, &stat.loc)
}
Expand Down Expand Up @@ -69,7 +69,7 @@ enum CheckStatus {
Failure,
}

struct LoopContext<'a> {
struct LoopContext<'a> {
indexes: HashSet<&'a str>,
nested_loops: usize,
}
Expand Down Expand Up @@ -220,9 +220,14 @@ fn check_if_stat<'b, 'a: 'b>(
fn check_read_stat<'a>(
read_stat: &'a syntax_tree::IdList,
table: &'a LocalVariableTable,
contex: &LoopContext
) -> Result<(), SemanticError<'a>> {
for id in read_stat {
table.get_variable(id)?;
match contex.check_assign(id) {
CheckStatus::Success => {},
CheckStatus::Failure => {}
}
}
Ok(())
}
Expand Down

0 comments on commit 32a35ae

Please sign in to comment.