annotate runtime/syntax/verilog.vim @ 6226:2fd96725b063 v7.4.448

updated for version 7.4.448 Problem: Using ETO_IGNORELANGUAGE causes problems. Solution: Remove this flag. (Paul Moore)
author Bram Moolenaar <bram@vim.org>
date Fri, 19 Sep 2014 16:13:53 +0200
parents 3502a7f991fc
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: Verilog
1120
e6db096b07a1 updated for version 7.1a
vimboss
parents: 316
diff changeset
3 " Maintainer: Mun Johl <Mun.Johl@emulex.com>
3082
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1120
diff changeset
4 " Last Update: Wed Jul 20 16:04:19 PDT 2011
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
3082
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1120
diff changeset
14 " Set the local value of the 'iskeyword' option.
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1120
diff changeset
15 " NOTE: '?' was added so that verilogNumber would be processed correctly when
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1120
diff changeset
16 " '?' is the last character of the number.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 if version >= 600
3082
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1120
diff changeset
18 setlocal iskeyword=@,48-57,63,_,192-255
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 else
3082
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1120
diff changeset
20 set iskeyword=@,48-57,63,_,192-255
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 " A bunch of useful Verilog keywords
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn keyword verilogStatement always and assign automatic buf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn keyword verilogStatement bufif0 bufif1 cell cmos
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn keyword verilogStatement config deassign defparam design
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn keyword verilogStatement disable edge endconfig
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn keyword verilogStatement endfunction endgenerate endmodule
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn keyword verilogStatement endprimitive endspecify endtable endtask
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn keyword verilogStatement event force function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn keyword verilogStatement generate genvar highz0 highz1 ifnone
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn keyword verilogStatement incdir include initial inout input
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn keyword verilogStatement instance integer large liblist
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn keyword verilogStatement library localparam macromodule medium
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn keyword verilogStatement module nand negedge nmos nor
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn keyword verilogStatement noshowcancelled not notif0 notif1 or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn keyword verilogStatement output parameter pmos posedge primitive
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 syn keyword verilogStatement pull0 pull1 pulldown pullup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn keyword verilogStatement pulsestyle_onevent pulsestyle_ondetect
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn keyword verilogStatement rcmos real realtime reg release
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn keyword verilogStatement rnmos rpmos rtran rtranif0 rtranif1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 syn keyword verilogStatement scalared showcancelled signed small
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn keyword verilogStatement specify specparam strong0 strong1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn keyword verilogStatement supply0 supply1 table task time tran
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn keyword verilogStatement tranif0 tranif1 tri tri0 tri1 triand
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn keyword verilogStatement trior trireg unsigned use vectored wait
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn keyword verilogStatement wand weak0 weak1 wire wor xnor xor
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn keyword verilogLabel begin end fork join
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 syn keyword verilogConditional if else case casex casez default endcase
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn keyword verilogRepeat forever repeat while for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52
3082
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1120
diff changeset
53 syn keyword verilogTodo contained TODO FIXME
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn match verilogOperator "[&|~><!)(*#%@+/=?:;}{,.\^\-\[\]]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56
316
96789bc4346a updated for version 7.0083
vimboss
parents: 7
diff changeset
57 syn region verilogComment start="/\*" end="\*/" contains=verilogTodo,@Spell
96789bc4346a updated for version 7.0083
vimboss
parents: 7
diff changeset
58 syn match verilogComment "//.*" contains=verilogTodo,@Spell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 "syn match verilogGlobal "`[a-zA-Z0-9_]\+\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn match verilogGlobal "`celldefine"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 syn match verilogGlobal "`default_nettype"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 syn match verilogGlobal "`define"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 syn match verilogGlobal "`else"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 syn match verilogGlobal "`elsif"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 syn match verilogGlobal "`endcelldefine"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 syn match verilogGlobal "`endif"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 syn match verilogGlobal "`ifdef"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 syn match verilogGlobal "`ifndef"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 syn match verilogGlobal "`include"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 syn match verilogGlobal "`line"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 syn match verilogGlobal "`nounconnected_drive"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 syn match verilogGlobal "`resetall"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 syn match verilogGlobal "`timescale"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 syn match verilogGlobal "`unconnected_drive"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 syn match verilogGlobal "`undef"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 syn match verilogGlobal "$[a-zA-Z0-9_]\+\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 syn match verilogConstant "\<[A-Z][A-Z0-9_]\+\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80
1120
e6db096b07a1 updated for version 7.1a
vimboss
parents: 316
diff changeset
81 syn match verilogNumber "\(\<\d\+\|\)'[sS]\?[bB]\s*[0-1_xXzZ?]\+\>"
e6db096b07a1 updated for version 7.1a
vimboss
parents: 316
diff changeset
82 syn match verilogNumber "\(\<\d\+\|\)'[sS]\?[oO]\s*[0-7_xXzZ?]\+\>"
e6db096b07a1 updated for version 7.1a
vimboss
parents: 316
diff changeset
83 syn match verilogNumber "\(\<\d\+\|\)'[sS]\?[dD]\s*[0-9_xXzZ?]\+\>"
e6db096b07a1 updated for version 7.1a
vimboss
parents: 316
diff changeset
84 syn match verilogNumber "\(\<\d\+\|\)'[sS]\?[hH]\s*[0-9a-fA-F_xXzZ?]\+\>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 syn match verilogNumber "\<[+-]\=[0-9_]\+\(\.[0-9_]*\|\)\(e[0-9_]*\|\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86
316
96789bc4346a updated for version 7.0083
vimboss
parents: 7
diff changeset
87 syn region verilogString start=+"+ skip=+\\"+ end=+"+ contains=verilogEscape,@Spell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 syn match verilogEscape +\\[nt"\\]+ contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 syn match verilogEscape "\\\o\o\=\o\=" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 " Directives
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 syn match verilogDirective "//\s*synopsys\>.*$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 syn region verilogDirective start="/\*\s*synopsys\>" end="\*/"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 syn region verilogDirective start="//\s*synopsys dc_script_begin\>" end="//\s*synopsys dc_script_end\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 syn match verilogDirective "//\s*\$s\>.*$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 syn region verilogDirective start="/\*\s*\$s\>" end="\*/"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 syn region verilogDirective start="//\s*\$s dc_script_begin\>" end="//\s*\$s dc_script_end\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 "Modify the following as needed. The trade-off is performance versus
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 "functionality.
316
96789bc4346a updated for version 7.0083
vimboss
parents: 7
diff changeset
102 syn sync minlines=50
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 " 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
107 if version >= 508 || !exists("did_verilog_syn_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 let did_verilog_syn_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 " The default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 HiLink verilogCharacter Character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 HiLink verilogConditional Conditional
3082
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1120
diff changeset
118 HiLink verilogRepeat Repeat
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1120
diff changeset
119 HiLink verilogString String
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1120
diff changeset
120 HiLink verilogTodo Todo
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1120
diff changeset
121 HiLink verilogComment Comment
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1120
diff changeset
122 HiLink verilogConstant Constant
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1120
diff changeset
123 HiLink verilogLabel Label
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1120
diff changeset
124 HiLink verilogNumber Number
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1120
diff changeset
125 HiLink verilogOperator Special
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1120
diff changeset
126 HiLink verilogStatement Statement
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1120
diff changeset
127 HiLink verilogGlobal Define
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1120
diff changeset
128 HiLink verilogDirective SpecialComment
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 HiLink verilogEscape Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 let b:current_syntax = "verilog"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 " vim: ts=8