/** represents a parsed call expression from command text */ export interface ParsedCallExpr { /** the command name (e.g., "run") */ command: string; /** positional arguments before "--" */ args: string[]; /** extra arguments after "--" */ extraArgs: string[]; } /** represents a run command match with its position */ export interface RunMatch { /** the matched text */ match: string; /** start offset in source */ start: number; /** end offset in source */ end: number; } /** parsed command structure */ export type ParsedCommand = ParsedSimpleCommand | ParsedBinaryCmd | ParsedSubshell | ParsedBlock; /** simple command (e.g., `run build`, `echo test`) */ export interface ParsedSimpleCommand { type: 'CallExpr'; /** command name (first word) */ command: string; /** arguments after command name */ args: string[]; /** extra arguments after "--" */ extraArgs: string[]; /** start offset in original source */ start: number; /** end offset in original source */ end: number; } /** binary operator type */ type BinaryOperator = '&&' | '||' | '|'; /** binary command (e.g., `cmd1 && cmd2`) */ export interface ParsedBinaryCmd { type: 'BinaryCmd'; /** operator: && || | */ op: BinaryOperator; /** left side command */ left: ParsedCommand; /** right side command */ right: ParsedCommand; /** start offset in original source */ start: number; /** end offset in original source */ end: number; } /** subshell (e.g., `(cmd1 && cmd2)`) */ export interface ParsedSubshell { type: 'Subshell'; /** inner command */ body: ParsedCommand; /** start offset in original source */ start: number; /** end offset in original source */ end: number; } /** block (e.g., `{ cmd1; cmd2; }`) */ export interface ParsedBlock { type: 'Block'; /** inner command */ body: ParsedCommand; /** start offset in original source */ start: number; /** end offset in original source */ end: number; } /** * parses command text into ParsedCallExpr structure (pure) * @param cmdText the command text to parse * @returns the parsed call expression */ export declare const parseCommandText: (cmdText: string) => Readonly; /** * parses command text into structured form * @param text command text to parse * @param baseOffset offset in original source * @returns parsed command structure */ export declare const parseCommandStructure: (text: string, baseOffset: number) => ParsedCommand; /** * finds all run commands in parsed structure * @param cmd parsed command to search * @param source original source string * @returns array of run command matches */ export declare const findRunInParsed: (cmd: ParsedCommand, source: string) => RunMatch[]; export {}; //# sourceMappingURL=parsing.d.ts.map