twitter/scrooge — pull request #11 by sodabrew (2012-04-04 08:14:27+00:00)
Title: Issue 9 - Make the AST position aware, use that for TypeNotFoundException, and pretty print exceptions in general

In these changesets, I implement TypeNotFoundException reporting with the bad type's position in the file.

This is accomplished by:

* Switching the thrift file input from a slurp-to-String to a StreamReader. This reader annotates the input with position information
* Adding a Positional mixing to the top level Node class of the AST.
* Calling the Parser positioned() combinator in useful places in the parser.
* Subclassing several exceptions from a new ExceptionAt which has a Position instance var.

Caveats:

* Unit tests not yet updated for the change from String to StreamReader.
* Exceptions are mostly suppressed, so weird ones might be more confusing now.
* I've been testing these based off the sbt11 branch because I cannot build locally with sbt 0.7, so these changesets have been cherry-picked to a new branch off master (though no errors or editing needed).