MCPcopy
hub / github.com/hashicorp/hcl / tokenIsNewline

Function tokenIsNewline

hclwrite/format.go:431–443  ·  view source on GitHub ↗
(tok *Token)

Source from the content-addressed store, hash-verified

429}
430
431func tokenIsNewline(tok *Token) bool {
432 switch tok.Type {
433 case hclsyntax.TokenNewline:
434 return true
435 case hclsyntax.TokenComment:
436 // Single line tokens (# and //) consume their terminating newline,
437 // so we need to treat them as newline tokens as well.
438 if len(tok.Bytes) > 0 && tok.Bytes[len(tok.Bytes)-1] == '\n' {
439 return true
440 }
441 }
442 return false
443}
444
445func tokenBracketChange(tok *Token) int {
446 switch tok.Type {

Callers 1

linesForFormatFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected