-
Notifications
You must be signed in to change notification settings - Fork 3
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
Implement a basic decoder #2
base: main
Are you sure you want to change the base?
Conversation
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.
Heroic effort! Thank you!! I've left some notes inline
Could you also use variables to avoid ever having case case
and to avoid complex operators split over multiple lines. Thank you
// } | ||
// _ -> False | ||
// } | ||
// } |
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.
How come this code is commented out?
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.
Their encoded yaml and the encoded yaml returned from cymbal don't match so no tests are passing there atm. It will need some tweaking but it's just commented so I could work on the other tests in the meantime. I will get to it at some point but I haven't been able to because of school/work
I wonder if implementing the restricted subset StrictYAML would be preferrable. It is of course up to the author but the implicit behaviors that comes from the yaml 1.2 and 1.1 spec could be argued shouldn't be implemented not that we have the chance. |
This pull requests implements a basic YAML decoder for issue #1 that should cover most standard YAML documents. A feature list can be found below. It should be sufficient to cover many common yaml files like docker-compose files and kubernetes configs.
The YAML test suite in the test directory has a preliminary implementation but is commented out as the encoded output of a cymbal yaml object does not match the expected output.
Basic Syntax
#
)Data Types
|
)>
)true
/false
null
~
Collections
-
)[ ]
):
){ }
)Advanced Features
&
)*
)<<
!!
)Directives
%YAML
)%TAG
)Document Markers
---
)...
)Flow Styles
{key1: value1, key2: value2}
)[item1, item2, item3]
)Special Features
!mytag
)!!binary
)