annotate runtime/syntax/ayacc.vim @ 481:66080ac5dab7 v7.0130

updated for version 7.0130
author vimboss
date Mon, 15 Aug 2005 21:41:48 +0000
parents 3fc0f57ecb91
children 91e53bcb7946
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: AYacc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Mathieu Clabaut <mathieu.clabaut@free.fr>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " LastChange: 02 May 2001
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " Original: Yacc, maintained by Dr. Charles E. Campbell, Jr.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " Comment: Replaced sourcing c.vim file by ada.vim and rename yacc*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " in ayacc*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " Read the Ada syntax to start with
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 so <sfile>:p:h/ada.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 runtime! syntax/ada.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 unlet b:current_syntax
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 " Clusters
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn cluster ayaccActionGroup contains=ayaccDelim,cInParen,cTodo,cIncluded,ayaccDelim,ayaccCurlyError,ayaccUnionCurly,ayaccUnion,cUserLabel,cOctalZero,cCppOut2,cCppSkip,cErrInBracket,cErrInParen,cOctalError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn cluster ayaccUnionGroup contains=ayaccKey,cComment,ayaccCurly,cType,cStructure,cStorageClass,ayaccUnionCurly
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 " Yacc stuff
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn match ayaccDelim "^[ \t]*[:|;]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn match ayaccOper "@\d\+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn match ayaccKey "^[ \t]*%\(token\|type\|left\|right\|start\|ident\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn match ayaccKey "[ \t]%\(prec\|expect\|nonassoc\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn match ayaccKey "\$\(<[a-zA-Z_][a-zA-Z_0-9]*>\)\=[\$0-9]\+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn keyword ayaccKeyActn yyerrok yyclearin
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn match ayaccUnionStart "^%union" skipwhite skipnl nextgroup=ayaccUnion
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 syn region ayaccUnion contained matchgroup=ayaccCurly start="{" matchgroup=ayaccCurly end="}" contains=@ayaccUnionGroup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn region ayaccUnionCurly contained matchgroup=ayaccCurly start="{" matchgroup=ayaccCurly end="}" contains=@ayaccUnionGroup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn match ayaccBrkt contained "[<>]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn match ayaccType "<[a-zA-Z_][a-zA-Z0-9_]*>" contains=ayaccBrkt
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 syn match ayaccDefinition "^[A-Za-z][A-Za-z0-9_]*[ \t]*:"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 " special Yacc separators
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn match ayaccSectionSep "^[ \t]*%%"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn match ayaccSep "^[ \t]*%{"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn match ayaccSep "^[ \t]*%}"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 " I'd really like to highlight just the outer {}. Any suggestions???
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn match ayaccCurlyError "[{}]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn region ayaccAction matchgroup=ayaccCurly start="{" end="}" contains=ALLBUT,@ayaccActionGroup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 if version >= 508 || !exists("did_ayacc_syntax_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 let did_ayacc_syntax_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 " Internal ayacc highlighting links
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 HiLink ayaccBrkt ayaccStmt
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 HiLink ayaccKey ayaccStmt
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 HiLink ayaccOper ayaccStmt
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 HiLink ayaccUnionStart ayaccKey
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 " External ayacc highlighting links
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 HiLink ayaccCurly Delimiter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 HiLink ayaccCurlyError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 HiLink ayaccDefinition Function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 HiLink ayaccDelim Function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 HiLink ayaccKeyActn Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 HiLink ayaccSectionSep Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 HiLink ayaccSep Delimiter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 HiLink ayaccStmt Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 HiLink ayaccType Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 " since Bram doesn't like my Delimiter :|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 HiLink Delimiter Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 let b:current_syntax = "ayacc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 " vim: ts=15