kellerkindt / asn1rs

Generates Rust Code and optionally compatible Protobuf schema files from ASN.1 definitions.
http://asn1.rs
Apache License 2.0
54 stars 19 forks source link

Parse and resolve ValueReferences #49

Closed kellerkindt closed 3 years ago

kellerkindt commented 3 years ago

ValueReferences are the constants of ASN.1. With this PR constant definitions in ASN.1 are parsed. The Model<Asn> type has been split intoModel<Asn<Unresolved>> (which is now returned after parsing the Tokenizer stream) and Model<Asn<Resolved>> which is required for the .to_rust() conversion. The function Model::<Asn<Unresolved>>::try_resolve(&self) -> Result<Model<Resolved>, _> transforms the model by replacing VR-occurances with their declared value.

TODOS remaining

This PR changes public API and thus is a breaking change in this regard. ~A version bump to 0.3.0 is therefore required by the semantic versioning guidelines~ No. 4: "Major version zero (0.y.z) is for initial development. Anything MAY change at any time. The public API SHOULD NOT be considered stable."