Skip to content

Commit

Permalink
Simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
dziegel committed Jan 9, 2024
1 parent d698a87 commit 97392b2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions generator/src/generator/ScxmlModel.egl
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,18 @@ operation t_state getModel(sm : Tuple) : Tuple {
}

result.transitions = new List();
for (transition in self.c_transition.sortBy(t | t.getSortKey())) {
transition.getModel(sm, result, result.transitions);
for (transition in self.c_transition.sortBy(t | t.getSortKey())) {
var t = transition.getModel();
t.start = result.name;
result.transitions.add(t);
}

return result;
}

operation t_transition getModel(sm : Tuple, state : Tuple, transitions : List) : Tuple {
operation t_transition getModel() : Tuple {
var result = new Tuple();

result.start = state.name;
result.target = self.a_target;
result.internal = (self.a_type = "internal");
result.trigger = self.a_event;
Expand All @@ -77,7 +78,7 @@ operation t_transition getModel(sm : Tuple, state : Tuple, transitions : List) :
result.guards.add(self.a_cond);
}

transitions.add(result);
return result;
}

operation t_transition getSortKey() : String {
Expand Down

0 comments on commit 97392b2

Please sign in to comment.