Mercurial > vim
annotate runtime/syntax/ayacc.vim @ 10048:43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Aug 30 23:26:57 2016 +0200
Updated runtime files. Remove version checks for Vim older than 6.0.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 30 Aug 2016 23:30:09 +0200 |
parents | 91e53bcb7946 |
children | 46763b01cd9a |
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 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
50 command -nargs=+ HiLink hi def link <args> |
7 | 51 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
52 " Internal ayacc highlighting links |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
53 HiLink ayaccBrkt ayaccStmt |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
54 HiLink ayaccKey ayaccStmt |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
55 HiLink ayaccOper ayaccStmt |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
56 HiLink ayaccUnionStart ayaccKey |
7 | 57 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
58 " External ayacc highlighting links |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
59 HiLink ayaccCurly Delimiter |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
60 HiLink ayaccCurlyError Error |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
61 HiLink ayaccDefinition Function |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
62 HiLink ayaccDelim Function |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
63 HiLink ayaccKeyActn Special |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
64 HiLink ayaccSectionSep Todo |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
65 HiLink ayaccSep Delimiter |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
66 HiLink ayaccStmt Statement |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
67 HiLink ayaccType Type |
7 | 68 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
69 " since Bram doesn't like my Delimiter :| |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
70 HiLink Delimiter Type |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
71 delcommand HiLink |
7 | 72 |
73 let b:current_syntax = "ayacc" | |
74 | |
3237 | 75 let &cpo = s:cpo_save |
76 unlet s:cpo_save | |
7 | 77 " vim: ts=15 |