User:Peter17/GSoC-2011
Before May 25th
After establishing the contact with my mentor, Erik Rose, we decided to complete a comparison, that he had already started, of the different existing parsers. I created an account on GitHub to host a fork of Erik's mediawiki-parser project.
We needed between 3 and 4 weeks to put the final list in place, by testing and comparing the parsers, the simplicity of their usage and the understandability of their source code.
We finally decided that PEG parsers were probably the best choice and, among them, I felt that Pijnu was the most pleasant to use. I began to implement some parts of MediaWiki grammar in it as a proof of concept.
However, Pijnu had some limitations that we wanted to correct (Unicode support, comparison in tests, tests failing unexpectedly). So, I contacted Pijnu's developer, Denis "Spir" Derman, and we discussed those questions.
After Spir solved the issue of failing tests (a memoization reset was needed), I added a lot of test cases for my parser and continued to develop it.
May 25th to Mat 31st
I spent a long time working on wikitable parsing. I added simple and semi-complex test cases and had them parsed correctly.
I also added a TODO file which gives the current status of the different parts of MediaWiki syntax for my parser.
Erik had a look at my commits and corrected a space/tabs indentation problem. We have planned to communicate with each other by audio.
June 1st to June 7th
I managed to understand how to use comparisons in tests in Pijnu and adapted my tests to do so.
I corrected the parsing of '=' in text lines which made me rewrite the parsing of titles, which now respect the behavior of MediaWiki. I added the support for nested tables and nested templates.
I tested pyParsing a little more. This confirmed my opinion that Pijnu was the best PEG parsing library we had tested so far and was much more practical and easy to use than pyParsing.
Spir informed me that he couldn't assume the development of Pijnu "in a foreseeable future"; after discussing this with him and with Erik, I decided to maintain it, keep the GPLv3 license and make the developments necessary to the continuation of our mediawiki parser (such as Unicode support).
I had a long and helpful discussion with Erik about what was urgent, less urgent and not needed. It was said that the most urgent was to have a clear view of the pre/main/post-processing steps. I will write something about that as soon as possible, getting inspiration from how MediaWiki parser works.
June 8th to June 14th
I improved Pijnu so that it can handle multiline tests. Then, I adapted the test file of our parser to use this functionality.
After a few email exchanges with Spir, he sent me the latest version of Pijnu and I (manually) merged it with our GitHub repository, which is now the official one for Pijnu. At the same time, I updated the license information of Pijnu (I added myself as the current developer) and improved the code style to match (partially but better than before) the PEP8 style guide.
June 15th to June 21st
I added a basic Unicode support in Pijnu, so that our parser could parse Unicode strings.
Erik defined tickets from my TODO list and I added the PEG rules and Python tests for some of them (paragraphs, lists). I also rewrote a part of the current syntax definition in order to be able to parse escaping characters (eg. [ { | } ]) when not used in the definition of a link or a template.