parsing comments in scripts

Dar Scott dsc at swcp.com
Fri Dec 10 16:39:30 EST 2004


On Dec 10, 2004, at 1:28 PM, Mark Wieder wrote:

> RB> In general, I think you need to use the offset function for each 
> line
> RB> and check for either -- or # and count whether there is an even
> RB> number of double-quotes before it (setting for example itemdelim to
> RB> quote and get the item count). If count is odd, you are within
> RB> literal and should continue. If count is even, then you hit a
> RB> beginning of comment. I think this approach will work with all 
> cases.
...
> Yes - I was doing something complicated like that and hit on the
> tokens thing as a way to simplify and speed things up.

Don't forget special parsing for this:

format("..."

Dar

****************************************
     DSC
     http://www.swcp.com/dsc/
     Programming Services
****************************************



More information about the use-livecode mailing list