3 " Maintainer: Haakon Riiser <haakon@riiser.net>
4 " Last Change: 2001 Apr 25
6 " For version 5.x: Clear all syntax items
7 " For version 6.x: Quit when a syntax file was already loaded
10 elseif exists("b:current_syntax")
14 " No case sensitivity in Simula
17 syn match simulaComment "^%.*$" contains=simulaTodo
18 syn region simulaComment start="!\|\<comment\>" end=";" contains=simulaTodo
20 " Text between the keyword 'end' and either a semicolon or one of the
21 " keywords 'end', 'else', 'when' or 'otherwise' is also a comment
22 syn region simulaComment start="\<end\>"lc=3 matchgroup=Statement end=";\|\<\(end\|else\|when\|otherwise\)\>"
24 syn match simulaCharError "'.\{-2,}'"
25 syn match simulaCharacter "'.'"
26 syn match simulaCharacter "'!\d\{-}!'" contains=simulaSpecialChar
27 syn match simulaString '".\{-}"' contains=simulaSpecialChar,simulaTodo
29 syn keyword simulaBoolean true false
30 syn keyword simulaCompound begin end
31 syn keyword simulaConditional else if otherwise then until when
32 syn keyword simulaConstant none notext
33 syn keyword simulaFunction procedure
34 syn keyword simulaOperator eq eqv ge gt imp in is le lt ne new not qua
35 syn keyword simulaRepeat while for
36 syn keyword simulaReserved activate after at before delay go goto label prior reactivate switch to
37 syn keyword simulaStatement do inner inspect step this
38 syn keyword simulaStorageClass external hidden name protected value
39 syn keyword simulaStructure class
40 syn keyword simulaType array boolean character integer long real short text virtual
41 syn match simulaAssigned "\<\h\w*\s*\((.*)\)\=\s*:\(=\|-\)"me=e-2
42 syn match simulaOperator "[&:=<>+\-*/]"
43 syn match simulaOperator "\<and\(\s\+then\)\=\>"
44 syn match simulaOperator "\<or\(\s\+else\)\=\>"
45 syn match simulaReferenceType "\<ref\s*(.\{-})"
46 syn match simulaSemicolon ";"
47 syn match simulaSpecial "[(),.]"
48 syn match simulaSpecialCharErr "!\d\{-4,}!" contained
49 syn match simulaSpecialCharErr "!!" contained
50 syn match simulaSpecialChar "!\d\{-}!" contains=simulaSpecialCharErr contained
51 syn match simulaTodo "xxx\+" contained
53 " Integer number (or float without `.')
54 syn match simulaNumber "-\=\<\d\+\>"
55 " Real with optional exponent
56 syn match simulaReal "-\=\<\d\+\(\.\d\+\)\=\(&&\=[+-]\=\d\+\)\=\>"
57 " Real starting with a `.', optional exponent
58 syn match simulaReal "-\=\.\d\+\(&&\=[+-]\=\d\+\)\=\>"
60 if version >= 508 || !exists("did_simula_syntax_inits")
62 let did_simula_syntax_inits = 1
63 command -nargs=+ HiLink hi link <args>
65 command -nargs=+ HiLink hi def link <args>
68 HiLink simulaAssigned Identifier
69 HiLink simulaBoolean Boolean
70 HiLink simulaCharacter Character
71 HiLink simulaCharError Error
72 HiLink simulaComment Comment
73 HiLink simulaCompound Statement
74 HiLink simulaConditional Conditional
75 HiLink simulaConstant Constant
76 HiLink simulaFunction Function
77 HiLink simulaNumber Number
78 HiLink simulaOperator Operator
79 HiLink simulaReal Float
80 HiLink simulaReferenceType Type
81 HiLink simulaRepeat Repeat
82 HiLink simulaReserved Error
83 HiLink simulaSemicolon Statement
84 HiLink simulaSpecial Special
85 HiLink simulaSpecialChar SpecialChar
86 HiLink simulaSpecialCharErr Error
87 HiLink simulaStatement Statement
88 HiLink simulaStorageClass StorageClass
89 HiLink simulaString String
90 HiLink simulaStructure Structure
91 HiLink simulaTodo Todo
92 HiLink simulaType Type
97 let b:current_syntax = "simula"
98 " vim: sts=4 sw=4 ts=8