home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 February / OpenLinux 2.3 CD.iso / live / usr / share / vim / syntax / simula.vim < prev    next >
Encoding:
Text File  |  1999-08-10  |  2.9 KB  |  81 lines

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