277
|
1 " Vim syntax file
|
846
|
2 " Language: ESTEREL
|
|
3 " Maintainer: Maurizio Tranchero <maurizio.tranchero@polito.it> - <maurizio.tranchero@gmail.com>
|
1621
|
4 " Credits: Luca Necchi <luca.necchi@polito.it>, Nikos Andrikos <nick.andrik@gmail.com>
|
846
|
5 " First Release: Tue May 17 23:49:39 CEST 2005
|
1621
|
6 " Last Change: Tue May 6 13:29:56 CEST 2008
|
|
7 " Version: 0.8
|
277
|
8
|
|
9 " For version 5.x: Clear all syntax items
|
|
10 " For version 6.x: Quit when a syntax file was already loaded
|
|
11 if version < 600
|
|
12 syntax clear
|
|
13 elseif exists("b:current_syntax")
|
|
14 finish
|
|
15 endif
|
|
16
|
|
17 " case is significant
|
|
18 syn case ignore
|
|
19 " Esterel Regions
|
846
|
20 syn region esterelModule start=/module/ end=/end module/ contains=ALLBUT,esterelModule
|
|
21 syn region esterelLoop start=/loop/ end=/end loop/ contains=ALLBUT,esterelModule
|
|
22 syn region esterelAbort start=/abort/ end=/when/ contains=ALLBUT,esterelModule
|
|
23 syn region esterelAbort start=/weak abort/ end=/when/ contains=ALLBUT,esterelModule
|
|
24 syn region esterelEvery start=/every/ end=/end every/ contains=ALLBUT,esterelModule
|
|
25 syn region esterelIf start=/if/ end=/end if/ contains=ALLBUT,esterelModule
|
|
26 syn region esterelConcurrent transparent start=/\[/ end=/\]/ contains=ALLBUT,esterelModule
|
|
27 syn region esterelIfThen start=/if/ end=/then/ oneline
|
277
|
28 " Esterel Keywords
|
846
|
29 syn keyword esterelIO input output inputoutput constant
|
|
30 syn keyword esterelBoolean and or not xor xnor nor nand
|
1621
|
31 syn keyword esterelExpressions mod pre
|
846
|
32 syn keyword esterelStatement nothing halt
|
|
33 syn keyword esterelStatement module signal sensor end
|
277
|
34 syn keyword esterelStatement every do loop abort weak
|
|
35 syn keyword esterelStatement emit present await
|
846
|
36 syn keyword esterelStatement pause when immediate
|
|
37 syn keyword esterelStatement if then else case
|
|
38 syn keyword esterelStatement var in run suspend
|
|
39 syn keyword esterelStatement repeat times combine with
|
|
40 syn keyword esterelStatement assert sustain
|
|
41 " check what it is the following
|
|
42 syn keyword esterelStatement relation
|
|
43 syn keyword esterelFunctions function procedure task
|
|
44 syn keyword esterelSysCall call trap exit exec
|
277
|
45 " Esterel Types
|
1621
|
46 syn keyword esterelType integer float bolean
|
277
|
47 " Esterel Comment
|
1621
|
48 syn match esterelComment "%.*$"
|
277
|
49 " Operators and special characters
|
1621
|
50 syn match esterelSpecial ":"
|
|
51 syn match esterelSpecial "<="
|
|
52 syn match esterelSpecial ">="
|
|
53 syn match esterelSpecial "+"
|
|
54 syn match esterelSpecial "-"
|
|
55 syn match esterelSpecial "="
|
|
56 syn match esterelSpecial ";"
|
|
57 syn match esterelSpecial "/"
|
|
58 syn match esterelSpecial "?"
|
|
59 syn match esterelOperator "\["
|
|
60 syn match esterelOperator "\]"
|
|
61 syn match esterelOperator ":="
|
|
62 syn match esterelOperator "||"
|
|
63 syn match esterelStatement "\<\(if\|else\)\>"
|
|
64 syn match esterelNone "\<else\s\+if\>$"
|
|
65 syn match esterelNone "\<else\s\+if\>\s"
|
277
|
66
|
|
67 " Class Linking
|
|
68 if version >= 508 || !exists("did_esterel_syntax_inits")
|
|
69 if version < 508
|
|
70 let did_esterel_syntax_inits = 1
|
|
71 command -nargs=+ HiLink hi link <args>
|
|
72 else
|
|
73 command -nargs=+ HiLink hi def link <args>
|
|
74 endif
|
|
75
|
846
|
76 HiLink esterelStatement Statement
|
|
77 HiLink esterelType Type
|
|
78 HiLink esterelComment Comment
|
|
79 HiLink esterelBoolean Number
|
|
80 HiLink esterelExpressions Number
|
|
81 HiLink esterelIO String
|
|
82 HiLink esterelOperator Type
|
|
83 HiLink esterelSysCall Type
|
|
84 HiLink esterelFunctions Type
|
|
85 HiLink esterelSpecial Special
|
277
|
86
|
|
87 delcommand HiLink
|
|
88 endif
|
|
89
|
|
90 let b:current_syntax = "esterel"
|