annotate runtime/syntax/pccts.vim @ 8033:a1b10634a28a v7.4.1311

commit https://github.com/vim/vim/commit/d090d7bab5a0d96559579e078dfdcc6d7d4f4713 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 13 17:09:53 2016 +0100 patch 7.4.1311 Problem: sock_T is defined too late. Solution: Move it up.
author Christian Brabandt <cb@256bit.org>
date Sat, 13 Feb 2016 17:15:06 +0100
parents 404aac550f35
children 43efa4f5a8ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: PCCTS
26
404aac550f35 updated for version 7.0017
vimboss
parents: 7
diff changeset
3 " Maintainer: Scott Bigham <dsb@killerbunnies.org>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " Last Change: 10 Aug 1999
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 " Read the C++ syntax to start with
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 syn include @cppTopLevel <sfile>:p:h/cpp.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 syn include @cppTopLevel syntax/cpp.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 syn region pcctsAction matchgroup=pcctsDelim start="<<" end=">>?\=" contains=@cppTopLevel,pcctsRuleRef
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 syn region pcctsArgBlock matchgroup=pcctsDelim start="\(>\s*\)\=\[" end="\]" contains=@cppTopLevel,pcctsRuleRef
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn region pcctsString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=pcctsSpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn match pcctsSpecialChar "\\\\\|\\\"" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn region pcctsComment start="/\*" end="\*/" contains=cTodo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn match pcctsComment "//.*$" contains=cTodo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn region pcctsDirective start="^\s*#header\s\+<<" end=">>" contains=pcctsAction keepend
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn match pcctsDirective "^\s*#parser\>.*$" contains=pcctsString,pcctsComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn match pcctsDirective "^\s*#tokdefs\>.*$" contains=pcctsString,pcctsComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn match pcctsDirective "^\s*#token\>.*$" contains=pcctsString,pcctsAction,pcctsTokenName,pcctsComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn region pcctsDirective start="^\s*#tokclass\s\+[A-Z]\i*\s\+{" end="}" contains=pcctsString,pcctsTokenName
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn match pcctsDirective "^\s*#lexclass\>.*$" contains=pcctsTokenName
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn region pcctsDirective start="^\s*#errclass\s\+[^{]\+\s\+{" end="}" contains=pcctsString,pcctsTokenName
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn match pcctsDirective "^\s*#pred\>.*$" contains=pcctsTokenName,pcctsAction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn cluster pcctsInRule contains=pcctsString,pcctsRuleName,pcctsTokenName,pcctsAction,pcctsArgBlock,pcctsSubRule,pcctsLabel,pcctsComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn region pcctsRule start="\<[a-z][A-Za-z0-9_]*\>\(\s*\[[^]]*\]\)\=\(\s*>\s*\[[^]]*\]\)\=\s*:" end=";" contains=@pcctsInRule
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn region pcctsSubRule matchgroup=pcctsDelim start="(" end=")\(+\|\*\|?\(\s*=>\)\=\)\=" contains=@pcctsInRule contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn region pcctsSubRule matchgroup=pcctsDelim start="{" end="}" contains=@pcctsInRule contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn match pcctsRuleName "\<[a-z]\i*\>" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn match pcctsTokenName "\<[A-Z]\i*\>" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 syn match pcctsLabel "\<\I\i*:\I\i*" contained contains=pcctsLabelHack,pcctsRuleName,pcctsTokenName
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn match pcctsLabel "\<\I\i*:\"\([^\\]\|\\.\)*\"" contained contains=pcctsLabelHack,pcctsString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn match pcctsLabelHack "\<\I\i*:" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 syn match pcctsRuleRef "\$\I\i*\>" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn match pcctsRuleRef "\$\d\+\(\.\d\+\)\>" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 syn keyword pcctsClass class nextgroup=pcctsClassName skipwhite
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 syn match pcctsClassName "\<\I\i*\>" contained nextgroup=pcctsClassBlock skipwhite skipnl
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 syn region pcctsClassBlock start="{" end="}" contained contains=pcctsRule,pcctsComment,pcctsDirective,pcctsAction,pcctsException,pcctsExceptionHandler
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn keyword pcctsException exception nextgroup=pcctsExceptionRuleRef skipwhite
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 syn match pcctsExceptionRuleRef "\[\I\i*\]" contained contains=pcctsExceptionID
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 syn match pcctsExceptionID "\I\i*" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 syn keyword pcctsExceptionHandler catch default
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 syn keyword pcctsExceptionHandler NoViableAlt NoSemViableAlt
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 syn keyword pcctsExceptionHandler MismatchedToken
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 syn sync clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 syn sync match pcctsSyncAction grouphere pcctsAction "<<"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 syn sync match pcctsSyncAction "<<\([^>]\|>[^>]\)*>>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 syn sync match pcctsSyncRule grouphere pcctsRule "\<[a-z][A-Za-z0-9_]*\>\s*\[[^]]*\]\s*:"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 syn sync match pcctsSyncRule grouphere pcctsRule "\<[a-z][A-Za-z0-9_]*\>\(\s*\[[^]]*\]\)\=\s*>\s*\[[^]]*\]\s*:"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 if version >= 508 || !exists("did_pccts_syntax_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 let did_pccts_syntax_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 HiLink pcctsDelim Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 HiLink pcctsTokenName Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 HiLink pcctsRuleName Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 HiLink pcctsLabelHack Label
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 HiLink pcctsDirective PreProc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 HiLink pcctsString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 HiLink pcctsComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 HiLink pcctsClass Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 HiLink pcctsClassName Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 HiLink pcctsException Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 HiLink pcctsExceptionHandler Keyword
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 HiLink pcctsExceptionRuleRef pcctsDelim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 HiLink pcctsExceptionID Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 HiLink pcctsRuleRef Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 HiLink pcctsSpecialChar SpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 let b:current_syntax = "pccts"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 " vim: ts=8