Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
prolog.vim119 linesDownload Raw Back to syntax
1" Vim syntax file2" Language:    PROLOG3" Maintainer:  Anton Kochkov <anton.kochkov@gmail.com>4" Last Change: 2021 Jan 055 6" There are two sets of highlighting in here:7" If the "prolog_highlighting_clean" variable exists, it is rather sparse.8" Otherwise you get more highlighting.9"10" You can also set the "prolog_highlighting_no_keyword" variable. If set,11" keywords will not be highlighted.12 13" quit when a syntax file was already loaded14if exists("b:current_syntax")15  finish16endif17 18" Prolog is case sensitive.19syn case match20 21" Very simple highlighting for comments, clause heads and22" character codes.  It respects prolog strings and atoms.23 24syn region   prologCComment start=+/\*+ end=+\*/+ contains=@Spell25syn match    prologComment  +%.*+ contains=@Spell26 27if !exists("prolog_highlighting_no_keyword")28  syn keyword  prologKeyword  module meta_predicate multifile dynamic29endif30syn match    prologCharCode +0'\\\=.+31syn region   prologString   start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell32syn region   prologAtom     start=+'+ skip=+\\\\\|\\'+ end=+'+33syn region   prologClause   matchgroup=prologClauseHead start=+^\s*[a-z]\w*+ matchgroup=Normal end=+\.\s\|\.$+ contains=ALLBUT,prologClause contains=@NoSpell34 35if !exists("prolog_highlighting_clean")36 37  " some keywords38  " some common predicates are also highlighted as keywords39  " is there a better solution?40  if !exists("prolog_highlighting_no_keyword")41    syn keyword prologKeyword   abolish current_output  peek_code42    syn keyword prologKeyword   append  current_predicate       put_byte43    syn keyword prologKeyword   arg     current_prolog_flag     put_char44    syn keyword prologKeyword   asserta fail    put_code45    syn keyword prologKeyword   assertz findall read46    syn keyword prologKeyword   at_end_of_stream        float   read_term47    syn keyword prologKeyword   atom    flush_output    repeat48    syn keyword prologKeyword   atom_chars      functor retract49    syn keyword prologKeyword   atom_codes      get_byte        set_input50    syn keyword prologKeyword   atom_concat     get_char        set_output51    syn keyword prologKeyword   atom_length     get_code        set_prolog_flag52    syn keyword prologKeyword   atomic  halt    set_stream_position53    syn keyword prologKeyword   bagof   integer setof54    syn keyword prologKeyword   call    is      stream_property55    syn keyword prologKeyword   catch   nl      sub_atom56    syn keyword prologKeyword   char_code       nonvar  throw57    syn keyword prologKeyword   char_conversion number  true58    syn keyword prologKeyword   clause  number_chars    unify_with_occurs_check59    syn keyword prologKeyword   close   number_codes    var60    syn keyword prologKeyword   compound        once    write61    syn keyword prologKeyword   copy_term       op      write_canonical62    syn keyword prologKeyword   current_char_conversion open    write_term63    syn keyword prologKeyword   current_input   peek_byte       writeq64    syn keyword prologKeyword   current_op      peek_char65  endif66 67  syn match   prologOperator "=\\=\|=:=\|\\==\|=<\|==\|>=\|\\=\|\\+\|=\.\.\|<\|>\|="68  syn match   prologAsIs     "===\|\\===\|<=\|=>"69 70  syn match   prologNumber            "\<\d*\>'\@!"71  syn match   prologNumber            "\<0[xX]\x*\>'\@!"72  syn match   prologCommentError      "\*/"73  syn match   prologSpecialCharacter  ";"74  syn match   prologSpecialCharacter  "!"75  syn match   prologSpecialCharacter  ":-"76  syn match   prologSpecialCharacter  "-->"77  syn match   prologQuestion          "?-.*\."  contains=prologNumber78 79 80endif81 82syn sync maxlines=5083 84 85" Define the default highlighting.86" Only when an item doesn't have highlighting yet87 88" The default highlighting.89hi def link prologComment          Comment90hi def link prologCComment         Comment91hi def link prologCharCode         Special92 93if exists ("prolog_highlighting_clean")94 95hi def link prologKeyword        Statement96hi def link prologClauseHead     Statement97hi def link prologClause Normal98 99else100 101hi def link prologKeyword        Keyword102hi def link prologClauseHead     Constant103hi def link prologClause Normal104hi def link prologQuestion       PreProc105hi def link prologSpecialCharacter Special106hi def link prologNumber         Number107hi def link prologAsIs           Normal108hi def link prologCommentError   Error109hi def link prologAtom           String110hi def link prologString         String111hi def link prologOperator       Operator112 113endif114 115 116let b:current_syntax = "prolog"117 118" vim: ts=8119 
codekingpro/portable-devtools · Team Ai