git-subtree-dir: golang-lean git-subtree-mainline:6487c7046fgit-subtree-split:f5f1701922
18 lines
583 B
Text
18 lines
583 B
Text
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
|