import GolangLean.Token import GolangLean.Error namespace GolangLean /-! # Scanner — port of `go/scanner/scanner.go`. Stub. The real implementation is a hand-written DFA over UTF-8 byte input, faithful to the upstream Go scanner. We start with a `notImpl` sentinel so the project compiles, then fill in token-by-token alongside the parser. -/ partial def scan (src : String) : Except GoError (Array Token) := do if src.isEmpty then return #[⟨.eof, ⟨1, 1, 0⟩⟩] else .error (.notImpl "Scanner.scan: see go-upstream/src/go/scanner/scanner.go") end GolangLean