You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c657124
Browse filesBrowse the repository at this point in the historyBrowse files
Give no twins under an unknown state or an unproved home directory
Under BashInitialStateMode.Unknown, the parser can report an exact
value for a word that Bash expands: `-o"$n"` gives `-o$n`, but Bash
passes `-oa`. The projection now gives no twins in that mode. Parse is
not changed here.
A cd without an operand goes to $HOME. Without a live launch HOME, the
parser takes that directory from HomeDirectory, but Bash uses its real
HOME. The projection now parses the source once more with another
HomeDirectory. A command whose exact directory changes gets no twins.
The check does not read the cd forms, so it also covers `cd --`,
`builtin cd`, `command cd`, and `if cd; then`.
Add the inputs as tests and to the real-Bash comparison, which now
also compares the working directory. Fix the stale parser comment.
Copy file name to clipboardExpand all lines: IMPLEMENTATION_PLAN.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ priorities.
16
16
-[x] Give no twins for an incomplete occurrence, a verb word that is not static, a word without a complete finite value set, an unquoted value that can split or glob, a redirect that depends on a value, and combinations over the limit. Kill a hand mutant of each gate with a test.
17
17
-[x] Review round 1: guard a backslash-newline, a carriage return, `=~` and `:~`, an unproved home directory, and `extglob` patterns. Count every twin parse against one budget of parses and source characters. Compare twins with GNU Bash argv on Linux.
18
18
-[x] Review round 2: check `=~` and `:~` in the full source. Parse each twin as one command in its exact directory, and check the budget before a twin is built.
19
+
-[x] Verification round: give no twins under the Unknown initial state, and for a directory that comes from an unproved `HOME`.
19
20
-[ ] Merge the PR after Linux and Windows CI and after the 0.4.0-beta.22 lexer fix. Tag `0.4.0-beta.23` and verify NuGet publication.
20
21
21
22
## Completed (0.4.0-beta.21 restore the beta.19 verb-slot rule)
Copy file name to clipboardExpand all lines: RELEASE_NOTES.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,9 @@ This prerelease adds literal twins of Bash commands whose argument words have a
15
15
- An unquoted word uses its authored values only under `FreshNonInteractiveNoStartup`, and only when each value is nonempty and has no space, tab, newline, `*`, `?`, `[`, parenthesis, or backslash. The parenthesis rule covers a Bash build with `extglob` on by default.
16
16
- A source with a backslash-newline, a carriage return, `=~`, or `:~` anywhere gets no twins. The lexer does not model this text as Bash does. The `=~` and `:~` rule covers a loop list item such as `for f in if=~/x`, and it also stops `[[ $x =~ re ]]`.
17
17
- When the source has `~` or `HOME`, a command gets twins only with a live launch `HOME`. Without it, the home directory is the caller assumption `HomeDirectory`.
18
-
- Budget: one call parses at most 128 twins and at most 2,048 + 8 x (source length) characters of twin text. The projection checks the budget before it builds a twin, so its cost stays a small constant factor of one `Parse`. On an 80 KB source with 8,000 commands, the projection takes about as long as `Parse`.
18
+
- A command whose exact directory comes from `HOME` (after `cd`, `cd --`, `builtin cd`, or `if cd; then`) gets twins only with a live launch `HOME`. The projection finds such a command with one more parse that uses another `HomeDirectory`.
19
+
- The projection gives no twins under `BashInitialStateMode.Unknown`. In that mode the parser can report `-o"$n"` as the exact value `-o$n`.
20
+
- Budget: one call parses at most 128 twins and at most 2,048 + 8 x (source length) characters of twin text, plus at most one more parse of the source for the `HOME` check. The projection checks the budget before it builds a twin, so its cost stays a small constant factor of one `Parse`. On an 80 KB source with 8,000 commands, the projection takes about as long as `Parse`.
19
21
- Values of different words combine independently. The twin set can hold combinations that never run, so a check of every twin is stricter, not weaker.
20
22
- A Linux test runs each source and each twin in GNU Bash and compares the argv.
21
23
- A twin grants no authority. Existing facts do not change: `Parse` gives the same output as 0.4.0-beta.22.
0 commit comments