Mercurial > vim
annotate runtime/syntax/prolog.vim @ 6978:5ad1ff809c32
Added tag v7-4-806 for changeset b10995a2f7c3
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 04 Aug 2015 18:23:22 +0200 |
parents | 2eb30f341e8d |
children | 43efa4f5a8ea |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: PROLOG | |
203 | 3 " Maintainers: Thomas Koehler <jean-luc@picard.franken.de> |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
4 " Last Change: 2013 May 23 |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
5 " URL: http://gott-gehabt.de/800_wer_wir_sind/thomas/Homepage/Computer/vim/syntax/prolog.vim |
7 | 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 " Quit when a syntax file was already loaded | |
12 if version < 600 | |
13 syntax clear | |
14 elseif exists("b:current_syntax") | |
15 finish | |
16 endif | |
17 | |
18 " Prolog is case sensitive. | |
19 syn case match | |
20 | |
21 " Very simple highlighting for comments, clause heads and | |
22 " character codes. It respects prolog strings and atoms. | |
23 | |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
24 syn region prologCComment start=+/\*+ end=+\*/+ |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
25 syn match prologComment +%.*+ |
7 | 26 |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
27 syn keyword prologKeyword module meta_predicate multifile dynamic |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
28 syn match prologCharCode +0'\\\=.+ |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
29 syn region prologString start=+"+ skip=+\\\\\|\\"+ end=+"+ |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
30 syn region prologAtom start=+'+ skip=+\\\\\|\\'+ end=+'+ |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
31 syn region prologClause matchgroup=prologClauseHead start=+^\s*[a-z]\w*+ matchgroup=Normal end=+\.\s\|\.$+ contains=ALLBUT,prologClause |
7 | 32 |
33 if !exists("prolog_highlighting_clean") | |
34 | |
35 " some keywords | |
36 " some common predicates are also highlighted as keywords | |
37 " is there a better solution? | |
38 syn keyword prologKeyword abolish current_output peek_code | |
39 syn keyword prologKeyword append current_predicate put_byte | |
40 syn keyword prologKeyword arg current_prolog_flag put_char | |
41 syn keyword prologKeyword asserta fail put_code | |
42 syn keyword prologKeyword assertz findall read | |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
43 syn keyword prologKeyword at_end_of_stream float read_term |
7 | 44 syn keyword prologKeyword atom flush_output repeat |
45 syn keyword prologKeyword atom_chars functor retract | |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
46 syn keyword prologKeyword atom_codes get_byte set_input |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
47 syn keyword prologKeyword atom_concat get_char set_output |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
48 syn keyword prologKeyword atom_length get_code set_prolog_flag |
7 | 49 syn keyword prologKeyword atomic halt set_stream_position |
50 syn keyword prologKeyword bagof integer setof | |
51 syn keyword prologKeyword call is stream_property | |
52 syn keyword prologKeyword catch nl sub_atom | |
53 syn keyword prologKeyword char_code nonvar throw | |
54 syn keyword prologKeyword char_conversion number true | |
55 syn keyword prologKeyword clause number_chars unify_with_occurs_check | |
56 syn keyword prologKeyword close number_codes var | |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
57 syn keyword prologKeyword compound once write |
7 | 58 syn keyword prologKeyword copy_term op write_canonical |
59 syn keyword prologKeyword current_char_conversion open write_term | |
60 syn keyword prologKeyword current_input peek_byte writeq | |
61 syn keyword prologKeyword current_op peek_char | |
62 | |
63 syn match prologOperator "=\\=\|=:=\|\\==\|=<\|==\|>=\|\\=\|\\+\|<\|>\|=" | |
64 syn match prologAsIs "===\|\\===\|<=\|=>" | |
65 | |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
66 syn match prologNumber "\<[0123456789]*\>'\@!" |
7 | 67 syn match prologCommentError "\*/" |
68 syn match prologSpecialCharacter ";" | |
69 syn match prologSpecialCharacter "!" | |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
70 syn match prologSpecialCharacter ":-" |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
71 syn match prologSpecialCharacter "-->" |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
72 syn match prologQuestion "?-.*\." contains=prologNumber |
7 | 73 |
74 | |
75 endif | |
76 | |
203 | 77 syn sync maxlines=50 |
7 | 78 |
79 | |
80 " Define the default highlighting. | |
81 " For version 5.7 and earlier: only when not done already | |
82 " For version 5.8 and later: only when an item doesn't have highlighting yet | |
83 if version >= 508 || !exists("did_prolog_syn_inits") | |
84 if version < 508 | |
85 let did_prolog_syn_inits = 1 | |
86 command -nargs=+ HiLink hi link <args> | |
87 else | |
88 command -nargs=+ HiLink hi def link <args> | |
89 endif | |
90 | |
91 " The default highlighting. | |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
92 HiLink prologComment Comment |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
93 HiLink prologCComment Comment |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
94 HiLink prologCharCode Special |
7 | 95 |
96 if exists ("prolog_highlighting_clean") | |
97 | |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
98 HiLink prologKeyword Statement |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
99 HiLink prologClauseHead Statement |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
100 HiLink prologClause Normal |
7 | 101 |
102 else | |
103 | |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
104 HiLink prologKeyword Keyword |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
105 HiLink prologClauseHead Constant |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
106 HiLink prologClause Normal |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
107 HiLink prologQuestion PreProc |
7 | 108 HiLink prologSpecialCharacter Special |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
109 HiLink prologNumber Number |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
110 HiLink prologAsIs Normal |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
111 HiLink prologCommentError Error |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
112 HiLink prologAtom String |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
113 HiLink prologString String |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
114 HiLink prologOperator Operator |
7 | 115 |
116 endif | |
117 | |
118 delcommand HiLink | |
119 endif | |
120 | |
121 let b:current_syntax = "prolog" | |
122 | |
123 " vim: ts=8 |