parsing comments in scripts

Mark Wieder mwieder at ahsoftware.net
Wed Dec 15 13:41:39 EST 2004


Frank-

Wednesday, December 15, 2004, 6:19:23 AM, you wrote:

FDEJ> Any attempt to implement this functionality will result in a 'best
FDEJ> guess' approach.

Not necessarily. Most C compilers will have an option to allow nested
comments. A simple IsInComment counter would allow this: start
incrementing a counter at the first "/*", decrement the counter at
each "*/" and don't exit the comment processing until the count
reaches zero.

-- 
-Mark Wieder
 mwieder at ahsoftware.net



More information about the use-livecode mailing list