-
Notifications
You must be signed in to change notification settings - Fork 18
Description
The current way jrb parses the text file is by building multiple regular expressions, one for each type. This works when the file is correct, but it makes debugging harder when it's not correct: jrb is unable to tell what and where is wrong, it can only tell that a specific line was garbage because the regular expression didn't match.
A different parsing approach is required, in order to make debugging easier, while not sacrificing performance.
One way is getting rid of regular expressions entirely, and using the xsd file as a guide about the immediate next step, much like we would do manually. Example: "I expect the next line to start with either 001 or 002. It's 001 ok, now I expect a zero-padded integer....". This way, if the file is broken, jrb can throw an error exactly where it's broken and can provide debug level logging about every single field it parses.