I've decided to write a Python version based on the code structure, and thus shamelessly rip off this project (I'll retain credit to Jeffrey of course and keep it GPL). I'm not going to go into the reasons why I'm doing this (I do have them), but if anyone is interested in the result (or helping) let me know.
cheers,
-Si.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've tried re-writing webcpp in cgi with Perl. It works, but not quite well. Sometime this year, I plan on making a better Perl re-write.
I didn't know how to code in Perl when I started webcpp, and doing it in C++ was a very tedious task, because the source is now 3,000 lines. I bet it could be well under 1,000 in a language that has a regexp engine, like Perl.
C++ is still my favorite language, but Perl remains king when it comes to text processing/data manipulation.
Have fun ripping off my structure and implementing it in Python. Later on this year, I'm also planning to re-write about 60% of the current structure, because I have thought of a better way to do it.
--Jeffrey Bakker
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm on about 280 lines of python so far, and it's mostly done (I did cheat by 'compressing' the keywords to > 1 per line). My version only has support for CSS and is very basic.
It probably is better to use regex. What I was also trying to do was to use one of the format files of an existing syntax-highlighting editor, ie kate (from KDE) or cooledit, but it seems rather complicated. I liked your idea of the styles - something that a lot of other highlighters seem to hard-code.
-Simon.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've decided to write a Python version based on the code structure, and thus shamelessly rip off this project (I'll retain credit to Jeffrey of course and keep it GPL). I'm not going to go into the reasons why I'm doing this (I do have them), but if anyone is interested in the result (or helping) let me know.
cheers,
-Si.
I've tried re-writing webcpp in cgi with Perl. It works, but not quite well. Sometime this year, I plan on making a better Perl re-write.
I didn't know how to code in Perl when I started webcpp, and doing it in C++ was a very tedious task, because the source is now 3,000 lines. I bet it could be well under 1,000 in a language that has a regexp engine, like Perl.
C++ is still my favorite language, but Perl remains king when it comes to text processing/data manipulation.
Have fun ripping off my structure and implementing it in Python. Later on this year, I'm also planning to re-write about 60% of the current structure, because I have thought of a better way to do it.
--Jeffrey Bakker
I'm on about 280 lines of python so far, and it's mostly done (I did cheat by 'compressing' the keywords to > 1 per line). My version only has support for CSS and is very basic.
It probably is better to use regex. What I was also trying to do was to use one of the format files of an existing syntax-highlighting editor, ie kate (from KDE) or cooledit, but it seems rather complicated. I liked your idea of the styles - something that a lot of other highlighters seem to hard-code.
-Simon.