SaylorTwift's picture
SaylorTwift HF Staff
Add files using upload-large-folder tool
68d7816 verified
Raw
History Blame Contribute Delete
863 Bytes
import { createDecorator, type ServiceIdentifier } from '#/_base/di/instantiation';
export interface BashSyntaxNode {
readonly type: string;
readonly text: string;
readonly startIndex: number;
readonly endIndex: number;
readonly isNamed: boolean;
readonly children: readonly BashSyntaxNode[];
}
export interface BashParseOptions {
readonly timeoutMs?: number;
readonly maxNodes?: number;
}
export type BashParseResult =
| { readonly ok: true; readonly hasError: boolean; readonly root: BashSyntaxNode }
| { readonly ok: false; readonly reason: 'aborted' };
export interface IBashParserService {
readonly _serviceBrand: undefined;
parse(source: string, options?: BashParseOptions): BashParseResult;
}
export const IBashParserService: ServiceIdentifier<IBashParserService> =
createDecorator<IBashParserService>('bashParserService');