annotate runtime/syntax/ayacc.vim @ 3273:c75a8d2404bd v7.3.405

updated for version 7.3.405 Problem: When xterm gets back the function keys it may delete the urxvt mouse termcap code. Solution: Check for the whole code, not just the start. (Egmont Koblinger)
author Bram Moolenaar <bram@vim.org>
date Fri, 20 Jan 2012 17:15:51 +0100
parents 91e53bcb7946
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: AYacc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Mathieu Clabaut <mathieu.clabaut@free.fr>
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
4 " LastChange: 2011 Dec 25
7
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
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
25 let s:cpo_save = &cpo
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
26 set cpo&vim
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
27
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 " Clusters
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 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
30 syn cluster ayaccUnionGroup contains=ayaccKey,cComment,ayaccCurly,cType,cStructure,cStorageClass,ayaccUnionCurly
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 " Yacc stuff
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn match ayaccDelim "^[ \t]*[:|;]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn match ayaccOper "@\d\+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn match ayaccKey "^[ \t]*%\(token\|type\|left\|right\|start\|ident\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn match ayaccKey "[ \t]%\(prec\|expect\|nonassoc\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn match ayaccKey "\$\(<[a-zA-Z_][a-zA-Z_0-9]*>\)\=[\$0-9]\+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 syn keyword ayaccKeyActn yyerrok yyclearin
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn match ayaccUnionStart "^%union" skipwhite skipnl nextgroup=ayaccUnion
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn region ayaccUnion contained matchgroup=ayaccCurly start="{" matchgroup=ayaccCurly end="}" contains=@ayaccUnionGroup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 syn region ayaccUnionCurly contained matchgroup=ayaccCurly start="{" matchgroup=ayaccCurly end="}" contains=@ayaccUnionGroup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn match ayaccBrkt contained "[<>]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn match ayaccType "<[a-zA-Z_][a-zA-Z0-9_]*>" contains=ayaccBrkt
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn match ayaccDefinition "^[A-Za-z][A-Za-z0-9_]*[ \t]*:"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 " special Yacc separators
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn match ayaccSectionSep "^[ \t]*%%"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 syn match ayaccSep "^[ \t]*%{"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn match ayaccSep "^[ \t]*%}"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 " I'd really like to highlight just the outer {}. Any suggestions???
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 syn match ayaccCurlyError "[{}]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn region ayaccAction matchgroup=ayaccCurly start="{" end="}" contains=ALLBUT,@ayaccActionGroup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 if version >= 508 || !exists("did_ayacc_syntax_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 let did_ayacc_syntax_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 " Internal ayacc highlighting links
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 HiLink ayaccBrkt ayaccStmt
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 HiLink ayaccKey ayaccStmt
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 HiLink ayaccOper ayaccStmt
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 HiLink ayaccUnionStart ayaccKey
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 " External ayacc highlighting links
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 HiLink ayaccCurly Delimiter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 HiLink ayaccCurlyError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 HiLink ayaccDefinition Function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 HiLink ayaccDelim Function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 HiLink ayaccKeyActn Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 HiLink ayaccSectionSep Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 HiLink ayaccSep Delimiter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 HiLink ayaccStmt Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 HiLink ayaccType Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 " since Bram doesn't like my Delimiter :|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 HiLink Delimiter Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 endif
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 = "ayacc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
89 let &cpo = s:cpo_save
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
90 unlet s:cpo_save
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 " vim: ts=15