annotate runtime/syntax/sexplib.vim @ 31994:096fe1952003 v9.0.1329

patch 9.0.1329: completion of map includes simplified ones Commit: https://github.com/vim/vim/commit/997b8a015cd39141866e953651d55c705275cbd6 Author: zeertzjq <zeertzjq@outlook.com> Date: Sun Feb 19 21:00:31 2023 +0000 patch 9.0.1329: completion of map includes simplified ones Problem: Completion of map includes simplified ones. Solution: Do not complete simplified mappings. (closes https://github.com/vim/vim/issues/12013)
author Bram Moolenaar <Bram@vim.org>
date Sun, 19 Feb 2023 22:15:03 +0100
parents 15fa3923cc49
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23466
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Vim syntax file
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2 " Language: S-expressions as used in Sexplib
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 " Filenames: *.sexp
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 " Maintainers: Markus Mottl <markus.mottl@gmail.com>
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5 " URL: https://github.com/ocaml/vim-ocaml
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6 " Last Change: 2020 Dec 31 - Updated header for Vim contribution (MM)
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 " 2017 Apr 11 - Improved matching of negative numbers (MM)
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8 " 2012 Jun 20 - Fixed a block comment highlighting bug (MM)
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10 " For version 5.x: Clear all syntax items
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11 " For version 6.x: Quit when a syntax file was already loaded
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 if version < 600
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13 syntax clear
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14 elseif exists("b:current_syntax") && b:current_syntax == "sexplib"
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15 finish
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16 endif
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 " Sexplib is case sensitive.
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19 syn case match
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21 " Comments
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 syn keyword sexplibTodo contained TODO FIXME XXX NOTE
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 syn region sexplibBlockComment matchgroup=sexplibComment start="#|" matchgroup=sexplibComment end="|#" contains=ALLBUT,sexplibQuotedAtom,sexplibUnquotedAtom,sexplibEncl,sexplibComment
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24 syn match sexplibSexpComment "#;" skipwhite skipempty nextgroup=sexplibQuotedAtomComment,sexplibUnquotedAtomComment,sexplibListComment,sexplibComment
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25 syn region sexplibQuotedAtomComment start=+"+ skip=+\\\\\|\\"+ end=+"+ contained
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 syn match sexplibUnquotedAtomComment /\([^;()" \t#|]\|#[^;()" \t|]\||[^;()" \t#]\)[^;()" \t]*/ contained
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27 syn region sexplibListComment matchgroup=sexplibComment start="(" matchgroup=sexplibComment end=")" contained contains=ALLBUT,sexplibEncl,sexplibString,sexplibQuotedAtom,sexplibUnquotedAtom,sexplibTodo,sexplibNumber,sexplibFloat
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 syn match sexplibComment ";.*" contains=sexplibTodo
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 " Atoms
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 syn match sexplibUnquotedAtom /\([^;()" \t#|]\|#[^;()" \t|]\||[^;()" \t#]\)[^;()" \t]*/
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 syn region sexplibQuotedAtom start=+"+ skip=+\\\\\|\\"+ end=+"+
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33 syn match sexplibNumber "-\=\<\d\(_\|\d\)*[l|L|n]\?\>"
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 syn match sexplibNumber "-\=\<0[x|X]\(\x\|_\)\+[l|L|n]\?\>"
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35 syn match sexplibNumber "-\=\<0[o|O]\(\o\|_\)\+[l|L|n]\?\>"
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36 syn match sexplibNumber "-\=\<0[b|B]\([01]\|_\)\+[l|L|n]\?\>"
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 syn match sexplibFloat "-\=\<\d\(_\|\d\)*\.\?\(_\|\d\)*\([eE][-+]\=\d\(_\|\d\)*\)\=\>"
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
39 " Lists
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
40 syn region sexplibEncl transparent matchgroup=sexplibEncl start="(" matchgroup=sexplibEncl end=")" contains=ALLBUT,sexplibParenErr
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
41
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
42 " Errors
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
43 syn match sexplibUnquotedAtomErr /\([^;()" \t#|]\|#[^;()" \t|]\||[^;()" \t#]\)[^;()" \t]*\(#|\||#\)[^;()" \t]*/
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
44 syn match sexplibParenErr ")"
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
45
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
46 " Synchronization
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
47 syn sync minlines=50
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
48 syn sync maxlines=500
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
49
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
50 " Define the default highlighting.
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
51 " For version 5.7 and earlier: only when not done already
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
52 " For version 5.8 and later: only when an item doesn't have highlighting yet
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
53 if version >= 508 || !exists("did_sexplib_syntax_inits")
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
54 if version < 508
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
55 let did_sexplib_syntax_inits = 1
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
56 command -nargs=+ HiLink hi link <args>
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
57 else
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
58 command -nargs=+ HiLink hi def link <args>
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
59 endif
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
60
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
61 HiLink sexplibParenErr Error
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
62 HiLink sexplibUnquotedAtomErr Error
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
63
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
64 HiLink sexplibComment Comment
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
65 HiLink sexplibSexpComment Comment
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
66 HiLink sexplibQuotedAtomComment Include
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
67 HiLink sexplibUnquotedAtomComment Comment
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
68 HiLink sexplibBlockComment Comment
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
69 HiLink sexplibListComment Comment
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
70
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
71 HiLink sexplibBoolean Boolean
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
72 HiLink sexplibCharacter Character
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
73 HiLink sexplibNumber Number
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
74 HiLink sexplibFloat Float
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
75 HiLink sexplibUnquotedAtom Identifier
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
76 HiLink sexplibEncl Identifier
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
77 HiLink sexplibQuotedAtom Keyword
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
78
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
79 HiLink sexplibTodo Todo
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
80
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
81 HiLink sexplibEncl Keyword
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
82
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
83 delcommand HiLink
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
84 endif
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
85
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
86 let b:current_syntax = "sexplib"
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
87
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
88 " vim: ts=8