You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
303 B
Go
20 lines
303 B
Go
2 years ago
|
package shell
|
||
|
|
||
|
func countBackslashSuffixes(chars []rune) int {
|
||
|
backslashCount := 0
|
||
|
for i := len(chars) - 1; i > 0; i-- {
|
||
|
if chars[i] == '\\' {
|
||
|
backslashCount += 1
|
||
|
continue
|
||
|
}
|
||
|
|
||
|
break
|
||
|
}
|
||
|
|
||
|
return backslashCount
|
||
|
}
|
||
|
|
||
|
func isWhitespace(r rune) bool {
|
||
|
return r == ' ' || r == '\t' || r == '\n'
|
||
|
}
|