Martin Atkins f87a794800 hclsyntax: check for and report incorrect peeker stack discipline
The peeker has an "include newlines" stack which the parser manipulates
to switch between the newline-sensitive and non-sensitive scanning modes.
If the parser code fails to manage this stack correctly (for example,
due to a missed call to PopIncludeNewlines) then this causes very
confusing downstream errors that are otherwise difficult to debug.

As an extra debug tool for when errors _are_ detected, when this problem
is encountered during tests we are able to produce a visualization of the
pushes and pops to help the test developer see which pushes and pops
seem out of place.

This is a lot of ugly extra code but it's usually disabled and seems worth
it to allow us to catch quickly bugs that would otherwise be quite
difficult to diagnose.
2018-02-16 17:37:22 -08:00
..
2018-01-27 11:03:05 -08:00
2018-01-14 11:24:19 -08:00
2018-01-14 11:24:19 -08:00
2018-01-14 11:51:05 -08:00
2018-01-14 11:51:05 -08:00