Documentation
¶
Overview ¶
Package text provides text manipulation utilities for formatting.
Index ¶
- func IsIdentifierChar(c byte) bool
- func IsIdentifierStart(c byte) bool
- func IsKeyword(s string) bool
- func LastLineStart(b []byte, pos int) int
- func LeadingWhitespace(b []byte, lineStart int) []byte
- func QuoteGoString(s string) string
- func SplitQuotedString(text string, startCol int, contIndent string, colLimit, tabStop int) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsIdentifierChar ¶
IsIdentifierChar returns true if c can be part of a Go identifier.
func IsIdentifierStart ¶
IsIdentifierStart returns true if c can start a Go identifier.
func LastLineStart ¶
LastLineStart finds the start position of the line containing pos. Returns 0 if pos is on the first line.
func LeadingWhitespace ¶
LeadingWhitespace extracts the whitespace prefix from the line starting at lineStart in b.
func QuoteGoString ¶
QuoteGoString returns s as a double-quoted Go string literal. It preserves printable runes and escapes only what's required.
func SplitQuotedString ¶
SplitQuotedString splits text into quoted segments that fit within the given width starting at startCol for the first segment. Continuation lines are indented with contIndent. Segments are joined with " +" at line breaks.
Types ¶
This section is empty.