add tests for eof problem in scanner
erlang scanner refactoring