Skip to content

Commit

Permalink
Fix exit function for transient states.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan-Michaels-Bose committed Oct 21, 2016
1 parent 0254160 commit f7fa1f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Semantics/Operation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ allHandlers g = fromList $
finalStates :: Gr EnterExitState Happening -> [Node]
finalStates g = nodes g \\
do (n, EnterExitState {st=st@(State _)}) <- states
(Event _, Just (st', ev')) <- toList $ Map.map (! st) ahs
(e, Just (st', ev')) <- toList $ Map.map (! st) ahs
guard $ canTransition e
(m, EnterExitState {st=st''}) <- states
guard $ st' == st''
(_, _, Happening {flags}) <- out g m
Expand All @@ -84,3 +85,6 @@ finalStates g = nodes g \\
where
ahs = allHandlers g
states = labNodes g
canTransition EventEnter = True
canTransition (Event _) = True
canTransition _ = False
4 changes: 3 additions & 1 deletion examples/showoff.smudge
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
[
_ -(SM3."External")-> B
],
D --> A,
B (@enterB)
[
"Whee" --> C,
Expand All @@ -17,7 +18,8 @@
* C
[
Beedoo --> A,
GoB -(@gob)-> B
GoB -(@gob)-> B,
something --> D
]
}

Expand Down

0 comments on commit f7fa1f2

Please sign in to comment.