Mercurial > vim
annotate runtime/syntax/ayacc.vim @ 17096:a8e6a8fbe880
Added tag v8.1.1547 for changeset 10e0d7d96cb0ca636c06a17978c82427190626ce
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 15 Jun 2019 19:45:07 +0200 |
parents | 46763b01cd9a |
children |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: AYacc | |
3 " Maintainer: Mathieu Clabaut <mathieu.clabaut@free.fr> | |
3237 | 4 " LastChange: 2011 Dec 25 |
7 | 5 " Original: Yacc, maintained by Dr. Charles E. Campbell, Jr. |
6 " Comment: Replaced sourcing c.vim file by ada.vim and rename yacc* | |
7 " in ayacc* | |
8 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
9 " quit when a syntax file was already loaded |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
10 if exists("b:current_syntax") |
7 | 11 finish |
12 endif | |
13 | |
14 " Read the Ada syntax to start with | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
15 runtime! syntax/ada.vim |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
16 unlet b:current_syntax |
7 | 17 |
3237 | 18 let s:cpo_save = &cpo |
19 set cpo&vim | |
20 | |
7 | 21 " Clusters |
22 syn cluster ayaccActionGroup contains=ayaccDelim,cInParen,cTodo,cIncluded,ayaccDelim,ayaccCurlyError,ayaccUnionCurly,ayaccUnion,cUserLabel,cOctalZero,cCppOut2,cCppSkip,cErrInBracket,cErrInParen,cOctalError | |
23 syn cluster ayaccUnionGroup contains=ayaccKey,cComment,ayaccCurly,cType,cStructure,cStorageClass,ayaccUnionCurly | |
24 | |
25 " Yacc stuff | |
26 syn match ayaccDelim "^[ \t]*[:|;]" | |
27 syn match ayaccOper "@\d\+" | |
28 | |
29 syn match ayaccKey "^[ \t]*%\(token\|type\|left\|right\|start\|ident\)\>" | |
30 syn match ayaccKey "[ \t]%\(prec\|expect\|nonassoc\)\>" | |
31 syn match ayaccKey "\$\(<[a-zA-Z_][a-zA-Z_0-9]*>\)\=[\$0-9]\+" | |
32 syn keyword ayaccKeyActn yyerrok yyclearin | |
33 | |
34 syn match ayaccUnionStart "^%union" skipwhite skipnl nextgroup=ayaccUnion | |
35 syn region ayaccUnion contained matchgroup=ayaccCurly start="{" matchgroup=ayaccCurly end="}" contains=@ayaccUnionGroup | |
36 syn region ayaccUnionCurly contained matchgroup=ayaccCurly start="{" matchgroup=ayaccCurly end="}" contains=@ayaccUnionGroup | |
37 syn match ayaccBrkt contained "[<>]" | |
38 syn match ayaccType "<[a-zA-Z_][a-zA-Z0-9_]*>" contains=ayaccBrkt | |
39 syn match ayaccDefinition "^[A-Za-z][A-Za-z0-9_]*[ \t]*:" | |
40 | |
41 " special Yacc separators | |
42 syn match ayaccSectionSep "^[ \t]*%%" | |
43 syn match ayaccSep "^[ \t]*%{" | |
44 syn match ayaccSep "^[ \t]*%}" | |
45 | |
46 " I'd really like to highlight just the outer {}. Any suggestions??? | |
47 syn match ayaccCurlyError "[{}]" | |
48 syn region ayaccAction matchgroup=ayaccCurly start="{" end="}" contains=ALLBUT,@ayaccActionGroup | |
49 | |
50 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
51 " Internal ayacc highlighting links |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
52 hi def link ayaccBrkt ayaccStmt |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
53 hi def link ayaccKey ayaccStmt |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
54 hi def link ayaccOper ayaccStmt |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
55 hi def link ayaccUnionStart ayaccKey |
7 | 56 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
57 " External ayacc highlighting links |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
58 hi def link ayaccCurly Delimiter |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
59 hi def link ayaccCurlyError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
60 hi def link ayaccDefinition Function |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
61 hi def link ayaccDelim Function |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
62 hi def link ayaccKeyActn Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
63 hi def link ayaccSectionSep Todo |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
64 hi def link ayaccSep Delimiter |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
65 hi def link ayaccStmt Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
66 hi def link ayaccType Type |
7 | 67 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
68 " since Bram doesn't like my Delimiter :| |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
69 hi def link Delimiter Type |
7 | 70 |
71 let b:current_syntax = "ayacc" | |
72 | |
3237 | 73 let &cpo = s:cpo_save |
74 unlet s:cpo_save | |
7 | 75 " vim: ts=15 |