Re: Bug in crm114 parser? Or is it me again?

Bill Yerazunis <[email protected]>
Newsgroups gmane.mail.spam.crm114
Message-ID <[email protected]>
   From: "Ger Hobbelt" <[email protected]>
   >
   > buggaFARRR

   Whoopsky. Yep, you are correct. Forgot the regex subexpression braces in there.

   <evil grin> Something for crm114 v3.0 to have a la GCC and other
   compilers which warn you when your arg count does not match the %
   items in your 'C' printf: "did the crm script programmer provide as
   many subexpressions as (s)he did provide variables to store them in?"
   if not, warn.

Not quite.  

    match /a(bad)*(clock)+/   (:1: :2:)

is perfectly legal, and reasonable (you might want repeated "clock"s,
but have no desire to bind to them).

The other way is an error:

    match  /this is (wrong)/   (:1: :2: :3:)

which I don't recall if we check for or not.

   Of course, that would not work for run-time generated regexes, but it
   would help script novices like me. :-P   Alas, that's for someone else
   to introduce in the compiler.

This is why the current compiler is a minimal as it is (that, and
lazyness.)  

If you pre-parse too deeply, and there's an embedded :*: or :+:
redirection, or any EVALs (since EVAL is repeated evaluation) then
all of the pre-compiled substring pointers *give you the wrong answers*. 

In the general case, finding the start and end of each chunk 
*correctly* is as far as you can do at "compile" time.

	    - Bill

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.