amazon-ion / ion-cli

Apache License 2.0
31 stars 15 forks source link

Sort ISL constraints in a type definition for generating code #108

Open desaikd opened 4 months ago

desaikd commented 4 months ago

Code generation uses logic to find some of the constraints like type, element in order to determine the final abstract data type. This would be simplified with some sorting of ISL constraints to get name, type(base type) etc.

It seems like there's a fair amount of complexity here that's dedicated to accommodating the ISL fields appearing in unpredictable orders. I think we could easily sort the fields beforehand so we could process them more easily, guaranteeing that we see name before type before element, etc.