()
| 139 | } |
| 140 | |
| 141 | func (p *peeker) PopIncludeNewlines() bool { |
| 142 | stack := p.IncludeNewlinesStack |
| 143 | remain, ret := stack[:len(stack)-1], stack[len(stack)-1] |
| 144 | p.IncludeNewlinesStack = remain |
| 145 | |
| 146 | if tracePeekerNewlinesStack { |
| 147 | // Record who called us so that we can more easily track down any |
| 148 | // mismanagement of the stack in the parser. |
| 149 | callers := []uintptr{0} |
| 150 | runtime.Callers(2, callers) |
| 151 | frames := runtime.CallersFrames(callers) |
| 152 | frame, _ := frames.Next() |
| 153 | p.newlineStackChanges = append(p.newlineStackChanges, peekerNewlineStackChange{ |
| 154 | false, frame, ret, |
| 155 | }) |
| 156 | } |
| 157 | |
| 158 | return ret |
| 159 | } |
| 160 | |
| 161 | // AssertEmptyNewlinesStack checks if the IncludeNewlinesStack is empty, doing |
| 162 | // panicking if it is not. This can be used to catch stack mismanagement that |
no outgoing calls