titan-lang / titan

The Titan programming language
http://titan-lang.org
MIT License
406 stars 13 forks source link

Restore TableFormatLevel after parser_spec tests #256

Closed hugomg closed 5 years ago

hugomg commented 5 years ago

When we set the TableFormatLevel to infinite in the parser spec, that setting carried on to the other spec files that ran after it. This turned out to be a problem because after the scope_analysis step out AST contains self-referential references. This meant that an attempt to print the AST in these test files (as may happen in failing test cases) would cause busted to get stuck into an infinite loop (and cause the machine to start swapping).

This was really tricky to find out, because the problem doesn't occur when running individual test files, only when running the whole test suite.

This is a port of https://github.com/pallene-lang/pallene/pull/46