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

Commit

Permalink
Fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
alxkzmn committed Jun 17, 2024
1 parent e7c5373 commit 3fe45a9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/compiler/setup_inter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl SetupInterpreter {
if !self.setup.get(&id.name()).unwrap().contains_key("final") {
self.interpret_state_decl(
dsym,
&Identifier::from("final"),
&Identifier::new("final", dsym.clone()),
&Statement::Block(dsym.clone(), vec![]),
)
}
Expand Down
7 changes: 5 additions & 2 deletions src/interpreter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ impl<'a, F: Field + Hash> Interpreter<'a, F> {
self.cur_frame.enter_machine(id.name());

for (id, input_value) in input.iter() {
self.cur_frame.set_value(id, &Value::Field(*input_value));
self.cur_frame.set_value(
&Identifier::new(id, dsym.clone()),
&Value::Field(*input_value),
);
}

while next_state.is_some() {
Expand Down Expand Up @@ -232,7 +235,7 @@ impl<'a, F: Field + Hash> Interpreter<'a, F> {
if self.cur_frame.get_state() == "final" {
Some(Statement::StateDecl(
machine_dsym.clone(),
self.cur_frame.get_state().into(),
Identifier::new(self.cur_frame.get_state(), machine_dsym.clone()),
Box::new(Statement::Block(machine_dsym.clone(), vec![])),
))
} else {
Expand Down
8 changes: 8 additions & 0 deletions src/parser/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@ impl Debug for DebugSymRef {
}
}

impl Eq for DebugSymRef {}

impl PartialEq for DebugSymRef {
fn eq(&self, other: &Self) -> bool {
self.start == other.start && self.end == other.end && self.file.name() == other.file.name()
}
}

#[derive(Clone, PartialEq, Eq)]
pub struct Identifier(pub String, pub i32, pub DebugSymRef);
impl Identifier {
Expand Down

0 comments on commit 3fe45a9

Please sign in to comment.