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

Function tokenBracketChange

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

Source from the content-addressed store, hash-verified

443}
444
445func tokenBracketChange(tok *Token) int {
446 switch tok.Type {
447 case hclsyntax.TokenOBrace, hclsyntax.TokenOBrack, hclsyntax.TokenOParen, hclsyntax.TokenTemplateControl, hclsyntax.TokenTemplateInterp:
448 return 1
449 case hclsyntax.TokenCBrace, hclsyntax.TokenCBrack, hclsyntax.TokenCParen, hclsyntax.TokenTemplateSeqEnd:
450 return -1
451 default:
452 return 0
453 }
454}
455
456// formatLine represents a single line of source code for formatting purposes,
457// splitting its tokens into up to three "cells":

Callers 3

formatIndentFunction · 0.85
spaceAfterTokenFunction · 0.85
linesForFormatFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected