[GNC-dev] [GNC] Fwd: Failed - import of QIF files from Quicken
derek at ihtfp.com
Wed Feb 19 13:13:49 EST 2020
Adrien Monteleone <adrien.monteleone at lusfiber.net> writes:
> I seem to recall a development goal being to eliminate Scheme code
> except for reports.
> This might be a good candidate for just re-writing this in C/C++ with
> proper tests and verbose error output and/or logging.
> If someone with the skillset is interested of course.
I started a re-write of the QIF importer in C a very very long time
ago. That (failed) re-write has long-since been removed from the repo.
It turns out that C is not very good at tokenizing and parsing strings.
I am sure that using std::string in C++ would make it a lot easier to
reprogram, but honestly the existing QIF importer is fairly robust and
fairly well tested (via time).
The real downside of the current implementation is that it doesn't have
a test suite where you can throw test-case QIF files at it and ensure
you get a reasonable answer.
Having said that, whether or not you can actually throw an error with
the line number will depend deeply on where it fails. The way the
process works is that it reads in the file (line by line) and tokenizes
the data. At this point it would be relatively easy to output the line
number. Then, after the file is tokenized, it actually goes through and
parses the tokens for QIF correctness; most likely THIS is where the
failure occurs, but at this point we don't have line numbers any more.
So we COULD add a "see line number X" into the qif-file.scm (IIRC), but
I doubt that's the stage of the process where the error happens.
Derek Atkins 617-623-3745
derek at ihtfp.com www.ihtfp.com
Computer and Internet Security Consultant
More information about the gnucash-devel