annotate runtime/syntax/pccts.vim @ 32015:018c77663f66 v9.0.1339

patch 9.0.1339: no test for :disassemble with class function Commit: https://github.com/vim/vim/commit/38f1ab31fa31196360dc4a31aeb388889b8bd6b8 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Feb 21 20:09:46 2023 +0000 patch 9.0.1339: no test for :disassemble with class function Problem: No test for :disassemble with class function. Solution: Add a test.
author Bram Moolenaar <Bram@vim.org>
date Tue, 21 Feb 2023 21:15:03 +0100
parents 46763b01cd9a
children
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
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
6 " quit when a syntax file was already loaded
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
7 if exists("b:current_syntax")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " Read the C++ syntax to start with
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
12 syn include @cppTopLevel syntax/cpp.vim
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 syn region pcctsAction matchgroup=pcctsDelim start="<<" end=">>?\=" contains=@cppTopLevel,pcctsRuleRef
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 syn region pcctsArgBlock matchgroup=pcctsDelim start="\(>\s*\)\=\[" end="\]" contains=@cppTopLevel,pcctsRuleRef
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 syn region pcctsString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=pcctsSpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 syn match pcctsSpecialChar "\\\\\|\\\"" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 syn region pcctsComment start="/\*" end="\*/" contains=cTodo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 syn match pcctsComment "//.*$" contains=cTodo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 syn region pcctsDirective start="^\s*#header\s\+<<" end=">>" contains=pcctsAction keepend
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn match pcctsDirective "^\s*#parser\>.*$" contains=pcctsString,pcctsComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn match pcctsDirective "^\s*#tokdefs\>.*$" contains=pcctsString,pcctsComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn match pcctsDirective "^\s*#token\>.*$" contains=pcctsString,pcctsAction,pcctsTokenName,pcctsComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 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
29 syn match pcctsDirective "^\s*#lexclass\>.*$" contains=pcctsTokenName
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn region pcctsDirective start="^\s*#errclass\s\+[^{]\+\s\+{" end="}" contains=pcctsString,pcctsTokenName
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn match pcctsDirective "^\s*#pred\>.*$" contains=pcctsTokenName,pcctsAction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn cluster pcctsInRule contains=pcctsString,pcctsRuleName,pcctsTokenName,pcctsAction,pcctsArgBlock,pcctsSubRule,pcctsLabel,pcctsComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 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
36
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn region pcctsSubRule matchgroup=pcctsDelim start="(" end=")\(+\|\*\|?\(\s*=>\)\=\)\=" contains=@pcctsInRule contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn region pcctsSubRule matchgroup=pcctsDelim start="{" end="}" contains=@pcctsInRule contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn match pcctsRuleName "\<[a-z]\i*\>" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn match pcctsTokenName "\<[A-Z]\i*\>" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 syn match pcctsLabel "\<\I\i*:\I\i*" contained contains=pcctsLabelHack,pcctsRuleName,pcctsTokenName
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn match pcctsLabel "\<\I\i*:\"\([^\\]\|\\.\)*\"" contained contains=pcctsLabelHack,pcctsString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn match pcctsLabelHack "\<\I\i*:" 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 pcctsRuleRef "\$\I\i*\>" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn match pcctsRuleRef "\$\d\+\(\.\d\+\)\>" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 syn keyword pcctsClass class nextgroup=pcctsClassName skipwhite
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn match pcctsClassName "\<\I\i*\>" contained nextgroup=pcctsClassBlock skipwhite skipnl
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn region pcctsClassBlock start="{" end="}" contained contains=pcctsRule,pcctsComment,pcctsDirective,pcctsAction,pcctsException,pcctsExceptionHandler
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 syn keyword pcctsException exception nextgroup=pcctsExceptionRuleRef skipwhite
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn match pcctsExceptionRuleRef "\[\I\i*\]" contained contains=pcctsExceptionID
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 syn match pcctsExceptionID "\I\i*" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 syn keyword pcctsExceptionHandler catch default
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 syn keyword pcctsExceptionHandler NoViableAlt NoSemViableAlt
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 syn keyword pcctsExceptionHandler MismatchedToken
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn sync clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 syn sync match pcctsSyncAction grouphere pcctsAction "<<"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 syn sync match pcctsSyncAction "<<\([^>]\|>[^>]\)*>>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 syn sync match pcctsSyncRule grouphere pcctsRule "\<[a-z][A-Za-z0-9_]*\>\s*\[[^]]*\]\s*:"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 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
66
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 " Define the default highlighting.
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
68 " Only when an item doesn't have highlighting yet
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
70 hi def link pcctsDelim Special
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
71 hi def link pcctsTokenName Identifier
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
72 hi def link pcctsRuleName Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
73 hi def link pcctsLabelHack Label
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
74 hi def link pcctsDirective PreProc
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
75 hi def link pcctsString String
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
76 hi def link pcctsComment Comment
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
77 hi def link pcctsClass Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
78 hi def link pcctsClassName Identifier
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
79 hi def link pcctsException Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
80 hi def link pcctsExceptionHandler Keyword
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
81 hi def link pcctsExceptionRuleRef pcctsDelim
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
82 hi def link pcctsExceptionID Identifier
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
83 hi def link pcctsRuleRef Identifier
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
84 hi def link pcctsSpecialChar SpecialChar
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 let b:current_syntax = "pccts"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 " vim: ts=8