-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SCXML and YAML Codecs #26
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
skbolton
commented
Aug 2, 2020
|
||
defp process_event({:start_element, "statechart", statechart}, nil) do | ||
extract_attributes(statechart, %{"name" => :name}) | ||
|> Map.merge(extract_attributes(Map.get(statechart, "root"), %{"initial" => :initial})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should put better docs here. The top level of yaml is weird because we need keys from both statechart
and root
There are a few issues here that I want to fix. Don't merge this just yet. |
skbolton
force-pushed
the
schema
branch
4 times, most recently
from
August 4, 2020 17:07
54544d8
to
04930ed
Compare
* create `Schema.Root` * create `Schema.State` * create `Schema.Transition`
This is the inital pass at the codec. Most state parsing is handled but a few things will happen in later work: * Datamodel handling * History handling
This has feature parity with the SCXML parser as of this commit. * Add YamlElixir library * Create walker module to mimic behaviour of xml parser
We can use this function to test out our parsing of schemas and transitions of the machines. This is not a long term function to have in the api.
johnnyt
approved these changes
Aug 4, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sorry there is a lot here but I figured I would just get everything cleaned up and off my machine.
This adds the yaml and scxml parsers. I did decide to change the name to Codec because it grew on me. The
Statifier.Schema
API is not perfect as of right now but I think it is good enough to move on. Really only people writingCodec
s will care about how to work with the Schema so its basically an internal detail that we can clean up over time. I also plan in the future to add more tests to all of this when I start doing more of the machine api.