求个高亮c操作符的的语法文件
发表于 : 2010-12-03 1:00
本来想自己写的,但发现各种嵌套和优先问题,实在是不好搞
不知道有没有现成的代码,默认的不知道操作符高亮
不知道有没有现成的代码,默认的不知道操作符高亮
代码: 全选
"===========================================================
" 自定义高亮
"===========================================================
syntax match mcLineContinue "\\$" contained
" 高亮宏定义
"syn region mcPreproc start="^#" end="*)\s+"
"syn match mcMacro "\<[A-Z][A-Z0-9_]*\>"
"hi def link mcMacro Constant
" 高亮函数
syn match mcFunction display "\<[a-zA-Z_][a-zA-Z0-9_]*\>\s*("me=e-1 contains=cLineContinue
hi def link mcFunction Function
" 高亮常数,以全大写分辨
syn match mcConstant display "\<[A-Z][A-Z0-9_]*\>" contains=mcFunction
hi def link mcConstant Constant
syn match mcOperator display "+\|-\|\*\|/\|%\|=\|<\|>\|&\||\|!\|\~\|\^\|\.\|?\|:" contains=cComment,cCommentL
hi link mcOperator Operator