We should validate the inputs to the leaves of tensor expressions so that various errors occur earlier rather than later:
- Validate that the input to
Integer is non-negative. Alternatively, we could modify the parser to allow negative numbers.
- Validate that the input to
Float is non-negative finite. Alternatively, we could modify the parser to allow inf and nan and negative numbers.
- Validate that the name and index names of
Tensor follow this regex [A-Za-z][A-Za-z0-9]*
We should validate the inputs to the leaves of tensor expressions so that various errors occur earlier rather than later:
Integeris non-negative. Alternatively, we could modify the parser to allow negative numbers.Floatis non-negative finite. Alternatively, we could modify the parser to allowinfandnanand negative numbers.Tensorfollow this regex[A-Za-z][A-Za-z0-9]*