Skip to content

doddish scanner: modernize error handling and operator model #31

@friedenberg

Description

@friedenberg

Collected TODOs from go/internal/_/doddish/scanner.go that represent design improvements to the scanner.

Items

  1. Switch err field to pkgError (line 21) — The scanner's err field is error but should use the package's typed error system. Not a simple field type change since the scanner stores io.EOF and errors.Wrap() results that don't implement GetErrorType(). Needs error wrapping at the boundary (e.g., in Error() method) or a scanner-specific error wrapper.

  2. Remove UnreadRune entirely (line 65) — Replace UnreadRune with a different buffering strategy.

  3. Create sequence methods for Scan family (line 110) — Add sequence-returning variants of the Scan methods.

  4. Make quotes and backslash operators (line 174) — Promote quote and backslash characters to first-class Op types rather than special-casing them in the scan loop.

  5. Add support for ellipsis (lines 263, 308) — Support ... syntax in consumeLiteralOrFieldValue and consumeIdentifierLike.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions