ion-cli
ion-cli copied to clipboard
Adds changes for sequence data type
Issue #, if available:
Description of changes:
This PR works on adding new model changes following up on #135. This Pr only contains changes for Sequence. This PR disables Rust support until the entire functionality for the new model change is supported and uses feature branch new-model-changes as target.
List of changes:
-
Generator changes:
- Adds
build_wrapped_sequence_from_constraintswhich is used for constructing named sequence data type as data model. - Adds
build_sequence_from_constraintswhich is used for constructing nested sequence data type as data model. (Doesn't have a name) - Adds
is_nestedflag inconvert_isl_type_def_to_data_model_nodewhich can be used to either call wrapped sequence or sequence ADT construction. - Modified
sequenceconstruction to move the common logic at the beginning of the method.
- Adds
-
Model changes:
- Changes
SequenceandWrappedSequenceADT to represent the underlying sequence type withbase_typeand its name withnamefield. - Adds doc comment changes for the same
- Changes
-
Adds templates changes for
java/sequence.templ
Generated code:
The generated code still stays the same only the template changes to use the new model. (Only added sequence files for checking this change, other files remain same)
Generated Java code can be found here.
Tests:
- Adds tests for ISL to model conversion.
- Modifies roundtrip code gen tests for
sequencetest cases.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.