Codes d’erreur › arche-body

Codes d’erreur

arche-body

indice Style: how the model reads (archec vet)

Ce que cela signifie#

A Python body that says only what the action language says (archec vet): written as a ```arche body, archec checks it and translates it to C, Rust and Go. The quick fix converts it.

Exemple#

Some Python bodies do only what the action language does: if, goto, send, return, assignments, comparisons, wait, log, and calls to the part's functions. Such a body reads better as a ```arche body. archec then checks it, and translates it to C, Rust and Go, not only to Python.

The quick fix Convert to arche body writes it, and so does archec fix --only arche-body. A body that does more is left as Python: a list, a library, a name the model does not declare.

Comment le corriger#

Le message dit ce qui ne va pas et où, et souvent ce qui était voulu (Did you mean …?). Modifiez le modèle pour que ce que décrit cette page ne soit plus vrai, puis vérifiez à nouveau : archec check main.arche.

Un indice : une suggestion ; le modèle se construit tel quel.

Une remarque de style : archec vet la signale, archec check non ; archec fmt --write corrige celles de mise en page.

archec check --beginner reformule les messages les plus courants en mots simples, avec les noms qui existent.

La correction automatique#

A Python body that says only what the action language can say is rewritten as a ```arche body. For example self.state == "Ready" → state == Ready, await goto("Auto") → goto Auto, send(self.p, M(f=1)) → send p M { f: 1 }. The fix is refused when the body does more: a list that grows, a library call, a name the model does not have. It is a style finding, so only archec fix --vet or --only arche-body applies it.

Elle devine quoi écrire, ou supprime quelque chose : VS Code la propose (Quick Fix), et archec fix ne l’applique que si vous nommez son code — archec fix main.arche --only arche-body.

Dans le terminal#

archec explain arche-body affiche cette explication ; archec explain style liste les codes de son domaine.