Skip to content

Commit 9746eae

Browse files
committed
Fixed graphviz bug for transitions that happen in loops not generating properly.
1 parent 72815f5 commit 9746eae

File tree

25 files changed

+67
-62
lines changed

25 files changed

+67
-62
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frame_build/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "frame_build"
3-
version = "0.11.4"
3+
version = "0.11.5"
44
authors = ["Eric Walkingshaw <[email protected]>"]
55
edition = "2018"
66

framec/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "framec"
3-
version = "0.11.4"
3+
version = "0.11.5"
44
authors = ["Mark Truluck <[email protected]>"]
55
edition = "2018"
66

framec/src/frame_c/compiler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use std::convert::TryFrom;
3535
/* --------------------------------------------------------------------- */
3636

3737
static IS_DEBUG: bool = false;
38-
static FRAMEC_VERSION: &str = "Emitted from framec_v0.11.2";
38+
static FRAMEC_VERSION: &str = "Emitted from framec_v0.11.5";
3939

4040
/* --------------------------------------------------------------------- */
4141

framec/src/frame_c/visitors/graphviz_visitor.rs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,6 +1424,50 @@ impl AstVisitor for GraphVizVisitor {
14241424

14251425
//* --------------------------------------------------------------------- *//
14261426

1427+
fn visit_loop_stmt_node(&mut self, loop_stmt_node: &LoopStmtNode) {
1428+
match &loop_stmt_node.loop_types {
1429+
LoopStmtTypes::LoopForStmt {
1430+
loop_for_stmt_node: loop_for_expr_node,
1431+
} => {
1432+
loop_for_expr_node.accept(self);
1433+
}
1434+
LoopStmtTypes::LoopInStmt { loop_in_stmt_node } => {
1435+
loop_in_stmt_node.accept(self);
1436+
}
1437+
LoopStmtTypes::LoopInfiniteStmt {
1438+
loop_infinite_stmt_node,
1439+
} => {
1440+
loop_infinite_stmt_node.accept(self);
1441+
}
1442+
}
1443+
}
1444+
1445+
//* --------------------------------------------------------------------- *//
1446+
1447+
fn visit_loop_for_stmt_node(&mut self, loop_for_expr_node: &LoopForStmtNode) {
1448+
// only call if there are statements
1449+
if loop_for_expr_node.statements.len() != 0 {
1450+
self.visit_decl_stmts(&loop_for_expr_node.statements);
1451+
}
1452+
}
1453+
1454+
//* --------------------------------------------------------------------- *//
1455+
1456+
fn visit_loop_in_stmt_node(&mut self, loop_in_stmt_node: &LoopInStmtNode) {
1457+
// only call if there are statements
1458+
if loop_in_stmt_node.statements.len() != 0 {
1459+
self.visit_decl_stmts(&loop_in_stmt_node.statements);
1460+
}
1461+
}
1462+
1463+
//* --------------------------------------------------------------------- *//
1464+
1465+
fn visit_loop_infinite_stmt_node(&mut self, loop_in_expr_node: &LoopInfiniteStmtNode) {
1466+
self.visit_decl_stmts(&loop_in_expr_node.statements);
1467+
}
1468+
1469+
//* --------------------------------------------------------------------- *//
1470+
14271471
fn visit_bool_test_conditional_branch_node(
14281472
&mut self,
14291473
bool_test_true_branch_node: &BoolTestConditionalBranchNode,

framec_tests/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "framec_tests"
3-
version = "0.11.4"
3+
version = "0.11.5"
44
authors = ["Eric Walkingshaw <[email protected]>", "Fernando De la Garza <[email protected]>"]
55
edition = "2018"
66

framec_tests/python/src/basic/basic.frm

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11

2-
```
3-
from framelang.framelang import FrameEvent
4-
```
52
#[codegen.python.code.public_state_info:bool="true"]
63

74
#Basic

framec_tests/python/src/branch/branch.frm

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
```
2-
from framelang.framelang import FrameEvent
3-
```
1+
42
#[codegen.python.code.public_state_info:bool="true"]
53

64
#Branch

framec_tests/python/src/enum_case/enum_case.frm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
```
2-
from framelang.framelang import FrameEvent
32
from enum import Enum
43
```
54
#[codegen.python.code.public_state_info:bool="true"]

framec_tests/python/src/event_handler/event_handler.frm

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11

2-
```
3-
from framelang.framelang import FrameEvent
4-
```
52
#[codegen.python.code.public_state_info:bool="true"]
63

74

0 commit comments

Comments
 (0)