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

  1. " Vim syntax file
  2. " Language:    Renderman shader language
  3. " Maintainer:    Dan Piponi <dan@tanelorn.demon.co.uk>
  4. " Last change:    1999 Jun 16
  5.  
  6. " Reset
  7. syn clear
  8.  
  9. " A bunch of useful Renderman keywords including special
  10. " RenderMan control structures
  11. syn keyword slStatement    break return continue
  12. syn keyword slConditional    if else
  13. syn keyword slRepeat        while for
  14. syn keyword slRepeat        illuminance illuminate solar
  15.  
  16. syn keyword slTodo contained    TODO FIXME XXX
  17.  
  18. " String and Character constants
  19. " Highlight special characters (those which have a backslash) differently
  20. syn match slSpecial contained    "\\[0-9][0-9][0-9]\|\\."
  21. syn region slString        start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=slSpecial
  22. syn match slCharacter        "'[^\\]'"
  23. syn match slSpecialCharacter    "'\\.'"
  24. syn match slSpecialCharacter    "'\\[0-9][0-9]'"
  25. syn match slSpecialCharacter    "'\\[0-9][0-9][0-9]'"
  26.  
  27. "catch errors caused by wrong parenthesis
  28. syn region slParen        transparent start='(' end=')' contains=ALLBUT,slParenError,slIncluded,slSpecial,slTodo,slUserLabel
  29. syn match slParenError        ")"
  30. syn match slInParen contained    "[{}]"
  31.  
  32. "integer number, or floating point number without a dot and with "f".
  33. syn case ignore
  34. syn match slNumber        "\<[0-9]\+\(u\=l\=\|lu\|f\)\>"
  35. "floating point number, with dot, optional exponent
  36. syn match slFloat        "\<[0-9]\+\.[0-9]*\(e[-+]\=[0-9]\+\)\=[fl]\=\>"
  37. "floating point number, starting with a dot, optional exponent
  38. syn match slFloat        "\.[0-9]\+\(e[-+]\=[0-9]\+\)\=[fl]\=\>"
  39. "floating point number, without dot, with exponent
  40. syn match slFloat        "\<[0-9]\+e[-+]\=[0-9]\+[fl]\=\>"
  41. "hex number
  42. syn match slNumber        "\<0x[0-9a-f]\+\(u\=l\=\|lu\)\>"
  43. "syn match slIdentifier    "\<[a-z_][a-z0-9_]*\>"
  44. syn case match
  45.  
  46. if exists("sl_comment_strings")
  47.   " A comment can contain slString, slCharacter and slNumber.
  48.   " But a "*/" inside a slString in a slComment DOES end the comment!  So we
  49.   " need to use a special type of slString: slCommentString, which also ends on
  50.   " "*/", and sees a "*" at the start of the line as comment again.
  51.   " Unfortunately this doesn't very well work for // type of comments :-(
  52.   syntax match slCommentSkip    contained "^\s*\*\($\|\s\+\)"
  53.   syntax region slCommentString    contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=slSpecial,slCommentSkip
  54.   syntax region slComment2String    contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=slSpecial
  55.   syntax region slComment    start="/\*" end="\*/" contains=slTodo,slCommentString,slCharacter,slNumber
  56. else
  57.   syn region slComment        start="/\*" end="\*/" contains=slTodo
  58. endif
  59. syntax match slCommentError    "\*/"
  60.  
  61. syn keyword slOperator    sizeof
  62. syn keyword slType        float point color string vector normal matrix void
  63. syn keyword slStorageClass    varying uniform extern
  64. syn keyword slStorageClass    light surface volume displacement transformation imager
  65. syn keyword slVariable    Cs Os P dPdu dPdv N Ng u v du dv s t
  66. syn keyword slVariable L Cl Ol E I ncomps time Ci Oi
  67. syn keyword slVariable Ps alpha
  68. syn keyword slVariable dtime dPdtime
  69.  
  70. syn sync ccomment slComment minlines=10
  71.  
  72. if !exists("did_sl_syntax_inits")
  73.   let did_sl_syntax_inits = 1
  74.   " The default methods for highlighting.  Can be overridden later
  75.   hi link slLabel    Label
  76.   hi link slUserLabel    Label
  77.   hi link slConditional    Conditional
  78.   hi link slRepeat    Repeat
  79.   hi link slCharacter    Character
  80.   hi link slSpecialCharacter slSpecial
  81.   hi link slNumber    Number
  82.   hi link slFloat    Float
  83.   hi link slParenError    slError
  84.   hi link slInParen    slError
  85.   hi link slCommentError    slError
  86.   hi link slOperator    Operator
  87.   hi link slStorageClass    StorageClass
  88.   hi link slError    Error
  89.   hi link slStatement    Statement
  90.   hi link slType        Type
  91.   hi link slCommentError    slError
  92.   hi link slCommentString slString
  93.   hi link slComment2String slString
  94.   hi link slCommentSkip    slComment
  95.   hi link slString    String
  96.   hi link slComment    Comment
  97.   hi link slSpecial    SpecialChar
  98.   hi link slTodo    Todo
  99.   hi link slVariable    Identifier
  100.   "hi link slIdentifier    Identifier
  101. endif
  102.  
  103. let b:current_syntax = "sl"
  104.  
  105. " vim: ts=8
  106.