On Sun, Aug 23, 2009 at 9:32 PM, BareFeet <list.develo...@tandb.com.au>wrote:
> Hi Keita, > > Hello, I'm writing a code editor and so far, i've been using Flex for >> regex-matching the whole document every time the text is changed and >> coloring appropriately... >> > > How are you doing this? How did you incorporate Flex or regex-matching? > It's terribly inefficient... Each time the text is modified, the whole text is sent into flex, which parses it into tokens (strings, comments, etc), and I colorize depending on what kind of token it is... I guess it's a little hard to describe. Anyways, I was thinking I could keep the basic flex part, and apply it only to the changed portions of the text. The problem with that is that I would have to check for quotes and record what's inside the quote from where the person started typing... But then that runs into the problem of somebody just putting their text cursor randomly in a string, etc etc. _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com