1" Vim syntax file 2" Language: HASTE - a language for VLSI IC programming 3" Maintainer: M. Tranchero - maurizio.tranchero?gmail.com 4" Credits: some parts have been taken from vhdl, verilog, and C syntax 5" files 6" Version: 0.9 7" Last Change: 0.9 improvement of haste numbers detection 8" Change: 0.8 error matching for wrong hierarchical connections 9" Change: 0.7 added more rules to highlight pre-processor directives 10 11" HASTE 12if exists("b:current_syntax") 13 finish 14endif 15" For version 5.x: Clear all syntax items 16" For version 6.x: Quit when a syntax file was already loaded 17if version < 600 18 syntax clear 19elseif exists("b:current_syntax") 20 finish 21endif 22 23" case is significant 24syn case match 25 26" HASTE keywords 27syn keyword hasteStatement act alias arb array begin bitvec 28syn keyword hasteStatement bitwidth boolvec broad case 29syn keyword hasteStatement cast chan const dataprobe do edge 30syn keyword hasteStatement else end export false ff fi file 31syn keyword hasteStatement fit for forever func if import 32syn keyword hasteStatement inprobe is les main narb narrow 33syn keyword hasteStatement negedge od of or outprobe pas 34syn keyword hasteStatement posedge probe proc ram ramreg 35syn keyword hasteStatement repeat rom romreg sample sel si 36syn keyword hasteStatement sign sizeof skip stop then true 37syn keyword hasteStatement type until var wait wire 38syn keyword hasteFutureExt Z ffe partial 39syn keyword hasteVerilog buf reg while 40 41" Special match for "if", "or", and "else" since "else if" 42" and other "else+if" combination shouldn't be highlighted. 43" The right keyword is "or" 44syn match hasteStatement "\<\(if\|then\|else\|fi\)\>" 45syn match hasteNone "\<else\s\+if\>$" 46syn match hasteNone "\<else\s\+if\>\s" 47syn match hasteNone "\<elseif\>\s" 48syn match hasteNone "\<elsif\>\s" 49syn match hasteStatement "\<\(case\|is\|si\)\>" 50syn match hasteStatement "\<\(repeat\|until\)\>" 51syn match hasteStatement "\<\(forever\|do\|od\)\>" 52syn match hasteStatement "\<\(for\|do\|od\)\>" 53syn match hasteStatement "\<\(do\|or\|od\)\>" 54syn match hasteStatement "\<\(sel\|les\)\>" 55syn match hasteError "\<\d\+[_a-zA-Z]\+\>" 56syn match hasteError "\(\([[:alnum:]]\+\s*(\s\+\|)\s*,\)\)\s*\([[:alnum:]]\+\s*(\)" 57 58" Predifined Haste types 59syn keyword hasteType bool 60 61" Values for standard Haste types 62" syn match hasteVector "\'[0L1HXWZU\-\?]\'" 63 64syn match hasteVector "0b\"[01_]\+\"" 65syn match hasteVector "0x\"[0-9a-f_]\+\"" 66syn match hasteCharacter "'.'" 67" syn region hasteString start=+"+ end=+"+ 68syn match hasteIncluded display contained "<[^>]*>" 69syn match hasteIncluded display contained "<[^"]*>" 70syn region hasteInclude start="^\s*#include\>\s*" end="$" contains=hasteIncluded,hasteString 71 72" integer numbers 73syn match hasteNumber "\d\+\^[[:alnum:]]*[-+]\{0,1\}[[:alnum:]]*" 74syn match hasteNumber "-\=\<\d\+\(\^[+\-]\=\d\+\)\>" 75syn match hasteNumber "-\=\<\d\+\>" 76" syn match hasteNumber "0*2#[01_]\+#\(\^[+\-]\=\d\+\)\=" 77" syn match hasteNumber "0*16#[0-9a-f_]\+#\(\^[+\-]\=\d\+\)\=" 78" operators 79syn keyword hasteSeparators & , . \| 80syn keyword hasteExecution \|\| ; @ 81syn keyword hasteOperator := ? ! : 82syn keyword hasteTypeConstr "[" << >> .. "]" ~ 83syn keyword hasteExprOp < <= >= > = # <> + - * == ## 84syn keyword hasteMisc ( ) 0x 0b 85" 86syn match hasteSeparators "[&:\|,.]" 87syn match hasteOperator ":=" 88syn match hasteOperator ":" 89syn match hasteOperator "?" 90syn match hasteOperator "!" 91syn match hasteExecution "||" 92syn match hasteExecution ";" 93syn match hasteExecution "@" 94syn match hasteType "\[\[" 95syn match hasteType "\]\]" 96syn match hasteType "<<" 97syn match hasteType ">>" 98syn match hasteExprOp "<" 99syn match hasteExprOp "<=" 100syn match hasteExprOp ">=" 101syn match hasteExprOp ">" 102syn match hasteExprOp "<>" 103syn match hasteExprOp "=" 104syn match hasteExprOp "==" 105syn match hasteExprOp "##" 106" syn match hasteExprOp "#" 107syn match hasteExprOp "*" 108syn match hasteExprOp "+" 109 110syn region hasteComment start="/\*" end="\*/" contains=@Spell 111syn region hasteComment start="{" end="}" contains=@Spell 112syn match hasteComment "//.*" contains=@Spell 113 114" Define the default highlighting. 115" Only when an item doesn't have highlighting yet 116hi def link hasteSpecial Special 117hi def link hasteStatement Statement 118hi def link hasteCharacter String 119hi def link hasteString String 120hi def link hasteVector String 121hi def link hasteBoolean String 122hi def link hasteComment Comment 123hi def link hasteNumber String 124hi def link hasteTime String 125hi def link hasteType Type 126hi def link hasteGlobal Error 127hi def link hasteError Error 128hi def link hasteAttribute Type 129" 130hi def link hasteSeparators Special 131hi def link hasteExecution Special 132hi def link hasteTypeConstr Special 133hi def link hasteOperator Type 134hi def link hasteExprOp Type 135hi def link hasteMisc String 136hi def link hasteFutureExt Error 137hi def link hasteVerilog Error 138hi def link hasteDefine Macro 139hi def link hasteInclude Include 140" hi def link hastePreProc Preproc 141" hi def link hastePreProcVar Special 142 143let b:current_syntax = "haste" 144 145" vim: ts=8 146