go-brace/parsetostring.go

16 lines
290 B
Go
Raw Normal View History

2023-11-22 14:51:50 +00:00
package brace
import (
"io"
)
// ParseToString is similar to Parse except it return the brace-string literal as a string.
func ParseToString(runescanner io.RuneScanner) (string, error) {
p, err := ParseToBytes(runescanner)
if nil != err {
return "", err
}
return string(p), nil
}