-
-
Notifications
You must be signed in to change notification settings - Fork 6
Remove unused fmtTerm helper #1739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
e37271e
1ea3261
985bb2d
767aff6
eb21a3e
6ba5217
651bf3a
0e72371
2f7f373
9b44528
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import type { Vec } from "../types/bit_vec/types.ts" | ||
|
|
||
| export type _ClassPc = | | ||
| 0b000_00000n | | ||
| 0b001_00000n | | ||
| 0b010_00000n | | ||
| 0b011_00000n | | ||
| 0b100_00000n | | ||
| 0b101_00000n | | ||
| 0b110_00000n | | ||
| 0b111_00000n | ||
|
|
||
| /** | ||
| * Note: the tag number (the second parameter) can be arbitrarily large, | ||
| * so we can't just use a single byte to represent it. | ||
| */ | ||
| export type _ParsedTag = readonly[_ClassPc, bigint] | ||
|
|
||
| export type _Round8 = { | ||
| readonly byteLen: bigint | ||
| readonly v: Vec | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import type { StringMap } from "../../types/object/types.ts" | ||
| import type { EmptyTag, Rule, RuleSet } from "./types.ts" | ||
| import type { Rule as FRule } from '../types.ts' | ||
|
|
||
| export type _EmptyTagMap = StringMap<EmptyTag> | ||
|
|
||
| export type _FRuleMap = StringMap<FRule> | ||
|
|
||
| export type _NewRule = (m: _FRuleMap) => readonly [_FRuleMap, RuleSet, Rule] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import type { AstResult, Cursor } from "../matcher/types.ts" | ||
| import type { TerminalRange } from "../types.ts" | ||
| import type { CodePointMeta } from "./types.ts" | ||
|
|
||
| /** | ||
| * The furthest-failure record while matching, positioned by the complete | ||
| * {@link Cursor}. {@link DescentFailure} is its public, physically-positioned | ||
| * form. | ||
| */ | ||
| export type _Failure = { | ||
| readonly pos: Cursor | ||
| readonly expected: readonly TerminalRange[] | ||
| } | ||
|
|
||
| /** | ||
| * The machine's own result: a {@link DescentMatchResult} positioned by the | ||
| * complete cursor, and with no failure record — that one is tracked per match | ||
| * rather than per frame. This backend always has a position, so it needs no | ||
| * `null` case. | ||
| */ | ||
| export type _Result<T> = AstResult<CodePointMeta<T>, Cursor> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -330,22 +330,6 @@ export const fmtPath = path => | |
| export const fmtImport = (file, path) => | ||
| `import(${JSON.stringify(file)}).proof${fmtPath(path)}()` | ||
|
|
||
| /** | ||
| * Renders a key chain for terminal output: `| ` per level of depth, followed | ||
| * by the last segment formatted as a bare integer, a bare identifier, or a | ||
| * JSON-quoted string. E.g. `['math', 'add']` → `| | add`, | ||
| * `['a', '0']` → `| | 0`, `['x', 'hello world']` → `| | "hello world"`. | ||
| * | ||
| * @type {(path: Path) => string} | ||
| */ | ||
| export const fmtTerm = path => { | ||
| const keys = path.flatMap(k => k !== null ? [k] : []) | ||
| const indent = '| '.repeat(keys.length) | ||
| if (keys.length === 0) { return `${indent}()` } | ||
| const last = keys[keys.length - 1] | ||
| return `${indent}${isInteger(last) || isIdentifier(last) ? last : JSON.stringify(last)}` | ||
| } | ||
|
|
||
| /** | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
AGENTS.md reference: AGENTS.md:L100-L107 Useful? React with 👍 / 👎. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Removing this formatter leaves AGENTS.md reference: AGENTS.md:L47-L53 Useful? React with 👍 / 👎. |
||
| * Percent-encodes characters that GitHub workflow-command property values | ||
| * treat as separators (`%`, `:`, `,`) plus newlines. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private.tsfilesThis adds authored TypeScript under a new filename even though
types.tsis the repository's sole permitted authored TypeScript form. The same violation occurs infjs/bnf/data/private.tsandfjs/bnf/descent/private.ts; these implementation-only aliases should remain JSDoc typedefs in their.f.mjsowners rather than introducing a second TypeScript source convention.AGENTS.md reference: fjs/AGENTS.md:L192-L193
Useful? React with 👍 / 👎.