Feature/fix parse error position

Add line number when LF is detected. Now jenerator shows correct position of parsing error.
I also extracted parse method from `main.ml` and wrote its test code.