Closed desaikd closed 1 year ago
Updates with latest changes:
load_isl_schema
doesn't need an argument for ISL version, instead
checking the version markerv_1_0
and v_2_0
has its own implementation now to
pass the proper ISL version.Display
for IonSchemaLanguageVersion
enum
Description of changes:
This PR works on adding version configuration changes to allow ISL 2.0 support.
List of changes:
IonSchemaLanguageVersion
(529fa2d02425d65bbda3062cda87ae0b5756c89e)isl_type
,isl_type_reference
andisl_constraint
contains two modules with specific implementation of types/type references and constraints based on ISL version(v_1_0
andv_2_0
). This will help with easier API modifications with new major/minor version release.IslType
which was previously used to model an ISL type definition is now renamed asIslTypeKind
.IslTypeKind
has all the implementation details required to support both/all ISL version with a single struct. A new wrapper class that takes in thisIslTypeKind
to hide its implementation details. Along with that nowIslTypeKind
will be private to crate and users can only construct forIslType
and use its accessor methods. In conclusion, all the wrapper classes are added to separate out implementation details from public facing APIs/structs.IslType
following structures are changed to add on a layer of abstraction from implementation layer.IslConstraint
enum has now changed to be calledIslConstraintImpl
. A wrapper classIslCosntraint
is added on top of it that takesIslConstraintImpl
to create the abstraction layer.IslTypeRef
is now calledIslTypeRefImpl
. And it has wrapper class that is calledIslTypeRef
.UserReservedFields
struct that stores user reserved fields for ISL 2.0.schema_system
that converts ISL model to a resolved schema calledschema_from_isl_schema
.schema_from_isl_schema
makes sure that the given ISL model types contains the same version of ISL for their cosntraints. This check is not done while constructing the ISL model.v_1_0
andv_2_0
modules does give user an idea on which ISL version they are using to construct the model but it does not guarantee that the model that is created has all the constraints from same version of ISL.IslSchema
now has two methods to construct schema for a particular versionschema_v_1_0
andschema_v_2_0
.Example construction of ISL model programmatically using the new signature:
Using a single ISL type to construct ISL schema model as below:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.