Detect infinite loop and raise exception

This seems to work well. I don't know how much unit testing etc. you would like me to do to show this works. .. but I used it to debug the ruby-in-ruby\crystal failing_tests we were discussing on the mailing list. 

I added  a helper to Position to let me output the preceding 20 characters. I'm sure you have a better way to show parser context when throwing exception, but this was useful for me.