Collected TODOs from go/internal/_/doddish/scanner.go that represent design improvements to the scanner.
Items
-
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.
-
Remove UnreadRune entirely (line 65) — Replace UnreadRune with a different buffering strategy.
-
Create sequence methods for Scan family (line 110) — Add sequence-returning variants of the Scan methods.
-
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.
-
Add support for ellipsis (lines 263, 308) — Support ... syntax in consumeLiteralOrFieldValue and consumeIdentifierLike.
Collected TODOs from
go/internal/_/doddish/scanner.gothat represent design improvements to the scanner.Items
Switch
errfield to pkgError (line 21) — The scanner'serrfield iserrorbut should use the package's typed error system. Not a simple field type change since the scanner storesio.EOFanderrors.Wrap()results that don't implementGetErrorType(). Needs error wrapping at the boundary (e.g., inError()method) or a scanner-specific error wrapper.Remove UnreadRune entirely (line 65) — Replace
UnreadRunewith a different buffering strategy.Create sequence methods for Scan family (line 110) — Add sequence-returning variants of the Scan methods.
Make quotes and backslash operators (line 174) — Promote quote and backslash characters to first-class
Optypes rather than special-casing them in the scan loop.Add support for ellipsis (lines 263, 308) — Support
...syntax inconsumeLiteralOrFieldValueandconsumeIdentifierLike.