simula.vim 3.3 KB

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