My Opera is closing 3rd of March

Cronache di Sarvegia

...because every new challenge hides an opportunity

Improving the pseudo-ini parser

,

In a previous article I described how to create a parser for a pseudo-INI file. The grammar presented in the post is unfortunately unable to parse inline comments correctly.

I asked for ways to improve it, both on perlmonks and on IRC. After some testing it turns out that a slight change is enough: the first line of the grammar should be changed to:

AsIni: <skip: qr{\s*(;[^\n]*\n\s*)?}s> Line(s?) /\Z/

Unfortunately, this won't print the skipped content (as CommentLine) does. From the answers I had it's not quite clear if this is actually possible with Parse::RecDescent. Anyway, I am satisfied with the result so far smile

Parrocchie piccole, parrocchie grandi...Cronache di Sarvegia: dal 9 Luglio al 23 Agosto