Add axis, bool, int, float, bool array, int array, and float array definitions and initializations.
Initialization lists are treated independently, i.e., without considering to what they will be assigned.
Initialization lists parsing yields a constant array of a given type.
In order to determine this type, we walk the list, and keep track of the highest type to which we can promote.
For example, for a list containing the types bool and int, that type would be int.
An initialization list can only contain elements of type bool, int, or float.
For a variable declaration including an initialization:
We first check the right hand side, resolving any identifier.
This allows us to avoid the case of declaring a variable and assigning itself as a value.
E.g., int i = i.
We then register the left hand side.
And, finally, we perform the assignment.
Assignments of arrays first consider the length of the arrays.
Assignments consider promotions.
A bool value can be promoted to int or float.
An int value can be promoted to float.
A bool array value can be promoted to int array or float array.
An int array value can be promoted to int array or float array.
A bool array, int array, or float array of 3 elements can be promoted to an axis type.
Changes to v1x files
res/v1:
Remove directories with names containing dashes. These directories were renamed in a previous commit to names using underscores. But some of the old directories remained there.
Golden files using variable definitions have changed because we no longer allow multiple variable definitions per line.
Add
axis
,bool
,int
,float
,bool
array,int
array, andfloat
array definitions and initializations.Initialization lists are treated independently, i.e., without considering to what they will be assigned. Initialization lists parsing yields a constant array of a given type. In order to determine this type, we walk the list, and keep track of the highest type to which we can promote. For example, for a list containing the types
bool
andint
, that type would beint
. An initialization list can only contain elements of typebool
,int
, orfloat
.For a variable declaration including an initialization:
int i = i
.bool
value can be promoted toint
orfloat
. Anint
value can be promoted tofloat
. Abool
array value can be promoted toint
array orfloat
array. Anint
array value can be promoted toint
array orfloat
array. Abool
array,int
array, orfloat
array of 3 elements can be promoted to anaxis
type.Changes to
v1x
filesres/v1
: