Refactor type inference for collections

The type inference for collections (tuples, vectors, matrices, and
records) has been significantly refactored.

This includes:
- Introducing distinct `StaticType` variants for `Tuple`, `Vector`, and
  `Matrix`.
- Implementing more robust type checking for these collections, allowing
  for homogeneous and heterogeneous structures.
- Enhancing the `is_assignable_from` method to handle type compatibility
  between these collection types.
- Updating `Value::static_type()` to correctly infer the types of
  literal collections.
- Improving the type inference for map literals to create `Record`
  types.
- Adding comprehensive unit tests for tuple, vector, matrix, and record
  type inference.
This commit is contained in:
Michael Schimmel
2026-02-20 10:19:29 +01:00
parent 494bf554d2
commit 4f849ebd34
12 changed files with 225 additions and 50 deletions
+2 -3
View File
@@ -102,12 +102,11 @@ impl<'a> Lexer<'a> {
fn skip_whitespace(&mut self) {
while let Some(&c) = self.peek() {
if c.is_whitespace() || is_invisible(c) {
if c.is_whitespace() || is_invisible(c) || c == ',' {
if c == '\n' {
self.line += 1;
self.col = 1;
} else if !is_invisible(c) {
// Only increment column for characters that actually take space
} else {
self.col += 1;
}
self.input.next();