MCPcopy
hub / github.com/go-yaml/yaml / is_blankz

Function is_blankz

yamlprivateh.go:166–178  ·  view source on GitHub ↗

Check if the character is a line break, space, tab, or NUL.

(b []byte, i int)

Source from the content-addressed store, hash-verified

164
165// Check if the character is a line break, space, tab, or NUL.
166func is_blankz(b []byte, i int) bool {
167 //return is_blank(b, i) || is_breakz(b, i)
168 return (
169 // is_blank:
170 b[i] == ' ' || b[i] == '\t' ||
171 // is_breakz:
172 b[i] == '\r' || // CR (#xD)
173 b[i] == '\n' || // LF (#xA)
174 b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85)
175 b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028)
176 b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029)
177 b[i] == 0)
178}
179
180// Determine the width of the character.
181func width(b byte) int {

Calls

no outgoing calls

Tested by

no test coverage detected