/** * The block structure of language.md 3.10, which is a stack of indentation * widths and nothing more. * * Only a line that carries a token ever reaches this. A blank line and a * comment-only line carry no indentation at all: they never open a block, never * end one and are never OS1003, and the rule is kept by never asking about * them rather than by asking and forgiving. */ /** What a line's indentation means for the blocks around it. */ export type IndentEvent = /** Another line of the block already open. */ { readonly kind: 'same'; } /** Deeper than the header above it: a block begins. */ | { readonly kind: 'open'; } /** Shallower: this many blocks end here. */ | { readonly kind: 'close'; readonly count: number; } /** * Indented to a width no open block has, which is OS1003. The line is kept in * the block it landed in, so that one lost space reports one error rather * than reshaping every block below it. */ | { readonly kind: 'mismatch'; readonly count: number; readonly expected: number; readonly openerLine: number; }; export declare class BlockStack { #private; get depth(): number; /** * Takes the next line's indentation. * * `afterHeader` is whether the statement above this line was one that opens a * block. Without it a line that drifted one space to the right would open a * block of its own and every sibling below it would be reported instead of * the one line that moved. */ enter(width: number, afterHeader: boolean, openerLine: number): IndentEvent; /** Every block still open, which the end of the file closes. */ closeAll(): number; } //# sourceMappingURL=blocks.d.ts.map