Re: Block Commenting

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Sun, Aug 03, 2003 at 10:52:38AM +0000, Andy Serpa wrote:
> I was actually thinking about this recently -- what if any of us could 
> add any kind of short-hand to Euphoria that we liked?  Now of course I 
> can make a pre-processor that converts my special code to 
> Euphoria-compliant code if I want, but then you've got to manage 
> different sets of source files, ex.err will refer to the final version 
> only, etc.
> 
> What if there was a standard pre-processing protocol built-in the 
> interpreter? Users could optionally link a pre-processor syntax file to 
> the interpreter, which would automatically convert the user source files 
> to regular Euphoria before it gets on with the actual interpreting.  In 
> other words, allow custom exentions to the parser.  And when errors 
> occur, the line numbers could be synchronized with the original source 
> (or with the converted source as well as an option).
> 
> Now this is a project that would probably need to tackled by one of us, 
> but it would be a lot more feasible if some of the facility was built-in 
> to the interpreter.  I suppose you could make a front-end that did the 
> preprocessing, called the interpreter, and caught the error file, but 
> there would be more overhead.
> 
> -- Andy
> 

The overhead would be less if the preprocessor was outside of the interpreter
actually...that way it wouldn't be run EVERY SINGLE TIME but only when it
is needed. Its even possible to compare the time stamps of the preprocessor
file and the converted file, so if the converted file is newer than don't bother
using the preprocessor since we know we already compiled the latest version.

The little-known Dredge preprocessor already has a facility to convert an
ex.err file into a dredge.err file, and an editor that lets you edit and
run a dredge preprocessor file the same way ed.ex lets you edit and run
an euphoria file. Also a facility that lets you run a dredge file the way
exu will run an euphoria file from the command line.

Dredge doesn't support using cached compiled files and timestamps yet tho,
but that wouldn't be extraordinary difficult to add.

It also doesn't support invoking arbituary preprocessors on the source code,
that would not be so easy to add but its doable (right now Dredge only
handles Dredge code).

jbrown

-- 
 /"\  ASCII ribbon              | http://www.geocities.com/jbrown1050/
 \ /  campain against           | Linux User:190064
  X   HTML in e-mail and        | Linux Machine:84163
 /*\  news, and unneeded MIME   | http://verify.stanford.edu/evote.html

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu