📄 pccts.vim
字号:
" Vim syntax file" Language: PCCTS" Maintainer: Scott Bigham <dsb@cs.duke.edu>" Last Change: 10 Aug 1999" For version 5.x: Clear all syntax items" For version 6.x: Quit when a syntax file was already loadedif version < 600 syntax clearelseif exists("b:current_syntax") finishendif" Read the C++ syntax to start withif version < 600 syn include @cppTopLevel <sfile>:p:h/cpp.vimelse syn include @cppTopLevel syntax/cpp.vimendifsyn region pcctsAction matchgroup=pcctsDelim start="<<" end=">>?\=" contains=@cppTopLevel,pcctsRuleRefsyn region pcctsArgBlock matchgroup=pcctsDelim start="\(>\s*\)\=\[" end="\]" contains=@cppTopLevel,pcctsRuleRefsyn region pcctsString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=pcctsSpecialCharsyn match pcctsSpecialChar "\\\\\|\\\"" containedsyn region pcctsComment start="/\*" end="\*/" contains=cTodosyn match pcctsComment "//.*$" contains=cTodosyn region pcctsDirective start="^\s*#header\s\+<<" end=">>" contains=pcctsAction keependsyn match pcctsDirective "^\s*#parser\>.*$" contains=pcctsString,pcctsCommentsyn match pcctsDirective "^\s*#tokdefs\>.*$" contains=pcctsString,pcctsCommentsyn match pcctsDirective "^\s*#token\>.*$" contains=pcctsString,pcctsAction,pcctsTokenName,pcctsCommentsyn region pcctsDirective start="^\s*#tokclass\s\+[A-Z]\i*\s\+{" end="}" contains=pcctsString,pcctsTokenNamesyn match pcctsDirective "^\s*#lexclass\>.*$" contains=pcctsTokenNamesyn region pcctsDirective start="^\s*#errclass\s\+[^{]\+\s\+{" end="}" contains=pcctsString,pcctsTokenNamesyn match pcctsDirective "^\s*#pred\>.*$" contains=pcctsTokenName,pcctsActionsyn cluster pcctsInRule contains=pcctsString,pcctsRuleName,pcctsTokenName,pcctsAction,pcctsArgBlock,pcctsSubRule,pcctsLabel,pcctsCommentsyn region pcctsRule start="\<[a-z][A-Za-z0-9_]*\>\(\s*\[[^]]*\]\)\=\(\s*>\s*\[[^]]*\]\)\=\s*:" end=";" contains=@pcctsInRulesyn region pcctsSubRule matchgroup=pcctsDelim start="(" end=")\(+\|\*\|?\(\s*=>\)\=\)\=" contains=@pcctsInRule containedsyn region pcctsSubRule matchgroup=pcctsDelim start="{" end="}" contains=@pcctsInRule containedsyn match pcctsRuleName "\<[a-z]\i*\>" containedsyn match pcctsTokenName "\<[A-Z]\i*\>" containedsyn match pcctsLabel "\<\I\i*:\I\i*" contained contains=pcctsLabelHack,pcctsRuleName,pcctsTokenNamesyn match pcctsLabel "\<\I\i*:\"\([^\\]\|\\.\)*\"" contained contains=pcctsLabelHack,pcctsStringsyn match pcctsLabelHack "\<\I\i*:" containedsyn match pcctsRuleRef "\$\I\i*\>" containedsyn match pcctsRuleRef "\$\d\+\(\.\d\+\)\>" containedsyn keyword pcctsClass class nextgroup=pcctsClassName skipwhitesyn match pcctsClassName "\<\I\i*\>" contained nextgroup=pcctsClassBlock skipwhite skipnlsyn region pcctsClassBlock start="{" end="}" contained contains=pcctsRule,pcctsComment,pcctsDirective,pcctsAction,pcctsException,pcctsExceptionHandlersyn keyword pcctsException exception nextgroup=pcctsExceptionRuleRef skipwhitesyn match pcctsExceptionRuleRef "\[\I\i*\]" contained contains=pcctsExceptionIDsyn match pcctsExceptionID "\I\i*" containedsyn keyword pcctsExceptionHandler catch defaultsyn keyword pcctsExceptionHandler NoViableAlt NoSemViableAltsyn keyword pcctsExceptionHandler MismatchedTokensyn sync clearsyn sync match pcctsSyncAction grouphere pcctsAction "<<"syn sync match pcctsSyncAction "<<\([^>]\|>[^>]\)*>>"syn sync match pcctsSyncRule grouphere pcctsRule "\<[a-z][A-Za-z0-9_]*\>\s*\[[^]]*\]\s*:"syn sync match pcctsSyncRule grouphere pcctsRule "\<[a-z][A-Za-z0-9_]*\>\(\s*\[[^]]*\]\)\=\s*>\s*\[[^]]*\]\s*:"" Define the default highlighting." For version 5.7 and earlier: only when not done already" For version 5.8 and later: only when an item doesn't have highlighting yetif version >= 508 || !exists("did_pccts_syntax_inits") if version < 508 let did_pccts_syntax_inits = 1 command -nargs=+ HiLink hi link <args> else command -nargs=+ HiLink hi def link <args> endif HiLink pcctsDelim Special HiLink pcctsTokenName Identifier HiLink pcctsRuleName Statement HiLink pcctsLabelHack Label HiLink pcctsDirective PreProc HiLink pcctsString String HiLink pcctsComment Comment HiLink pcctsClass Statement HiLink pcctsClassName Identifier HiLink pcctsException Statement HiLink pcctsExceptionHandler Keyword HiLink pcctsExceptionRuleRef pcctsDelim HiLink pcctsExceptionID Identifier HiLink pcctsRuleRef Identifier HiLink pcctsSpecialChar SpecialChar delcommand HiLinkendiflet b:current_syntax = "pccts"" vim: ts=8
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -