0xMiden / 0xMiden/air-script

nested slices break the parser and some Middle IR assumptions

Aberta
#502 0 comentários 0 reações 0 responsáveis Ver no GitHub
IR parser
Linguagem predominante
Rust
Estrelas
96
Forks
39
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

Currently, nesting slices breaks the parser: `arr[0..5][2..4]`. Introducing indirection with a let statement or function calls is not expressible in the current MIR.

The current way to bypass this issue is to use nested evaluator calls:
```air-script
trace_columns {
main: [a[10]],
}
integrity_constraints {
enf f(a[0..5]);
}
ev f([a[5]) {
enf g([a[2..5]);
}
ev g([a[3]) {
enf x^2 = x for x in a;
}
```

The behaviour should replicate what is done for evaluator calls in #495, likely by fixing the parser and by enabling support for `MirAccessType::Slice` in MIR.

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

The issue is about nested slices in the parser and MIR (Middle IR). Start by examining the parser code for handling slice expressions like `arr[0..5][2..4]` and the MIR representation for `MirAccessType::Slice`. Look at how issue #495 handled evaluator calls as a reference. The fix likely involves modifying the grammar and updating MIR to support nested slice accesses. Test changes with the provided air-script example to ensure nested slices are parsed and lowered correctly.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
rust
Domínio
compilers
Tipo de issue
Bug
Dificuldade
4/5
Tempo estimado
3-5 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
45/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.