annotate runtime/syntax/ayacc.vim @ 30023:87063bfe81cd v9.0.0349

patch 9.0.0349: filetype of *.sil files not well detected Commit: https://github.com/vim/vim/commit/be807d582499acbe314ead3891481cba6ca136df Author: Bram Moolenaar <Bram@vim.org> Date: Thu Sep 1 15:01:25 2022 +0100 patch 9.0.0349: filetype of *.sil files not well detected Problem: Filetype of *.sil files not well detected. Solution: Inspect the file contents to guess the filetype.
author Bram Moolenaar <Bram@vim.org>
date Thu, 01 Sep 2022 16:15:03 +0200
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: 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
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
18 let s:cpo_save = &cpo
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
19 set cpo&vim
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
20
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 " Clusters
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 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
23 syn cluster ayaccUnionGroup contains=ayaccKey,cComment,ayaccCurly,cType,cStructure,cStorageClass,ayaccUnionCurly
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 " Yacc stuff
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn match ayaccDelim "^[ \t]*[:|;]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn match ayaccOper "@\d\+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn match ayaccKey "^[ \t]*%\(token\|type\|left\|right\|start\|ident\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn match ayaccKey "[ \t]%\(prec\|expect\|nonassoc\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn match ayaccKey "\$\(<[a-zA-Z_][a-zA-Z_0-9]*>\)\=[\$0-9]\+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn keyword ayaccKeyActn yyerrok yyclearin
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn match ayaccUnionStart "^%union" skipwhite skipnl nextgroup=ayaccUnion
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn region ayaccUnion contained matchgroup=ayaccCurly start="{" matchgroup=ayaccCurly end="}" contains=@ayaccUnionGroup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn region ayaccUnionCurly contained matchgroup=ayaccCurly start="{" matchgroup=ayaccCurly end="}" contains=@ayaccUnionGroup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn match ayaccBrkt contained "[<>]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn match ayaccType "<[a-zA-Z_][a-zA-Z0-9_]*>" contains=ayaccBrkt
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 syn match ayaccDefinition "^[A-Za-z][A-Za-z0-9_]*[ \t]*:"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 " special Yacc separators
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn match ayaccSectionSep "^[ \t]*%%"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 syn match ayaccSep "^[ \t]*%{"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn match ayaccSep "^[ \t]*%}"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 " I'd really like to highlight just the outer {}. Any suggestions???
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn match ayaccCurlyError "[{}]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn region ayaccAction matchgroup=ayaccCurly start="{" end="}" contains=ALLBUT,@ayaccActionGroup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 let b:current_syntax = "ayacc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
73 let &cpo = s:cpo_save
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
74 unlet s:cpo_save
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 " vim: ts=15