Re: Syntax Coloring?
Re: Syntax Coloring?
- Subject: Re: Syntax Coloring?
- From: Keitaroh Kobayashi <email@hidden>
- Date: Mon, 24 Aug 2009 22:36:14 -0300
On Sun, Aug 23, 2009 at 9:32 PM, BareFeet <email@hidden>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 (email@hidden)
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:
This email sent to email@hidden