本来想看看语法高亮是怎么做的,我当然也知道简单的说就是选区-上颜色-改字体,仅此而已,不过这几乎没有什么实际意义,我想做到接近vs里面的效果,于是开始搜,第一个目标就是SharpDevelop,开源的c#编辑器,很好很强大,拖完源码打开一看,我就傻眼了,54个项目囧,我只能找到大致的位置,可层次太多,一头雾水,放弃。开始用google搜,中文的一个都没找到,英文的倒是找到一个
http://69.10.233.10/KB/miscctrl/FixingTheCode.aspx
不过作者下面这句话让我掉进了冰窟窿
I discovered that HighLighting is not easy. A simple wordlist might be, but when several 'rules' come into play: order is important. Paying attention to the order where in you define (and therefore execute) your rules will help a lot, but it is likely you still end up with conflicting rules.
作者还把关键字加重了
于是决定不靠别人了,自己想逻辑。