diff --git a/TODO.txt b/TODO.txt index 4367578..3c51288 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,3 +1,3 @@ Think about changing "consume" to "commit" -What's Megaparsec got that we ain't got? +What’s Megaparsec got that we ain’t got? chainl diff --git a/bind.go b/bind.go index 8d00f2e..aae2b2a 100644 --- a/bind.go +++ b/bind.go @@ -4,7 +4,7 @@ package gigaparsec -// Bind combines p with a parser created by f that depends on p's result value. +// Bind combines p with a parser created by f that depends on p’s result value. func Bind[In, Out, T any]( p Parser[In, T], f func(T) Parser[In, Out], diff --git a/gigaparsec.go b/gigaparsec.go index dfac587..0678661 100644 --- a/gigaparsec.go +++ b/gigaparsec.go @@ -134,7 +134,7 @@ func MessageEnd(pos uint64, expected ...string) Message { } // MakeState creates a new State. -// It's mostly useful for testing. You probably don't need it. +// It’s mostly useful for testing. You probably don’t need it. func MakeState[In any](r ReaderAt[In]) State[In] { return State[In]{r: r} } @@ -145,12 +145,12 @@ type State[In any] struct { pos uint64 } -// Read fills dst with data from this State's position in the underlying source. +// Read fills dst with data from this State’s position in the underlying source. // It returns the number of data it read and a new State for the position at which // the read ended, and an error if the read either (1) failed or (2) reached the // end of the source before filling dst. All reads from a given State will return // data from the same position the source. -// If the source had too few data left to fill dst, or if the State's position is +// If the source had too few data left to fill dst, or if the State’s position is // at or past the end of the source, err will be io.EOF. func (s State[In]) Read(dst []In) (n uint64, next State[In], err error) { if s.pos > math.MaxInt64 { @@ -169,7 +169,7 @@ func (s State[In]) Read(dst []In) (n uint64, next State[In], err error) { return uint64(nread), s, err } -// Pos returns this State's position. +// Pos returns this State’s position. func (s State[In]) Pos() uint64 { return s.pos } diff --git a/internal/bindgen/bind.go.tmpl b/internal/bindgen/bind.go.tmpl index 96ef26c..0e92cc4 100644 --- a/internal/bindgen/bind.go.tmpl +++ b/internal/bindgen/bind.go.tmpl @@ -5,7 +5,7 @@ {{end}}{{end}}{{end -}} {{define "func" -}} -{{if eq . 1}}// Bind combines p with a parser created by f that depends on p's result value. +{{if eq . 1}}// Bind combines p with a parser created by f that depends on p’s result value. {{- else}}// Bind{{.}} is equivalent to {{.}} nested calls to Bind.{{end}} func Bind{{.}}[In, Out{{range .Count}}, T{{.}}{{end}} any]( p Parser[In, T],