Skip to main content

Module parse

Module parse 

Source
Expand description

Tokenization and cursor-aware command-line parsing. Shell-like tokenization and cursor analysis for completion.

This module exists to turn a partially typed input line plus a cursor offset into the structured data the completion engine actually needs: command path, tail items, pipe mode, and the active replacement span.

Contract:

  • parsing here stays permissive for interactive use
  • the parser owns lexical structure, not suggestion ranking
  • callers should rely on ParsedCursorLine and CursorState rather than re-deriving cursor spans themselves

Structsยง

CommandLineParser
Shell-like parser used by the completion engine.
ParsedCursorLine
Parsed command-line state for the full line and the cursor position.
TokenSpan
Token value with byte offsets into the original input line.