Releases: saphyr-rs/saphyr
Releases Β· saphyr-rs/saphyr
v0.0.6
Important note
This release contains an important fix for the YamlEmitter in saphyr for a bug that was introduced in v0.0.5 (#51).
If you use tags and have updated to v0.0.5, please update to v0.0.6 asap (no breaking change).
saphyr-parser
Fixes:
- Fix emitting of tags with empty handles.
!tagno longer emits as!!tag.
saphyr
Fixes:
- #51: Fix indent when emitting tagged collections.
v0.0.5
saphyr
Breaking Changes:
- 234c69c..374d892: Use
Cows forTags - Perform parsing of scalars with unknown tags according to the core schema. Previously,
!foo 42would yield aScalar::String("42")because the tag wasn't known. It will now yield aScalar::Integer(42).!!str 42will still yield aScalar::String. - Parsing a scalar with an unknown Core Schema tag (e.g.:
!!unknown) now results in aBadValuerather than aString. - Expose custom YAML tags as a variant of
Yaml/YamlDataobjects. The biggest pain point for existing users is probably the inclusion ofYaml::Tagged, which will break existingmatches onYaml. Details about howsaphyrhandles YAML tags can be found on the library documentation. - Add
into_taggedas aLoadableYamlNoderequirement.
Features:
- c0e8b8c and f4ab733: Add
Fromimplementations to convert between owned and borrowed versions ofYamlandScalar. parse_core_schema_fpfor parsing floating point values according to the YAML core schema.- Support for custom tags.
Fixes:
- 3bbe423: No longer parse any capitalization of
inf, orinfinityasf64::INFINITY - e88eeae: Parse
.NaNas float instead ofNaN. - Lower
Cargo.toml'srust-versionto1.65.0, as stated in the documentation.
saphyr-parser
Breaking Changes:
- Emit
Cow<'input, Tag>instead ofTagto avoid copies.
Fixes:
- 8ef76dc: Fix
Markers fornulland empty values. - Fix
Spans for collections to correctly mark the end of the collection.
Changes
- Exclude
yaml-test-suitefrom the Cargo package. - Bump
libtest-mimicto0.8.1.
v0.0.4
saphyr
Breaking Changes:
- Allow
Yamlto borrow from the input. - All indexing traits now panic if the key is not found or the YAML variant is incorrect. This helps in making the behavior of
[]more consistent across all operations. - Use
Mappinginstead ofHashto refer to YAML mappings. - Use
Sequenceinstead ofArrayto refer to YAML sequences.
Methods to access sequences usingvecinstead ofarraystill exist.
Another method usingsequencehas been added. as_f64->as_floating_point,as_i64->as_integer- Reworked
YamlandYamlData- They now have a
Valueand aRepresentationvariants for scalars.
Representationholds the raw characters from the input (pre-parsing) whileValueholds the parsed value. Infoo: 3,Representationwould hold"foo"and"3"(both as strings) whileValuewould hold"foo"and3. - The idea behind this is to allow lazy-parsing of scalar nodes and to give more control about key duplication detection in mappings (e.g.: is
{ 0xB: ~, 11: ~ }considered a duplicate because0xB == 11?).
- They now have a
- Rename
from_strtovalue_from_strto better highlight it:- Doesn't load a YAML document
- Doesn't always load into a YAML string
load_from_*functions now belong to theLoadableYamlNodetrait to avoid implementing them in each YAML node type. It is now required to importLoadableYamlNodeto use these functions (LSPs should have a fixit for it).
Features:
- Add the following convenience methods to the YAML objects:
contains_mapping_keyas_mapping_getas_mapping_get_mut
- Add many more conversion methods (
as_*,as_*_mut,into_*, ...). - Use
ordered-floatto store floating point values in scalars. This allows using floating point values in mappings, with the caveats listed in the crate description (#18).
TheOrderedFloats are kept within theScalarobject and conversion methods do not expose them. - Add
YamlDataOwned, an owned version ofYamlDatafor when lifetimes are not required. - Add
MarkedYamlOwned, an owned version ofMarkedYamlfor when lifetimes are not required. - Add
YamlOwned, an owned version ofYamlwhich corresponds to whatYamlwas prior to this version.
saphyr-parser
Breaking Changes:
- Allow events to borrow from the input.
- Rename
TScalarStyletoScalarStyle.