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 / vim54rt.sit / runtime / syntax / ocaml.vim < prev    next >
Encoding:
Text File  |  1999-08-14  |  3.2 KB  |  114 lines  |  [TEXT/ALFA]

  1. " Vim syntax file
  2. " Language:   OCAML
  3. " Maintainers:  Karl-Heinz Sylla <Karl-Heinz.Sylla@gmd.de>
  4. " Last changes: 1999 June 30, ocamlString now handles "\\" correctly
  5. "                            (hint by Markus Mottl <mottl@miss.wu-wien.ac.at>)
  6. "               1998 August 26, adding ocaml 2.00 keywords
  7. "
  8.  
  9. " Remove any old syntax stuff hanging around.
  10. syn clear
  11.  
  12. " ocaml is case sensitive.
  13. syn case match
  14.  
  15. " It respects ocaml strings and constructors
  16.  
  17. syn region   ocamlComment start=+(\*+ end=+\*)+ contains=ocamlComment
  18. syn match    ocamlCommentError +\*)+
  19.  
  20. syn keyword  ocamlKeyword    and as asr begin class closed
  21. syn keyword  ocamlKeyword    constraint do done downto else end and
  22. syn keyword  ocamlKeyword    exception external for fun function
  23. syn keyword  ocamlKeyword    functor if in include inherit initializer
  24. syn keyword  ocamlKeyword    land let lor lsl lsr lxor match
  25. syn keyword  ocamlKeyword    method mod module mutable new object of
  26. syn keyword  ocamlKeyword    open or parser private rec sig
  27. syn keyword  ocamlKeyword    struct then to try type
  28. syn keyword  ocamlKeyword    unit val virtual when while with
  29.  
  30. syn keyword  ocamlType    int char string float bool exn
  31. syn keyword  ocamlType    list array option format
  32. syn match    ocamlType    +()+
  33.  
  34. syn keyword  ocamlBoolean    true false
  35.  
  36. syn keyword  ocamlKeyword    not
  37.  
  38. syn match    ocamlConstructor /\<[A-Z][0-9A-Za-z_]*\>/
  39. syn match    ocamlCharacter    +'.'\|'\\[0-9][0-9][0-9]'\|'\\[\'ntbr]'+
  40. syn match    ocamlCharErr    +'\\[0-9][0-9]'\|'\\[0-9]'+
  41. syn match    ocamlCharErr    +'\\[0-9][0-9]'\|'\\[0-9]'+
  42. syn match    ocamlCharErr    +'\\[^\'ntbr]'+
  43. syn region   ocamlString        start=+"+ skip=+\\\\\|\\"+ end=+"+
  44.  
  45. syn match    ocamlFunDef    "->"
  46. syn match    ocamlArray    "\[|\||\]"
  47. syn match    ocamlList    "\[\|\]"
  48. syn match    ocamlRefAssign    ":="
  49. syn match    ocamlTopStop    ";;"
  50. syn match    ocamlOperator    "\^"
  51. syn match    ocamlOperator    "::"
  52. syn match    ocamlOperator    "<-"
  53. syn match    ocamlAnyVar    +\<_\>+
  54. syn match    ocamlKeyChar    "!"
  55. syn match    ocamlKeyChar    "|"
  56. syn match    ocamlKeyChar    ";"
  57. syn match    ocamlKeyChar    "?"
  58. syn match    ocamlKeyChar    "\*"
  59. syn match    ocamlKeyChar    "="
  60.  
  61. syn match    ocamlModQualifier /\<[A-Z][0-9A-Za-z_]*\>[\b]*\./
  62.  
  63. "if !exists("ocaml_highlighting_clean")
  64.  
  65.   " some keywords
  66.   " some common functions are also highlighted as keywords
  67.   " is there a better solution?
  68.   syn keyword ocamlKeyword    trace
  69.  
  70.   syn match   ocamlNumber    "\<[0123456789]*\>"
  71.  
  72. "endif
  73.  
  74. syn sync ccomment maxlines=50
  75.  
  76. if !exists("did_ocaml_syntax_inits")
  77.  
  78.   let did_ocaml_syntax_inits = 1
  79.  
  80.   " The default methods for highlighting.  Can be overridden later
  81.  
  82.   hi link ocamlComment    Comment
  83.  
  84.   hi link ocamlModQualifier    Keyword
  85.  
  86.   hi link ocamlEnvKeyword    Keyword
  87.   hi link ocamlKeyword    Keyword
  88.   hi link ocamlFunDef    Keyword
  89.   hi link ocamlRefAssign    Keyword
  90.   hi link ocamlKeyChar    Keyword
  91.   hi link ocamlAnyVar    Keyword
  92.   hi link ocamlArray    Keyword
  93.   hi link ocamlList    Keyword
  94.   hi link ocamlTopStop    Keyword
  95.   hi link ocamlOperator    Keyword
  96.  
  97.   hi link ocamlConstructor    Constant
  98.  
  99.   hi link ocamlBoolean    Boolean
  100.   hi link ocamlCharacter    Character
  101.   hi link ocamlNumber    Number
  102.   hi link ocamlString    String
  103.  
  104.   hi link ocamlType    Type
  105.  
  106.   hi link ocamlCommentError    Error
  107.   hi link ocamlCharCodeErr    Error
  108.  
  109. endif
  110.  
  111. let b:current_syntax = "ocaml"
  112.  
  113. " vim: ts=8
  114.