annotate runtime/syntax/abel.vim @ 5231:74d2f3188cd0 v7.4a.041

updated for version 7.4a.041 Problem: When using ":new ++ff=unix" and "dos" is first in 'fileformats' then 'ff' is set to "dos" instead of "unix". (Ingo Karkat) Solution: Create set_file_options() and invoke it from do_ecmd().
author Bram Moolenaar <bram@vim.org>
date Wed, 24 Jul 2013 15:02:03 +0200
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: ABEL
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
3 " Maintainer: John Cook <johncook3@gmail.com>
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
4 " Last Change: 2011 Dec 27
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 elseif exists("b:current_syntax")
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
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
14 let s:cpo_save = &cpo
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
15 set cpo&vim
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
16
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " this language is oblivious to case
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 " A bunch of keywords
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 syn keyword abelHeader module title device options
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 syn keyword abelSection declarations equations test_vectors end
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 syn keyword abelDeclaration state truth_table state_diagram property
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 syn keyword abelType pin node attribute constant macro library
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn keyword abelTypeId com reg neg pos buffer dc reg_d reg_t contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn keyword abelTypeId reg_sr reg_jk reg_g retain xor invert contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn keyword abelStatement when then else if with endwith case endcase
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn keyword abelStatement fuses expr trace
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 " option to omit obsolete statements
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 if exists("abel_obsolete_ok")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn keyword abelStatement enable flag in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn keyword abelError enable flag in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " directives
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn match abelDirective "@alternate"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn match abelDirective "@standard"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn match abelDirective "@const"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 syn match abelDirective "@dcset"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn match abelDirective "@include"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn match abelDirective "@page"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn match abelDirective "@radix"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn match abelDirective "@repeat"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn match abelDirective "@irp"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn match abelDirective "@expr"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 syn match abelDirective "@if"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn match abelDirective "@ifb"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn match abelDirective "@ifnb"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn match abelDirective "@ifdef"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 syn match abelDirective "@ifndef"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn match abelDirective "@ifiden"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 syn match abelDirective "@ifniden"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 syn keyword abelTodo contained TODO XXX FIXME
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 " wrap up type identifiers to differentiate them from normal strings
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn region abelSpecifier start='istype' end=';' contains=abelTypeIdChar,abelTypeId,abelTypeIdEnd keepend
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 syn match abelTypeIdChar "[,']" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 syn match abelTypeIdEnd ";" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 " string contstants and special characters within them
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 syn match abelSpecial contained "\\['\\]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 syn region abelString start=+'+ skip=+\\"+ end=+'+ contains=abelSpecial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 " valid integer number formats (decimal, binary, octal, hex)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 syn match abelNumber "\<[-+]\=[0-9]\+\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 syn match abelNumber "\^d[0-9]\+\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 syn match abelNumber "\^b[01]\+\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 syn match abelNumber "\^o[0-7]\+\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 syn match abelNumber "\^h[0-9a-f]\+\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 " special characters
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 " (define these after abelOperator so ?= overrides ?)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 syn match abelSpecialChar "[\[\](){},;:?]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 " operators
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 syn match abelLogicalOperator "[!#&$]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 syn match abelRangeOperator "\.\."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 syn match abelAlternateOperator "[/*+]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 syn match abelAlternateOperator ":[+*]:"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 syn match abelArithmeticOperator "[-%]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 syn match abelArithmeticOperator "<<"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 syn match abelArithmeticOperator ">>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 syn match abelRelationalOperator "[<>!=]="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 syn match abelRelationalOperator "[<>]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 syn match abelAssignmentOperator "[:?]\=="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 syn match abelAssignmentOperator "?:="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 syn match abelTruthTableOperator "->"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 " signal extensions
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 syn match abelExtension "\.aclr\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 syn match abelExtension "\.aset\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 syn match abelExtension "\.clk\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 syn match abelExtension "\.clr\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 syn match abelExtension "\.com\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 syn match abelExtension "\.fb\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 syn match abelExtension "\.[co]e\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 syn match abelExtension "\.l[eh]\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 syn match abelExtension "\.fc\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 syn match abelExtension "\.pin\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 syn match abelExtension "\.set\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 syn match abelExtension "\.[djksrtq]\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 syn match abelExtension "\.pr\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 syn match abelExtension "\.re\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 syn match abelExtension "\.a[pr]\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 syn match abelExtension "\.s[pr]\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 " special constants
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 syn match abelConstant "\.[ckudfpxz]\."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 syn match abelConstant "\.sv[2-9]\."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 " one-line comments
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 syn region abelComment start=+"+ end=+"\|$+ contains=abelNumber,abelTodo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 " option to prevent C++ style comments
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 if !exists("abel_cpp_comments_illegal")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 syn region abelComment start=+//+ end=+$+ contains=abelNumber,abelTodo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 syn sync minlines=1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 if version >= 508 || !exists("did_abel_syn_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 let did_abel_syn_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 " The default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 HiLink abelHeader abelStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 HiLink abelSection abelStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 HiLink abelDeclaration abelStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 HiLink abelLogicalOperator abelOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 HiLink abelRangeOperator abelOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 HiLink abelAlternateOperator abelOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 HiLink abelArithmeticOperator abelOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 HiLink abelRelationalOperator abelOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 HiLink abelAssignmentOperator abelOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 HiLink abelTruthTableOperator abelOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 HiLink abelSpecifier abelStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 HiLink abelOperator abelStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 HiLink abelStatement Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 HiLink abelIdentifier Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 HiLink abelTypeId abelType
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 HiLink abelTypeIdChar abelType
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 HiLink abelType Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154 HiLink abelNumber abelString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 HiLink abelString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 HiLink abelConstant Constant
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 HiLink abelComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 HiLink abelExtension abelSpecial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 HiLink abelSpecialChar abelSpecial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 HiLink abelTypeIdEnd abelSpecial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 HiLink abelSpecial Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 HiLink abelDirective PreProc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 HiLink abelTodo Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 HiLink abelError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 let b:current_syntax = "abel"
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
170
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
171 let &cpo = s:cpo_save
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
172 unlet s:cpo_save
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
173
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 " vim:ts=8