Extract shared native argument fragment classification
維護者通常 2 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 48/100
研究方向
比較 PR #68 引入的 Bash 與 PowerShell 原生引數片段遍歷,然後檢查它們針對帶引號值、最大連續序列、混合語法和 curl @ 轉換的對抗性語料庫案例。僅擷取與 shell 無關的分類,同時將 token 配接器與剖析器行為分開。執行 dotnet build -c Release、dotnet test -c Release 和 header 驗證;完成表示兩種 shell 中現有行為都維持通過。
由索引模型根據 Issue 內容生成。
描述
Problem
PR #68 added equivalent native-argument fragment walks to the Bash and PowerShell parsers. Both implementations now collect contiguous lexer fragments, preserve the complete raw span and decoded value, detect opaque fragments, and safe-fail resolver-sensitive mixed quoting. Keeping those rules duplicated creates a drift risk when another fragment shape or shell is added.
This is not a request for a shared lexer or parser core. Bash and PowerShell must retain their shell-specific tokenization, quoting, recursion, and command semantics.
Proposed scope
Extract an internal shell-neutral classification result for one native argument assembled from parser-owned lexer fragments. Each parser adapts its own tokens into the helper and remains responsible for consuming the resulting token range.
The shared result should carry:
- the complete authored source span and raw value;
- the combined decoded logical value;
- whether any fragment is opaque or computed;
- whether all value fragments are literal;
- whether mixed literal and expandable fragments contain resolver-sensitive syntax;
- the first index after the consumed fragment run.
Non-goals
- Unifying the Bash and PowerShell lexers.
- Building a shared parser base class.
- Changing the public AST or parser APIs.
- Weakening
DynamicSkipbehavior for ambiguous mixed quoting.
Acceptance criteria
- Bash and PowerShell use one internal fragment-classification implementation.
- Shell-specific token adapters remain small and explicit.
- Existing
Raw,Value, source-span, path, andDynamicSkipbehavior remains unchanged. - The PR #68 adversarial corpus cases for quoted values, maximal fragment runs, unquoted prefixes, mixed literal syntax, and curl
@transformation remain green in both shells. dotnet build -c Release,dotnet test -c Release, and header verification pass.
Extraction trigger
Do this before adding a third shell or another native fragment rule. Until then, the current duplication is correct but carries maintenance cost.
- 主要語言
- C#
- 星號
- 15
- 分支
- 0
- 平均合併
- 8 分鐘
- 30 天內合併 PR
- 9
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
Aaronontheweb/ShellSyntaxTree 的其他 Issue
-
enhancement
難度 5/5 一週以上 新手友好度 35/100
Aaronontheweb/ShellSyntaxTree#71 · 1 則留言 ·
維護者通常 2 天內回覆
查看 Aaronontheweb/ShellSyntaxTree 的全部 Issue
相似的 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 72/100
fluentassertions/fluentassertions#3353 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 65/100
-
難度 2/5 半天 新手友好度 78/100
unoplatform/uno#24769 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 75/100
AvaloniaUI/Avalonia#22323 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 88/100
microsoft/onnxruntime-genai#2633 ·
維護者通常 1 天內回覆