blob: 0540843cd886cd227eeeb696805751604ad1075f [file] [log] [blame]
Bram Moolenaar35c54e52005-05-20 21:25:31 +00001" Vim syntax file
Bram Moolenaar437df8f2006-04-27 21:47:44 +00002" Language: ESTEREL
3" Maintainer: Maurizio Tranchero <maurizio.tranchero@polito.it> - <maurizio.tranchero@gmail.com>
Bram Moolenaar446cb832008-06-24 21:56:24 +00004" Credits: Luca Necchi <luca.necchi@polito.it>, Nikos Andrikos <nick.andrik@gmail.com>
Bram Moolenaar437df8f2006-04-27 21:47:44 +00005" First Release: Tue May 17 23:49:39 CEST 2005
Bram Moolenaar446cb832008-06-24 21:56:24 +00006" Last Change: Tue May 6 13:29:56 CEST 2008
7" Version: 0.8
Bram Moolenaar35c54e52005-05-20 21:25:31 +00008
Bram Moolenaar89bcfda2016-08-30 23:26:57 +02009" quit when a syntax file was already loaded
10if exists("b:current_syntax")
Bram Moolenaar35c54e52005-05-20 21:25:31 +000011 finish
12endif
13
14" case is significant
15syn case ignore
16" Esterel Regions
Bram Moolenaar437df8f2006-04-27 21:47:44 +000017syn region esterelModule start=/module/ end=/end module/ contains=ALLBUT,esterelModule
18syn region esterelLoop start=/loop/ end=/end loop/ contains=ALLBUT,esterelModule
19syn region esterelAbort start=/abort/ end=/when/ contains=ALLBUT,esterelModule
20syn region esterelAbort start=/weak abort/ end=/when/ contains=ALLBUT,esterelModule
21syn region esterelEvery start=/every/ end=/end every/ contains=ALLBUT,esterelModule
22syn region esterelIf start=/if/ end=/end if/ contains=ALLBUT,esterelModule
23syn region esterelConcurrent transparent start=/\[/ end=/\]/ contains=ALLBUT,esterelModule
24syn region esterelIfThen start=/if/ end=/then/ oneline
Bram Moolenaar35c54e52005-05-20 21:25:31 +000025" Esterel Keywords
Bram Moolenaar437df8f2006-04-27 21:47:44 +000026syn keyword esterelIO input output inputoutput constant
27syn keyword esterelBoolean and or not xor xnor nor nand
Bram Moolenaar446cb832008-06-24 21:56:24 +000028syn keyword esterelExpressions mod pre
Bram Moolenaar437df8f2006-04-27 21:47:44 +000029syn keyword esterelStatement nothing halt
30syn keyword esterelStatement module signal sensor end
Bram Moolenaar35c54e52005-05-20 21:25:31 +000031syn keyword esterelStatement every do loop abort weak
32syn keyword esterelStatement emit present await
Bram Moolenaar437df8f2006-04-27 21:47:44 +000033syn keyword esterelStatement pause when immediate
34syn keyword esterelStatement if then else case
35syn keyword esterelStatement var in run suspend
36syn keyword esterelStatement repeat times combine with
37syn keyword esterelStatement assert sustain
38" check what it is the following
39syn keyword esterelStatement relation
40syn keyword esterelFunctions function procedure task
41syn keyword esterelSysCall call trap exit exec
Bram Moolenaar35c54e52005-05-20 21:25:31 +000042" Esterel Types
Bram Moolenaar446cb832008-06-24 21:56:24 +000043syn keyword esterelType integer float bolean
Bram Moolenaar35c54e52005-05-20 21:25:31 +000044" Esterel Comment
Bram Moolenaar446cb832008-06-24 21:56:24 +000045syn match esterelComment "%.*$"
Bram Moolenaar35c54e52005-05-20 21:25:31 +000046" Operators and special characters
Bram Moolenaar446cb832008-06-24 21:56:24 +000047syn match esterelSpecial ":"
48syn match esterelSpecial "<="
49syn match esterelSpecial ">="
50syn match esterelSpecial "+"
51syn match esterelSpecial "-"
52syn match esterelSpecial "="
53syn match esterelSpecial ";"
54syn match esterelSpecial "/"
55syn match esterelSpecial "?"
56syn match esterelOperator "\["
57syn match esterelOperator "\]"
58syn match esterelOperator ":="
59syn match esterelOperator "||"
60syn match esterelStatement "\<\(if\|else\)\>"
61syn match esterelNone "\<else\s\+if\>$"
62syn match esterelNone "\<else\s\+if\>\s"
Bram Moolenaar35c54e52005-05-20 21:25:31 +000063
64" Class Linking
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020065command -nargs=+ HiLink hi def link <args>
Bram Moolenaar35c54e52005-05-20 21:25:31 +000066
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020067HiLink esterelStatement Statement
68HiLink esterelType Type
69HiLink esterelComment Comment
70HiLink esterelBoolean Number
71HiLink esterelExpressions Number
72HiLink esterelIO String
73HiLink esterelOperator Type
74HiLink esterelSysCall Type
75HiLink esterelFunctions Type
76HiLink esterelSpecial Special
Bram Moolenaar35c54e52005-05-20 21:25:31 +000077
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020078delcommand HiLink
Bram Moolenaar35c54e52005-05-20 21:25:31 +000079
80let b:current_syntax = "esterel"