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

  1. " Vim syntax file
  2. " Language:    Modula 2
  3. " Maintainer:    pf@artcom0.north.de (Peter Funk)
  4. "   based on original work of Bram Moolenaar <Bram@vim.org>
  5. " Last change:    1999 Jun 14
  6.  
  7. " Remove any old syntax stuff hanging around
  8. syn clear
  9.  
  10. " Don't ignore case (Modula-2 is case significant). This is the default in vim
  11.  
  12. " Especially emphasize headers of procedures and modules:
  13. syn region modula2Header matchgroup=modula2Header start="PROCEDURE " end="(" contains=modula2Ident oneline
  14. syn region modula2Header matchgroup=modula2Header start="MODULE " end=";" contains=modula2Ident oneline
  15. syn region modula2Header matchgroup=modula2Header start="BEGIN (\*" end="\*)" contains=modula2Ident oneline
  16. syn region modula2Header matchgroup=modula2Header start="END " end=";" contains=modula2Ident oneline
  17. syn region modula2Keyword start="END" end=";" contains=ALLBUT,modula2Ident oneline
  18.  
  19. " Some very important keywords which should be emphasized more than others:
  20. syn keyword modula2AttKeyword CONST EXIT HALT RETURN TYPE VAR
  21. " All other keywords in alphabetical order:
  22. syn keyword modula2Keyword AND ARRAY BY CASE DEFINITION DIV DO ELSE
  23. syn keyword modula2Keyword ELSIF EXPORT FOR FROM IF IMPLEMENTATION IMPORT
  24. syn keyword modula2Keyword IN LOOP MOD NOT OF OR POINTER QUALIFIED RECORD
  25. syn keyword modula2Keyword SET THEN TO UNTIL WHILE WITH
  26.  
  27. syn keyword modula2Type ADDRESS BITSET BOOLEAN CARDINAL CHAR INTEGER REAL WORD
  28. syn keyword modula2StdFunc ABS CAP CHR DEC EXCL INC INCL ORD SIZE TSIZE VAL
  29. syn keyword modula2StdConst FALSE NIL TRUE
  30. " The following may be discussed, since NEW and DISPOSE are some kind of
  31. " special builtin macro functions:
  32. syn keyword modula2StdFunc NEW DISPOSE
  33. " The following types are added later on and may be missing from older
  34. " Modula-2 Compilers (they are at least missing from the original report
  35. " by N.Wirth from March 1980 ;-)  Highlighting should apply nevertheless:
  36. syn keyword modula2Type BYTE LONGCARD LONGINT LONGREAL PROC SHORTCARD SHORTINT
  37. " same note applies to min and max, which were also added later to m2:
  38. syn keyword modula2StdFunc MAX MIN
  39. " The underscore was originally disallowed in m2 ids, it was also added later:
  40. syn match   modula2Ident " [A-Z,a-z][A-Z,a-z,0-9,_]*" contained
  41.  
  42. " Comments may be nested in Modula-2:
  43. syn region modula2Comment start="(\*" end="\*)" contains=modula2Comment,modula2Todo
  44. syn keyword modula2Todo    contained TODO FIXME XXX
  45.  
  46. " Strings
  47. syn region modula2String start=+"+ end=+"+
  48. syn region modula2String start="'" end="'"
  49. syn region modula2Set start="{" end="}"
  50.  
  51. if !exists("did_modula2_syntax_inits")
  52.   let did_modula2_syntax_inits = 1
  53.   " The default methods for highlighting.  Can be overridden later
  54.   hi link modula2Ident        Identifier
  55.   hi link modula2StdConst    Boolean
  56.   hi link modula2Type        Identifier
  57.   hi link modula2StdFunc    Identifier
  58.   hi link modula2Header        Type
  59.   hi link modula2Keyword    Statement
  60.   hi link modula2AttKeyword     PreProc
  61.   hi link modula2Comment    Comment
  62.   " The following is just a matter of taste (you want to try this instead):
  63.   " hi modula2Comment term=bold ctermfg=DarkBlue guifg=Blue gui=bold
  64.   hi link modula2Todo        Todo
  65.   hi link modula2String        String
  66.   hi link modula2Set        String
  67. endif
  68.  
  69. let b:current_syntax = "modula2"
  70.  
  71. " vim: ts=8
  72.