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

Method PushIncludeNewlines

hclsyntax/peeker.go:125–139  ·  view source on GitHub ↗
(include bool)

Source from the content-addressed store, hash-verified

123}
124
125func (p *peeker) PushIncludeNewlines(include bool) {
126 if tracePeekerNewlinesStack {
127 // Record who called us so that we can more easily track down any
128 // mismanagement of the stack in the parser.
129 callers := []uintptr{0}
130 runtime.Callers(2, callers)
131 frames := runtime.CallersFrames(callers)
132 frame, _ := frames.Next()
133 p.newlineStackChanges = append(p.newlineStackChanges, peekerNewlineStackChange{
134 true, frame, include,
135 })
136 }
137
138 p.IncludeNewlinesStack = append(p.IncludeNewlinesStack, include)
139}
140
141func (p *peeker) PopIncludeNewlines() bool {
142 stack := p.IncludeNewlinesStack

Callers 11

parseTemplatePartsMethod · 0.80
parseExpressionTermMethod · 0.80
parseTupleConsMethod · 0.80
parseObjectConsMethod · 0.80
finishParsingForExprMethod · 0.80
ParseExpressionFunction · 0.80
ParseTraversalAbsFunction · 0.80
ParseTraversalPartialFunction · 0.80
TestPeekerFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestPeekerFunction · 0.64