2 ms·
Sometimes the best thing you do is learn at least one parsing framework so that you can write your own parsers. The advantage of this is you know exactly what t
by nly 6y ago
Sometimes the best thing you do is learn at least one parsing framework so that you can write your own parsers. The advantage of this is you know exactly what the behavior will be.
Here's a CSV parser in ~40 lines of C++ using Boost Spirit that handles all kinds of weird cases:
https://gcc.godbolt.org/z/KGUHXo https://gcc.godbolt.org/z/KGUHXo
It's easy to customize, declarative, and compiles down to about ~15KB.