Repository navigation
Conversation
Contributor
|
Web preview: https://sf624.github.io/bash-explainer/pr/570/ (commit 5be582c) |
Each token says its colour role (`Token.role`, from its kind: src/roles.ts, the table panel.css writes out) and the ids of the catalog's facts said at its node (`Token.facts`, `markTokens`). Every note is a catalog fact, or a style check's or a dialect issue's made by the catalog at its table's level (`styleNote`, `problemNote`): the string overload of `cx.note`, `plainNote` and the `continuationNotes` string list went, and SA5's known list is empty. The order of redirections is data (`redirectOrder`) said by the catalog (`redirections-in-order`); `cmd 2>&1 >file` is a caveat at Info with the rewrite `>file 2>&1` (`stderr-to-original-stdout`), none where the command writes into a pipe, which then gets only the errors. The sentence of a line compares the problems' facts (`CLAUSE_FACTS`, `problemCodes`), not their manual sections. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t around a range); the PR number in the docs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…`|&` after the redirections, `says` on the catalog entries, zsh syntax at info) - No `2>&1 >file` caveat where the command's original stdout is a pipe or a command substitution (`stdoutTo`, src/semantics/env.ts, from the chain's links): `$( )`, `<( )`, a group or a loop piped on. Before, only a stage of a pipeline itself; `err=$(f 2>&1 >/dev/null)` got a fix that breaks it. - `|&`'s implicit `2>&1` comes after the stage's redirections (3.2.3, `stderrPiped`): `f 2>&1 >o |& x` sends stderr to `o`. - The clauses a fact says are a field of its catalog entry (`says`, `clausesOf`), not a list beside the sentence's texts. - zsh syntax a line cannot be read with is information, as the Problems list always showed it. - The rewrite's bash check takes `/dev/null` too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sf624
force-pushed
the
sb3a-token-facts
branch
from
November 1, 2026 04:00
a624cd4 to
5be582c
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SB3a of the "one source per fact" plan (docs/design/sources.md, stage SB, item 3; rows 6, 14, 18, 27; M3). SB3c (the row record per token) and SB3d (the
uitexts out of render.ts) follow in other PRs.What changed
Token.role: the colour role of the token's kind, from one table (src/roles.ts,KIND_ROLES), which is what media/panel.css's.kind-*rules write out (a test checks them against it).ROLES/Rolemoved there from src/ui/themeTokens.ts (re-exported). render.tsKIND_ROLEand readingSteps'ROLESare untouched (SC10).Token.facts: the ids of the catalog's facts said at the token's node, in the order said (markTokens, src/tokenmarks.ts, from the anchorscx.say/cx.notealready record; a fact at a node with no token of its own goes to the innermost token around it; one about the line to none). Over the corpus: 904 anchors match a token exactly, 32 fall back to the innermost, 42 have no token on the line.cx.note,plainNoteand thecontinuationNotesstring list are gone;markedis private to src/messages.ts. test/fixtures/note-strings-known.json is empty.redirections-in-order,stderr-to-original-stdout,heredoc-end-line,heredoc-body-line,statement-continued,read-ifs-separators,yq-flavour,yq-compat,host-substitution,github-file, the host region notes (dockerfile-*,jenkinsfile-groovy-interpolation,python-*,yaml-folded-block), and one entry per idiom (src/messages-idioms.ts, with the manual sections each is about).styleNotefromSTYLE_LEVELS,problemNotefromPROBLEM_LEVELS, which gainsparse: 'info'for the zsh-syntax note, the severity it always had as a problem); their texts stay in their modules, as the design keeps them.yq-flavour,yq-compat,host-substitution,github-filehave real ids, but their wording is still built outside the catalog (recorded in sources.md; SB3c).2>&1 >file:redirectOrder(src/idioms.ts) gives the descriptor table as data; the catalog says it.cmd 2>&1 >fileis a caveat (Info) with the rewrite>file 2>&1as quick-fix data (a P3 fix), checked in bash by test/rewrites-corpus.test.ts (new states in test/support/rewrite-states.ts). No caveat where the command's original stdout is a pipe or a command substitution (stdoutTo, src/semantics/env.ts, from the env chain: a stage before|,$( ),<( ), a coprocess, a group or loop piped on): the table says "only the error messages go into the pipe" / "make the substitution's value". I widened M3's "/dev/null before a pipe" to any file there: the order is the only way to send stderr alone.|&'s implicit2>&1is applied after the stage's redirections (3.2.3,stderrPiped), sof 2>&1 >o |& xsays stderr → o. Fixed on the way:cmd 2>&1 >o 2>eandcmd 2>&1 >o |& xno longer claim stderr goes to the original stdout.problemSectionsis nowproblemCodes(fact ids; a host'sdockerPipefailcounts as its fact), and each catalog entry names the sentence clauses it says (says, read byclausesOf). A test sorts every problem citing 3.2.3 or 4.3.1.yq-flavourfact instead of matching the note's textyq:.spanWithin/sameSpanin src/noteanchors.ts (reading.ts and hoverParts.ts had copies).Explanation changes (snapshot of the corpus, both languages, with sentences)
ℹ(idioms, here-document lines, continued statements, yq, the redirection table, host notes). No other text change in them.2>&1 >filesentence moved out of the table note into its own caveat: "ⓘ Caveat:2>&1comes before>build.log, so stderr goes to the original stdout, not to the file. To send both to the file, write>build.log 2>&1".pipeline-subshell-variable.Tests
npm testlocally (bash 5.3, bash-ast, browsers): all pass but the twopslayout tests of test/examples-layouts.test.ts, which fail here because of a stray process on this machine (bash … /tmp/explain-bash-argv-5kqVAQ/0/script.sh, running for a day, whoseTIMEfield1-00:09:37the layout regex does not expect); unrelated.CLAUSE_FACTSclassification).Open
PROSE_MARKglyphs in them stay until a renderer can draw a token's level from its facts (SB3c).🤖 Generated with Claude Code