home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 February / OpenLinux 2.3 CD.iso / live / usr / share / vim / syntax / st.vim < prev    next >
Encoding:
Text File  |  1999-08-10  |  2.5 KB  |  87 lines

  1. " Vim syntax file
  2. " Language: Smalltalk
  3. " Maintainer: Arndt Hesse <hesse@self.de>
  4. " Last change: 1997 Dec 24
  5.  
  6. " remove any old syntax stuff hanging around
  7. syn clear
  8.  
  9. " some Smalltalk keywords and standard methods
  10. syn keyword    stKeyword    super self class true false new not
  11. syn keyword    stKeyword    notNil isNil inspect out nil
  12. syn match    stMethod    "\<do\>:"
  13. syn match    stMethod    "\<whileTrue\>:"
  14. syn match    stMethod    "\<whileFalse\>:"
  15. syn match    stMethod    "\<ifTrue\>:"
  16. syn match    stMethod    "\<ifFalse\>:"
  17. syn match    stMethod    "\<put\>:"
  18. syn match    stMethod    "\<to\>:"
  19. syn match    stMethod    "\<at\>:"
  20. syn match    stMethod    "\<add\>:"
  21. syn match    stMethod    "\<new\>:"
  22. syn match    stMethod    "\<for\>:"
  23. syn match    stMethod    "\<methods\>:"
  24. syn match    stMethod    "\<methodsFor\>:"
  25. syn match    stMethod    "\<instanceVariableNames\>:"
  26. syn match    stMethod    "\<classVariableNames\>:"
  27. syn match    stMethod    "\<poolDictionaries\>:"
  28. syn match    stMethod    "\<subclass\>:"
  29.  
  30. " the block of local variables of a method
  31. syn region stLocalVariables    start="^[ \t]*|" end="|"
  32.  
  33. " the Smalltalk comment
  34. syn region stComment    start="\"" end="\""
  35.  
  36. " the Smalltalk strings and single characters
  37. syn region stString    start='\'' skip="''" end='\''
  38. syn match  stCharacter    "$."
  39.  
  40. syn case ignore
  41.  
  42. " the symols prefixed by a '#'
  43. syn match  stSymbol    "\(#\<[a-z_][a-z0-9_]*\>\)"
  44. syn match  stSymbol    "\(#'[^']*'\)"
  45.  
  46. " the variables in a statement block for loops
  47. syn match  stBlockVariable "\(:[ \t]*\<[a-z_][a-z0-9_]*\>[ \t]*\)\+|" contained
  48.  
  49. " some representations of numbers
  50. syn match  stNumber    "\<\d\+\(u\=l\=\|lu\|f\)\>"
  51. syn match  stFloat    "\<\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=\>"
  52. syn match  stFloat    "\<\d\+e[-+]\=\d\+[fl]\=\>"
  53.  
  54. syn case match
  55.  
  56. " a try to higlight paren mismatches
  57. syn region stParen    transparent start='(' end=')' contains=ALLBUT,stParenError
  58. syn match  stParenError    ")"
  59. syn region stBlock    transparent start='\[' end='\]' contains=ALLBUT,stBlockError
  60. syn match  stBlockError    "\]"
  61. syn region stSet    transparent start='{' end='}' contains=ALLBUT,stSetError
  62. syn match  stSetError    "}"
  63.  
  64. hi link stParenError stError
  65. hi link stSetError stError
  66. hi link stBlockError stError
  67.  
  68. " synchronization for syntax analysis
  69. syn sync minlines=50
  70.  
  71. if !exists("did_st_syntax_inits")
  72.   let did_st_syntax_inits = 1
  73.   hi link stKeyword        Statement
  74.   hi link stMethod        Statement
  75.   hi link stComment        Comment
  76.   hi link stCharacter        Constant
  77.   hi link stString        Constant
  78.   hi link stSymbol        Special
  79.   hi link stNumber        Type
  80.   hi link stFloat        Type
  81.   hi link stError        Error
  82.   hi link stLocalVariables    Identifier
  83.   hi link stBlockVariable    Identifier
  84. endif
  85.  
  86. let b:current_syntax = "st"
  87.