" Vim syntax file
" Language:	Verilog
" Maintainer:	Mun Johl <mj@core.rose.hp.com>
" Last change:  Fri May  2 08:17:56 PDT 1997

" Remove any old syntax stuff hanging around
syntax clear

" A bunch of useful Verilog keywords
syntax keyword verilogStatement   disable assign deassign force release
syntax keyword verilogStatement   parameter function endfunction
syntax keyword verilogStatement   always initial module endmodule
syntax keyword verilogStatement   task endtask
syntax keyword verilogStatement   input output inout reg wire
syntax keyword verilogStatement   posedge negedge wait
syntax keyword verilogStatement   buf pullup pull0 pull1 pulldown
syntax keyword verilogStatement   tri0 tri1 tri trireg
syntax keyword verilogStatement   wand wor triand trior
syntax keyword verilogStatement   defparam
syntax keyword verilogStatement   integer real
syntax keyword verilogLabel       begin end
syntax keyword verilogConditional if else case casex casez default endcase
"syntax keyword verilogConditional   ? :
syntax keyword verilogRepeat        forever repeat while for
"syntax keyword verilogUnaryOperator ! ~ & ~& | ^| ^ ~^
"syntax keyword verilogBinaryOperator + - * / % == != === !== && || < <= > >=
"syntax keyword verilogBinaryOperator >> << ^~

syntax keyword verilogTodo contained TODO

syntax region  verilogString start=+"+  end=+"+

syntax match   verilogNumber "\(\<[0-9]\+\| \)'[bdh][0-9a-fxzA-F]\+\>"
syntax match   verilogNumber "\<[+-]\=[0-9]\+\>"

syntax match   verilogConstant "\<[A-Z][A-Z0-9_]\+"

syntax match   verilogGlobal "`[a-zA-Z_]\+\>"
syntax match   verilogGlobal "$[a-zA-Z_]\+\>"

syntax region  verilogComment start="/\*" end="\*/"
syntax match   verilogComment "//.*"

syntax match   verilogOperator "[&|~><!)(*#%@+/=?:;}{,.\^\-\[\]]"

"Modify the following as needed.  The trade-off is performance versus
"functionality.
syntax sync lines 50

if !exists("did_verilog_syntax_inits")
  let did_verilog_syntax_inits = 1
 " The default methods for highlighting.  Can be overridden later

 "highlight link verilogBinaryOperator  Operator
  highlight link verilogCharacter       Character
 "highlight link verilogComment         Comment
  highlight link verilogConditional     Conditional
 "highlight link verilogLabel           Label
 "highlight link verilogNumber          Number
  highlight link verilogRepeat          Repeat
 "highlight link verilogStatement       Statement
  highlight link verilogString          String
  highlight link verilogTodo            Todo

  highlight link verilogComment   Comment
  highlight link verilogConstant  Todo
  highlight link verilogLabel     PreCondit
  highlight link verilogNumber    Special
  highlight link verilogOperator  Type
  highlight link verilogStatement Statement
  highlight link verilogGlobal    String
endif
