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