String parser

I'm writing a code formatter to use on the board (similar to Lucky's but not C++). All is going well but I have a few problems which you will probably notice straight away.
1. Only one keyword is being formatted per line.
this is because I have a series of if-else-if statements so they all get skipped.
2. Keywords are being found inside other words.
3. Currently the single line comments only work when on a line by itself But I haven't really looked into that properly yet. Here is a sample of some formatted code

You need a while loop which operates on the remainder of what strstr returned.

dwk

Seek and ye shall find. quaere et invenies.

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell

I have tested the code and seems to work fine. Note however that it is a brute force algorithm, highly inneficient. Just for having some geek fun I could try to implement a better algorithm that I know. Anyway, for small codes this should be quick. Any problem with this code let me know.

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell

You know what I really wish more syntax highlighters had? Different colors for different levels of nested parentheses. e.g.:
if(a || (b && c))

Sometimes I hate counting parentheses to make sure I closed everything at the right place or to see if I have enough or too many. That example doesn't really make it look useful, but for more complex statements it would be a boon.

It's not fully modularized yet. I can get it to produce HTML output just by changing the vars at the top.

And of course, [ c o d e ] means without the spaces.

dwk

Seek and ye shall find. quaere et invenies.

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell