scilla_parser/
transition.rs1use crate::FieldList;
2
3#[derive(Debug, PartialEq)]
4pub struct Transition {
5 pub name: String,
6 pub params: FieldList,
7}
8
9impl Transition {
10 pub fn new(name: &str, params: FieldList) -> Self {
11 Self {
12 name: name.to_string(),
13 params,
14 }
15 }
16
17 pub fn new_without_param(name: &str) -> Self {
18 Self {
19 name: name.to_string(),
20 params: FieldList::default(),
21 }
22 }
23}
24
25#[derive(Debug, PartialEq, Default)]
26pub struct TransitionList(pub Vec<Transition>);
27
28impl std::ops::Deref for TransitionList {
29 type Target = Vec<Transition>;
30
31 fn deref(&self) -> &Self::Target {
32 &self.0
33 }
34}
35
36impl std::ops::DerefMut for TransitionList {
37 fn deref_mut(&mut self) -> &mut Self::Target {
38 &mut self.0
39 }
40}