Support structured control flow (loops) in Bash and PowerShell grammars
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
Beginnen Sie mit Abschnitt 4 von SPEC.md und der bestehenden flachen Befehls-/Klauselgrammatik für Bash und PowerShell. Verfolgen Sie, wie IsUnparseable gesetzt wird und wie der AST Klauseln verfügbar macht; überprüfen Sie anschließend, dass die aufgeführten strukturierten Konstrukte untergeordnete Body-Klauseln erzeugen, die von approval-gate-Verbrauchern durchlaufen werden können, ohne IsUnparseable auszulösen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Problem
SPEC.md section 4 states v0.1 does not support control-flow keywords. for, while, do, done, then, fi, case, and esac set IsUnparseable = true.
The grammar is flat:
command := clause (compound_op clause)*
This is load-bearing for real consumers. NetClaw's shell approval gate walks parsed clauses to decide authorization. Commands that hit IsUnparseable fail closed to an approval prompt.
Why it matters
LLM agents emit loops and heredocs constantly. A production corpus of 45 approval-prompted shell commands showed 8 (18%) were for loops, heredocs, or process substitution. All tripped IsUnparseable.
Loops are static constructs. for f in *.txt; do rm "$f"; done does not hide a path behind $(). The approval risk is the body clause (rm). The existing clause model already evaluates that.
Request
Support structured control flow in both grammars:
- Bash:
for/while/until/if/casewithdo/done/then/else/fi/esac - PowerShell:
foreach/for/while/do/if/switch
Design intent: parse the loop header and expose body clauses as child clauses in the AST. The loop keyword adds no authorization scope. Consumers (approval gates) can walk body clauses with the same logic they use for && chains.
Priority
Corpus-based order for Bash: for loops first, then heredocs, then while / if. Also consider arithmetic expansion $(( ... )), which the same spec line excludes.
- Vorherrschende Sprache
- C#
- Sterne
- 15
- Forks
- 0
- Ø Merge
- 7 Min.
- Gemergte PRs (30 T.)
- 11
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus Aaronontheweb/ShellSyntaxTree
-
enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
Aaronontheweb/ShellSyntaxTree#190 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
Aaronontheweb/ShellSyntaxTree#69 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in Aaronontheweb/ShellSyntaxTree
Ähnliche Issues
-
needs triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
spectreconsole/spectre.console#2221 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
-
area/navigationview 🧭 difficulty/starter 🚀 good first issue kind/bug platform/all project/navigation-lifecycle 🧬 triage/untriaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
unoplatform/uno#24925 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
PhilippC/keepass2android#3315 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
DamianEdwards/ghcp-spend-tray#39 ·
Maintainer antworten meist innerhalb von 1 Tag