Skip to content

Commit b250e0f

Browse files
committed
Feedback
1 parent 68070e6 commit b250e0f

File tree

7 files changed

+126
-281
lines changed

7 files changed

+126
-281
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ bench-*.mjs
1414
todo/
1515
*.parsed.json
1616
.pnpm-store
17-
.docs-test-tmp/
17+
.docs-test-tmp/
18+
.claude/

biome.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
"!**/node_modules",
3636
"!**/*.md",
3737
"!examples",
38-
"!**/*.parsed.json"
38+
"!**/*.parsed.json",
39+
"!.claude"
3940
]
4041
}
4142
}

src/interpreter/builtins/shopt.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ const STUB_OPTIONS = [
6060
"login_shell",
6161
"mailwarn",
6262
"no_empty_cmd_completion",
63-
"nocaseglob",
6463
"progcomp",
6564
"progcomp_alias",
6665
"promptvars",

src/interpreter/expansion/analysis.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import type {
1717
* Check if a glob pattern string contains variable references ($var or ${var})
1818
* This is used to detect when IFS splitting should apply to expanded glob patterns.
1919
*/
20-
function globPatternHasVarRef(pattern: string): boolean {
20+
export function globPatternHasVarRef(pattern: string): boolean {
2121
// Look for $varname or ${...} patterns
2222
// Skip escaped $ (e.g., \$)
2323
for (let i = 0; i < pattern.length; i++) {

src/interpreter/expansion/word-split.ts

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,10 @@ import type { ParameterExpansionPart, WordPart } from "../../ast/types.js";
88
import { getVariable, isVariableSet } from "../expansion/variable.js";
99
import { splitByIfsForExpansionEx } from "../helpers/ifs.js";
1010
import type { InterpreterContext } from "../types.js";
11-
import { isOperationWordEntirelyQuoted } from "./analysis.js";
12-
13-
/**
14-
* Check if a glob pattern string contains variable references ($var or ${var})
15-
* This is used to detect when IFS splitting should apply to expanded glob patterns.
16-
*/
17-
function globPatternHasVarRef(pattern: string): boolean {
18-
// Look for $varname or ${...} patterns
19-
// Skip escaped $ (e.g., \$)
20-
for (let i = 0; i < pattern.length; i++) {
21-
if (pattern[i] === "\\") {
22-
i++; // Skip next character
23-
continue;
24-
}
25-
if (pattern[i] === "$") {
26-
const next = pattern[i + 1];
27-
// Check for ${...} or $varname
28-
if (next === "{" || (next && /[a-zA-Z_]/.test(next))) {
29-
return true;
30-
}
31-
}
32-
}
33-
return false;
34-
}
11+
import {
12+
globPatternHasVarRef,
13+
isOperationWordEntirelyQuoted,
14+
} from "./analysis.js";
3515

3616
/**
3717
* Type for the expandPart function that will be injected

0 commit comments

Comments
 (0)