Mercurial > vim
annotate runtime/syntax/prolog.vim @ 27991:e8cad604c218
Added tag v8.2.4520 for changeset 27ae8ea82d7ab9e0e4f8f894394dad7fd6344a5a
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 06 Mar 2022 21:00:07 +0100 |
parents | e2e2cc5d0856 |
children |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: PROLOG | |
17909 | 3 " Maintainer: Anton Kochkov <anton.kochkov@gmail.com> |
23573 | 4 " Last Change: 2021 Jan 05 |
7 | 5 |
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. | |
17909 | 9 " |
10 " You can also set the "prolog_highlighting_no_keyword" variable. If set, | |
11 " keywords will not be highlighted. | |
7 | 12 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
13 " quit when a syntax file was already loaded |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
14 if exists("b:current_syntax") |
7 | 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 | |
23573 | 24 syn region prologCComment start=+/\*+ end=+\*/+ contains=@Spell |
25 syn match prologComment +%.*+ contains=@Spell | |
7 | 26 |
17909 | 27 if !exists("prolog_highlighting_no_keyword") |
28 syn keyword prologKeyword module meta_predicate multifile dynamic | |
29 endif | |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
30 syn match prologCharCode +0'\\\=.+ |
23573 | 31 syn region prologString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
32 syn region prologAtom start=+'+ skip=+\\\\\|\\'+ end=+'+ |
23573 | 33 syn region prologClause matchgroup=prologClauseHead start=+^\s*[a-z]\w*+ matchgroup=Normal end=+\.\s\|\.$+ contains=ALLBUT,prologClause contains=@NoSpell |
7 | 34 |
35 if !exists("prolog_highlighting_clean") | |
36 | |
37 " some keywords | |
38 " some common predicates are also highlighted as keywords | |
39 " is there a better solution? | |
17909 | 40 if !exists("prolog_highlighting_no_keyword") |
41 syn keyword prologKeyword abolish current_output peek_code | |
42 syn keyword prologKeyword append current_predicate put_byte | |
43 syn keyword prologKeyword arg current_prolog_flag put_char | |
44 syn keyword prologKeyword asserta fail put_code | |
45 syn keyword prologKeyword assertz findall read | |
46 syn keyword prologKeyword at_end_of_stream float read_term | |
47 syn keyword prologKeyword atom flush_output repeat | |
48 syn keyword prologKeyword atom_chars functor retract | |
49 syn keyword prologKeyword atom_codes get_byte set_input | |
50 syn keyword prologKeyword atom_concat get_char set_output | |
51 syn keyword prologKeyword atom_length get_code set_prolog_flag | |
52 syn keyword prologKeyword atomic halt set_stream_position | |
53 syn keyword prologKeyword bagof integer setof | |
54 syn keyword prologKeyword call is stream_property | |
55 syn keyword prologKeyword catch nl sub_atom | |
56 syn keyword prologKeyword char_code nonvar throw | |
57 syn keyword prologKeyword char_conversion number true | |
58 syn keyword prologKeyword clause number_chars unify_with_occurs_check | |
59 syn keyword prologKeyword close number_codes var | |
60 syn keyword prologKeyword compound once write | |
61 syn keyword prologKeyword copy_term op write_canonical | |
62 syn keyword prologKeyword current_char_conversion open write_term | |
63 syn keyword prologKeyword current_input peek_byte writeq | |
64 syn keyword prologKeyword current_op peek_char | |
65 endif | |
7 | 66 |
17909 | 67 syn match prologOperator "=\\=\|=:=\|\\==\|=<\|==\|>=\|\\=\|\\+\|=\.\.\|<\|>\|=" |
7 | 68 syn match prologAsIs "===\|\\===\|<=\|=>" |
69 | |
17909 | 70 syn match prologNumber "\<\d*\>'\@!" |
71 syn match prologNumber "\<0[xX]\x*\>'\@!" | |
7 | 72 syn match prologCommentError "\*/" |
73 syn match prologSpecialCharacter ";" | |
74 syn match prologSpecialCharacter "!" | |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
75 syn match prologSpecialCharacter ":-" |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
76 syn match prologSpecialCharacter "-->" |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
77 syn match prologQuestion "?-.*\." contains=prologNumber |
7 | 78 |
79 | |
80 endif | |
81 | |
203 | 82 syn sync maxlines=50 |
7 | 83 |
84 | |
85 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
86 " Only when an item doesn't have highlighting yet |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
87 |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
88 " The default highlighting. |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
89 hi def link prologComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
90 hi def link prologCComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
91 hi def link prologCharCode Special |
7 | 92 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
93 if exists ("prolog_highlighting_clean") |
7 | 94 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
95 hi def link prologKeyword Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
96 hi def link prologClauseHead Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
97 hi def link prologClause Normal |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
98 |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
99 else |
7 | 100 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
101 hi def link prologKeyword Keyword |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
102 hi def link prologClauseHead Constant |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
103 hi def link prologClause Normal |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
104 hi def link prologQuestion PreProc |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
105 hi def link prologSpecialCharacter Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
106 hi def link prologNumber Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
107 hi def link prologAsIs Normal |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
108 hi def link prologCommentError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
109 hi def link prologAtom String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
110 hi def link prologString String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
111 hi def link prologOperator Operator |
7 | 112 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
113 endif |
7 | 114 |
115 | |
116 let b:current_syntax = "prolog" | |
117 | |
118 " vim: ts=8 |