When writing a machine with the yed graph editor, we can use line returns to have the names of control states, or the labels for guards and actions fit in the graphical shape that we are using.
Those non-printable characters can lead to malform JavaScript when compiling, and anyways be less user-friendly on the API user side, as an API user would have to have exactly the same name including the non-printable characters. That is not so practical, nor readable inside a JS code base.
So the idea here is to:
replace \n and \r (I doubt yed will allow the insertion of any other non-printable) by spaces
remove extra spaces (not just at the end and begin of strings, but also inside)
This sould give simple and ergonomic rules for mapping labels in the graph to their implementing JavaScript function.
Also:
just like yed2kingly does, as a helper, it woudl be great to add comments that are precisely preformatted code that can be copy paste to make the guards and actions.
This links to https://github.com/brucou/slim/issues/1
When writing a machine with the yed graph editor, we can use line returns to have the names of control states, or the labels for guards and actions fit in the graphical shape that we are using.
Those non-printable characters can lead to malform JavaScript when compiling, and anyways be less user-friendly on the API user side, as an API user would have to have exactly the same name including the non-printable characters. That is not so practical, nor readable inside a JS code base.
So the idea here is to:
This sould give simple and ergonomic rules for mapping labels in the graph to their implementing JavaScript function.
Also: