annotate runtime/syntax/mp.vim @ 7870:fb5ba6fbc843 v7.4.1232

commit https://github.com/vim/vim/commit/1357caf31f3e447d99baf8dd6a3243e2ab38567f Author: Bram Moolenaar <Bram@vim.org> Date: Mon Feb 1 21:40:14 2016 +0100 patch 7.4.1232 Problem: Compiler warnings when the Sniff feature is enabled. Solution: Add UNUSED.
author Christian Brabandt <cb@256bit.org>
date Mon, 01 Feb 2016 21:45:06 +0100
parents 3fc0f57ecb91
children 43efa4f5a8ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: MetaPost
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Andreas Scherer <andreas.scherer@pobox.com>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " Last Change: April 30, 2001
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 syn clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 let plain_mf_macros = 0 " plain.mf has no special meaning for MetaPost
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 let other_mf_macros = 0 " cmbase.mf, logo.mf, ... neither
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " Read the Metafont syntax to start with
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 source <sfile>:p:h/mf.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 runtime! syntax/mf.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 " MetaPost has TeX inserts for typeset labels
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 " verbatimtex, btex, and etex will be treated as keywords
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn match mpTeXbegin "\(verbatimtex\|btex\)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn match mpTeXend "etex"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn region mpTeXinsert start="\(verbatimtex\|btex\)"hs=e+1 end="etex"he=s-1 contains=mpTeXbegin,mpTeXend keepend
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 " MetaPost primitives not found in Metafont
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn keyword mpInternal bluepart clip color dashed fontsize greenpart infont
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn keyword mpInternal linecap linejoin llcorner lrcorner miterlimit mpxbreak
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn keyword mpInternal prologues redpart setbounds tracinglostchars
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn keyword mpInternal truecorners ulcorner urcorner withcolor
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 " Metafont primitives not found in MetaPost
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn keyword notDefined autorounding chardx chardy fillin granularity hppp
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn keyword notDefined proofing smoothing tracingedges tracingpens
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 syn keyword notDefined turningcheck vppp xoffset yoffset
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 " Keywords defined by plain.mp
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 if !exists("plain_mp_macros")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 let plain_mp_macros = 1 " Set this to '0' if your source gets too colourful
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 if plain_mp_macros
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn keyword mpMacro ahangle ahlength background bbox bboxmargin beginfig
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn keyword mpMacro beveled black blue buildcycle butt center cutafter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn keyword mpMacro cutbefore cuttings dashpattern defaultfont defaultpen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn keyword mpMacro defaultscale dotlabel dotlabels drawarrow drawdblarrow
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 syn keyword mpMacro drawoptions endfig evenly extra_beginfig extra_endfig
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn keyword mpMacro green label labeloffset mitered red rounded squared
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn keyword mpMacro thelabel white base_name base_version
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn keyword mpMacro upto downto exitunless relax gobble gobbled
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 syn keyword mpMacro interact loggingall tracingall tracingnone
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn keyword mpMacro eps epsilon infinity right left up down origin
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 syn keyword mpMacro quartercircle halfcircle fullcircle unitsquare identity
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 syn keyword mpMacro blankpicture withdots ditto EOF pensquare penrazor
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 syn keyword mpMacro penspeck whatever abs round ceiling byte dir unitvector
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 syn keyword mpMacro inverse counterclockwise tensepath mod div dotprod
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 syn keyword mpMacro takepower direction directionpoint intersectionpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn keyword mpMacro softjoin incr decr reflectedabout rotatedaround
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 syn keyword mpMacro rotatedabout min max flex superellipse interpath
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 syn keyword mpMacro magstep currentpen currentpen_path currentpicture
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 syn keyword mpMacro fill draw filldraw drawdot unfill undraw unfilldraw
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 syn keyword mpMacro undrawdot erase cutdraw image pickup numeric_pickup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 syn keyword mpMacro pen_lft pen_rt pen_top pen_bot savepen clearpen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 syn keyword mpMacro clear_pen_memory lft rt top bot ulft urt llft lrt
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 syn keyword mpMacro penpos penstroke arrowhead makelabel labels penlabel
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 syn keyword mpMacro range numtok thru clearxy clearit clearpen pickup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 syn keyword mpMacro shipit bye hide stop solve
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 " Keywords defined by mfplain.mp
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 if !exists("mfplain_mp_macros")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 let mfplain_mp_macros = 0 " Set this to '1' to include these macro names
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 if mfplain_mp_macros
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 syn keyword mpMacro beginchar blacker capsule_def change_width
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 syn keyword mpMacro define_blacker_pixels define_corrected_pixels
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 syn keyword mpMacro define_good_x_pixels define_good_y_pixels
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 syn keyword mpMacro define_horizontal_corrected_pixels
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 syn keyword mpMacro define_pixels define_whole_blacker_pixels
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 syn keyword mpMacro define_whole_vertical_blacker_pixels
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 syn keyword mpMacro define_whole_vertical_pixels endchar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 syn keyword mpMacro extra_beginchar extra_endchar extra_setup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 syn keyword mpMacro font_coding_scheme font_extra_space font_identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 syn keyword mpMacro font_normal_shrink font_normal_space
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 syn keyword mpMacro font_normal_stretch font_quad font_size
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 syn keyword mpMacro font_slant font_x_height italcorr labelfont
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 syn keyword mpMacro makebox makegrid maketicks mode_def mode_setup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 syn keyword mpMacro o_correction proofrule proofrulethickness rulepen smode
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 " plus some no-ops, also from mfplain.mp
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 syn keyword mpMacro cullit currenttransform gfcorners grayfont hround
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 syn keyword mpMacro imagerules lowres_fix nodisplays notransforms openit
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 syn keyword mpMacro proofoffset screenchars screenrule screenstrokes
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 syn keyword mpMacro showit slantfont titlefont unitpixel vround
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 " Keywords defined by other macro packages, e.g., boxes.mp
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 if !exists("other_mp_macros")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 let other_mp_macros = 1 " Set this to '0' if your source gets too colourful
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 if other_mp_macros
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 syn keyword mpMacro circmargin defaultdx defaultdy
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 syn keyword mpMacro boxit boxjoin bpath circleit drawboxed drawboxes
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 syn keyword mpMacro drawunboxed fixpos fixsize pic
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 " Define the default highlighting
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 if version >= 508 || !exists("did_mp_syntax_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 let did_mp_syntax_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 HiLink mpTeXinsert String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 HiLink mpTeXbegin Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 HiLink mpTeXend Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 HiLink mpInternal mfInternal
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 HiLink mpMacro Macro
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 let b:current_syntax = "mp"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 " vim: ts=8