fixed sync.svg
authorEdouard Tisserant <edouard@pep-project.org>
Tue, 18 Apr 2017 16:40:32 +0200
changeset 1709dcebe0692d63
parent 1707 6c6e4315ba6f
child 1710 990bd6357969
child 1711 39ee8370648b
fixed sync.svg
sync/fsm.yml2
sync/gen_dot.ysl2
sync/gen_statemachine.ysl2
     1.1 --- a/sync/fsm.yml2	Thu Mar 30 17:32:55 2017 +0200
     1.2 +++ b/sync/fsm.yml2	Tue Apr 18 16:40:32 2017 +0200
     1.3 @@ -14,5 +14,6 @@
     1.4  decl transition @target, go is transition;
     1.5  decl action @name, do is action;
     1.6  decl condition @name, if is condition;
     1.7 +decl alternative, else is alternative;
     1.8  decl interface @name;
     1.9  decl tag @name (id);
     2.1 --- a/sync/gen_dot.ysl2	Thu Mar 30 17:32:55 2017 +0200
     2.2 +++ b/sync/gen_dot.ysl2	Tue Apr 18 16:40:32 2017 +0200
     2.3 @@ -21,9 +21,10 @@
     2.4  
     2.5      template "event" {
     2.6          param "state";
     2.7 +        const "transitions", "transition|descendant::condition/transition|descendant::alternative/transition";
     2.8          choose {
     2.9 -            when "count(transition) > 0"
    2.10 -                apply "transition|condition/transition", 0
    2.11 +            when "count($transitions) > 0"
    2.12 +                apply "$transitions", 0
    2.13                      with "state", "$state", with "event", "@name";
    2.14              otherwise
    2.15                  if "@name != 'Init'"
     3.1 --- a/sync/gen_statemachine.ysl2	Thu Mar 30 17:32:55 2017 +0200
     3.2 +++ b/sync/gen_statemachine.ysl2	Tue Apr 18 16:40:32 2017 +0200
     3.3 @@ -346,10 +346,10 @@
     3.4          |> if (cond_result) {
     3.5          apply "action|transition|condition";
     3.6          |> }
     3.7 -        const "else", "./following-sibling::*[position()=1][name(.)='else']";
     3.8 -        if "$else" {
     3.9 +        const "alternative", "./following-sibling::*[position()=1][name(.)='alternative']";
    3.10 +        if "$alternative" {
    3.11          |> else {
    3.12 -        apply "$else/action|$else/transition|$else/condition";
    3.13 +        apply "$alternative/action|$alternative/transition|$alternative/condition";
    3.14          |> }
    3.15          }
    3.16          | }