Skip to content

Commit

Permalink
Fixed graphviz bug for transitions that happen in loops not generatin…
Browse files Browse the repository at this point in the history
…g properly.
  • Loading branch information
cogiton committed Apr 25, 2024
1 parent 72815f5 commit 9746eae
Show file tree
Hide file tree
Showing 25 changed files with 67 additions and 62 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frame_build/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "frame_build"
version = "0.11.4"
version = "0.11.5"
authors = ["Eric Walkingshaw <eric.walkingshaw@savant.com>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion framec/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "framec"
version = "0.11.4"
version = "0.11.5"
authors = ["Mark Truluck <mark@frame-lang.org>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion framec/src/frame_c/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use std::convert::TryFrom;
/* --------------------------------------------------------------------- */

static IS_DEBUG: bool = false;
static FRAMEC_VERSION: &str = "Emitted from framec_v0.11.2";
static FRAMEC_VERSION: &str = "Emitted from framec_v0.11.5";

/* --------------------------------------------------------------------- */

Expand Down
44 changes: 44 additions & 0 deletions framec/src/frame_c/visitors/graphviz_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1424,6 +1424,50 @@ impl AstVisitor for GraphVizVisitor {

//* --------------------------------------------------------------------- *//

fn visit_loop_stmt_node(&mut self, loop_stmt_node: &LoopStmtNode) {
match &loop_stmt_node.loop_types {
LoopStmtTypes::LoopForStmt {
loop_for_stmt_node: loop_for_expr_node,
} => {
loop_for_expr_node.accept(self);
}
LoopStmtTypes::LoopInStmt { loop_in_stmt_node } => {
loop_in_stmt_node.accept(self);
}
LoopStmtTypes::LoopInfiniteStmt {
loop_infinite_stmt_node,
} => {
loop_infinite_stmt_node.accept(self);
}
}
}

//* --------------------------------------------------------------------- *//

fn visit_loop_for_stmt_node(&mut self, loop_for_expr_node: &LoopForStmtNode) {
// only call if there are statements
if loop_for_expr_node.statements.len() != 0 {
self.visit_decl_stmts(&loop_for_expr_node.statements);
}
}

//* --------------------------------------------------------------------- *//

fn visit_loop_in_stmt_node(&mut self, loop_in_stmt_node: &LoopInStmtNode) {
// only call if there are statements
if loop_in_stmt_node.statements.len() != 0 {
self.visit_decl_stmts(&loop_in_stmt_node.statements);
}
}

//* --------------------------------------------------------------------- *//

fn visit_loop_infinite_stmt_node(&mut self, loop_in_expr_node: &LoopInfiniteStmtNode) {
self.visit_decl_stmts(&loop_in_expr_node.statements);
}

//* --------------------------------------------------------------------- *//

fn visit_bool_test_conditional_branch_node(
&mut self,
bool_test_true_branch_node: &BoolTestConditionalBranchNode,
Expand Down
2 changes: 1 addition & 1 deletion framec_tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "framec_tests"
version = "0.11.4"
version = "0.11.5"
authors = ["Eric Walkingshaw <eric.wakingshaw@savant.com>", "Fernando De la Garza <fernando.delagarza@savant.com>"]
edition = "2018"

Expand Down
3 changes: 0 additions & 3 deletions framec_tests/python/src/basic/basic.frm
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@

```
from framelang.framelang import FrameEvent
```
#[codegen.python.code.public_state_info:bool="true"]

#Basic
Expand Down
4 changes: 1 addition & 3 deletions framec_tests/python/src/branch/branch.frm
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
```
from framelang.framelang import FrameEvent
```

#[codegen.python.code.public_state_info:bool="true"]

#Branch
Expand Down
1 change: 0 additions & 1 deletion framec_tests/python/src/enum_case/enum_case.frm
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
```
from framelang.framelang import FrameEvent
from enum import Enum
```
#[codegen.python.code.public_state_info:bool="true"]
Expand Down
3 changes: 0 additions & 3 deletions framec_tests/python/src/event_handler/event_handler.frm
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@

```
from framelang.framelang import FrameEvent
```
#[codegen.python.code.public_state_info:bool="true"]


Expand Down
4 changes: 1 addition & 3 deletions framec_tests/python/src/forward_events/forward_events.frm
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
```
from framelang.framelang import FrameEvent
```

#[codegen.python.code.public_state_info:bool="true"]

#ForwardEvents
Expand Down
4 changes: 1 addition & 3 deletions framec_tests/python/src/handler_calls/handler_calls.frm
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
```
from framelang.framelang import FrameEvent
```

#[codegen.python.code.public_state_info:bool="true"]

#HandlerCalls
Expand Down
4 changes: 1 addition & 3 deletions framec_tests/python/src/hierarchical/hierarchical.frm
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
```
from framelang.framelang import FrameEvent
```

#[codegen.python.code.public_state_info:bool="true"]

#Hierarchical
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
```
from framelang.framelang import FrameEvent
```

#[codegen.python.code.public_state_info:bool="true"]

#HierarchicalGuard
Expand Down
4 changes: 1 addition & 3 deletions framec_tests/python/src/match/match.frm
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
```
from framelang.framelang import FrameEvent
```

#[codegen.python.code.public_state_info:bool="true"]

#Match
Expand Down
4 changes: 1 addition & 3 deletions framec_tests/python/src/naming/naming.frm
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
```
from framelang.framelang import FrameEvent
```

#[codegen.python.code.public_state_info:bool="true"]

#Naming
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
```
from framelang.framelang import FrameEvent
```

#[codegen.python.code.public_state_info:bool="true"]

#SimpleHandlerCalls
Expand Down
4 changes: 1 addition & 3 deletions framec_tests/python/src/state_context/state_context.frm
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
```
from framelang.framelang import FrameEvent
```

#[codegen.python.code.public_state_info:bool="true"]


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
```
from framelang.framelang import FrameEvent
```

#[codegen.python.code.public_state_info:bool="true"]

#StateContextStack
Expand Down
4 changes: 1 addition & 3 deletions framec_tests/python/src/state_params/state_params.frm
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
```
from framelang.framelang import FrameEvent
```

#[codegen.python.code.public_state_info:bool="true"]

#StateParams
Expand Down
4 changes: 1 addition & 3 deletions framec_tests/python/src/state_stack/state_stack.frm
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
```
from framelang.framelang import FrameEvent
```

#[codegen.python.code.public_state_info:bool="true"]

#StateStack
Expand Down
4 changes: 1 addition & 3 deletions framec_tests/python/src/state_vars/state_vars.frm
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
```
from framelang.framelang import FrameEvent
```

#[codegen.python.code.public_state_info:bool="true"]
#[codegen.python.code.public_compartment:bool="true"]

Expand Down
4 changes: 1 addition & 3 deletions framec_tests/python/src/transition/transition.frm
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
```
from framelang.framelang import FrameEvent
```

#[codegen.python.code.public_state_info:bool="true"]

#TransitionSm
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
```
from framelang.framelang import FrameEvent
```

#[codegen.python.code.public_state_info:bool="true"]

#TransitParams
Expand Down
4 changes: 1 addition & 3 deletions framec_tests/python/src/var_scope/var_scope.frm
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
```
from framelang.framelang import FrameEvent
```

#[codegen.python.code.public_state_info:bool="true"]

#VarScope
Expand Down

0 comments on commit 9746eae

Please sign in to comment.