I re-used the components (see above) in a different program (again a parser with different needs) and I ended up with more or less the same one-liner.

auto dictionary = Lexicon(); // output range
string[string] lex = arr.byEntry().copy(dictionary).lexicon;

The only change necessary was the logic bit in the Entry struct (two lines had to be changed). I could emit the byComment() bit, because there are no comments in the source, without any complaints or side effects. Great stuff!

Reply via email to