robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
9f6d693e26
master
1" Vim syntax file 2" Language: METAFONT 3" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com> 4" Former Maintainers: Andreas Scherer <andreas.scherer@pobox.com> 5" Last Change: 2016 Oct 1 6 7if exists ( "b:current_syntax" ) 8finish 9endif 10 11syn iskeyword @,_ 12 13" METAFONT 'primitives' as defined in chapter 25 of 'The METAFONTbook' 14" Page 210: 'boolean expressions' 15syn keyword mfBoolExp and charexists false known not odd or true unknown 16 17" Page 210: 'numeric expression' 18syn keyword mfNumExp ASCII angle cosd directiontime floor hex length 19syn keyword mfNumExp mexp mlog normaldeviate oct sind sqrt totalweight 20syn keyword mfNumExp turningnumber uniformdeviate xpart xxpart xypart 21syn keyword mfNumExp ypart yxpart yypart 22 23" Page 211: 'internal quantities' 24syn keyword mfInternal autorounding boundarychar charcode chardp chardx 25syn keyword mfInternal chardy charext charht charic charwd day designsize 26syn keyword mfInternal fillin fontmaking granularity hppp jobname month 27syn keyword mfInternal pausing proofing showstopping smoothing time 28syn keyword mfInternal tracingcapsules tracingchoices tracingcommands 29syn keyword mfInternal tracingedges tracingequations tracingmacros 30syn keyword mfInternal tracingonline tracingoutput tracingpens 31syn keyword mfInternal tracingrestores tracingspecs tracingstats 32syn keyword mfInternal tracingtitles turningcheck vppp warningcheck 33syn keyword mfInternal xoffset year yoffset 34 35" Page 212: 'pair expressions' 36syn keyword mfPairExp of penoffset point postcontrol precontrol rotated 37syn keyword mfPairExp scaled shifted slanted transformed xscaled yscaled 38syn keyword mfPairExp zscaled 39 40" Page 213: 'path expressions' 41syn keyword mfPathExp atleast controls curl cycle makepath reverse 42syn keyword mfPathExp subpath tension 43 44" Page 214: 'pen expressions' 45syn keyword mfPenExp makepen nullpen pencircle 46 47" Page 214: 'picture expressions' 48syn keyword mfPicExp nullpicture 49 50" Page 214: 'string expressions' 51syn keyword mfStringExp char decimal readstring str substring 52 53" Page 217: 'commands and statements' 54syn keyword mfCommand addto also at batchmode contour cull delimiters 55syn keyword mfCommand display doublepath dropping dump end errhelp 56syn keyword mfCommand errmessage errorstopmode everyjob from interim 57syn keyword mfCommand inwindow keeping let message newinternal 58syn keyword mfCommand nonstopmode numspecial openwindow outer randomseed 59syn keyword mfCommand save scrollmode shipout show showdependencies 60syn keyword mfCommand showstats showtoken showvariable special to withpen 61syn keyword mfCommand withweight 62 63" Page 56: 'types' 64syn keyword mfType boolean numeric pair path pen picture string 65syn keyword mfType transform 66 67" Page 155: 'grouping' 68syn keyword mfStatement begingroup endgroup 69 70" Page 165: 'definitions' 71syn keyword mfDefinition def enddef expr primary primarydef secondary 72syn keyword mfDefinition secondarydef suffix tertiary tertiarydef text 73syn keyword mfDefinition vardef 74 75" Page 169: 'conditions and loops' 76syn keyword mfCondition else elseif endfor exitif fi for forever 77syn keyword mfCondition forsuffixes if step until 78 79" Other primitives listed in the index 80syn keyword mfPrimitive charlist endinput expandafter extensible fontdimen 81syn keyword mfPrimitive headerbyte inner input intersectiontimes kern 82syn keyword mfPrimitive ligtable quote scantokens skipto 83 84" Implicit suffix parameters 85syn match mfSuffixParam "@#\|#@\|@ " 86 87" These are just tags, but given their special status, we 88" highlight them as variables 89syn keyword mfVariable x y 90 91" Keywords defined by plain.mf (defined on pp.262-278) 92if get ( g:, "plain_mf_macros" , 1 ) 93syn keyword mfDef addto_currentpicture beginchar capsule_def 94syn keyword mfDef change_width clear_pen_memory clearit clearpen 95syn keyword mfDef clearxy culldraw cullit cutdraw 96syn keyword mfDef define_blacker_pixels define_corrected_pixels 97syn keyword mfDef define_good_x_pixels define_good_y_pixels 98syn keyword mfDef define_horizontal_corrected_pixels define_pixels 99syn keyword mfDef define_whole_blacker_pixels define_whole_pixels 100syn keyword mfDef define_whole_vertical_blacker_pixels 101syn keyword mfDef define_whole_vertical_pixels downto draw drawdot 102syn keyword mfDef endchar erase exitunless fill filldraw fix_units 103syn keyword mfDef flex font_coding_scheme font_extra_space 104syn keyword mfDef font_identifier font_normal_shrink 105syn keyword mfDef font_normal_space font_normal_stretch font_quad 106syn keyword mfDef font_size font_slant font_x_height gfcorners gobble 107syn keyword mfDef hide imagerules interact italcorr killtext 108syn keyword mfDef loggingall lowres_fix makebox makegrid maketicks 109syn keyword mfDef mode_def mode_setup nodisplays notransforms numtok 110syn keyword mfDef openit penrazor pensquare penstroke pickup 111syn keyword mfDef proofoffset proofrule range reflectedabout 112syn keyword mfDef rotatedaround screenchars screenrule screenstrokes 113syn keyword mfDef shipit showit smode stop superellipse takepower 114syn keyword mfDef tracingall tracingnone undraw undrawdot unfill 115syn keyword mfDef unfilldraw upto z 116syn match mfDef "??? " 117syn keyword mfVardef bot byte ceiling counterclockwise cutoff decr dir 118syn keyword mfVardef direction directionpoint grayfont hround incr 119syn keyword mfVardef interpath inverse labelfont labels lft magstep 120" Note: nodot is not a vardef, it is used as in makelabel.lft.nodot("5",z5) 121" (METAFONT only) 122syn keyword mfVardef makelabel max min nodot penlabels penpos 123syn keyword mfVardef proofrulethickness round rt savepen slantfont solve 124syn keyword mfVardef tensepath titlefont top unitvector vround whatever 125syn match mpVardef "\<good\.\%(x\|y\|lft\|rt\|top\|bot\)\> " 126syn keyword mfPrimaryDef div dotprod gobbled mod 127syn keyword mfSecondaryDef intersectionpoint 128syn keyword mfTertiaryDef softjoin thru 129syn keyword mfNewInternal blacker currentwindow displaying eps epsilon 130syn keyword mfNewInternal infinity join_radius number_of_modes o_correction 131syn keyword mfNewInternal pen_bot pen_lft pen_rt pen_top pixels_per_inch 132syn keyword mfNewInternal screen_cols screen_rows tolerance 133" Predefined constants 134syn keyword mfConstant base_name base_version blankpicture ditto down 135syn keyword mfConstant fullcircle halfcircle identity left lowres origin 136syn keyword mfConstant penspeck proof quartercircle right rulepen smoke 137syn keyword mfConstant unitpixel unitsquare up 138" Other predefined variables 139syn keyword mfVariable aspect_ratio currentpen extra_beginchar 140syn keyword mfVariable extra_endchar currentpen_path currentpicture 141syn keyword mfVariable currenttransform d extra_setup h localfont mag mode 142syn keyword mfVariable mode_name w 143" let statements: 144syn keyword mfnumExp abs 145syn keyword mfPairExp rotatedabout 146syn keyword mfCommand bye relax 147endif 148 149" By default, METAFONT loads modes.mf, too 150if get ( g:, "plain_mf_modes" , 1 ) 151syn keyword mfConstant APSSixMed AgfaFourZeroZero AgfaThreeFourZeroZero 152syn keyword mfConstant AtariNineFive AtariNineSix AtariSLMEightZeroFour 153syn keyword mfConstant AtariSMOneTwoFour CItohEightFiveOneZero 154syn keyword mfConstant CItohThreeOneZero CanonBJCSixZeroZero CanonCX 155syn keyword mfConstant CanonEX CanonLBPLX CanonLBPTen CanonSX ChelgraphIBX 156syn keyword mfConstant CompugraphicEightSixZeroZero 157syn keyword mfConstant CompugraphicNineSixZeroZero DD DEClarge DECsmall 158syn keyword mfConstant DataDiscNew EightThree EpsonAction 159syn keyword mfConstant EpsonLQFiveZeroZeroLo EpsonLQFiveZeroZeroMed 160syn keyword mfConstant EpsonMXFX EpsonSQEightSevenZero EpsonStylusPro 161syn keyword mfConstant EpsonStylusProHigh EpsonStylusProLow 162syn keyword mfConstant EpsonStylusProMed FourFour GThreefax HPDeskJet 163syn keyword mfConstant HPLaserJetIIISi IBMFourTwoFiveZero IBMFourTwoOneSix 164syn keyword mfConstant IBMFourTwoThreeZero IBMFourZeroOneNine 165syn keyword mfConstant IBMFourZeroThreeNine IBMFourZeroTwoNine 166syn keyword mfConstant IBMProPrinter IBMSixOneFiveFour IBMSixSixSevenZero 167syn keyword mfConstant IBMThreeEightOneTwo IBMThreeEightTwoZero 168syn keyword mfConstant IBMThreeOneNineThree IBMThreeOneSevenNine 169syn keyword mfConstant IBMUlfHolleberg LASevenFive LNOthreR LNOthree 170syn keyword mfConstant LNZeroOne LNZeroThree LPSFourZero LPSTwoZero 171syn keyword mfConstant LexmarkFourZeroThreeNine LexmarkOptraR 172syn keyword mfConstant LexmarkOptraS LinotypeLThreeThreeZero 173syn keyword mfConstant LinotypeOneZeroZero LinotypeOneZeroZeroLo 174syn keyword mfConstant LinotypeThreeZeroZeroHi MacTrueSize NeXTprinter 175syn keyword mfConstant NeXTscreen NecTwoZeroOne Newgen NineOne 176syn keyword mfConstant OCESixSevenFiveZeroPS OneTwoZero OneZeroZero 177syn keyword mfConstant PrintwareSevenTwoZeroIQ Prism QMSOneSevenTwoFive 178syn keyword mfConstant QMSOneSevenZeroZero QMSTwoFourTwoFive RicohA 179syn keyword mfConstant RicohFortyEighty RicohFourZeroEightZero RicohLP 180syn keyword mfConstant SparcPrinter StarNLOneZero VAXstation VTSix 181syn keyword mfConstant VarityperFiveZeroSixZeroW 182syn keyword mfConstant VarityperFourThreeZeroZeroHi 183syn keyword mfConstant VarityperFourThreeZeroZeroLo 184syn keyword mfConstant VarityperFourTwoZeroZero VarityperSixZeroZero 185syn keyword mfConstant XeroxDocutech XeroxEightSevenNineZero 186syn keyword mfConstant XeroxFourZeroFiveZero XeroxNineSevenZeroZero 187syn keyword mfConstant XeroxPhaserSixTwoZeroZeroDP XeroxThreeSevenZeroZero 188syn keyword mfConstant Xerox_world agfafzz agfatfzz amiga aps apssixhi 189syn keyword mfConstant aselect atariezf atarinf atarins atariotf bitgraph 190syn keyword mfConstant bjtenex bjtzzex bjtzzl bjtzzs boise canonbjc 191syn keyword mfConstant canonex canonlbp cg cgl cgnszz citohtoz corona crs 192syn keyword mfConstant cthreeten cx datadisc declarge decsmall deskjet 193syn keyword mfConstant docutech dover dp dpdfezzz eighthre elvira epscszz 194syn keyword mfConstant epsdraft epsdrft epsdrftl epsfast epsfastl epshi 195syn keyword mfConstant epslo epsmed epsmedl epson epsonact epsonfx epsonl 196syn keyword mfConstant epsonlo epsonlol epsonlq epsonsq epstylus epstylwr 197syn keyword mfConstant epstyplo epstypmd epstypml epstypro epswlo epswlol 198syn keyword mfConstant esphi fourfour gpx gtfax gtfaxhi gtfaxl gtfaxlo 199syn keyword mfConstant gtfaxlol help hifax highfax hplaser hprugged ibm_a 200syn keyword mfConstant ibmd ibmega ibmegal ibmfzon ibmfztn ibmpp ibmppl 201syn keyword mfConstant ibmsoff ibmteot ibmtetz ibmtont ibmtosn ibmtosnl 202syn keyword mfConstant ibmvga ibx imagen imagewriter itoh itohl itohtoz 203syn keyword mfConstant itohtozl iw jetiiisi kyocera laserjet laserjetfive 204syn keyword mfConstant laserjetfivemp laserjetfour laserjetfourthousand 205syn keyword mfConstant laserjetfourzerozerozero laserjethi laserjetlo 206syn keyword mfConstant laserjettwoonezerozero 207syn keyword mfConstant laserjettwoonezerozerofastres lasermaster 208syn keyword mfConstant laserwriter lasf lexmarkr lexmarks lexmarku 209syn keyword mfConstant linohalf linohi linolo linolttz linoone linosuper 210syn keyword mfConstant linothree linothreelo linotzzh ljfive ljfivemp 211syn keyword mfConstant ljfour ljfzzz ljfzzzfr ljlo ljtozz ljtozzfr lmaster 212syn keyword mfConstant lnotr lnzo lps lpstz lqhires lqlores lqmed lqmedl 213syn keyword mfConstant lqmedres lview lviewl lwpro macmag mactrue modes_mf 214syn keyword mfConstant ncd nec nechi neclm nectzo newdd newddl nexthi 215syn keyword mfConstant nextscreen nextscrn nineone nullmode ocessfz 216syn keyword mfConstant okidata okidatal okifourten okifte okihi onetz 217syn keyword mfConstant onezz pcprevw pcscreen phaser phaserfs phasertf 218syn keyword mfConstant phasertfl phasertl pixpt printware prntware 219syn keyword mfConstant proprinter qms qmsesz qmsostf qmsoszz qmstftf ricoh 220syn keyword mfConstant ricoha ricohlp ricohsp sherpa sparcptr starnlt 221syn keyword mfConstant starnltl styletwo stylewr stylewri stylewriter sun 222syn keyword mfConstant supre swtwo toshiba ultre varityper vs vtftzz 223syn keyword mfConstant vtftzzhi vtftzzlo vtfzszw vtszz xpstzz xpstzzl 224syn keyword mfConstant xrxesnz xrxfzfz xrxnszz xrxtszz 225syn keyword mfDef BCPL_string coding_scheme font_face_byte 226syn keyword mfDef font_family landscape 227syn keyword mfDef mode_extra_info mode_help mode_param 228syn keyword mfNewInternal blacker_min 229endif 230 231" Some other basic macro names, e.g., from cmbase, logo, etc. 232if get ( g:, "other_mf_macros" , 1 ) 233syn keyword mfDef beginlogochar 234syn keyword mfDef font_setup 235syn keyword mfPrimitive generate 236endif 237 238" Numeric tokens 239syn match mfNumeric "[ - ] \=\d\+ " 240syn match mfNumeric "[ - ] \=\.\d\+ " 241syn match mfNumeric "[ - ] \=\d\+\.\d\+ " 242 243" METAFONT lengths 244syn match mfLength "\<\(bp\|cc\|cm\|dd\|in\|mm\|pc\|pt\)\> " 245syn match mfLength "[ - ] \=\d\+\(bp\|cc\|cm\|dd\|in\|mm\|pc\|pt\)\#\= " 246syn match mfLength "[ - ] \=\.\d\+\(bp\|cc\|cm\|dd\|in\|mm\|pc\|pt\)\#\= " 247syn match mfLength "[ - ] \=\d\+\.\d\+\(bp\|cc\|cm\|dd\|in\|mm\|pc\|pt\)\#\= " 248 249" String constants 250syn match mfOpenString /" [ ^" ] * / 251syn region mfString oneline keepend start = +" +end = +" + 252 253" Comments: 254syn keyword mfTodoComment contained TODO FIXME XXX DEBUG NOTE 255syn match mfComment "%. * $ "contains = mfTodoComment , @Spell 256 257" synchronizing 258syn sync maxlines= 50 259 260" Define the default highlighting 261hi def link mfBoolExp Statement 262hi def link mfNumExp Statement 263hi def link mfPairExp Statement 264hi def link mfPathExp Statement 265hi def link mfPenExp Statement 266hi def link mfPicExp Statement 267hi def link mfStringExp Statement 268hi def link mfInternal Identifier 269hi def link mfCommand Statement 270hi def link mfType Type 271hi def link mfStatement Statement 272hi def link mfDefinition Statement 273hi def link mfCondition Conditional 274hi def link mfPrimitive Statement 275hi def link mfDef Function 276hi def link mfVardef mfDef 277hi def link mfPrimaryDef mfDef 278hi def link mfSecondaryDef mfDef 279hi def link mfTertiaryDef mfDef 280hi def link mfCoord Identifier 281hi def link mfPoint Identifier 282hi def link mfNumeric Number 283hi def link mfLength Number 284hi def link mfComment Comment 285hi def link mfString String 286hi def link mfOpenString Todo 287hi def link mfSuffixParam Label 288hi def link mfNewInternal mfInternal 289hi def link mfVariable Identifier 290hi def link mfConstant Constant 291hi def link mfTodoComment Todo 292 293let b: current_syntax = "mf" 294 295" vim:sw=2