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