Aaronontheweb / Aaronontheweb/ShellSyntaxTree
Extract shared native argument fragment classification
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- C#
- Estrellas
- 15
- Forks
- 0
- Merge medio
- 9 min
- PR fusionados (30 d)
- 7
Descripción
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.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Compara los recorridos de fragmentos de argumentos nativos de Bash y PowerShell introducidos por PR #68 y, después, inspecciona sus casos de corpus adversariales para valores entre comillas, ejecuciones máximas, sintaxis mixta y la transformación de curl @. Extrae únicamente la clasificación neutral respecto al shell, manteniendo separados los adaptadores de tokens y el comportamiento del parser. Ejecuta dotnet build -c Release, dotnet test -c Release y la verificación de headers; se considera terminado cuando todo el comportamiento existente sigue pasando en ambos shells.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- bash, csharp, powershell
- Área
- tooling
- Tipo de issue
- Refactorización
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Tranquilo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 48/100