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

  1. " Vim syntax file
  2. " Language:   PROLOG
  3. " Maintainers:   Ralph Becket <rwab1@cam.sri.co.uk>,
  4. "                Thomas Koehler <jean-luc@picard.franken.de>
  5. " Last change:   1997 December 28
  6.  
  7. " There are two sets of highlighting in here:
  8. " If the "prolog_highlighting_clean" variable exists, it is rather sparse.
  9. " Otherwise you get more highlighting.
  10.  
  11. " Remove any old syntax stuff hanging around.
  12. syn clear
  13.  
  14. " Prolog is case sensitive.
  15. syn case match
  16.  
  17. " Very simple highlighting for comments, clause heads and
  18. " character codes.  It respects prolog strings and atoms.
  19.  
  20. syn region   prologCComment     start=+/\*+ end=+\*/+
  21. syn match    prologComment      +%.*+
  22.  
  23. syn keyword  prologKeyword      module meta_predicate multifile dynamic
  24. syn match    prologCharCode     +0'\\\=.+
  25. syn region   prologString       start=+"+ skip=+\\"+ end=+"+
  26. syn region   prologAtom         start=+'+ skip=+\\'+ end=+'+
  27. syn region   prologClauseHead   start=+^[a-z][^(]*(+ end=+:-\|\.\|-->+
  28.  
  29. if !exists("prolog_highlighting_clean")
  30.  
  31.   " some keywords
  32.   " some common predicates are also highlighted as keywords
  33.   " is there a better solution?
  34.   syn keyword prologKeyword   abolish current_output  peek_code
  35.   syn keyword prologKeyword   append  current_predicate       put_byte
  36.   syn keyword prologKeyword   arg     current_prolog_flag     put_char
  37.   syn keyword prologKeyword   asserta fail    put_code
  38.   syn keyword prologKeyword   assertz findall read
  39.   syn keyword prologKeyword   at_end_of_stream        float   read_term
  40.   syn keyword prologKeyword   atom    flush_output    repeat
  41.   syn keyword prologKeyword   atom_chars      functor retract
  42.   syn keyword prologKeyword   atom_codes      get_byte        set_input
  43.   syn keyword prologKeyword   atom_concat     get_char        set_output
  44.   syn keyword prologKeyword   atom_length     get_code        set_prolog_flag
  45.   syn keyword prologKeyword   atomic  halt    set_stream_position
  46.   syn keyword prologKeyword   bagof   integer setof
  47.   syn keyword prologKeyword   call    is      stream_property
  48.   syn keyword prologKeyword   catch   nl      sub_atom
  49.   syn keyword prologKeyword   char_code       nonvar  throw
  50.   syn keyword prologKeyword   char_conversion number  true
  51.   syn keyword prologKeyword   clause  number_chars    unify_with_occurs_check
  52.   syn keyword prologKeyword   close   number_codes    var
  53.   syn keyword prologKeyword   compound        once    write
  54.   syn keyword prologKeyword   copy_term       op      write_canonical
  55.   syn keyword prologKeyword   current_char_conversion open    write_term
  56.   syn keyword prologKeyword   current_input   peek_byte       writeq
  57.   syn keyword prologKeyword   current_op      peek_char
  58.  
  59.   syn match   prologOperator "=\\=\|=:=\|\\==\|=<\|==\|>=\|\\=\|\\+\|<\|>\|="
  60.   syn match   prologAsIs     "===\|\\===\|<=\|=>"
  61.  
  62.   syn match   prologNumber            "\<[0123456789]*\>"
  63.   syn match   prologCommentError      "\*/"
  64.   syn match   prologSpecialCharacter  ";"
  65.   syn match   prologSpecialCharacter  "!"
  66.   syn match   prologQuestion          "?-.*\."  contains=prologNumber
  67.  
  68.  
  69. endif
  70.  
  71. syn sync ccomment maxlines=50
  72.  
  73. if !exists("did_prolog_syntax_inits")
  74.  
  75.   let did_prolog_syntax_inits = 1
  76.  
  77.   " The default methods for highlighting.  Can be overridden later
  78.  
  79.   hi link prologComment    Comment
  80.   hi link prologCComment   Comment
  81.   hi link prologCharCode   Special
  82.  
  83.   if exists ("prolog_highlighting_clean")
  84.  
  85.     hi link prologKeyword      Statement
  86.     hi link prologClauseHead   Statement
  87.  
  88.   else
  89.  
  90.     hi link prologKeyword          Keyword
  91.     hi link prologClauseHead       Constant
  92.     hi link prologQuestion         PreProc
  93.     hi link prologSpecialCharacter Special
  94.     hi link prologNumber           Number
  95.     hi link prologAsIs             Normal
  96.     hi link prologCommentError     Error
  97.     hi link prologAtom             String
  98.     hi link prologString           String
  99.     hi link prologOperator         Operator
  100.  
  101.   endif
  102.  
  103. endif
  104.  
  105. let b:current_syntax = "prolog"
  106.  
  107. " vim: ts=28
  108.