Releases: nemesissoft/Nemesis.TextParsers
Add support for parsing Stack<T>
v2.0.4 Make exploratory tests aware of special AB<> equivalence
Fix emptiness parsing for compound parsers. Add unit tests
v2.0.2 Fix emptiness parsing for compound parsers. Add unit tests
Support for settings and basic Dependency Injection capabilities
- New features
- Deconstructable aspect
- Transformable aspect
for more information on both see: https://github.com/nemesissoft/Nemesis.TextParsers/blob/master/Specification.md
- Introduce settings for handling:
- dictionaries
- lists/collections
- arrays
- value tuples
- key-value pairs
- deconstructables
-
Transformer creators may obtain ITransformerStore instance via simple constructor injection
-
Breaking changes:
- SpanCollectionSerializer was removed - opt for using ITransformerStore.GetTransformer. Use any common collection/array/dictionary class or interface as generic parameter i.e. IList, IEnumerable, Dictionary<key, value>, SomeType[], OtherType[][]
- ParsingPairSequence/ParsingSequence non generic ref structs were introduced in place of old ParsedSequence/ParsedPairSequence
- several methods from SpanParserHelper were removed/moved to more appropriate places
Support for settings and basic Dependency Injection capabilities
Introduce settings for handling:
- dictionaries
- lists/collections
- arrays
- value tuples
- key-value pairs
- deconstructables
Transformer creators may obtain ITransformerStore instance via simple constructor injection
Improve unit tests experience
v1.5.1 Update SourceLink
Deconstructables + simple parsers singletons + emptiness
- Simple type parsers are exposed via singletons (see i.e. DoubleParser.Instance)
- New type of parsing strategy - Deconstructables. It is enough for type to have constructor and matching Deconstruct - these members will be used to parse/format object automatically i.e. this structure
readonly struct Address
{
public string City { get; }
public int ZipCode { get; }
public Address(string city, int zipCode)
{
City = city;
ZipCode = zipCode;
}
public void Deconstruct(out string city, out int zipCode)
{
city = City;
zipCode = ZipCode;
}
}
will be automatically formatted to "(City;ZipCode)" format and parsed from same format
-
New concept - emptiness vs null parsing. Now transformers can decide what it meas to them when "" string is parsed as opposed to null string
-
TupleHelper - user can now create complex parser that parse tuple-like structures (records etc.) using common logic
-
Transformables - types can register own transformers using TransformerAttribute. Such custom transformers can benefit from simple dependency injections (currently only TransformerStore object) via constructor
DEPRECATED:
One of next minor releases will be the last one where we support FromText(string) convention. It was only a bridge for consumers bound to targets < .NET Standard 2.1. Now we encourage upgrade to FromText(ReadOnlySpan) - especially since all simple type parsers are exposed via singletons (see i.e. DoubleParser.Instance)
Add support for deconstructable parsing
- Improve text syntax provider - take from text factory
- add support for automatic parsing of deconstructable objects i.e.
readonly struct Address
{
public string City { get; }
public int ZipCode { get; }
public Address(string city, int zipCode)
{
City = city;
ZipCode = zipCode;
}
[UsedImplicitly]
public void Deconstruct(out string city, out int zipCode)
{
city = City;
zipCode = ZipCode;
}
}
Introduce TextTypeConverter
v1.3.2 Improve GetSyntax tests
Reorganize namespaces
v1.3.0 Reorganize namespaces
Move parsers to new namespace
Make parsers public and move them to Nemesis.TextParsers.Parsers namespace