lace.vim 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. " Vim syntax file
  2. " Language: lace
  3. " Maintainer: Jocelyn Fiat <utilities@eiffel.com>
  4. " Last Change: 2001 May 09
  5. " Copyright Interactive Software Engineering, 1998
  6. " You are free to use this file as you please, but
  7. " if you make a change or improvement you must send
  8. " it to the maintainer at <utilities@eiffel.com>
  9. " quit when a syntax file was already loaded
  10. if exists("b:current_syntax")
  11. finish
  12. endif
  13. " LACE is case insensitive, but the style guide lines are not.
  14. if !exists("lace_case_insensitive")
  15. syn case match
  16. else
  17. syn case ignore
  18. endif
  19. " A bunch of useful LACE keywords
  20. syn keyword laceTopStruct system root default option visible cluster
  21. syn keyword laceTopStruct external generate end
  22. syn keyword laceOptionClause collect assertion debug optimize trace
  23. syn keyword laceOptionClause profile inline precompiled multithreaded
  24. syn keyword laceOptionClause exception_trace dead_code_removal
  25. syn keyword laceOptionClause array_optimization
  26. syn keyword laceOptionClause inlining_size inlining
  27. syn keyword laceOptionClause console_application dynamic_runtime
  28. syn keyword laceOptionClause line_generation
  29. syn keyword laceOptionMark yes no all
  30. syn keyword laceOptionMark require ensure invariant loop check
  31. syn keyword laceClusterProp use include exclude
  32. syn keyword laceAdaptClassName adapt ignore rename as
  33. syn keyword laceAdaptClassName creation export visible
  34. syn keyword laceExternal include_path object makefile
  35. " Operators
  36. syn match laceOperator "\$"
  37. syn match laceBrackets "[[\]]"
  38. syn match laceExport "[{}]"
  39. " Constants
  40. syn keyword laceBool true false
  41. syn keyword laceBool True False
  42. syn region laceString start=+"+ skip=+%"+ end=+"+ contains=laceEscape,laceStringError
  43. syn match laceEscape contained "%[^/]"
  44. syn match laceEscape contained "%/\d\+/"
  45. syn match laceEscape contained "^[ \t]*%"
  46. syn match laceEscape contained "%[ \t]*$"
  47. syn match laceStringError contained "%/[^0-9]"
  48. syn match laceStringError contained "%/\d\+[^0-9/]"
  49. syn match laceStringError "'\(%[^/]\|%/\d\+/\|[^'%]\)\+'"
  50. syn match laceCharacter "'\(%[^/]\|%/\d\+/\|[^'%]\)'" contains=laceEscape
  51. syn match laceNumber "-\=\<\d\+\(_\d\+\)*\>"
  52. syn match laceNumber "\<[01]\+[bB]\>"
  53. syn match laceNumber "-\=\<\d\+\(_\d\+\)*\.\(\d\+\(_\d\+\)*\)\=\([eE][-+]\=\d\+\(_\d\+\)*\)\="
  54. syn match laceNumber "-\=\.\d\+\(_\d\+\)*\([eE][-+]\=\d\+\(_\d\+\)*\)\="
  55. syn match laceComment "--.*" contains=laceTodo
  56. syn case match
  57. " Case sensitive stuff
  58. syn keyword laceTodo TODO XXX FIXME
  59. syn match laceClassName "\<[A-Z][A-Z0-9_]*\>"
  60. syn match laceCluster "[a-zA-Z][a-zA-Z0-9_]*\s*:"
  61. syn match laceCluster "[a-zA-Z][a-zA-Z0-9_]*\s*(\s*[a-zA-Z][a-zA-Z0-9_]*\s*)\s*:"
  62. " Catch mismatched parentheses
  63. syn match laceParenError ")"
  64. syn match laceBracketError "\]"
  65. syn region laceGeneric transparent matchgroup=laceBrackets start="\[" end="\]" contains=ALLBUT,laceBracketError
  66. syn region laceParen transparent start="(" end=")" contains=ALLBUT,laceParenError
  67. " Should suffice for even very long strings and expressions
  68. syn sync lines=40
  69. " Define the default highlighting.
  70. " Only when an item doesn't have highlighting yet
  71. hi def link laceTopStruct PreProc
  72. hi def link laceOptionClause Statement
  73. hi def link laceOptionMark Constant
  74. hi def link laceClusterProp Label
  75. hi def link laceAdaptClassName Label
  76. hi def link laceExternal Statement
  77. hi def link laceCluster ModeMsg
  78. hi def link laceEscape Special
  79. hi def link laceBool Boolean
  80. hi def link laceString String
  81. hi def link laceCharacter Character
  82. hi def link laceClassName Type
  83. hi def link laceNumber Number
  84. hi def link laceOperator Special
  85. hi def link laceArray Special
  86. hi def link laceExport Special
  87. hi def link laceCreation Special
  88. hi def link laceBrackets Special
  89. hi def link laceConstraint Special
  90. hi def link laceComment Comment
  91. hi def link laceError Error
  92. hi def link laceStringError Error
  93. hi def link laceParenError Error
  94. hi def link laceBracketError Error
  95. hi def link laceTodo Todo
  96. let b:current_syntax = "lace"
  97. " vim: ts=4