Allow bus operations to be defined without a selector
- Linguagem predominante
- Rust
- Estrelas
- 96
- Forks
- 39
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
Currently, bus operations require a selector / multiplicity set with the `when` / `for` keywords:
```
p.remove(3, 4) when s;
q.insert(3, 4) for 2;
```
The following statement is not valid:
```
p.remove(3, 4);
```
It could be useful to allow this kind of statements, to use them in match statements, for instance:
```
ev evaluator_with_bus([a, b, c]) {
[...]
p.remove(3, 4);
}
match {
case s2: enf evaluator_with_bus([a, b, c]),
[...]
}
```
In this case, the match statement for this bus would be equivalent to:
```
p.remove(3, 4) when s2;
```
The use case for this
_Originally posted by @bobbinth in https://github.com/0xMiden/air-script/pull/413#discussion_r2234955653_
Guia de contribuição
Direção de pesquisa
The issue is about the language grammar and parser for bus operations in air-script. Look at the parser code (likely in a `parser/` or `src/` directory) for handling bus operation statements like `p.remove(3, 4) when s;`. The change involves allowing statements without the `when` or `for` clause. Check the AST definition and the match statement handling. A good starting point is the linked PR #413 discussion. Verify the change by writing a test case for the new syntax.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- rust
- Domínio
- compilers
- Tipo de issue
- Funcionalidade
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 55/100