Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d0c20df
Add failing tests for indirect left recursion
claude Apr 20, 2026
edeadc6
Handle indirect left recursion via Paull + multi-token dispatch
claude Apr 20, 2026
b99d52f
Add token-rewind primitives: ctx.v, ctx.mark, ctx.rewind
claude Apr 20, 2026
3b88d0d
Handle hidden left recursion via topo sort + trivial-alt drop
claude Apr 20, 2026
f518e3a
Cap ctx.v with a configurable ring buffer
claude Apr 20, 2026
5091f5e
Set the default ctx.v history size to 64
claude Apr 20, 2026
93d3d6f
ABNF stage 1: switch rule header to \`name = rhs\`
claude Apr 20, 2026
2052828
ABNF stage 2: switch alternation from \`|\` to \`/\`
claude Apr 20, 2026
98dec84
ABNF stage 3: switch optional from \`A?\` to \`[ A ]\`
claude Apr 20, 2026
d08c2f0
ABNF stage 4: switch repetition to ABNF prefix forms
claude Apr 20, 2026
c4f6252
ABNF stage 5: switch comment marker from \`#\` to \`;\`
claude Apr 20, 2026
7a1159e
ABNF stage 6: numeric value notation (%xNN, %dNN, %bNN)
claude Apr 20, 2026
fb1f059
ABNF stage 7: case-insensitive quoted strings (plus %s / %i)
claude Apr 20, 2026
daceed9
ABNF stage 8: incremental alternatives (\`name =/ alt\`)
claude Apr 20, 2026
69347b2
ABNF stage 9: line-wrapped rules
claude Apr 20, 2026
7ee6cb8
ABNF stage 10: RFC 5234 Appendix B.1 core rules
claude Apr 20, 2026
09b18a9
Add RFC 3986 URI grammar fixture and test
claude Apr 20, 2026
6c0a419
Add probe + phase-retry for LL(k) ambiguous [X D] Y patterns
claude Apr 20, 2026
72cb0c3
Make #AA a true any-token wildcard regardless of tin
claude Apr 20, 2026
2648edd
Emit ergonomic AST tagged by ABNF rule name
claude Apr 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions dist/bnf.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { BnfConvertOptions, GrammarSpec, Rule } from './types';
type BnfElement = {
kind: 'term';
literal: string;
caseSensitive?: boolean;
} | {
kind: 'ref';
name: string;
Expand All @@ -18,6 +19,11 @@ type BnfElement = {
} | {
kind: 'plus';
inner: BnfElement;
} | {
kind: 'rep';
min: number;
max: number;
inner: BnfElement;
} | {
kind: 'group';
alts: BnfSequence[];
Expand All @@ -26,9 +32,29 @@ type BnfSequence = BnfElement[];
type BnfProduction = {
name: string;
alts: BnfSequence[];
incremental?: boolean;
probeDispatch?: ProbeDispatchSpec;
probeHelper?: {
vocabElements: BnfElement[];
};
nodeKind?: 'user' | 'core' | 'helper';
};
type ProbeDispatchSpec = {
probeRule: string;
disambiguator: BnfElement;
withBranch: string;
noBranch: string;
};
type BnfGrammar = {
productions: BnfProduction[];
ambiguities?: AmbiguityReport[];
};
type AmbiguityReport = {
rule: string;
altIdx: number;
optIdx: number;
reason: string;
resolved: boolean;
};
declare const bnfRules: Record<string, {
bo?: (r: Rule) => void;
Expand Down
Loading
Loading