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 / rebol.vim < prev    next >
Encoding:
Text File  |  1999-09-25  |  7.0 KB  |  200 lines  |  [TEXT/VIM!]

  1. " Vim syntax file
  2. " Language:     Rebol
  3. " Maintainer:    Mike Williams <mrw@netcomuk.co.uk>
  4. " Filenames:    *.r
  5. " Last change:  20th October 1998
  6. " URL:          N/A
  7. "
  8. " Change history
  9.  
  10. " Remove any old syntax stuff hanging around
  11. syn clear
  12.  
  13. " Rebol is case insensitive
  14. syn case ignore
  15.  
  16. " As per current users documentation
  17. set isk=@,48-57,?,!,.,',+,-,*,&,\|,=,_,~
  18.  
  19. " Yer TODO highlighter
  20. syn keyword    rebolTodo    contained TODO
  21.  
  22. " Comments
  23. syn match       rebolComment    ";.*$" contains=rebolTodo
  24.  
  25. " Words
  26. syn match       rebolWord       "\a\k*"
  27. syn match       rebolWordPath   "[^[:space:]]/[^[:space]]"ms=s+1,me=e-1
  28.  
  29. " Booleans
  30. syn keyword     rebolBoolean    true false on off yes no
  31.  
  32. " Values
  33. " Integers
  34. syn match       rebolInteger    "\<[+-]\=\d\+\('\d*\)*\>"
  35. " Decimals
  36. syn match       rebolDecimal    "[+-]\=\(\d\+\('\d*\)*\)\=[,.]\d*\(e[+-]\=\d\+\)\="
  37. syn match       rebolDecimal    "[+-]\=\d\+\('\d*\)*\(e[+-]\=\d\+\)\="
  38. " Time
  39. syn match       rebolTime       "[+-]\=\(\d\+\('\d*\)*\:\)\{1,2}\d\+\('\d*\)*\([.,]\d\+\)\=\([AP]M\)\=\>"
  40. syn match       rebolTime       "[+-]\=:\d\+\([.,]\d*\)\=\([AP]M\)\=\>"
  41. " Dates
  42. " DD-MMM-YY & YYYY format
  43. syn match       rebolDate       "\d\{1,2}\([/-]\)\(Jan\|Feb\|Mar\|Apr\|May\|Jun\|Jul\|Aug\|Sep\|Oct\|Nov\|Dec\)\1\(\d\{2}\)\{1,2}\>"
  44. " DD-month-YY & YYYY format
  45. syn match       rebolDate       "\d\{1,2}\([/-]\)\(January\|February\|March\|April\|May\|June\|July\|August\|September\|October\|November\|December\)\1\(\d\{2}\)\{1,2}\>"
  46. " DD-MM-YY & YY format
  47. syn match       rebolDate       "\d\{1,2}\([/-]\)\d\{1,2}\1\(\d\{2}\)\{1,2}\>"
  48. " YYYY-MM-YY format
  49. syn match       rebolDate       "\d\{4}-\d\{1,2}-\d\{1,2}\>"
  50. " DD.MM.YYYY format
  51. syn match       rebolDate       "\d\{1,2}\.\d\{1,2}\.\d\{4}\>"
  52. " Money
  53. syn match       rebolMoney      "\a*\$\d\+\('\d*\)*\([,.]\d\+\)\="
  54. " Strings
  55. syn region      rebolString     oneline start=+"+ skip=+^"+ end=+"+ contains=rebolSpecialCharacter
  56. syn region      rebolString     start=+[^#]{+ end=+}+ skip=+{[^}]*}+ contains=rebolSpecialCharacter
  57. " Binary
  58. syn region      rebolBinary     start=+\d*#{+ end=+}+ contains=rebolComment
  59. " Email
  60. syn match       rebolEmail      "\<\k\+@\(\k\+\.\)*\k\+\>"
  61. " File
  62. syn match       rebolFile       "%\(\k\+/\)*\k\+[/]\=" contains=rebolSpecialCharacter
  63. syn region      rebolFile       oneline start=+%"+ end=+"+ contains=rebolSpecialCharacter
  64. " URLs
  65. syn match       rebolURL        "http://\k\+\(\.\k\+\)*\(:\d\+\)\=\(/\(\k\+/\)*\(\k\+\)\=\)*"
  66. syn match       rebolURL        "file://\k\+\(\.\k\+\)*/\(\k\+/\)*\k\+"
  67. syn match       rebolURL        "ftp://\(\k\+:\k\+@\)\=\k\+\(\.\k\+\)*\(:\d\+\)\=/\(\k\+/\)*\k\+"
  68. syn match       rebolURL        "mailto:\k\+\(\.\k\+\)*@\k\+\(\.\k\+\)*"
  69. " Issues
  70. syn match       rebolIssue      "#\(\d\+-\)*\d\+"
  71. " Tuples
  72. syn match       rebolTuple      "\(\d\+\.\)\{2,}"
  73.  
  74. " Characters
  75. syn match       rebolSpecialCharacter contained "\^[^[:space:][]"
  76. syn match       rebolSpecialCharacter contained "%\d\+"
  77.  
  78.  
  79. " Operators
  80. " Math operators
  81. syn match       rebolMathOperator  "\(\*\{1,2}\|+\|-\|/\{1,2}\)"
  82. syn keyword     rebolMathFunction  abs absolute add arccosine arcsine arctangent cosine
  83. syn keyword     rebolMathFunction  divide exp log-10 log-2 log-e max maximum min
  84. syn keyword     rebolMathFunction  minimum multiply negate power random remainder sine
  85. syn keyword     rebolMathFunction  square-root subtract tangent
  86. " Binary operators
  87. syn keyword     rebolBinaryOperator complement and or xor ~
  88. " Logic operators
  89. syn match       rebolLogicOperator "[<>=]=\="
  90. syn match       rebolLogicOperator "<>"
  91. syn keyword     rebolLogicOperator not
  92. syn keyword     rebolLogicFunction all any
  93. syn keyword     rebolLogicFunction head? tail?
  94. syn keyword     rebolLogicFunction negative? positive? zero? even? odd?
  95. syn keyword     rebolLogicFunction binary? block? char? date? decimal? email? empty?
  96. syn keyword     rebolLogicFunction file? found? function? integer? issue? logic? money?
  97. syn keyword     rebolLogicFunction native? none? object? paren? path? port? series?
  98. syn keyword     rebolLogicFunction string? time? tuple? url? word?
  99. syn keyword     rebolLogicFunction exists? input? same? value?
  100.  
  101. " Datatypes
  102. syn keyword     rebolType       binary! block! char! date! decimal! email! file!
  103. syn keyword     rebolType       function! integer! issue! logic! money! native!
  104. syn keyword     rebolType       none! object! paren! path! port! string! time!
  105. syn keyword     rebolType       tuple! url! word!
  106. syn keyword     rebolTypeFunction type?
  107.  
  108. " Control statements
  109. syn keyword     rebolStatement  break catch exit halt reduce return shield
  110. syn keyword     rebolConditional if else
  111. syn keyword     rebolRepeat     for forall foreach forskip loop repeat while until do
  112.  
  113. " Series statements
  114. syn keyword     rebolStatement  change clear copy fifth find first format fourth free
  115. syn keyword     rebolStatement  func function head insert last match next parse past
  116. syn keyword     rebolStatement  pick remove second select skip sort tail third trim length?
  117.  
  118. " Context
  119. syn keyword     rebolStatement  alias bind use
  120.  
  121. " Object
  122. syn keyword     rebolStatement  import make make-object rebol info?
  123.  
  124. " I/O statements
  125. syn keyword     rebolStatement  delete echo form format import input load mold prin
  126. syn keyword     rebolStatement  print probe read save secure send write
  127. syn keyword     rebolOperator   size? modified?
  128.  
  129. " Debug statement
  130. syn keyword     rebolStatement  help probe trace
  131.  
  132. " Misc statements
  133. syn keyword     rebolStatement  func function free
  134.  
  135. " Constants
  136. syn keyword     rebolConstant   none
  137.  
  138.  
  139. if !exists("did_rebol_syntax_inits")
  140.   let did_rebol_syntax_inits = 1
  141.   " The default methods for highlighting.  Can be overridden later
  142.   hi link rebolTodo     Todo
  143.  
  144.   hi link rebolStatement Statement
  145.   hi link rebolLabel    Label
  146.   hi link rebolConditional Conditional
  147.   hi link rebolRepeat    Repeat
  148.  
  149.   hi link rebolOperator    Operator
  150.   hi link rebolLogicOperator rebolOperator
  151.   hi link rebolLogicFunction rebolLogicOperator
  152.   hi link rebolMathOperator rebolOperator
  153.   hi link rebolMathFunction rebolMathOperator
  154.   hi link rebolBinaryOperator rebolOperator
  155.   hi link rebolBinaryFunction rebolBinaryOperator
  156.  
  157.   hi link rebolType     Type
  158.   hi link rebolTypeFunction rebolOperator
  159.  
  160.   hi link rebolWord     Identifier
  161.   hi link rebolWordPath rebolWord
  162.   hi link rebolFunction    Function
  163.  
  164.   hi link rebolCharacter Character
  165.   hi link rebolSpecialCharacter SpecialChar
  166.   hi link rebolString    String
  167.  
  168.   hi link rebolNumber   Number
  169.   hi link rebolInteger  rebolNumber
  170.   hi link rebolDecimal  rebolNumber
  171.   hi link rebolTime     rebolNumber
  172.   hi link rebolDate     rebolNumber
  173.   hi link rebolMoney    rebolNumber
  174.   hi link rebolBinary   rebolNumber
  175.   hi link rebolEmail    rebolString
  176.   hi link rebolFile     rebolString
  177.   hi link rebolURL      rebolString
  178.   hi link rebolIssue    rebolNumber
  179.   hi link rebolTuple    rebolNumber
  180.   hi link rebolFloat    Float
  181.   hi link rebolBoolean  Boolean
  182.  
  183.   hi link rebolConstant Constant
  184.  
  185.   hi link rebolComment    Comment
  186.  
  187.   hi link rebolError    Error
  188.  
  189. endif
  190.  
  191. if exists("my_rebol_file")
  192.   if file_readable(expand(my_rebol_file))
  193.     execute "source " . my_rebol_file
  194.   endif
  195. endif
  196.  
  197. let b:current_syntax = "rebol"
  198.  
  199. " vim: ts=8
  200.