Adding functionality to any TextReader
- by strager
I have a Location class which represents a location somewhere in a stream. (The class isn't coupled to any specific stream.) The location information will be used to match tokens to location in the input in my parser, to allow for nicer error reporting to the user.
I want to add location tracking to a TextReader instance. This way, while…