[Pas-dev] New Compiler
Status: Beta
Brought to you by:
mortis
From: Kyle R . B. <mo...@vo...> - 2003-05-11 04:08:58
|
I just checked in a new PSP compiler. This should fix the previously reported bug with newlines being dropped under specific circumstances. For the willing, please check out the latest CVS and give the new compiler a whirl. The old compiler used a search/replace regex approach (complicated, fragile, hard to extend, etc). The new approach uses split on PSP identifiers /(<%|%>)/ and then uses a state based approach on the resulting tokens. Some immediate benefits are that the compiler throws an exception if you nest PSP tags or if you leave a tag open to the end of a PSP file. The new compiler should be largely api compatible with the previous compiler, so code that called it should continue to work (the request handler and compile utilities both worked for me). The new implementation should also be much easier to add new features into - it is much easier to read and understand. In fact, instead of implementing includes as a special case, the new compiler now uses itself. It creates a compiler, uses it to compile the include file and then inserts the results into the including file. Thanks in advance for any help with testing. Kyle -- ------------------------------------------------------------------------------ Wisdom and Compassion are inseparable. -- Christmas Humphreys mo...@vo... http://www.voicenet.com/~mortis ------------------------------------------------------------------------------ |