Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: idea for pre-processing

From: greggirwin:mindspring at: 20-Jun-2002 11:09

Hi Anton, << I want to optionally strip debugging lines in my programs, so that they run at top speed without them. >> Should be DOable. ;) I haven't tackled it in REBOL, but have in another language. There it was fairly simple to do it in line oriented fashion, and the stuff I was processing all started with a specific object method call. E.g. Assert.Require ... Assert.Ensure ... In your example, looking for "if debug ["... would be similar, but then you'd have to actually parse things to find the end of the block if you want to handle debug code that spans more than one line. If you're building a deployment tool, writing it as a real parser might be a good way to go, maybe even if it's a runtime tool. A line-oriented approach would probably be too limiting, though it's easy to do. --Gregg