home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / mac / vim55rt.sit / runtime / syntax / simula.vim < prev    next >
Encoding:
Text File  |  1999-09-25  |  3.3 KB  |  86 lines  |  [TEXT/VIM!]

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