comparison runtime/syntax/haste.vim @ 1668:0b796e045c42 v7.2b.000

updated for version 7.2b-000
author vimboss
date Sun, 13 Jul 2008 17:41:49 +0000
parents 53938adac247
children 43efa4f5a8ea
comparison
equal deleted inserted replaced
1667:131dbd3d2a4b 1668:0b796e045c42
1 " Vim syntax file 1 " Vim syntax file
2 " Language: HASTE 2 " Language: HASTE - a language for VLSI IC programming
3 " Maintainer: M. Tranchero - maurizio.tranchero?gmail.com 3 " Maintainer: M. Tranchero - maurizio.tranchero?gmail.com
4 " Credits: some parts have been taken from vhdl, verilog, and C syntax 4 " Credits: some parts have been taken from vhdl, verilog, and C syntax
5 " files 5 " files
6 " version: 0.5 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
7 10
8 " HASTE 11 " HASTE
9 if exists("b:current_syntax") 12 if exists("b:current_syntax")
10 finish 13 finish
11 endif 14 endif
48 syn match hasteStatement "\<\(forever\|do\|od\)\>" 51 syn match hasteStatement "\<\(forever\|do\|od\)\>"
49 syn match hasteStatement "\<\(for\|do\|od\)\>" 52 syn match hasteStatement "\<\(for\|do\|od\)\>"
50 syn match hasteStatement "\<\(do\|or\|od\)\>" 53 syn match hasteStatement "\<\(do\|or\|od\)\>"
51 syn match hasteStatement "\<\(sel\|les\)\>" 54 syn match hasteStatement "\<\(sel\|les\)\>"
52 syn match hasteError "\<\d\+[_a-zA-Z]\+\>" 55 syn match hasteError "\<\d\+[_a-zA-Z]\+\>"
56 syn match hasteError "\(\([[:alnum:]]\+\s*(\s\+\|)\s*,\)\)\s*\([[:alnum:]]\+\s*(\)"
53 57
54 " Predifined Haste types 58 " Predifined Haste types
55 syn keyword hasteType bool 59 syn keyword hasteType bool
56 60
57 " Values for standard Haste types 61 " Values for standard Haste types
58 " syn match hasteVector "\'[0L1HXWZU\-\?]\'" 62 " syn match hasteVector "\'[0L1HXWZU\-\?]\'"
59 63
60 syn match hasteVector "0b\"[01_]\+\"" 64 syn match hasteVector "0b\"[01_]\+\""
61 syn match hasteVector "0x\"[0-9a-f_]\+\"" 65 syn match hasteVector "0x\"[0-9a-f_]\+\""
62 syn match hasteCharacter "'.'" 66 syn match hasteCharacter "'.'"
63 syn region hasteString start=+"+ end=+"+ 67 " syn region hasteString start=+"+ end=+"+
64 " C pre-processor directives
65 "syn region hasteIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
66 syn match hasteIncluded display contained "<[^>]*>" 68 syn match hasteIncluded display contained "<[^>]*>"
67 syn match hasteIncluded display contained "<[^"]*>" 69 syn match hasteIncluded display contained "<[^"]*>"
68 syn match hasteInclude display "^\s*#include\>\s*["<]" contains=hasteIncluded 70 syn region hasteInclude start="^\s*#include\>\s*" end="$" contains=hasteIncluded,hasteString
69 syn region hasteDefine start="^\s*\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" end="//"me=s-1 contains=ALLBUT,@hastePreProcGroup,@Spell
70 syn region hasteDefine start="^\s*\(%:\|#\)\s*\(ifndef\|ifdef\|endif\)\>" skip="\\$" end="$" end="//"me=s-1 contains=@Spell
71 syn region hastePreCondit start="^\s*\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" end="//"me=s-1 contains=hasteComment,hasteCppString,hasteCharacter,hasteCppParen,hasteParenError,hasteNumbers,hasteCommentError,hasteSpaceError
72 syn region hastePreProc start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@hastePreProcGroup,@Spell
73 syn cluster hastePreProcGroup contains=hasteIncluded,hasteInclude,hasteDefine
74 syn region hasteCppSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=hasteSpaceError,hasteCppSkip
75 71
76 " floating numbers
77 syn match hasteNumber "-\=\<\d\+\.\d\+\(E[+\-]\=\d\+\)\>"
78 syn match hasteNumber "-\=\<\d\+\.\d\+\>"
79 syn match hasteNumber "0*2#[01_]\+\.[01_]\+#\(E[+\-]\=\d\+\)\="
80 syn match hasteNumber "0*16#[0-9a-f_]\+\.[0-9a-f_]\+#\(E[+\-]\=\d\+\)\="
81 " integer numbers 72 " integer numbers
82 syn match hasteNumber "-\=\<\d\+\(E[+\-]\=\d\+\)\>" 73 syn match hasteNumber "\d\+\^[[:alnum:]]*[-+]\{0,1\}[[:alnum:]]*"
74 syn match hasteNumber "-\=\<\d\+\(\^[+\-]\=\d\+\)\>"
83 syn match hasteNumber "-\=\<\d\+\>" 75 syn match hasteNumber "-\=\<\d\+\>"
84 syn match hasteNumber "0*2#[01_]\+#\(E[+\-]\=\d\+\)\=" 76 " syn match hasteNumber "0*2#[01_]\+#\(\^[+\-]\=\d\+\)\="
85 syn match hasteNumber "0*16#[0-9a-f_]\+#\(E[+\-]\=\d\+\)\=" 77 " syn match hasteNumber "0*16#[0-9a-f_]\+#\(\^[+\-]\=\d\+\)\="
86 " operators 78 " operators
87 syn keyword hasteSeparators & , . \| : 79 syn keyword hasteSeparators & , . \|
88 syn keyword hasteExecution \|\| ; @ 80 syn keyword hasteExecution \|\| ; @
89 syn keyword hasteOperator := ? ! 81 syn keyword hasteOperator := ? ! :
90 syn keyword hasteTypeConstr "[" << >> .. "]" ~ 82 syn keyword hasteTypeConstr "[" << >> .. "]" ~
91 syn keyword hasteExprOp < <= >= > = # <> + - * == ## 83 syn keyword hasteExprOp < <= >= > = # <> + - * == ##
92 syn keyword hasteMisc ( ) 0x 0b 84 syn keyword hasteMisc ( ) 0x 0b
93 " 85 "
94 syn match hasteSeparators "[&:\|,.]" 86 syn match hasteSeparators "[&:\|,.]"
95 syn match hasteOperator ":=" 87 syn match hasteOperator ":="
88 syn match hasteOperator ":"
96 syn match hasteOperator "?" 89 syn match hasteOperator "?"
97 syn match hasteOperator "!" 90 syn match hasteOperator "!"
98 syn match hasteExecution "||" 91 syn match hasteExecution "||"
99 syn match hasteExecution ";" 92 syn match hasteExecution ";"
100 syn match hasteExecution "@" 93 syn match hasteExecution "@"
108 syn match hasteExprOp ">" 101 syn match hasteExprOp ">"
109 syn match hasteExprOp "<>" 102 syn match hasteExprOp "<>"
110 syn match hasteExprOp "=" 103 syn match hasteExprOp "="
111 syn match hasteExprOp "==" 104 syn match hasteExprOp "=="
112 syn match hasteExprOp "##" 105 syn match hasteExprOp "##"
113 syn match hasteExprOp "#" 106 " syn match hasteExprOp "#"
114 syn match hasteExprOp "*" 107 syn match hasteExprOp "*"
115 syn match hasteExprOp "+" 108 syn match hasteExprOp "+"
116 109
117 syn region hasteComment start="/\*" end="\*/" contains=@Spell 110 syn region hasteComment start="/\*" end="\*/" contains=@Spell
118 syn region hasteComment start="{" end="}" contains=@Spell 111 syn region hasteComment start="{" end="}" contains=@Spell
131 hi def link hasteTime String 124 hi def link hasteTime String
132 hi def link hasteType Type 125 hi def link hasteType Type
133 hi def link hasteGlobal Error 126 hi def link hasteGlobal Error
134 hi def link hasteError Error 127 hi def link hasteError Error
135 hi def link hasteAttribute Type 128 hi def link hasteAttribute Type
129 "
136 hi def link hasteSeparators Special 130 hi def link hasteSeparators Special
137 hi def link hasteExecution Special 131 hi def link hasteExecution Special
138 hi def link hasteTypeConstr Special 132 hi def link hasteTypeConstr Special
139 hi def link hasteOperator Type 133 hi def link hasteOperator Type
140 hi def link hasteExprOp Type 134 hi def link hasteExprOp Type
141 hi def link hasteMisc String 135 hi def link hasteMisc String
142 hi def link hasteFutureExt Error 136 hi def link hasteFutureExt Error
143 hi def link hasteVerilog Error 137 hi def link hasteVerilog Error
144 hi def link hasteDefine Macro 138 hi def link hasteDefine Macro
145 hi def link hasteInclude Include 139 hi def link hasteInclude Include
146 hi def link hastePreProc PreProc 140 " hi def link hastePreProc Preproc
141 " hi def link hastePreProcVar Special
147 142
148 let b:current_syntax = "haste" 143 let b:current_syntax = "haste"
149 144
150 " vim: ts=8 145 " vim: ts=8