aboutsummaryrefslogtreecommitdiff
path: root/runtime/syntax/mp.vim
blob: a8fa36fe0aa5b047ee844025d46a8a7a975fb5e7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
" Vim syntax file
" Language:           MetaPost
" Maintainer:         Nicola Vitacolonna <nvitacolonna@gmail.com>
" Former Maintainers: Andreas Scherer <andreas.scherer@pobox.com>
" Last Change:        2016 Oct 14

if exists("b:current_syntax")
  finish
endif

let s:cpo_sav = &cpo
set cpo&vim

if exists("g:plain_mf_macros")
  let s:plain_mf_macros = g:plain_mf_macros
endif
if exists("g:plain_mf_modes")
  let s:plain_mf_modes = g:plain_mf_modes
endif
if exists("g:other_mf_macros")
  let s:other_mf_macros = g:other_mf_macros
endif

let g:plain_mf_macros = 0 " plain.mf has no special meaning for MetaPost
let g:plain_mf_modes  = 0 " No METAFONT modes
let g:other_mf_macros = 0 " cmbase.mf, logo.mf, ... neither

" Read the METAFONT syntax to start with
runtime! syntax/mf.vim
unlet b:current_syntax " Necessary for syn include below

" Restore the value of existing global variables
if exists("s:plain_mf_macros")
  let g:plain_mf_macros = s:plain_mf_macros
else
  unlet g:plain_mf_macros
endif
if exists("s:plain_mf_modes")
  let g:plain_mf_modes = s:plain_mf_modes
else
  unlet g:plain_mf_modes
endif
if exists("s:other_mf_macros")
  let g:other_mf_macros = s:other_mf_macros
else
  unlet g:other_mf_macros
endif

" Use TeX highlighting inside verbatimtex/btex... etex
syn include @MPTeX syntax/tex.vim
unlet b:current_syntax
" These are defined as keywords rather than using matchgroup
" in order to make them available to syntaxcomplete.
syn keyword mpTeXdelim       btex etex verbatimtex contained
syn region mpTeXinsert
      \ start=/\<verbatimtex\>\|\<btex\>/rs=e+1
      \ end=/\<etex\>/re=s-1 keepend
      \ contains=@MPTeX,mpTeXdelim

" iskeyword must be set after the syn include above, because tex.vim sets `syn
" iskeyword`. Note that keywords do not contain numbers (numbers are
" subscripts)
syntax iskeyword @,_

" MetaPost primitives not found in METAFONT
syn keyword mpBoolExp        bounded clipped filled stroked textual arclength
syn keyword mpNumExp         arctime blackpart bluepart colormodel cyanpart
syn keyword mpNumExp         fontsize greenpart greypart magentapart redpart
syn keyword mpPairExp        yellowpart llcorner lrcorner ulcorner urcorner
" envelope is seemingly undocumented, but it exists since mpost 1.003.
" The syntax is: envelope <polygonal pen> of <path primary>. For example,
"     path p;
"     p := envelope pensquare of (up--left);
" (Thanks to Daniel H. Luecking for the example!)
syn keyword mpPathExp        envelope pathpart
syn keyword mpPenExp         penpart
syn keyword mpPicExp         dashpart glyph infont
syn keyword mpStringExp      fontpart readfrom textpart
syn keyword mpType           cmykcolor color rgbcolor
" Other MetaPost primitives listed in the manual
syn keyword mpPrimitive      mpxbreak within
" Internal quantities not found in METAFONT
" (Table 6 in MetaPost: A User's Manual)
syn keyword mpInternal       defaultcolormodel hour minute linecap linejoin
syn keyword mpInternal       miterlimit mpprocset mpversion numberprecision
syn keyword mpInternal       numbersystem outputfilename outputformat
syn keyword mpInternal       outputformatoptions outputtemplate prologues
syn keyword mpInternal       restoreclipcolor tracinglostchars troffmode
syn keyword mpInternal       truecorners
" List of commands not found in METAFONT (from MetaPost: A User's Manual)
syn keyword mpCommand        clip closefrom dashed filenametemplate fontmapfile
syn keyword mpCommand        fontmapline setbounds withcmykcolor withcolor
syn keyword mpCommand        withgreyscale withoutcolor withpostscript
syn keyword mpCommand        withprescript withrgbcolor write
" METAFONT internal variables not found in MetaPost
syn keyword notDefined       autorounding chardx chardy fillin granularity
syn keyword notDefined       proofing smoothing tracingedges tracingpens
syn keyword notDefined       turningcheck xoffset yoffset
" Suffix defined only in METAFONT:
syn keyword notDefined       nodot
" Other not implemented primitives (see MetaPost: A User's Manual, §C.1)
syn keyword notDefined       cull display openwindow numspecial totalweight
syn keyword notDefined       withweight

" Keywords defined by plain.mp
if get(g:, "plain_mp_macros", 1) || get(g:, "mp_metafun_macros", 0)
  syn keyword mpDef          beginfig clear_pen_memory clearit clearpen clearpen
  syn keyword mpDef          clearxy colorpart cutdraw downto draw drawarrow
  syn keyword mpDef          drawdblarrow drawdot drawoptions endfig erase
  syn keyword mpDef          exitunless fill filldraw flex gobble hide interact
  syn keyword mpDef          label loggingall makelabel numtok penstroke pickup
  syn keyword mpDef          range reflectedabout rotatedaround shipit
  syn keyword mpDef          stop superellipse takepower tracingall tracingnone
  syn keyword mpDef          undraw undrawdot unfill unfilldraw upto
  syn match   mpDef          "???"
  syn keyword mpVardef       arrowhead bbox bot buildcycle byte ceiling center
  syn keyword mpVardef       counterclockwise decr dir direction directionpoint
  syn keyword mpVardef       dotlabel dotlabels image incr interpath inverse
  syn keyword mpVardef       labels lft magstep max min penlabels penpos round
  syn keyword mpVardef       rt savepen solve tensepath thelabel top unitvector
  syn keyword mpVardef       whatever z
  syn keyword mpPrimaryDef   div dotprod gobbled mod
  syn keyword mpSecondaryDef intersectionpoint
  syn keyword mpTertiaryDef  cutafter cutbefore softjoin thru
  syn keyword mpNewInternal  ahangle ahlength bboxmargin beveled butt defaultpen
  syn keyword mpNewInternal  defaultscale dotlabeldiam eps epsilon infinity
  syn keyword mpNewInternal  join_radius labeloffset mitered pen_bot pen_lft
  syn keyword mpNewInternal  pen_rt pen_top rounded squared tolerance
  " Predefined constants
  syn keyword mpConstant     EOF background base_name base_version black
  syn keyword mpConstant     blankpicture blue ditto down evenly fullcircle
  syn keyword mpConstant     green halfcircle identity left origin penrazor
  syn keyword mpConstant     penspeck pensquare quartercircle red right
  syn keyword mpConstant     unitsquare up white withdots
  " Other predefined variables
  syn keyword mpVariable     currentpen currentpen_path currentpicture cuttings
  syn keyword mpVariable     defaultfont extra_beginfig extra_endfig
  syn match   mpVariable     /\<\%(laboff\|labxf\|labyf\)\>/
  syn match   mpVariable     /\<\%(laboff\|labxf\|labyf\)\.\%(lft\|rt\|bot\|top\|ulft\|urt\|llft\|lrt\)\>/
  " let statements:
  syn keyword mpnumExp       abs
  syn keyword mpDef          rotatedabout
  syn keyword mpCommand      bye relax
  " on and off are not technically keywords, but it is nice to highlight them
  " inside dashpattern().
  syn keyword mpOnOff        off on contained
  syn keyword mpDash         dashpattern contained
  syn region  mpDashPattern
        \ start="dashpattern\s*"
        \ end=")"he=e-1
        \ contains=mfNumeric,mfLength,mpOnOff,mpDash
endif

" Keywords defined by mfplain.mp
if get(g:, "mfplain_mp_macros", 0)
  syn keyword mpDef          beginchar capsule_def change_width
  syn keyword mpDef          define_blacker_pixels define_corrected_pixels
  syn keyword mpDef          define_good_x_pixels define_good_y_pixels
  syn keyword mpDef          define_horizontal_corrected_pixels define_pixels
  syn keyword mpDef          define_whole_blacker_pixels define_whole_pixels
  syn keyword mpDef          define_whole_vertical_blacker_pixels
  syn keyword mpDef          define_whole_vertical_pixels endchar
  syn keyword mpDef          font_coding_scheme font_extra_space font_identifier
  syn keyword mpDef          font_normal_shrink font_normal_space
  syn keyword mpDef          font_normal_stretch font_quad font_size font_slant
  syn keyword mpDef          font_x_height italcorr labelfont lowres_fix makebox
  syn keyword mpDef          makegrid maketicks mode_def mode_setup proofrule
  syn keyword mpDef          smode
  syn keyword mpVardef       hround proofrulethickness vround
  syn keyword mpNewInternal  blacker o_correction
  syn keyword mpVariable     extra_beginchar extra_endchar extra_setup rulepen
  " plus some no-ops, also from mfplain.mp
  syn keyword mpDef          cull cullit gfcorners imagerules nodisplays
  syn keyword mpDef          notransforms openit proofoffset screenchars
  syn keyword mpDef          screenrule screenstrokes showit
  syn keyword mpVardef       grayfont slantfont titlefont
  syn keyword mpVariable     currenttransform
  syn keyword mpConstant     unitpixel
  " These are not listed in the MetaPost manual, and some are ignored by
  " MetaPost, but are nonetheless defined in mfplain.mp
  syn keyword mpDef          killtext
  syn match   mpVardef       "\<good\.\%(x\|y\|lft\|rt\|top\|bot\)\>"
  syn keyword mpVariable     aspect_ratio localfont mag mode mode_name
  syn keyword mpVariable     proofcolor
  syn keyword mpConstant     lowres proof smoke
  syn keyword mpNewInternal  autorounding bp_per_pixel granularity
  syn keyword mpNewInternal  number_of_modes proofing smoothing turningcheck
endif

" Keywords defined by all base macro packages:
" - (r)boxes.mp
" - format.mp
" - graph.mp
" - marith.mp
" - sarith.mp
" - string.mp
" - TEX.mp
if get(g:, "other_mp_macros", 1)
  " boxes and rboxes
  syn keyword mpDef          boxjoin drawboxed drawboxes drawunboxed
  syn keyword mpNewInternal  circmargin defaultdx defaultdy rbox_radius
  syn keyword mpVardef       boxit bpath circleit fixpos fixsize generic_declare
  syn keyword mpVardef       generic_redeclare generisize pic rboxit str_prefix
  " format
  syn keyword mpVardef       Mformat format init_numbers roundd
  syn keyword mpVariable     Fe_base Fe_plus
  syn keyword mpConstant     Ten_to
  " graph
  syn keyword mpDef          Gfor Gxyscale OUT auto begingraph endgraph gdata
  syn keyword mpDef          gdraw gdrawarrow gdrawdblarrow gfill plot
  syn keyword mpVardef       augment autogrid frame gdotlabel glabel grid itick
  syn keyword mpVardef       otick
  syn keyword mpVardef       Mreadpath setcoords setrange
  syn keyword mpNewInternal  Gmarks Gminlog Gpaths linear log
  syn keyword mpVariable     Autoform Gemarks Glmarks Gumarks
  syn keyword mpConstant     Gtemplate
  syn match   mpVariable     /Gmargin\.\%(low\|high\)/
  " marith
  syn keyword mpVardef       Mabs Meform Mexp Mexp_str Mlog Mlog_Str Mlog_str
  syn keyword mpPrimaryDef   Mdiv Mmul
  syn keyword mpSecondaryDef Madd Msub
  syn keyword mpTertiaryDef  Mleq
  syn keyword mpNewInternal  Mten Mzero
  " sarith
  syn keyword mpVardef       Sabs Scvnum
  syn keyword mpPrimaryDef   Sdiv Smul
  syn keyword mpSecondaryDef Sadd Ssub
  syn keyword mpTertiaryDef  Sleq Sneq
  " string
  syn keyword mpVardef       cspan isdigit loptok
  " TEX
  syn keyword mpVardef       TEX TEXPOST TEXPRE
endif

" Up to date as of 23-Sep-2016.
if get(b:, 'mp_metafun_macros', get(g:, 'mp_metafun_macros', 0))
  " Highlight TeX keywords (for use in ConTeXt documents)
  syn match   mpTeXKeyword  '\\[a-zA-Z@]\+'

  " These keywords have been added manually.
  syn keyword mpPrimitive runscript

  " The following MetaFun keywords have been extracted automatically from
  " ConTeXt source code. They include all "public" macros (where a macro is
  " considered public if and only if it does not start with _, mfun_, mlib_, or
  " do_, and it does not end with _), all "public" unsaved variables, and all
  " `let` statements.

  " mp-abck.mpiv
  syn keyword mpDef          abck_grid_line anchor_box box_found boxfilloptions
  syn keyword mpDef          boxgridoptions boxlineoptions draw_multi_pars
  syn keyword mpDef          draw_multi_side draw_multi_side_path freeze_box
  syn keyword mpDef          initialize_box initialize_box_pos
  syn keyword mpDef          multi_side_draw_options show_multi_kind
  syn keyword mpDef          show_multi_pars
  syn keyword mpVardef       abck_baseline_grid abck_draw_path abck_graphic_grid
  syn keyword mpVariable     boxdashtype boxfilloffset boxfilltype
  syn keyword mpVariable     boxgriddirection boxgriddistance boxgridshift
  syn keyword mpVariable     boxgridtype boxgridwidth boxlineoffset
  syn keyword mpVariable     boxlineradius boxlinetype boxlinewidth multikind
  syn keyword mpConstant     context_abck
  " mp-apos.mpiv
  syn keyword mpDef          anch_sidebars_draw boxfilloptions boxlineoptions
  syn keyword mpDef          connect_positions
  syn keyword mpConstant     context_apos
  " mp-asnc.mpiv
  syn keyword mpDef          FlushSyncTasks ProcessSyncTask ResetSyncTasks
  syn keyword mpDef          SetSyncColor SetSyncThreshold SyncTask
  syn keyword mpVardef       PrepareSyncTasks SyncBox TheSyncColor
  syn keyword mpVardef       TheSyncThreshold
  syn keyword mpVariable     CurrentSyncClass NOfSyncPaths SyncColor
  syn keyword mpVariable     SyncLeftOffset SyncPaths SyncTasks SyncThreshold
  syn keyword mpVariable     SyncThresholdMethod SyncWidth
  syn keyword mpConstant     context_asnc
  " mp-back.mpiv
  syn keyword mpDef          some_double_back some_hash
  syn keyword mpVariable     back_nillcolor
  syn keyword mpConstant     context_back
  " mp-bare.mpiv
  syn keyword mpVardef       colordecimals rawtextext
  syn keyword mpPrimaryDef   infont
  syn keyword mpConstant     context_bare
  " mp-base.mpiv
  " This is essentially plain.mp with only a few keywords added
  syn keyword mpNumExp       graypart
  syn keyword mpType         graycolor greycolor
  syn keyword mpConstant     cyan magenta yellow
  " mp-butt.mpiv
  syn keyword mpDef          predefinedbutton some_button
  syn keyword mpConstant     context_butt
  " mp-char.mpiv
  syn keyword mpDef          flow_begin_chart flow_begin_sub_chart
  syn keyword mpDef          flow_chart_draw_comment flow_chart_draw_exit
  syn keyword mpDef          flow_chart_draw_label flow_chart_draw_text
  syn keyword mpDef          flow_clip_chart flow_collapse_points
  syn keyword mpDef          flow_connect_bottom_bottom flow_connect_bottom_left
  syn keyword mpDef          flow_connect_bottom_right flow_connect_bottom_top
  syn keyword mpDef          flow_connect_left_bottom flow_connect_left_left
  syn keyword mpDef          flow_connect_left_right flow_connect_left_top
  syn keyword mpDef          flow_connect_right_bottom flow_connect_right_left
  syn keyword mpDef          flow_connect_right_right flow_connect_right_top
  syn keyword mpDef          flow_connect_top_bottom flow_connect_top_left
  syn keyword mpDef          flow_connect_top_right flow_connect_top_top
  syn keyword mpDef          flow_draw_connection flow_draw_connection_point
  syn keyword mpDef          flow_draw_midpoint flow_draw_shape
  syn keyword mpDef          flow_draw_test_area flow_draw_test_shape
  syn keyword mpDef          flow_draw_test_shapes flow_end_chart
  syn keyword mpDef          flow_end_sub_chart flow_flush_connections
  syn keyword mpDef          flow_flush_picture flow_flush_pictures
  syn keyword mpDef          flow_flush_shape flow_flush_shapes
  syn keyword mpDef          flow_initialize_grid flow_new_chart flow_new_shape
  syn keyword mpDef          flow_scaled_to_grid flow_show_connection
  syn keyword mpDef          flow_show_connections flow_show_shapes
  syn keyword mpDef          flow_xy_offset flow_y_pos
  syn keyword mpVardef       flow_connection_path flow_down_on_grid
  syn keyword mpVardef       flow_down_to_grid flow_i_point flow_left_on_grid
  syn keyword mpVardef       flow_left_to_grid flow_offset
  syn keyword mpVardef       flow_points_initialized flow_right_on_grid
  syn keyword mpVardef       flow_right_to_grid flow_smooth_connection
  syn keyword mpVardef       flow_trim_points flow_trimmed flow_up_on_grid
  syn keyword mpVardef       flow_up_to_grid flow_valid_connection
  syn keyword mpVardef       flow_x_on_grid flow_xy_bottom flow_xy_left
  syn keyword mpVardef       flow_xy_on_grid flow_xy_right flow_xy_top
  syn keyword mpVardef       flow_y_on_grid
  syn keyword mpVariable     flow_arrowtip flow_chart_background_color
  syn keyword mpVariable     flow_chart_offset flow_comment_offset
  syn keyword mpVariable     flow_connection_arrow_size
  syn keyword mpVariable     flow_connection_dash_size
  syn keyword mpVariable     flow_connection_line_color
  syn keyword mpVariable     flow_connection_line_width
  syn keyword mpVariable     flow_connection_smooth_size flow_connections
  syn keyword mpVariable     flow_cpath flow_dash_pattern flow_dashline
  syn keyword mpVariable     flow_exit_offset flow_forcevalid flow_grid_height
  syn keyword mpVariable     flow_grid_width flow_label_offset flow_max_x
  syn keyword mpVariable     flow_max_y flow_peepshape flow_reverse_connection
  syn keyword mpVariable     flow_reverse_y flow_shape_action flow_shape_archive
  syn keyword mpVariable     flow_shape_decision flow_shape_down
  syn keyword mpVariable     flow_shape_fill_color flow_shape_height
  syn keyword mpVariable     flow_shape_left flow_shape_line_color
  syn keyword mpVariable     flow_shape_line_width flow_shape_loop
  syn keyword mpVariable     flow_shape_multidocument flow_shape_node
  syn keyword mpVariable     flow_shape_procedure flow_shape_product
  syn keyword mpVariable     flow_shape_right flow_shape_singledocument
  syn keyword mpVariable     flow_shape_subprocedure flow_shape_up
  syn keyword mpVariable     flow_shape_wait flow_shape_width
  syn keyword mpVariable     flow_show_all_points flow_show_con_points
  syn keyword mpVariable     flow_show_mid_points flow_showcrossing flow_smooth
  syn keyword mpVariable     flow_touchshape flow_xypoint flow_zfactor
  syn keyword mpConstant     context_flow
  " mp-chem.mpiv
  syn keyword mpDef          chem_init_all chem_reset chem_start_structure
  syn keyword mpDef          chem_transformed
  syn keyword mpVardef       chem_ad chem_adj chem_align chem_arrow chem_au
  syn keyword mpVardef       chem_b chem_bb chem_bd chem_bw chem_c chem_cc
  syn keyword mpVardef       chem_ccd chem_cd chem_crz chem_cz chem_dash chem_db
  syn keyword mpVardef       chem_diff chem_dir chem_do chem_dr chem_draw
  syn keyword mpVardef       chem_drawarrow chem_eb chem_ed chem_ep chem_er
  syn keyword mpVardef       chem_es chem_et chem_fill chem_hb chem_init_some
  syn keyword mpVardef       chem_label chem_ldb chem_ldd chem_line chem_lr
  syn keyword mpVardef       chem_lrb chem_lrbd chem_lrd chem_lrh chem_lrn
  syn keyword mpVardef       chem_lrt chem_lrz chem_lsr chem_lsub chem_mark
  syn keyword mpVardef       chem_marked chem_mid chem_mids chem_midz chem_mir
  syn keyword mpVardef       chem_mov chem_move chem_number chem_oe chem_off
  syn keyword mpVardef       chem_pb chem_pe chem_r chem_r_fragment chem_rb
  syn keyword mpVardef       chem_rbd chem_rd chem_rdb chem_rdd chem_restore
  syn keyword mpVardef       chem_rh chem_rm chem_rn chem_rot chem_rr chem_rrb
  syn keyword mpVardef       chem_rrbd chem_rrd chem_rrh chem_rrn chem_rrt
  syn keyword mpVardef       chem_rrz chem_rsr chem_rsub chem_rt chem_rz chem_s
  syn keyword mpVardef       chem_save chem_sb chem_sd chem_set chem_sr chem_ss
  syn keyword mpVardef       chem_start_component chem_stop_component
  syn keyword mpVardef       chem_stop_structure chem_sub chem_symbol chem_tb
  syn keyword mpVardef       chem_text chem_z chem_zln chem_zlt chem_zn chem_zrn
  syn keyword mpVardef       chem_zrt chem_zt
  syn keyword mpVariable     chem_mark_pair chem_stack_mirror chem_stack_origin
  syn keyword mpVariable     chem_stack_p chem_stack_previous
  syn keyword mpVariable     chem_stack_rotation chem_trace_boundingbox
  syn keyword mpVariable     chem_trace_nesting chem_trace_text
  syn keyword mpConstant     context_chem
  " mp-core.mpiv
  syn keyword mpDef          FlushSyncTasks ProcessSyncTask
  syn keyword mpDef          RegisterLocalTextArea RegisterPlainTextArea
  syn keyword mpDef          RegisterRegionTextArea RegisterTextArea
  syn keyword mpDef          ResetLocalTextArea ResetSyncTasks ResetTextAreas
  syn keyword mpDef          SaveTextAreas SetSyncColor SetSyncThreshold
  syn keyword mpDef          SyncTask anchor_box box_found boxfilloptions
  syn keyword mpDef          boxgridoptions boxlineoptions collapse_multi_pars
  syn keyword mpDef          draw_box draw_multi_pars draw_par freeze_box
  syn keyword mpDef          initialize_area initialize_area_par initialize_box
  syn keyword mpDef          initialize_box_pos initialize_par
  syn keyword mpDef          prepare_multi_pars relocate_multipars save_multipar
  syn keyword mpDef          set_par_line_height show_multi_pars show_par
  syn keyword mpDef          simplify_multi_pars sort_multi_pars
  syn keyword mpVardef       InsideSavedTextArea InsideSomeSavedTextArea
  syn keyword mpVardef       InsideSomeTextArea InsideTextArea PrepareSyncTasks
  syn keyword mpVardef       SyncBox TextAreaH TextAreaW TextAreaWH TextAreaX
  syn keyword mpVardef       TextAreaXY TextAreaY TheSyncColor TheSyncThreshold
  syn keyword mpVardef       baseline_grid graphic_grid multi_par_at_top
  syn keyword mpVariable     CurrentSyncClass NOfSavedTextAreas
  syn keyword mpVariable     NOfSavedTextColumns NOfSyncPaths NOfTextAreas
  syn keyword mpVariable     NOfTextColumns PlainTextArea RegionTextArea
  syn keyword mpVariable     SavedTextColumns SyncColor SyncLeftOffset SyncPaths
  syn keyword mpVariable     SyncTasks SyncThreshold SyncThresholdMethod
  syn keyword mpVariable     SyncWidth TextAreas TextColumns
  syn keyword mpVariable     auto_multi_par_hsize boxdashtype boxfilloffset
  syn keyword mpVariable     boxfilltype boxgriddirection boxgriddistance
  syn keyword mpVariable     boxgridshift boxgridtype boxgridwidth boxlineradius
  syn keyword mpVariable     boxlinetype boxlinewidth check_multi_par_chain
  syn keyword mpVariable     compensate_multi_par_topskip
  syn keyword mpVariable     enable_multi_par_fallback force_multi_par_chain
  syn keyword mpVariable     ignore_multi_par_page last_multi_par_shift lefthang
  syn keyword mpVariable     local_multi_par_area multi_column_first_page_hack
  syn keyword mpVariable     multi_par_pages multiloc multilocs multipar
  syn keyword mpVariable     multipars multiref multirefs nofmultipars
  syn keyword mpVariable     obey_multi_par_hang obey_multi_par_more
  syn keyword mpVariable     one_piece_multi_par par_hang_after par_hang_indent
  syn keyword mpVariable     par_indent par_left_skip par_line_height
  syn keyword mpVariable     par_right_skip par_start_pos par_stop_pos
  syn keyword mpVariable     par_strut_depth par_strut_height ppos righthang
  syn keyword mpVariable     snap_multi_par_tops somehang span_multi_column_pars
  syn keyword mpVariable     use_multi_par_region
  syn keyword mpConstant     context_core
  syn keyword LET            anchor_area anchor_par draw_area
  " mp-cows.mpiv
  syn keyword mpConstant     context_cows cow
  " mp-crop.mpiv
  syn keyword mpDef          page_marks_add_color page_marks_add_lines
  syn keyword mpDef          page_marks_add_marking page_marks_add_number
  syn keyword mpVardef       crop_color crop_gray crop_marks_cmyk
  syn keyword mpVardef       crop_marks_cmykrgb crop_marks_gray crop_marks_lines
  syn keyword mpVariable     crop_colors more page
  syn keyword mpConstant     context_crop
  " mp-figs.mpiv
  syn keyword mpDef          naturalfigure registerfigure
  syn keyword mpVardef       figuredimensions figureheight figuresize
  syn keyword mpVardef       figurewidth
  syn keyword mpConstant     context_figs
  " mp-fobg.mpiv
  syn keyword mpDef          DrawFoFrame
  syn keyword mpVardef       equalpaths
  syn keyword mpPrimaryDef   inset outset
  syn keyword mpVariable     FoBackground FoBackgroundColor FoFrame FoLineColor
  syn keyword mpVariable     FoLineStyle FoLineWidth FoSplit
  syn keyword mpConstant     FoAll FoBottom FoDash FoDotted FoDouble FoGroove
  syn keyword mpConstant     FoHidden FoInset FoLeft FoMedium FoNoColor FoNone
  syn keyword mpConstant     FoOutset FoRidge FoRight FoSolid FoThick FoThin
  syn keyword mpConstant     FoTop context_fobg
  " mp-form.mpiv
  syn keyword mpConstant     context_form
  " mp-func.mpiv
  syn keyword mpDef          constructedfunction constructedpairs
  syn keyword mpDef          constructedpath curvedfunction curvedpairs
  syn keyword mpDef          curvedpath function pathconnectors straightfunction
  syn keyword mpDef          straightpairs straightpath
  syn keyword mpConstant     context_func
  " mp-grap.mpiv
  syn keyword mpDef          Gfor OUT auto begingraph circles crosses diamonds
  syn keyword mpDef          downtriangles endgraph gdata gdraw gdrawarrow
  syn keyword mpDef          gdrawdblarrow gfill graph_addto
  syn keyword mpDef          graph_addto_currentpicture graph_comma
  syn keyword mpDef          graph_coordinate_multiplication graph_draw
  syn keyword mpDef          graph_draw_label graph_errorbar_text graph_fill
  syn keyword mpDef          graph_generate_exponents
  syn keyword mpDef          graph_generate_label_position
  syn keyword mpDef          graph_generate_numbers graph_label_location
  syn keyword mpDef          graph_scan_mark graph_scan_marks graph_setbounds
  syn keyword mpDef          graph_suffix graph_tick_label
  syn keyword mpDef          graph_with_pen_and_color graph_withlist
  syn keyword mpDef          graph_xyscale lefttriangles makefunctionpath plot
  syn keyword mpDef          plotsymbol points rainbow righttriangles smoothpath
  syn keyword mpDef          squares stars uptriangles witherrorbars
  syn keyword mpVardef       addtopath augment autogrid constant_fit
  syn keyword mpVardef       constant_function det escaped_format exp
  syn keyword mpVardef       exponential_fit exponential_function format
  syn keyword mpVardef       formatted frame functionpath gaussian_fit
  syn keyword mpVardef       gaussian_function gdotlabel glabel graph_Feform
  syn keyword mpVardef       graph_Meform graph_arrowhead_extent graph_bounds
  syn keyword mpVardef       graph_clear_bounds
  syn keyword mpVardef       graph_convert_user_path_to_internal graph_cspan
  syn keyword mpVardef       graph_draw_arrowhead graph_error graph_errorbars
  syn keyword mpVardef       graph_exp graph_factor_and_exponent_to_string
  syn keyword mpVardef       graph_gridline_picture graph_is_null
  syn keyword mpVardef       graph_label_convert_user_to_internal graph_loptok
  syn keyword mpVardef       graph_match_exponents graph_mlog
  syn keyword mpVardef       graph_modified_exponent_ypart graph_pair_adjust
  syn keyword mpVardef       graph_picture_conversion graph_post_draw
  syn keyword mpVardef       graph_read_line graph_readpath graph_remap
  syn keyword mpVardef       graph_scan_path graph_select_exponent_mark
  syn keyword mpVardef       graph_select_mark graph_set_bounds
  syn keyword mpVardef       graph_set_default_bounds graph_shapesize
  syn keyword mpVardef       graph_stash_label graph_ti