diff --git a/lib/python3.12/site-packages/pygments/lexers/__pycache__/macaulay2.cpython-312.pyc b/lib/python3.12/site-packages/pygments/lexers/__pycache__/macaulay2.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5791228cabd7d5c849980a2f967d254e84bd0e48 Binary files /dev/null and b/lib/python3.12/site-packages/pygments/lexers/__pycache__/macaulay2.cpython-312.pyc differ diff --git a/lib/python3.12/site-packages/pygments/lexers/__pycache__/ptx.cpython-312.pyc b/lib/python3.12/site-packages/pygments/lexers/__pycache__/ptx.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..70b5f8538a570df4f97d4135a3a9ad7388fc8897 Binary files /dev/null and b/lib/python3.12/site-packages/pygments/lexers/__pycache__/ptx.cpython-312.pyc differ diff --git a/lib/python3.12/site-packages/pygments/lexers/_lilypond_builtins.py b/lib/python3.12/site-packages/pygments/lexers/_lilypond_builtins.py new file mode 100644 index 0000000000000000000000000000000000000000..b00dbbfd47d4e658f2d664ec61c81a9da27b14c5 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/_lilypond_builtins.py @@ -0,0 +1,4932 @@ +""" + pygments.lexers._lilypond_builtins + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + LilyPond builtins. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +# Contents generated by the script lilypond-builtins-generator.ly +# found in the external/ directory of the source tree. + +keywords = [ + "accepts", + "addlyrics", + "alias", + "book", + "bookpart", + "chordmode", + "chords", + "consists", + "context", + "defaultchild", + "denies", + "description", + "drummode", + "drums", + "etc", + "figuremode", + "figures", + "header", + "include", + "inherit-acceptability", + "language", + "layout", + "lyricmode", + "lyricsto", + "midi", + "name", + "new", + "notemode", + "paper", + "remove", + "score", + "type", + "version", + "with", +] + +clefs = [ + "C", + "F", + "G", + "G2", + "GG", + "alto", + "altovarC", + "baritone", + "baritonevarC", + "baritonevarF", + "bass", + "blackmensural-c1", + "blackmensural-c2", + "blackmensural-c3", + "blackmensural-c4", + "blackmensural-c5", + "french", + "hufnagel-do-fa", + "hufnagel-do1", + "hufnagel-do2", + "hufnagel-do3", + "hufnagel-fa1", + "hufnagel-fa2", + "kievan-do", + "medicaea-do1", + "medicaea-do2", + "medicaea-do3", + "medicaea-fa1", + "medicaea-fa2", + "mensural-c1", + "mensural-c2", + "mensural-c3", + "mensural-c4", + "mensural-c5", + "mensural-f", + "mensural-g", + "mezzosoprano", + "moderntab", + "neomensural-c1", + "neomensural-c2", + "neomensural-c3", + "neomensural-c4", + "neomensural-c5", + "percussion", + "petrucci-c1", + "petrucci-c2", + "petrucci-c3", + "petrucci-c4", + "petrucci-c5", + "petrucci-f", + "petrucci-f2", + "petrucci-f3", + "petrucci-f4", + "petrucci-f5", + "petrucci-g", + "petrucci-g1", + "petrucci-g2", + "soprano", + "subbass", + "tab", + "tenor", + "tenorG", + "tenorvarC", + "treble", + "varC", + "varbaritone", + "varpercussion", + "vaticana-do1", + "vaticana-do2", + "vaticana-do3", + "vaticana-fa1", + "vaticana-fa2", + "violin", +] + +scales = [ + "aeolian", + "dorian", + "ionian", + "locrian", + "lydian", + "major", + "minor", + "mixolydian", + "phrygian", +] + +repeat_types = [ + "percent", + "segno", + "tremolo", + "unfold", + "volta", +] + +units = [ + "cm", + "in", + "mm", + "pt", + "staff-space", +] + +chord_modifiers = [ + "aug", + "dim", + "m", + "maj", +] + +pitch_language_names = [ + "arabic", + "catalan", + "català", + "deutsch", + "english", + "espanol", + "español", + "français", + "italiano", + "nederlands", + "norsk", + "portugues", + "português", + "suomi", + "svenska", + "vlaams", +] + +pitches = [ + "R", + "a", + "a-flat", + "a-flatflat", + "a-natural", + "a-sharp", + "a-sharpsharp", + "ab", + "acousticbassdrum", + "acousticsnare", + "ad", + "adb", + "add", + "aeh", + "aes", + "aeseh", + "aeses", + "aess", + "aesseh", + "aessess", + "af", + "aff", + "afhb", + "afhd", + "agh", + "agl", + "ah", + "aih", + "ais", + "aisih", + "aisis", + "aiss", + "aissih", + "aississ", + "aqf", + "aqs", + "as", + "asah", + "asas", + "aseh", + "ases", + "ashb", + "ashd", + "ass", + "asseh", + "assess", + "atqb", + "atqd", + "atqf", + "atqs", + "ax", + "b", + "b-flat", + "b-flatflat", + "b-natural", + "b-sharp", + "b-sharpsharp", + "bassdrum", + "bb", + "bd", + "bda", + "bdb", + "bdd", + "beh", + "bes", + "beseh", + "beses", + "bess", + "bf", + "bff", + "bfhb", + "bfhd", + "bih", + "bis", + "bisih", + "bisis", + "boh", + "bohm", + "boho", + "bol", + "bolm", + "bolo", + "bqf", + "bqs", + "bs", + "bshb", + "bshd", + "bss", + "btqb", + "btqd", + "btqf", + "btqs", + "bx", + "c", + "c-flat", + "c-flatflat", + "c-natural", + "c-sharp", + "c-sharpsharp", + "cab", + "cabasa", + "cb", + "cd", + "cdb", + "cdd", + "ceh", + "ces", + "ceseh", + "ceses", + "cess", + "cesseh", + "cessess", + "cf", + "cff", + "cfhb", + "cfhd", + "cgh", + "cghm", + "cgho", + "cgl", + "cglm", + "cglo", + "chinesecymbal", + "cih", + "cis", + "cisih", + "cisis", + "ciss", + "cissih", + "cississ", + "cl", + "claves", + "closedhihat", + "cowbell", + "cqf", + "cqs", + "crashcymbal", + "crashcymbala", + "crashcymbalb", + "cs", + "cshb", + "cshd", + "css", + "ctqb", + "ctqd", + "ctqf", + "ctqs", + "cuim", + "cuio", + "cx", + "cymc", + "cymca", + "cymcb", + "cymch", + "cymr", + "cymra", + "cymrb", + "cyms", + "d", + "d-flat", + "d-flatflat", + "d-natural", + "d-sharp", + "d-sharpsharp", + "db", + "dd", + "ddb", + "ddd", + "deh", + "des", + "deseh", + "deses", + "dess", + "desseh", + "dessess", + "df", + "dff", + "dfhb", + "dfhd", + "dih", + "dis", + "disih", + "disis", + "diss", + "dissih", + "dississ", + "do", + "dob", + "dobb", + "dobhb", + "dobqt", + "dobsb", + "dobtqt", + "docb", + "docs", + "dod", + "dodd", + "dodsd", + "dohb", + "dohk", + "dok", + "dokhk", + "dokk", + "doqb", + "doqd", + "doqs", + "dos", + "dosb", + "dosd", + "dosqt", + "doss", + "dostqt", + "dotcb", + "dotcs", + "dotqb", + "dotqd", + "dotqs", + "dox", + "dqf", + "dqs", + "ds", + "dshb", + "dshd", + "dss", + "dtqb", + "dtqd", + "dtqf", + "dtqs", + "dx", + "e", + "e-flat", + "e-flatflat", + "e-natural", + "e-sharp", + "e-sharpsharp", + "eb", + "ed", + "edb", + "edd", + "eeh", + "ees", + "eeseh", + "eeses", + "eess", + "eesseh", + "eessess", + "ef", + "eff", + "efhb", + "efhd", + "eh", + "eih", + "eis", + "eisih", + "eisis", + "eiss", + "eissih", + "eississ", + "electricsnare", + "eqf", + "eqs", + "es", + "eseh", + "eses", + "eshb", + "eshd", + "ess", + "esseh", + "essess", + "etqb", + "etqd", + "etqf", + "etqs", + "ex", + "f", + "f-flat", + "f-flatflat", + "f-natural", + "f-sharp", + "f-sharpsharp", + "fa", + "fab", + "fabb", + "fabhb", + "fabqt", + "fabsb", + "fabtqt", + "facb", + "facs", + "fad", + "fadd", + "fadsd", + "fahb", + "fahk", + "fak", + "fakhk", + "fakk", + "faqb", + "faqd", + "faqs", + "fas", + "fasb", + "fasd", + "fasqt", + "fass", + "fastqt", + "fatcb", + "fatcs", + "fatqb", + "fatqd", + "fatqs", + "fax", + "fb", + "fd", + "fdb", + "fdd", + "feh", + "fes", + "feseh", + "feses", + "fess", + "fesseh", + "fessess", + "ff", + "fff", + "ffhb", + "ffhd", + "fih", + "fis", + "fisih", + "fisis", + "fiss", + "fissih", + "fississ", + "fqf", + "fqs", + "fs", + "fshb", + "fshd", + "fss", + "ftqb", + "ftqd", + "ftqf", + "ftqs", + "fx", + "g", + "g-flat", + "g-flatflat", + "g-natural", + "g-sharp", + "g-sharpsharp", + "gb", + "gd", + "gdb", + "gdd", + "geh", + "ges", + "geseh", + "geses", + "gess", + "gesseh", + "gessess", + "gf", + "gff", + "gfhb", + "gfhd", + "gih", + "gis", + "gisih", + "gisis", + "giss", + "gissih", + "gississ", + "gqf", + "gqs", + "gs", + "gshb", + "gshd", + "gss", + "gtqb", + "gtqd", + "gtqf", + "gtqs", + "gui", + "guil", + "guiro", + "guis", + "gx", + "h", + "halfopenhihat", + "handclap", + "hc", + "heh", + "heseh", + "heses", + "hesseh", + "hessess", + "hh", + "hhc", + "hhho", + "hho", + "hhp", + "hiagogo", + "hibongo", + "hiconga", + "highfloortom", + "hightom", + "hih", + "hihat", + "himidtom", + "his", + "hisidestick", + "hisih", + "hisis", + "hiss", + "hissih", + "hississ", + "hitimbale", + "hiwoodblock", + "la", + "lab", + "labb", + "labhb", + "labqt", + "labsb", + "labtqt", + "lacb", + "lacs", + "lad", + "ladd", + "ladsd", + "lahb", + "lahk", + "lak", + "lakhk", + "lakk", + "laqb", + "laqd", + "laqs", + "las", + "lasb", + "lasd", + "lasqt", + "lass", + "lastqt", + "latcb", + "latcs", + "latqb", + "latqd", + "latqs", + "lax", + "loagogo", + "lobongo", + "loconga", + "longguiro", + "longwhistle", + "losidestick", + "lotimbale", + "lowfloortom", + "lowmidtom", + "lowoodblock", + "lowtom", + "mar", + "maracas", + "mi", + "mib", + "mibb", + "mibhb", + "mibqt", + "mibsb", + "mibtqt", + "micb", + "mics", + "mid", + "midd", + "midsd", + "mihb", + "mihk", + "mik", + "mikhk", + "mikk", + "miqb", + "miqd", + "miqs", + "mis", + "misb", + "misd", + "misqt", + "miss", + "mistqt", + "mitcb", + "mitcs", + "mitqb", + "mitqd", + "mitqs", + "mix", + "mutecuica", + "mutehibongo", + "mutehiconga", + "mutelobongo", + "muteloconga", + "mutetriangle", + "opencuica", + "openhibongo", + "openhiconga", + "openhihat", + "openlobongo", + "openloconga", + "opentriangle", + "pedalhihat", + "r", + "rb", + "re", + "reb", + "rebb", + "rebhb", + "rebqt", + "rebsb", + "rebtqt", + "recb", + "recs", + "red", + "redd", + "redsd", + "rehb", + "rehk", + "rek", + "rekhk", + "rekk", + "reqb", + "reqd", + "reqs", + "res", + "resb", + "resd", + "resqt", + "ress", + "restqt", + "retcb", + "retcs", + "retqb", + "retqd", + "retqs", + "rex", + "ridebell", + "ridecymbal", + "ridecymbala", + "ridecymbalb", + "ré", + "réb", + "rébb", + "rébsb", + "réd", + "rédd", + "rédsd", + "résb", + "résd", + "réx", + "shortguiro", + "shortwhistle", + "si", + "sib", + "sibb", + "sibhb", + "sibqt", + "sibsb", + "sibtqt", + "sicb", + "sics", + "sid", + "sidd", + "sidestick", + "sidsd", + "sihb", + "sihk", + "sik", + "sikhk", + "sikk", + "siqb", + "siqd", + "siqs", + "sis", + "sisb", + "sisd", + "sisqt", + "siss", + "sistqt", + "sitcb", + "sitcs", + "sitqb", + "sitqd", + "sitqs", + "six", + "sn", + "sna", + "snare", + "sne", + "sol", + "solb", + "solbb", + "solbhb", + "solbqt", + "solbsb", + "solbtqt", + "solcb", + "solcs", + "sold", + "soldd", + "soldsd", + "solhb", + "solhk", + "solk", + "solkhk", + "solkk", + "solqb", + "solqd", + "solqs", + "sols", + "solsb", + "solsd", + "solsqt", + "solss", + "solstqt", + "soltcb", + "soltcs", + "soltqb", + "soltqd", + "soltqs", + "solx", + "splashcymbal", + "ss", + "ssh", + "ssl", + "tamb", + "tambourine", + "timh", + "timl", + "tomfh", + "tomfl", + "tomh", + "toml", + "tommh", + "tomml", + "tri", + "triangle", + "trim", + "trio", + "tt", + "vibraslap", + "vibs", + "wbh", + "wbl", + "whl", + "whs", +] + +music_functions = [ + "=", + "absolute", + "acciaccatura", + "accidentalStyle", + "addChordShape", + "addInstrumentDefinition", + "addQuote", + "after", + "afterGrace", + "allowPageTurn", + "allowVoltaHook", + "alterBroken", + "alternative", + "ambitusAfter", + "appendToTag", + "applyContext", + "applyMusic", + "applyOutput", + "appoggiatura", + "assertBeamQuant", + "assertBeamSlope", + "autoChange", + "balloonGrobText", + "balloonText", + "bar", + "barNumberCheck", + "beamExceptions", + "bendAfter", + "bendHold", + "bendStartLevel", + "bookOutputName", + "bookOutputSuffix", + "breathe", + "caesura", + "change", + "chordRepeats", + "clef", + "codaMark", + "compoundMeter", + "compressMMRests", + "crossStaff", + "cueClef", + "cueClefUnset", + "cueDuring", + "cueDuringWithClef", + "deadNote", + "defineBarLine", + "displayLilyMusic", + "displayMusic", + "displayScheme", + "dropNote", + "enablePolymeter", + "endSpanners", + "eventChords", + "featherDurations", + "finger", + "fixed", + "footnote", + "grace", + "grobdescriptions", + "harmonicByFret", + "harmonicByRatio", + "harmonicNote", + "harmonicsOn", + "hide", + "inStaffSegno", + "incipit", + "inherit-acceptability", + "instrumentSwitch", + "inversion", + "invertChords", + "jump", + "keepWithTag", + "key", + "killCues", + "label", + "language", + "languageRestore", + "languageSaveAndChange", + "magnifyMusic", + "magnifyStaff", + "makeClusters", + "makeDefaultStringTuning", + "mark", + "markupMap", + "modalInversion", + "modalTranspose", + "musicMap", + "noPageBreak", + "noPageTurn", + "octaveCheck", + "offset", + "omit", + "once", + "ottava", + "override", + "overrideProperty", + "overrideTimeSignatureSettings", + "pageBreak", + "pageTurn", + "palmMute", + "palmMuteOn", + "parallelMusic", + "parenthesize", + "partCombine", + "partCombineDown", + "partCombineForce", + "partCombineUp", + "partial", + "phrasingSlurDashPattern", + "pitchedTrill", + "pointAndClickOff", + "pointAndClickOn", + "pointAndClickTypes", + "preBend", + "preBendHold", + "propertyOverride", + "propertyRevert", + "propertySet", + "propertyTweak", + "propertyUnset", + "pushToTag", + "quoteDuring", + "raiseNote", + "reduceChords", + "relative", + "removeWithTag", + "repeat", + "resetRelativeOctave", + "retrograde", + "revert", + "revertTimeSignatureSettings", + "rightHandFinger", + "scaleDurations", + "sectionLabel", + "segnoMark", + "set", + "settingsFrom", + "shape", + "shiftDurations", + "single", + "skip", + "slashedGrace", + "slurDashPattern", + "staffHighlight", + "storePredefinedDiagram", + "stringTuning", + "styledNoteHeads", + "tabChordRepeats", + "tabChordRepetition", + "tag", + "tagGroup", + "tempo", + "temporary", + "textEndMark", + "textMark", + "tieDashPattern", + "time", + "times", + "tocItem", + "transpose", + "transposedCueDuring", + "transposition", + "tuplet", + "tupletSpan", + "tweak", + "undo", + "unfoldRepeats", + "unfolded", + "unset", + "voices", + "void", + "volta", + "vshape", + "withMusicProperty", + "xNote", +] + +dynamics = [ + "!", + "<", + ">", + "cr", + "cresc", + "decr", + "decresc", + "dim", + "endcr", + "endcresc", + "enddecr", + "enddecresc", + "enddim", + "f", + "ff", + "fff", + "ffff", + "fffff", + "fp", + "fz", + "mf", + "mp", + "n", + "p", + "pp", + "ppp", + "pppp", + "ppppp", + "rfz", + "sf", + "sff", + "sfp", + "sfz", + "sp", + "spp", +] + +articulations = [ + "(", + ")", + "-", + "[", + "]", + "^", + "accent", + "arpeggio", + "breakDynamicSpan", + "coda", + "dashBang", + "dashDash", + "dashDot", + "dashHat", + "dashLarger", + "dashPlus", + "dashUnderscore", + "downbow", + "downmordent", + "downprall", + "episemFinis", + "episemInitium", + "espressivo", + "fermata", + "flageolet", + "glide", + "glissando", + "halfopen", + "harmonic", + "haydnturn", + "henzelongfermata", + "henzeshortfermata", + "laissezVibrer", + "lheel", + "lineprall", + "longfermata", + "ltoe", + "marcato", + "mordent", + "noBeam", + "open", + "portato", + "prall", + "pralldown", + "prallmordent", + "prallprall", + "prallup", + "repeatTie", + "reverseturn", + "rheel", + "rtoe", + "segno", + "shortfermata", + "signumcongruentiae", + "slashturn", + "snappizzicato", + "sostenutoOff", + "sostenutoOn", + "staccatissimo", + "staccato", + "startGraceSlur", + "startGroup", + "startTextSpan", + "startTrillSpan", + "stopGraceSlur", + "stopGroup", + "stopTextSpan", + "stopTrillSpan", + "stopped", + "sustainOff", + "sustainOn", + "tenuto", + "thumb", + "treCorde", + "trill", + "turn", + "unaCorda", + "upbow", + "upmordent", + "upprall", + "varcoda", + "verylongfermata", + "veryshortfermata", + "vowelTransition", + "~", +] + +music_commands = [ + "[", + "]", + "aikenHeads", + "aikenHeadsMinor", + "aikenThinHeads", + "aikenThinHeadsMinor", + "allowBreak", + "arabicStringNumbers", + "arpeggioArrowDown", + "arpeggioArrowUp", + "arpeggioBracket", + "arpeggioNormal", + "arpeggioParenthesis", + "arpeggioParenthesisDashed", + "autoBeamOff", + "autoBeamOn", + "autoBreaksOff", + "autoBreaksOn", + "autoLineBreaksOff", + "autoLineBreaksOn", + "autoPageBreaksOff", + "autoPageBreaksOn", + "balloonLengthOff", + "balloonLengthOn", + "bassFigureExtendersOff", + "bassFigureExtendersOn", + "bassFigureStaffAlignmentDown", + "bassFigureStaffAlignmentNeutral", + "bassFigureStaffAlignmentUp", + "break", + "cadenzaOff", + "cadenzaOn", + "compressEmptyMeasures", + "crescHairpin", + "crescTextCresc", + "deadNotesOff", + "deadNotesOn", + "defaultNoteHeads", + "defaultTimeSignature", + "deprecatedcresc", + "deprecateddim", + "deprecatedendcresc", + "deprecatedenddim", + "dimHairpin", + "dimTextDecr", + "dimTextDecresc", + "dimTextDim", + "dotsDown", + "dotsNeutral", + "dotsUp", + "dynamicDown", + "dynamicNeutral", + "dynamicUp", + "easyHeadsOff", + "easyHeadsOn", + "endSkipNCs", + "expandEmptyMeasures", + "fine", + "frenchChords", + "funkHeads", + "funkHeadsMinor", + "germanChords", + "harmonicsOff", + "hideNotes", + "hideSplitTiedTabNotes", + "hideStaffSwitch", + "huge", + "ignatzekExceptionMusic", + "improvisationOff", + "improvisationOn", + "italianChords", + "kievanOff", + "kievanOn", + "large", + "markLengthOff", + "markLengthOn", + "medianChordGridStyle", + "melisma", + "melismaEnd", + "mergeDifferentlyDottedOff", + "mergeDifferentlyDottedOn", + "mergeDifferentlyHeadedOff", + "mergeDifferentlyHeadedOn", + "newSpacingSection", + "noBreak", + "normalsize", + "numericTimeSignature", + "oneVoice", + "palmMuteOff", + "partCombineApart", + "partCombineAutomatic", + "partCombineChords", + "partCombineSoloI", + "partCombineSoloII", + "partCombineUnisono", + "phrasingSlurDashed", + "phrasingSlurDotted", + "phrasingSlurDown", + "phrasingSlurHalfDashed", + "phrasingSlurHalfSolid", + "phrasingSlurNeutral", + "phrasingSlurSolid", + "phrasingSlurUp", + "predefinedFretboardsOff", + "predefinedFretboardsOn", + "romanStringNumbers", + "sacredHarpHeads", + "sacredHarpHeadsMinor", + "section", + "semiGermanChords", + "setDefaultDurationToQuarter", + "shiftOff", + "shiftOn", + "shiftOnn", + "shiftOnnn", + "showSplitTiedTabNotes", + "showStaffSwitch", + "skipNC", + "skipNCs", + "slurDashed", + "slurDotted", + "slurDown", + "slurHalfDashed", + "slurHalfSolid", + "slurNeutral", + "slurSolid", + "slurUp", + "small", + "southernHarmonyHeads", + "southernHarmonyHeadsMinor", + "startAcciaccaturaMusic", + "startAppoggiaturaMusic", + "startGraceMusic", + "startMeasureCount", + "startMeasureSpanner", + "startSlashedGraceMusic", + "startStaff", + "stemDown", + "stemNeutral", + "stemUp", + "stopAcciaccaturaMusic", + "stopAppoggiaturaMusic", + "stopGraceMusic", + "stopMeasureCount", + "stopMeasureSpanner", + "stopSlashedGraceMusic", + "stopStaff", + "stopStaffHighlight", + "tabFullNotation", + "teeny", + "textLengthOff", + "textLengthOn", + "textSpannerDown", + "textSpannerNeutral", + "textSpannerUp", + "tieDashed", + "tieDotted", + "tieDown", + "tieHalfDashed", + "tieHalfSolid", + "tieNeutral", + "tieSolid", + "tieUp", + "tiny", + "tupletDown", + "tupletNeutral", + "tupletUp", + "unHideNotes", + "voiceFour", + "voiceFourStyle", + "voiceNeutralStyle", + "voiceOne", + "voiceOneStyle", + "voiceThree", + "voiceThreeStyle", + "voiceTwo", + "voiceTwoStyle", + "walkerHeads", + "walkerHeadsMinor", + "xNotesOff", + "xNotesOn", + "|", + "~", +] + +markup_commands = [ + "abs-fontsize", + "accidental", + "align-on-other", + "arrow-head", + "auto-footnote", + "backslashed-digit", + "beam", + "bold", + "box", + "bracket", + "caps", + "center-align", + "center-column", + "char", + "circle", + "coda", + "column", + "column-lines", + "combine", + "compound-meter", + "concat", + "conditional-trill-markup", + "customTabClef", + "dir-column", + "discant", + "doubleflat", + "doublesharp", + "draw-circle", + "draw-dashed-line", + "draw-dotted-line", + "draw-hline", + "draw-line", + "draw-squiggle-line", + "dynamic", + "ellipse", + "epsfile", + "eyeglasses", + "fermata", + "figured-bass", + "fill-line", + "fill-with-pattern", + "filled-box", + "finger", + "first-visible", + "flat", + "fontCaps", + "fontsize", + "footnote", + "fraction", + "freeBass", + "fret-diagram", + "fret-diagram-terse", + "fret-diagram-verbose", + "fromproperty", + "general-align", + "halign", + "harp-pedal", + "hbracket", + "hcenter-in", + "hspace", + "huge", + "if", + "italic", + "justified-lines", + "justify", + "justify-field", + "justify-line", + "justify-string", + "large", + "larger", + "left-align", + "left-brace", + "left-column", + "line", + "lookup", + "lower", + "magnify", + "map-markup-commands", + "markalphabet", + "markletter", + "markup", + "markuplist", + "medium", + "multi-measure-rest-by-number", + "musicglyph", + "natural", + "normal-size-sub", + "normal-size-super", + "normal-text", + "normalsize", + "note", + "note-by-number", + "null", + "number", + "on-the-fly", + "oval", + "overlay", + "override", + "override-lines", + "overtie", + "pad-around", + "pad-markup", + "pad-to-box", + "pad-x", + "page-link", + "page-ref", + "parenthesize", + "path", + "pattern", + "polygon", + "postscript", + "property-recursive", + "put-adjacent", + "raise", + "replace", + "rest", + "rest-by-number", + "rhythm", + "right-align", + "right-brace", + "right-column", + "roman", + "rotate", + "rounded-box", + "sans", + "scale", + "score", + "score-lines", + "segno", + "semiflat", + "semisharp", + "sesquiflat", + "sesquisharp", + "sharp", + "simple", + "slashed-digit", + "small", + "smallCaps", + "smaller", + "stdBass", + "stdBassIV", + "stdBassV", + "stdBassVI", + "stencil", + "string-lines", + "strut", + "sub", + "super", + "table", + "table-of-contents", + "teeny", + "text", + "tie", + "tied-lyric", + "tiny", + "translate", + "translate-scaled", + "transparent", + "triangle", + "typewriter", + "underline", + "undertie", + "unless", + "upright", + "varcoda", + "vcenter", + "verbatim-file", + "vspace", + "whiteout", + "with-color", + "with-dimension", + "with-dimension-from", + "with-dimensions", + "with-dimensions-from", + "with-link", + "with-outline", + "with-string-transformer", + "with-true-dimension", + "with-true-dimensions", + "with-url", + "woodwind-diagram", + "wordwrap", + "wordwrap-field", + "wordwrap-internal", + "wordwrap-lines", + "wordwrap-string", + "wordwrap-string-internal", +] + +grobs = [ + "Accidental", + "AccidentalCautionary", + "AccidentalPlacement", + "AccidentalSuggestion", + "Ambitus", + "AmbitusAccidental", + "AmbitusLine", + "AmbitusNoteHead", + "Arpeggio", + "BalloonText", + "BarLine", + "BarNumber", + "BassFigure", + "BassFigureAlignment", + "BassFigureAlignmentPositioning", + "BassFigureBracket", + "BassFigureContinuation", + "BassFigureLine", + "Beam", + "BendAfter", + "BendSpanner", + "BreakAlignGroup", + "BreakAlignment", + "BreathingSign", + "CaesuraScript", + "CenteredBarNumber", + "CenteredBarNumberLineSpanner", + "ChordName", + "ChordSquare", + "Clef", + "ClefModifier", + "ClusterSpanner", + "ClusterSpannerBeacon", + "CodaMark", + "CombineTextScript", + "ControlPoint", + "ControlPolygon", + "CueClef", + "CueEndClef", + "Custos", + "Divisio", + "DotColumn", + "Dots", + "DoublePercentRepeat", + "DoublePercentRepeatCounter", + "DoubleRepeatSlash", + "DurationLine", + "DynamicLineSpanner", + "DynamicText", + "DynamicTextSpanner", + "Episema", + "FingerGlideSpanner", + "Fingering", + "FingeringColumn", + "Flag", + "Footnote", + "FretBoard", + "Glissando", + "GraceSpacing", + "GridChordName", + "GridLine", + "GridPoint", + "Hairpin", + "HorizontalBracket", + "HorizontalBracketText", + "InstrumentName", + "InstrumentSwitch", + "JumpScript", + "KeyCancellation", + "KeySignature", + "KievanLigature", + "LaissezVibrerTie", + "LaissezVibrerTieColumn", + "LedgerLineSpanner", + "LeftEdge", + "LigatureBracket", + "LyricExtender", + "LyricHyphen", + "LyricRepeatCount", + "LyricSpace", + "LyricText", + "MeasureCounter", + "MeasureGrouping", + "MeasureSpanner", + "MelodyItem", + "MensuralLigature", + "MetronomeMark", + "MultiMeasureRest", + "MultiMeasureRestNumber", + "MultiMeasureRestScript", + "MultiMeasureRestText", + "NonMusicalPaperColumn", + "NoteCollision", + "NoteColumn", + "NoteHead", + "NoteName", + "NoteSpacing", + "OttavaBracket", + "PaperColumn", + "Parentheses", + "PercentRepeat", + "PercentRepeatCounter", + "PhrasingSlur", + "PianoPedalBracket", + "RehearsalMark", + "RepeatSlash", + "RepeatTie", + "RepeatTieColumn", + "Rest", + "RestCollision", + "Script", + "ScriptColumn", + "ScriptRow", + "SectionLabel", + "SegnoMark", + "SignumRepetitionis", + "Slur", + "SostenutoPedal", + "SostenutoPedalLineSpanner", + "SpacingSpanner", + "SpanBar", + "SpanBarStub", + "StaffEllipsis", + "StaffGrouper", + "StaffHighlight", + "StaffSpacing", + "StaffSymbol", + "StanzaNumber", + "Stem", + "StemStub", + "StemTremolo", + "StringNumber", + "StrokeFinger", + "SustainPedal", + "SustainPedalLineSpanner", + "System", + "SystemStartBar", + "SystemStartBrace", + "SystemStartBracket", + "SystemStartSquare", + "TabNoteHead", + "TextMark", + "TextScript", + "TextSpanner", + "Tie", + "TieColumn", + "TimeSignature", + "TrillPitchAccidental", + "TrillPitchGroup", + "TrillPitchHead", + "TrillPitchParentheses", + "TrillSpanner", + "TupletBracket", + "TupletNumber", + "UnaCordaPedal", + "UnaCordaPedalLineSpanner", + "VaticanaLigature", + "VerticalAlignment", + "VerticalAxisGroup", + "VoiceFollower", + "VoltaBracket", + "VoltaBracketSpanner", + "VowelTransition", +] + +contexts = [ + "ChoirStaff", + "ChordGrid", + "ChordGridScore", + "ChordNames", + "CueVoice", + "Devnull", + "DrumStaff", + "DrumVoice", + "Dynamics", + "FiguredBass", + "FretBoards", + "Global", + "GrandStaff", + "GregorianTranscriptionLyrics", + "GregorianTranscriptionStaff", + "GregorianTranscriptionVoice", + "InternalGregorianStaff", + "KievanStaff", + "KievanVoice", + "Lyrics", + "MensuralStaff", + "MensuralVoice", + "NoteNames", + "NullVoice", + "OneStaff", + "PetrucciStaff", + "PetrucciVoice", + "PianoStaff", + "RhythmicStaff", + "Score", + "Staff", + "StaffGroup", + "StandaloneRhythmScore", + "StandaloneRhythmStaff", + "StandaloneRhythmVoice", + "TabStaff", + "TabVoice", + "Timing", + "VaticanaLyrics", + "VaticanaStaff", + "VaticanaVoice", + "Voice", +] + +translators = [ + "Accidental_engraver", + "Alteration_glyph_engraver", + "Ambitus_engraver", + "Arpeggio_engraver", + "Auto_beam_engraver", + "Axis_group_engraver", + "Balloon_engraver", + "Bar_engraver", + "Bar_number_engraver", + "Beam_collision_engraver", + "Beam_engraver", + "Beam_performer", + "Beat_engraver", + "Beat_performer", + "Bend_engraver", + "Bend_spanner_engraver", + "Break_align_engraver", + "Breathing_sign_engraver", + "Caesura_engraver", + "Centered_bar_number_align_engraver", + "Chord_name_engraver", + "Chord_square_engraver", + "Chord_tremolo_engraver", + "Clef_engraver", + "Cluster_spanner_engraver", + "Collision_engraver", + "Completion_heads_engraver", + "Completion_rest_engraver", + "Concurrent_hairpin_engraver", + "Control_track_performer", + "Cue_clef_engraver", + "Current_chord_text_engraver", + "Custos_engraver", + "Divisio_engraver", + "Dot_column_engraver", + "Dots_engraver", + "Double_percent_repeat_engraver", + "Drum_note_performer", + "Drum_notes_engraver", + "Duration_line_engraver", + "Dynamic_align_engraver", + "Dynamic_engraver", + "Dynamic_performer", + "Episema_engraver", + "Extender_engraver", + "Figured_bass_engraver", + "Figured_bass_position_engraver", + "Finger_glide_engraver", + "Fingering_column_engraver", + "Fingering_engraver", + "Font_size_engraver", + "Footnote_engraver", + "Forbid_line_break_engraver", + "Fretboard_engraver", + "Glissando_engraver", + "Grace_auto_beam_engraver", + "Grace_beam_engraver", + "Grace_engraver", + "Grace_spacing_engraver", + "Grid_chord_name_engraver", + "Grid_line_span_engraver", + "Grid_point_engraver", + "Grob_pq_engraver", + "Horizontal_bracket_engraver", + "Hyphen_engraver", + "Instrument_name_engraver", + "Instrument_switch_engraver", + "Jump_engraver", + "Keep_alive_together_engraver", + "Key_engraver", + "Key_performer", + "Kievan_ligature_engraver", + "Laissez_vibrer_engraver", + "Ledger_line_engraver", + "Ligature_bracket_engraver", + "Lyric_engraver", + "Lyric_performer", + "Lyric_repeat_count_engraver", + "Mark_engraver", + "Mark_performer", + "Mark_tracking_translator", + "Measure_counter_engraver", + "Measure_grouping_engraver", + "Measure_spanner_engraver", + "Melody_engraver", + "Mensural_ligature_engraver", + "Merge_mmrest_numbers_engraver", + "Merge_rests_engraver", + "Metronome_mark_engraver", + "Midi_control_change_performer", + "Multi_measure_rest_engraver", + "New_fingering_engraver", + "Non_musical_script_column_engraver", + "Note_head_line_engraver", + "Note_heads_engraver", + "Note_name_engraver", + "Note_performer", + "Note_spacing_engraver", + "Ottava_spanner_engraver", + "Output_property_engraver", + "Page_turn_engraver", + "Paper_column_engraver", + "Parenthesis_engraver", + "Part_combine_engraver", + "Percent_repeat_engraver", + "Phrasing_slur_engraver", + "Piano_pedal_align_engraver", + "Piano_pedal_engraver", + "Piano_pedal_performer", + "Pitch_squash_engraver", + "Pitched_trill_engraver", + "Pure_from_neighbor_engraver", + "Repeat_acknowledge_engraver", + "Repeat_tie_engraver", + "Rest_collision_engraver", + "Rest_engraver", + "Rhythmic_column_engraver", + "Script_column_engraver", + "Script_engraver", + "Script_row_engraver", + "Separating_line_group_engraver", + "Show_control_points_engraver", + "Signum_repetitionis_engraver", + "Skip_typesetting_engraver", + "Slash_repeat_engraver", + "Slur_engraver", + "Slur_performer", + "Spacing_engraver", + "Span_arpeggio_engraver", + "Span_bar_engraver", + "Span_bar_stub_engraver", + "Span_stem_engraver", + "Spanner_break_forbid_engraver", + "Spanner_tracking_engraver", + "Staff_collecting_engraver", + "Staff_highlight_engraver", + "Staff_performer", + "Staff_symbol_engraver", + "Stanza_number_align_engraver", + "Stanza_number_engraver", + "Stem_engraver", + "System_start_delimiter_engraver", + "Tab_note_heads_engraver", + "Tab_staff_symbol_engraver", + "Tab_tie_follow_engraver", + "Tempo_performer", + "Text_engraver", + "Text_mark_engraver", + "Text_spanner_engraver", + "Tie_engraver", + "Tie_performer", + "Time_signature_engraver", + "Time_signature_performer", + "Timing_translator", + "Trill_spanner_engraver", + "Tuplet_engraver", + "Tweak_engraver", + "Vaticana_ligature_engraver", + "Vertical_align_engraver", + "Volta_engraver", +] + +scheme_functions = [ + "!=", + "*location*", + "*parser*", + "Alteration_glyph_engraver", + "Beat_performer", + "Bend_spanner_engraver", + "Breathing_sign_engraver", + "Centered_bar_number_align_engraver", + "Chord_name_engraver", + "Chord_square_engraver", + "Current_chord_text_engraver", + "Divisio_engraver", + "Duration_line_engraver", + "Finger_glide_engraver", + "G_", + "Grid_chord_name_engraver", + "Lyric_repeat_count_engraver", + "Measure_counter_engraver", + "Measure_spanner_engraver", + "Merge_mmrest_numbers_engraver", + "Merge_rests_engraver", + "Show_control_points_engraver", + "Signum_repetitionis_engraver", + "Skip_typesetting_engraver", + "Span_stem_engraver", + "Spanner_tracking_engraver", + "Staff_highlight_engraver", + "Text_mark_engraver", + "Trill_spanner_engraver", + "_i", + "abs-fontsize-markup", + "accidental->markup", + "accidental->markup-italian", + "accidental-interface::calc-alteration", + "accidental-interface::calc-glyph-name", + "accidental-invalid?", + "accidental-markup", + "add-bar-glyph-print-procedure", + "add-font", + "add-grace-property", + "add-music", + "add-music-fonts", + "add-new-clef", + "add-pango-fonts", + "add-point", + "add-quotable", + "add-score", + "add-simple-time-signature-style", + "add-stroke-glyph", + "add-stroke-straight", + "add-text", + "adjust-slash-stencil", + "align-on-other-markup", + "aligned-text-stencil-function", + "alist->hash-table", + "alisttext-accidental-markup", + "alterations-in-key", + "ambitus-line::calc-gap", + "ambitus::print", + "analyse-spanner-states", + "ancestor-lookup-initialize", + "angle-0-2pi", + "angle-0-360", + "annotate-spacing-spec", + "annotate-y-interval", + "any-mmrest-events", + "apply-durations", + "apply-group-draw-rule-series", + "arrow-head-markup", + "arrow-stencil", + "arrow-stencil-maker", + "assemble-stencils", + "assoc-get", + "assoc-keys", + "assoc-values", + "at-bar-line-substitute-caesura-type", + "aug-modifier", + "auto-footnote-markup", + "average", + "b", + "backslashed-digit-markup", + "bar-line::bar-y-extent", + "bar-line::calc-blot", + "bar-line::calc-break-visibility", + "bar-line::calc-glyph-name", + "bar-line::calc-glyph-name-for-direction", + "bar-line::compound-bar-line", + "bar-line::draw-filled-box", + "bar-line::widen-bar-extent-on-span", + "base-length", + "bass-clarinet-rh-ees-key-stencil", + "bassoon-bend-info-maker", + "bassoon-cc-six-key-stencil", + "bassoon-lh-a-flick-key-stencil", + "bassoon-lh-c-flick-key-stencil", + "bassoon-lh-cis-key-stencil", + "bassoon-lh-d-flick-key-stencil", + "bassoon-lh-ees-key-stencil", + "bassoon-lh-he-key-stencil", + "bassoon-lh-hees-key-stencil", + "bassoon-lh-lb-key-stencil", + "bassoon-lh-lbes-key-stencil", + "bassoon-lh-lc-key-stencil", + "bassoon-lh-ld-key-stencil", + "bassoon-lh-lhees-key-stencil", + "bassoon-lh-thumb-cis-key-stencil", + "bassoon-lh-whisper-key-stencil", + "bassoon-midline-rule", + "bassoon-rh-bes-key-stencil", + "bassoon-rh-cis-key-stencil", + "bassoon-rh-f-key-stencil", + "bassoon-rh-fis-key-stencil", + "bassoon-rh-gis-key-stencil", + "bassoon-rh-thumb-bes-key-stencil", + "bassoon-rh-thumb-e-key-stencil", + "bassoon-rh-thumb-fis-key-stencil", + "bassoon-rh-thumb-gis-key-stencil", + "bassoon-uber-key-stencil", + "beam-exceptions", + "beam-markup", + "beam::align-with-broken-parts", + "beam::get-kievan-positions", + "beam::get-kievan-quantized-positions", + "beam::place-broken-parts-individually", + "beam::slope-like-broken-parts", + "beat-grouping-internal", + "beat-structure", + "bend-spanner::print", + "bend::arrow-head-stencil", + "bend::calc-bend-x-begin", + "bend::calc-bend-x-end", + "bend::calc-y-coordinates", + "bend::draw-curves", + "bend::make-line-curve-stencil", + "bend::print", + "bend::remove-certain-tab-note-heads", + "bend::target-cautionary", + "bend::text-stencil", + "bend::text-string", + "bezier-head-for-stencil", + "binary-search", + "bold-markup", + "book-first-page", + "boolean-or-number?", + "boolean-or-symbol?", + "bounding-note-heads-pitches", + "box-grob-stencil", + "box-markup", + "box-stencil", + "bracket-markup", + "bracketify-stencil", + "break-alignable-interface::self-alignment-of-anchor", + "break-alignable-interface::self-alignment-opposite-of-anchor", + "break-alignment-list", + "breathe::midi-length", + "buildflag", + "cached-file-contents", + "caesura-script-interface::before-line-breaking", + "caesura-to-bar-line-or-divisio", + "caesura-to-divisio", + "calc-harmonic-pitch", + "calc-line-thickness", + "calc-repeat-slash-count", + "calculate-complex-compound-time", + "calculate-compound-base-beat", + "calculate-compound-base-beat-full", + "calculate-compound-beat-grouping", + "calculate-compound-measure-length", + "calculate-time-fraction", + "call-after-session", + "caps-markup", + "car-or-identity", + "car<", + "car<=", + "cdr-or-identity", + "center-align-markup", + "center-column-markup", + "centered-spanner-interface::calc-x-offset", + "centered-stencil", + "chain-assoc-get", + "change-pitches", + "char-markup", + "cheap-list?", + "cheap-markup?", + "check-beam-quant", + "check-beam-slope-sign", + "check-broken-spanner", + "check-context-path", + "check-division-alist", + "check-for-annotation", + "check-for-replacement", + "check-grob-path", + "check-music-path", + "check-pitch-against-signature", + "check-quant-callbacks", + "check-slope-callbacks", + "chord-name->german-markup", + "chord-name->italian-markup", + "chord-square::height", + "chord-square::print", + "chord-square::width", + "circle-markup", + "circle-stencil", + "clarinet-lh-R-key-stencil", + "clarinet-lh-a-key-stencil", + "clarinet-lh-cis-key-stencil", + "clarinet-lh-d-key-stencil", + "clarinet-lh-e-key-stencil", + "clarinet-lh-ees-key-stencil", + "clarinet-lh-f-key-stencil", + "clarinet-lh-fis-key-stencil", + "clarinet-lh-gis-key-stencil", + "clarinet-lh-thumb-key-stencil", + "clarinet-rh-b-key-stencil", + "clarinet-rh-d-key-stencil", + "clarinet-rh-e-key-stencil", + "clarinet-rh-f-key-stencil", + "clarinet-rh-fis-key-stencil", + "clarinet-rh-four-key-stencil", + "clarinet-rh-gis-key-stencil", + "clarinet-rh-low-c-key-stencil", + "clarinet-rh-low-cis-key-stencil", + "clarinet-rh-low-d-key-stencil", + "clarinet-rh-one-key-stencil", + "clarinet-rh-three-key-stencil", + "clarinet-rh-two-key-stencil", + "clef-transposition-markup", + "clef::print-modern-tab-if-set", + "clip-systems-to-region-stencils", + "clipped-systems-stencils", + "close-enough?", + "close-port-rename", + "coda-markup", + "collect-book-music-for-book", + "collect-bookpart-for-book", + "collect-music-aux", + "collect-music-for-book", + "collect-scores-for-book", + "color?", + "column-circle-stencil", + "column-lines-markup-list", + "column-markup", + "combine-markup", + "comparable-note-events", + "comparator-from-key", + "compile-all-markup-args", + "compile-all-markup-expressions", + "compile-markup-arg", + "compile-markup-expression", + "completize-formats", + "completize-grob-entry", + "compound-meter-markup", + "concat-markup", + "conditional-kern-before", + "conditional-string-capitalize", + "conditional-trill-markup-markup", + "configuration", + "cons-fret", + "constante-hairpin", + "construct-chord-elements", + "context-defs-from-music", + "context-mod-from-music", + "context-spec-music", + "control-point::calc-offset", + "control-polygon::calc-text", + "coord-axis", + "coord-rotate", + "coord-rotated", + "coord-scale", + "coord-translate", + "coord-x", + "coord-y", + "copy-binary-file", + "copy-repeat-chord", + "count-list", + "create-file-exclusive", + "create-fretboard", + "create-glyph-flag", + "cross-staff-connect", + "css-color", + "cue-substitute", + "current-or-previous-voice-states", + "customTabClef-markup", + "cyclic-base-value", + "debugf", + "def-grace-function", + "default-auto-beam-check", + "default-flag", + "default-paren-color", + "define-bar-line", + "define-event-class", + "define-event-function", + "define-fonts", + "define-grob-property", + "define-internal-grob-property", + "define-markup-command", + "define-markup-command-internal", + "define-markup-list-command", + "define-music-function", + "define-scheme-function", + "define-session", + "define-session-public", + "define-syntax-function", + "define-syntax-public", + "define-syntax-rule-public", + "define-tag-group", + "define-void-function", + "degree-first-true", + "degrees->radians", + "descend-to-context", + "determine-frets", + "determine-split-list", + "determine-string-fret-finger", + "dim-modifier", + "dimension-arrows", + "dir-basename", + "dir-column-markup", + "display-lily-music", + "display-music", + "display-scheme-music", + "dodecaphonic-no-repeat-rule", + "done?", + "dot-column-interface::pad-by-one-dot-width", + "dot-has-color", + "dot-is-inverted", + "dot-is-parenthesized", + "dots::calc-dot-count", + "dots::calc-dot-stencil", + "dots::calc-glyph-name", + "dots::calc-staff-position", + "doubleflat-markup", + "doublesharp-markup", + "draw-circle-markup", + "draw-dashed-line-markup", + "draw-dotted-line-markup", + "draw-hline-markup", + "draw-line-markup", + "draw-squiggle-line-markup", + "dump-zombies", + "duration", + "duration-dot-factor", + "duration-length", + "duration-line::calc", + "duration-line::calc-thickness", + "duration-line::print", + "duration-log-factor", + "duration-of-note", + "duration-or-music?", + "duration-visual", + "duration-visual-length", + "dynamic-markup", + "dynamic-text-spanner::before-line-breaking", + "elbowed-hairpin", + "ellipse-markup", + "ellipse-radius", + "ellipse-stencil", + "empty-music", + "end-broken-spanner?", + "entry-greater-than-x?", + "eps-file->stencil", + "epsfile-markup", + "eval-carefully", + "event-cause", + "event-chord-notes", + "event-chord-pitches", + "event-chord-reduce", + "event-chord-wrap!", + "event-class-cons", + "event-has-articulation?", + "events", + "every-nth-bar-number-visible", + "every-nth-repeat-count-visible", + "exact-rational?", + "expand-repeat-chords!", + "expand-repeat-notes!", + "extent-combine", + "extract-alteration", + "extract-beam-exceptions", + "extract-music", + "extract-named-music", + "extract-typed-music", + "eyeglasses-markup", + "fermata-markup", + "figured-bass-markup", + "fill-line-markup", + "fill-with-pattern-markup", + "filled-box-markup", + "find-named-props", + "find-pitch-entry", + "find-value-to-offset", + "finger-glide::print", + "finger-markup", + "fingering::calc-text", + "first-assoc", + "first-bar-number-invisible", + "first-bar-number-invisible-and-no-parenthesized-bar-numbers", + "first-bar-number-invisible-save-broken-bars", + "first-broken-spanner?", + "first-member", + "first-visible-markup", + "flared-hairpin", + "flat-flag", + "flat-markup", + "flatten-alist", + "flatten-list", + "flip-stencil", + "flute-lh-b-key-stencil", + "flute-lh-bes-key-stencil", + "flute-lh-gis-key-stencil", + "flute-lh-gis-rh-bes-key-stencil", + "flute-rh-b-key-stencil", + "flute-rh-bes-key-stencil", + "flute-rh-c-key-stencil", + "flute-rh-cis-key-stencil", + "flute-rh-d-key-stencil", + "flute-rh-dis-key-stencil", + "flute-rh-ees-key-stencil", + "flute-rh-gz-key-stencil", + "fold-some-music", + "font-children", + "font-default", + "font-name-split", + "font-name-style", + "font-qualifier", + "fontCaps-markup", + "fontsize-markup", + "footnote-markup", + "for-some-music", + "forced-configuration", + "format", + "format-bass-figure", + "format-coda-mark", + "format-compound-time", + "format-dal-segno-text", + "format-dal-segno-text-brief", + "format-mark-alphabet", + "format-mark-barnumbers", + "format-mark-box-alphabet", + "format-mark-box-barnumbers", + "format-mark-box-letters", + "format-mark-box-numbers", + "format-mark-circle-alphabet", + "format-mark-circle-barnumbers", + "format-mark-circle-letters", + "format-mark-circle-numbers", + "format-mark-generic", + "format-mark-letters", + "format-mark-numbers", + "format-metronome-markup", + "format-segno-mark", + "format-segno-mark-considering-bar-lines", + "format-sign-with-number", + "format-time-element", + "format-time-fraction", + "format-time-list", + "format-time-numerator", + "format-varcoda-mark", + "fraction->moment", + "fraction-markup", + "fraction?", + "fret->pitch", + "fret-board::calc-stencil", + "fret-count", + "fret-diagram-markup", + "fret-diagram-terse-markup", + "fret-diagram-verbose-markup", + "fret-letter-tablature-format", + "fret-number-tablature-format", + "fret-number-tablature-format-banjo", + "fret-parse-definition-string", + "fret-parse-marking-list", + "fret-parse-terse-definition-string", + "fromproperty-markup", + "function-chain", + "g", + "g-lookup-font", + "general-align-markup", + "general-column", + "generate-bassoon-family-entry", + "generate-clarinet-family-entry", + "generate-crop-stencil", + "generate-flute-family-entry", + "generate-oboe-family-entry", + "generate-preview-stencil", + "generate-saxophone-family-entry", + "generate-system-stencils", + "generate-tin-whistle-family-entry", + "get-bound-note-heads", + "get-chord-shape", + "get-current-filename", + "get-current-suffix", + "get-fill-space", + "get-key", + "get-named-spreadsheet-column", + "get-next-unique-voice-name", + "get-numeric-from-key", + "get-outfile-name", + "get-postscript-bbox", + "get-quarter-diffs", + "get-setting", + "get-slope-offset", + "get-span-glyph", + "get-spreadsheet-column", + "get-step", + "get-sub-list", + "get-top-most-tab-head", + "get-tweakable-music", + "get-woodwind-key-list", + "glissando::calc-tab-extra-dy", + "glissando::draw-tab-glissando", + "glyph->stencil", + "glyph-flag", + "grace-spacing::calc-shortest-duration", + "gray-colorize", + "grid-chord-name::calc-X-offset", + "grid-chord-name::calc-Y-offset", + "grid-chord-name::calc-offset-on-axis", + "grob-interpret-markup", + "grob-list?", + "grob-transformer", + "grob::all-objects", + "grob::calc-property-by-copy", + "grob::compose-function", + "grob::display-objects", + "grob::has-interface", + "grob::inherit-parent-property", + "grob::is-live?", + "grob::name", + "grob::objects-from-interface", + "grob::offset-function", + "grob::relay-other-property", + "grob::rhythmic-location", + "grob::show-skylines-if-debug-skylines-set", + "grob::unpure-Y-extent-from-stencil", + "grob::when", + "group-automate-rule", + "group-draw-rule", + "group-extra-offset-rule", + "gs-cmd-args", + "gs-safe-run", + "hairpin::calc-grow-direction", + "halign-markup", + "harp-pedal-check", + "harp-pedal-info", + "harp-pedal-markup", + "harp-pedals-parse-string", + "has-at-least-two?", + "has-one-or-less?", + "hash-table->alist", + "hbracket-markup", + "hcenter-in-markup", + "header-to-file", + "headers-property-alist-chain", + "hook-stencil", + "horizontal-slash-interval", + "hspace-markup", + "huge-markup", + "if-markup", + "ignatzek-chord-names", + "index-cell", + "index-or-markup?", + "index?", + "insert-markups", + "internal-set-paper-size", + "interpret-markup", + "interpret-markup-list", + "interval-bound", + "interval-center", + "interval-contains?", + "interval-empty?", + "interval-end", + "interval-index", + "interval-intersection", + "interval-length", + "interval-sane?", + "interval-scale", + "interval-start", + "interval-union", + "interval-widen", + "invalidate-alterations", + "inverter-factory", + "is-absolute?", + "is-square?", + "italic-markup", + "item::extra-spacing-height-including-staff", + "justified-lines-markup-list", + "justify-field-markup", + "justify-line-helper", + "justify-line-markup", + "justify-markup", + "justify-string-markup", + "key-crawler", + "key-entry-alteration", + "key-entry-bar-number", + "key-entry-end-mom", + "key-entry-notename", + "key-entry-octave", + "key-fill-translate", + "key-list-or-music?", + "key-list-or-symbol?", + "key-list?", + "key-signature-interface::alteration-position", + "key-signature-interface::alteration-positions", + "key?", + "keyword->make-markup", + "large-markup", + "larger-markup", + "layout-blot-diameter", + "layout-extract-page-properties", + "layout-line-thickness", + "layout-set-absolute-staff-size", + "layout-set-absolute-staff-size-in-module", + "layout-set-staff-size", + "left-align-markup", + "left-brace-markup", + "left-column-markup", + "lexicographic-list-compare?", + "lh-woodwind-text-stencil", + "lilypond-all", + "lilypond-file", + "lilypond-main", + "lilypond-version", + "lilypond-version-outdated?", + "line-markup", + "list-all-possible-keys", + "list-all-possible-keys-verbose", + "list-element-index", + "list-insert-separator", + "list-join", + "listener->once-listener", + "little-elliptical-key-stencil", + "long-midline-stencil", + "lookup-font", + "lookup-markup", + "lookup-markup-command", + "lookup-markup-command-aux", + "lookup-markup-list-command", + "lookup-paper-name", + "low-bass-clarinet-rh-ees-key-stencil", + "lower-markup", + "ly-getcwd", + "ly-type?", + "ly:accidental-interface::height", + "ly:accidental-interface::horizontal-skylines", + "ly:accidental-interface::print", + "ly:accidental-interface::remove-tied", + "ly:accidental-placement::calc-positioning-done", + "ly:add-context-mod", + "ly:add-interface", + "ly:add-listener", + "ly:add-option", + "ly:align-interface::align-to-ideal-distances", + "ly:align-interface::align-to-minimum-distances", + "ly:all-grob-interfaces", + "ly:all-options", + "ly:all-output-backend-commands", + "ly:all-stencil-commands", + "ly:all-stencil-expressions", + "ly:alternative-sequence-iterator::constructor", + "ly:angle", + "ly:apply-context-iterator::constructor", + "ly:arpeggio::brew-chord-bracket", + "ly:arpeggio::brew-chord-slur", + "ly:arpeggio::calc-cross-staff", + "ly:arpeggio::calc-positions", + "ly:arpeggio::print", + "ly:arpeggio::pure-height", + "ly:arpeggio::width", + "ly:assoc-get", + "ly:axis-group-interface::add-element", + "ly:axis-group-interface::adjacent-pure-heights", + "ly:axis-group-interface::calc-pure-relevant-grobs", + "ly:axis-group-interface::calc-pure-staff-staff-spacing", + "ly:axis-group-interface::calc-pure-y-common", + "ly:axis-group-interface::calc-skylines", + "ly:axis-group-interface::calc-staff-staff-spacing", + "ly:axis-group-interface::calc-x-common", + "ly:axis-group-interface::calc-y-common", + "ly:axis-group-interface::combine-skylines", + "ly:axis-group-interface::height", + "ly:axis-group-interface::pure-height", + "ly:axis-group-interface::width", + "ly:balloon-interface::print", + "ly:balloon-interface::pure-height", + "ly:balloon-interface::remove-irrelevant-spanner", + "ly:balloon-interface::width", + "ly:bar-check-iterator::constructor", + "ly:bar-line::calc-anchor", + "ly:bar-line::calc-bar-extent", + "ly:bar-line::print", + "ly:basic-progress", + "ly:beam::calc-beam-segments", + "ly:beam::calc-beaming", + "ly:beam::calc-cross-staff", + "ly:beam::calc-direction", + "ly:beam::calc-normal-stems", + "ly:beam::calc-stem-shorten", + "ly:beam::calc-x-positions", + "ly:beam::print", + "ly:beam::pure-rest-collision-callback", + "ly:beam::quanting", + "ly:beam::rest-collision-callback", + "ly:beam::set-stem-lengths", + "ly:bezier-extent", + "ly:bezier-extract", + "ly:book-add-bookpart!", + "ly:book-add-score!", + "ly:book-book-parts", + "ly:book-header", + "ly:book-paper", + "ly:book-process", + "ly:book-process-to-systems", + "ly:book-scores", + "ly:book-set-header!", + "ly:book?", + "ly:bp", + "ly:bracket", + "ly:break-alignable-interface::find-parent", + "ly:break-alignable-interface::self-align-callback", + "ly:break-aligned-interface::calc-average-anchor", + "ly:break-aligned-interface::calc-break-visibility", + "ly:break-aligned-interface::calc-extent-aligned-anchor", + "ly:break-aligned-interface::calc-joint-anchor-alignment", + "ly:break-alignment-interface::calc-positioning-done", + "ly:break-alignment-interface::find-nonempty-break-align-group", + "ly:breathing-sign::divisio-maior", + "ly:breathing-sign::divisio-maxima", + "ly:breathing-sign::divisio-minima", + "ly:breathing-sign::finalis", + "ly:breathing-sign::offset-callback", + "ly:breathing-sign::set-breath-properties", + "ly:broadcast", + "ly:cairo-output-stencil", + "ly:cairo-output-stencils", + "ly:calculated-sequential-music::length", + "ly:calculated-sequential-music::start", + "ly:camel-case->lisp-identifier", + "ly:chain-assoc-get", + "ly:change-iterator::constructor", + "ly:check-expected-warnings", + "ly:chord-name::after-line-breaking", + "ly:clef-modifier::calc-parent-alignment", + "ly:clef::calc-glyph-name", + "ly:clef::print", + "ly:cluster-beacon::height", + "ly:cluster::calc-cross-staff", + "ly:cluster::print", + "ly:cm", + "ly:command-line-code", + "ly:command-line-options", + "ly:connect-dispatchers", + "ly:context-current-moment", + "ly:context-def-lookup", + "ly:context-def-modify", + "ly:context-def?", + "ly:context-event-source", + "ly:context-events-below", + "ly:context-find", + "ly:context-grob-definition", + "ly:context-id", + "ly:context-matched-pop-property", + "ly:context-mod-apply!", + "ly:context-mod?", + "ly:context-name", + "ly:context-output-def", + "ly:context-parent", + "ly:context-property", + "ly:context-property-where-defined", + "ly:context-pushpop-property", + "ly:context-set-property!", + "ly:context-specced-music-iterator::constructor", + "ly:context-unset-property", + "ly:context?", + "ly:custos::print", + "ly:debug", + "ly:default-scale", + "ly:dimension?", + "ly:dir?", + "ly:directed", + "ly:disconnect-dispatchers", + "ly:dispatcher?", + "ly:dot-column::calc-positioning-done", + "ly:dots::print", + "ly:duration->string", + "ly:duration-compress", + "ly:duration-dot-count", + "ly:duration-factor", + "ly:duration-length", + "ly:duration-log", + "ly:duration-scale", + "ly:duration::less?", + "ly:durationlist", + "ly:grob-array-length", + "ly:grob-array-ref", + "ly:grob-array?", + "ly:grob-basic-properties", + "ly:grob-chain-callback", + "ly:grob-common-refpoint", + "ly:grob-common-refpoint-of-array", + "ly:grob-default-font", + "ly:grob-extent", + "ly:grob-get-vertical-axis-group-index", + "ly:grob-interfaces", + "ly:grob-layout", + "ly:grob-list->grob-array", + "ly:grob-object", + "ly:grob-original", + "ly:grob-parent", + "ly:grob-pqoffsets", + "ly:listened-event-class?", + "ly:listened-event-types", + "ly:listener?", + "ly:load", + "ly:lyric-combine-music-iterator::constructor", + "ly:lyric-combine-music::length-callback", + "ly:lyric-extender::print", + "ly:lyric-hyphen::print", + "ly:lyric-hyphen::set-spacing-rods", + "ly:make-book", + "ly:make-book-part", + "ly:make-context-mod", + "ly:make-dispatcher", + "ly:make-duration", + "ly:make-event-class", + "ly:make-global-context", + "ly:make-global-translator", + "ly:make-grob-properties", + "ly:make-listener", + "ly:make-moment", + "ly:make-music", + "ly:make-music-function", + "ly:make-music-relative!", + "ly:make-output-def", + "ly:make-page-label-marker", + "ly:make-page-permission-marker", + "ly:make-pango-description-string", + "ly:make-paper-outputter", + "ly:make-pitch", + "ly:make-prob", + "ly:make-rotation", + "ly:make-scale", + "ly:make-scaling", + "ly:make-score", + "ly:make-skyline", + "ly:make-spring", + "ly:make-stencil", + "ly:make-stream-event", + "ly:make-transform", + "ly:make-translation", + "ly:make-unpure-pure-container", + "ly:measure-grouping::print", + "ly:measure-spanner::calc-connect-to-neighbors", + "ly:measure-spanner::print", + "ly:melody-spanner::calc-neutral-stem-direction", + "ly:mensural-ligature::brew-ligature-primitive", + "ly:mensural-ligature::print", + "ly:message", + "ly:minimal-breaking", + "ly:mm", + "ly:module->alist", + "ly:module-copy", + "ly:modules-lookup", + "ly:moment-add", + "ly:moment-div", + "ly:moment-grace", + "ly:moment-grace-denominator", + "ly:moment-grace-numerator", + "ly:moment-main", + "ly:moment-main-denominator", + "ly:moment-main-numerator", + "ly:moment-mod", + "ly:moment-mul", + "ly:moment-sub", + "ly:momentstring", + "ly:number-pair->string", + "ly:one-line-auto-height-breaking", + "ly:one-line-breaking", + "ly:one-page-breaking", + "ly:optimal-breaking", + "ly:option-usage", + "ly:otf->cff", + "ly:otf-font-glyph-info", + "ly:otf-font-table-data", + "ly:otf-font?", + "ly:otf-glyph-count", + "ly:otf-glyph-list", + "ly:ottava-bracket::print", + "ly:output-def-clone", + "ly:output-def-lookup", + "ly:output-def-parent", + "ly:output-def-scope", + "ly:output-def-set-variable!", + "ly:output-def?", + "ly:output-description", + "ly:output-find-context-def", + "ly:outputter-close", + "ly:outputter-dump-stencil", + "ly:outputter-dump-string", + "ly:outputter-output-scheme", + "ly:outputter-port", + "ly:page-marker?", + "ly:page-turn-breaking", + "ly:pango-font-physical-fonts", + "ly:pango-font?", + "ly:paper-book-header", + "ly:paper-book-pages", + "ly:paper-book-paper", + "ly:paper-book-performances", + "ly:paper-book-scopes", + "ly:paper-book-systems", + "ly:paper-book?", + "ly:paper-column::break-align-width", + "ly:paper-column::print", + "ly:paper-fonts", + "ly:paper-get-font", + "ly:paper-get-number", + "ly:paper-outputscale", + "ly:paper-score-paper-systems", + "ly:paper-system-minimum-distance", + "ly:paper-system?", + "ly:parse-file", + "ly:parse-init", + "ly:parse-string-expression", + "ly:parsed-undead-list!", + "ly:parser-clear-error", + "ly:parser-clone", + "ly:parser-define!", + "ly:parser-error", + "ly:parser-has-error?", + "ly:parser-include-string", + "ly:parser-lookup", + "ly:parser-output-name", + "ly:parser-parse-string", + "ly:parser-set-note-names", + "ly:part-combine-iterator::constructor", + "ly:partial-iterator::constructor", + "ly:partial-iterator::finalization", + "ly:percent-repeat-interface::beat-slash", + "ly:percent-repeat-interface::double-percent", + "ly:percent-repeat-interface::percent", + "ly:percent-repeat-iterator::constructor", + "ly:perform-text-replacements", + "ly:performance-headers", + "ly:performance-write", + "ly:piano-pedal-bracket::print", + "ly:pitch-alteration", + "ly:pitch-diff", + "ly:pitch-negate", + "ly:pitch-notename", + "ly:pitch-octave", + "ly:pitch-quartertones", + "ly:pitch-semitones", + "ly:pitch-steps", + "ly:pitch-tones", + "ly:pitch-transpose", + "ly:pitch::less?", + "ly:pitchpoints", + "ly:skyline-distance", + "ly:skyline-empty?", + "ly:skyline-height", + "ly:skyline-max-height", + "ly:skyline-max-height-position", + "ly:skyline-merge", + "ly:skyline-pad", + "ly:skyline-pair?", + "ly:skyline-touching-point", + "ly:skyline?", + "ly:skylines-for-stencil", + "ly:slur::calc-control-points", + "ly:slur::calc-cross-staff", + "ly:slur::calc-direction", + "ly:slur::height", + "ly:slur::outside-slur-callback", + "ly:slur::outside-slur-cross-staff", + "ly:slur::print", + "ly:slur::pure-height", + "ly:slur::pure-outside-slur-callback", + "ly:smob-protects", + "ly:solve-spring-rod-problem", + "ly:source-file?", + "ly:source-files", + "ly:spacing-spanner::calc-common-shortest-duration", + "ly:spacing-spanner::set-springs", + "ly:span-bar::before-line-breaking", + "ly:span-bar::calc-anchor", + "ly:span-bar::calc-glyph-name", + "ly:span-bar::choose-model-bar-line", + "ly:span-bar::print", + "ly:span-bar::width", + "ly:spanner-bound", + "ly:spanner-broken-into", + "ly:spanner-set-bound!", + "ly:spanner::bounds-width", + "ly:spanner::calc-normalized-endpoints", + "ly:spanner::kill-zero-spanned-time", + "ly:spanner::set-spacing-rods", + "ly:spanner?", + "ly:spawn", + "ly:spring-set-inverse-compress-strength!", + "ly:spring-set-inverse-stretch-strength!", + "ly:spring?", + "ly:staff-symbol-line-thickness", + "ly:staff-symbol-referencer::callback", + "ly:staff-symbol-staff-radius", + "ly:staff-symbol-staff-space", + "ly:staff-symbol::height", + "ly:staff-symbol::print", + "ly:stderr-redirect", + "ly:stem-tremolo::calc-cross-staff", + "ly:stem-tremolo::calc-direction", + "ly:stem-tremolo::calc-shape", + "ly:stem-tremolo::calc-slope", + "ly:stem-tremolo::calc-width", + "ly:stem-tremolo::calc-y-offset", + "ly:stem-tremolo::print", + "ly:stem-tremolo::pure-calc-y-offset", + "ly:stem-tremolo::pure-height", + "ly:stem-tremolo::width", + "ly:stem::calc-cross-staff", + "ly:stem::calc-default-direction", + "ly:stem::calc-direction", + "ly:stem::calc-length", + "ly:stem::calc-positioning-done", + "ly:stem::calc-stem-begin-position", + "ly:stem::calc-stem-end-position", + "ly:stem::calc-stem-info", + "ly:stem::height", + "ly:stem::offset-callback", + "ly:stem::print", + "ly:stem::pure-calc-length", + "ly:stem::pure-calc-stem-begin-position", + "ly:stem::pure-calc-stem-end-position", + "ly:stem::pure-height", + "ly:stem::width", + "ly:stencil-add", + "ly:stencil-aligned-to", + "ly:stencil-combine-at-edge", + "ly:stencil-empty?", + "ly:stencil-expr", + "ly:stencil-extent", + "ly:stencil-in-color", + "ly:stencil-outline", + "ly:stencil-rotate", + "ly:stencil-rotate-absolute", + "ly:stencil-scale", + "ly:stencil-stack", + "ly:stencil-translate", + "ly:stencil-translate-axis", + "ly:stencil?", + "ly:stream-event?", + "ly:string-percent-encode", + "ly:string-substitute", + "ly:sustain-pedal::print", + "ly:system", + "ly:system-font-load", + "ly:system-start-delimiter::print", + "ly:system::calc-pure-height", + "ly:system::calc-pure-relevant-grobs", + "ly:system::footnotes-after-line-breaking", + "ly:system::footnotes-before-line-breaking", + "ly:system::get-nonspaceable-staves", + "ly:system::get-spaceable-staves", + "ly:system::get-staves", + "ly:system::get-vertical-alignment", + "ly:system::height", + "ly:system::vertical-skyline-elements", + "ly:text-interface::interpret-markup", + "ly:text-interface::interpret-string", + "ly:text-interface::print", + "ly:tie-column::before-line-breaking", + "ly:tie-column::calc-positioning-done", + "ly:tie::calc-control-points", + "ly:tie::calc-direction", + "ly:tie::print", + "ly:time-signature::print", + "ly:transform->list", + "ly:transform?", + "ly:translate-cpp-warning-scheme", + "ly:translator-context", + "ly:translator-description", + "ly:translator-group?", + "ly:translator-name", + "ly:translator?", + "ly:transpose-key-alist", + "ly:ttf->pfa", + "ly:ttf-ps-name", + "ly:tuplet-bracket::calc-connect-to-neighbors", + "ly:tuplet-bracket::calc-cross-staff", + "ly:tuplet-bracket::calc-direction", + "ly:tuplet-bracket::calc-positions", + "ly:tuplet-bracket::calc-x-positions", + "ly:tuplet-bracket::print", + "ly:tuplet-iterator::constructor", + "ly:tuplet-number::calc-cross-staff", + "ly:tuplet-number::calc-x-offset", + "ly:tuplet-number::calc-y-offset", + "ly:tuplet-number::print", + "ly:type1->pfa", + "ly:unit", + "ly:unpure-call", + "ly:unpure-pure-container-pure-part", + "ly:unpure-pure-container-unpure-part", + "ly:unpure-pure-container?", + "ly:usage", + "ly:vaticana-ligature::brew-ligature-primitive", + "ly:vaticana-ligature::print", + "ly:verbose-output?", + "ly:version", + "ly:version?", + "ly:volta-bracket-interface::print", + "ly:volta-bracket::calc-shorten-pair", + "ly:volta-repeat-iterator::constructor", + "ly:volta-specced-music-iterator::constructor", + "ly:vowel-transition::set-spacing-rods", + "ly:warning", + "ly:warning-located", + "ly:wide-char->utf-8", + "lyric-hyphen::vaticana-style", + "lyric-text::print", + "magnification->font-size", + "magnify-markup", + "magnifyStaff-is-set?", + "magstep", + "maj7-modifier", + "make-abs-fontsize-markup", + "make-accidental-dodecaphonic-rule", + "make-accidental-markup", + "make-accidental-rule", + "make-align-on-other-markup", + "make-apply-context", + "make-arrow-head-markup", + "make-articulation", + "make-auto-footnote-markup", + "make-autochange-music", + "make-backslashed-digit-markup", + "make-beam-markup", + "make-bezier-sandwich-stencil", + "make-bold-markup", + "make-bow-stencil", + "make-box-markup", + "make-bracket-bar-line", + "make-bracket-markup", + "make-c-time-signature-markup", + "make-caps-markup", + "make-center-align-markup", + "make-center-column-markup", + "make-central-column-hole-addresses", + "make-char-markup", + "make-chord-elements", + "make-circle-markup", + "make-circle-stencil", + "make-clef-set", + "make-coda-markup", + "make-colon-bar-line", + "make-color-handler", + "make-column-lines-markup-list", + "make-column-markup", + "make-combine-markup", + "make-compound-meter-markup", + "make-concat-markup", + "make-conditional-trill-markup-markup", + "make-connected-line", + "make-connected-path-stencil", + "make-cue-clef-set", + "make-cue-clef-unset", + "make-customTabClef-markup", + "make-dashed-bar-line", + "make-default-fonts-tree", + "make-dir-column-markup", + "make-dotted-bar-line", + "make-doubleflat-markup", + "make-doublesharp-markup", + "make-draw-circle-markup", + "make-draw-dashed-line-markup", + "make-draw-dotted-line-markup", + "make-draw-hline-markup", + "make-draw-line-markup", + "make-draw-squiggle-line-markup", + "make-duration-of-length", + "make-dynamic-markup", + "make-ellipse-markup", + "make-ellipse-stencil", + "make-empty-bar-line", + "make-engraver", + "make-epsfile-markup", + "make-event-chord", + "make-extended-scale", + "make-eyeglasses-markup", + "make-fermata-markup", + "make-figured-bass-markup", + "make-fill-line-markup", + "make-fill-with-pattern-markup", + "make-filled-box-markup", + "make-filled-box-stencil", + "make-finger-markup", + "make-first-visible-markup", + "make-flat-markup", + "make-font-tree-leaf", + "make-font-tree-node", + "make-fontCaps-markup", + "make-fontsize-markup", + "make-footnote-markup", + "make-fraction-markup", + "make-fret-diagram", + "make-fret-diagram-markup", + "make-fret-diagram-terse-markup", + "make-fret-diagram-verbose-markup", + "make-fromproperty-markup", + "make-general-align-markup", + "make-glyph-time-signature-markup", + "make-grace-music", + "make-graceless-rhythmic-location", + "make-grob-property-override", + "make-grob-property-revert", + "make-grob-property-set", + "make-halign-markup", + "make-harmonic", + "make-harp-pedal-markup", + "make-hbracket-markup", + "make-hcenter-in-markup", + "make-hspace-markup", + "make-huge-markup", + "make-if-markup", + "make-italic-markup", + "make-justified-lines-markup-list", + "make-justify-field-markup", + "make-justify-line-markup", + "make-justify-markup", + "make-justify-string-markup", + "make-key-alist", + "make-key-symbols", + "make-kievan-bar-line", + "make-large-markup", + "make-larger-markup", + "make-left-align-markup", + "make-left-brace-markup", + "make-left-column-markup", + "make-left-hand-key-addresses", + "make-line-markup", + "make-line-stencil", + "make-lookup-markup", + "make-lower-markup", + "make-lyric-event", + "make-lyric-repeat-count-formatter", + "make-magnify-markup", + "make-map-markup-commands-markup-list", + "make-markalphabet-markup", + "make-markletter-markup", + "make-markup", + "make-medium-markup", + "make-modal-inverter", + "make-modal-transposer", + "make-multi-measure-rest", + "make-multi-measure-rest-by-number-markup", + "make-music", + "make-musicglyph-markup", + "make-name-keylist", + "make-named-spreadsheet", + "make-natural-markup", + "make-no-bar-line", + "make-non-relative-music", + "make-normal-size-sub-markup", + "make-normal-size-super-markup", + "make-normal-text-markup", + "make-normalsize-markup", + "make-note-by-number-markup", + "make-note-markup", + "make-null-markup", + "make-number-keylist", + "make-number-markup", + "make-on-the-fly-markup", + "make-oval-markup", + "make-oval-stencil", + "make-overlay-markup", + "make-override-lines-markup-list", + "make-override-markup", + "make-overtie-markup", + "make-pad-around-markup", + "make-pad-markup-markup", + "make-pad-to-box-markup", + "make-pad-x-markup", + "make-page-link-markup", + "make-page-ref-markup", + "make-pango-font-tree", + "make-parenthesis-stencil", + "make-parenthesize-markup", + "make-part-combine-context-changes", + "make-part-combine-marks", + "make-partial-ellipse-stencil", + "make-path-markup", + "make-path-stencil", + "make-pattern-markup", + "make-percent-set", + "make-performer", + "make-polygon-markup", + "make-postscript-markup", + "make-property-recursive-markup", + "make-property-set", + "make-property-unset", + "make-put-adjacent-markup", + "make-raise-markup", + "make-relative", + "make-relative::to-relative-callback", + "make-repeat", + "make-replace-markup", + "make-rest-by-number-markup", + "make-rest-markup", + "make-rhythm-markup", + "make-rhythmic-location", + "make-right-align-markup", + "make-right-brace-markup", + "make-right-column-markup", + "make-right-hand-key-addresses", + "make-roman-markup", + "make-rotate-markup", + "make-rounded-box-markup", + "make-sans-markup", + "make-scale", + "make-scale-markup", + "make-score-lines-markup-list", + "make-score-markup", + "make-segno-bar-line", + "make-segno-markup", + "make-semiflat-markup", + "make-semisharp-markup", + "make-semitone->pitch", + "make-sequential-music", + "make-sesquiflat-markup", + "make-sesquisharp-markup", + "make-session-variable", + "make-setting", + "make-sharp-markup", + "make-short-bar-line", + "make-simple-bar-line", + "make-simple-markup", + "make-simultaneous-music", + "make-skip-music", + "make-skipped", + "make-slashed-digit-markup", + "make-small-markup", + "make-smallCaps-markup", + "make-smaller-markup", + "make-spacer-bar-line", + "make-span-event", + "make-split-state", + "make-spreadsheet", + "make-stem-span!", + "make-stem-spans!", + "make-stencil-boxer", + "make-stencil-circler", + "make-stencil-markup", + "make-string-lines-markup-list", + "make-strut-markup", + "make-sub-markup", + "make-super-markup", + "make-symbol-alist", + "make-tab-heads-transparent", + "make-table-markup-list", + "make-teeny-markup", + "make-text-markup", + "make-thick-bar-line", + "make-tick-bar-line", + "make-tie-markup", + "make-tie-stencil", + "make-tied-lyric-markup", + "make-tilted-portion", + "make-time-signature-set", + "make-tiny-markup", + "make-tmpfile", + "make-translate-markup", + "make-translate-scaled-markup", + "make-translator", + "make-translator-component", + "make-translator-internal", + "make-transparent-box-stencil", + "make-transparent-markup", + "make-tremolo-set", + "make-triangle-markup", + "make-type-checker", + "make-typewriter-markup", + "make-underline-markup", + "make-undertie-markup", + "make-unfolded-set", + "make-unless-markup", + "make-upright-markup", + "make-varcoda-markup", + "make-vcenter-markup", + "make-verbatim-file-markup", + "make-voice-props-override", + "make-voice-props-revert", + "make-voice-props-set", + "make-voice-states", + "make-volta-set", + "make-vspace-markup", + "make-whiteout-markup", + "make-with-color-markup", + "make-with-dimension-from-markup", + "make-with-dimension-markup", + "make-with-dimensions-from-markup", + "make-with-dimensions-markup", + "make-with-link-markup", + "make-with-outline-markup", + "make-with-string-transformer-markup", + "make-with-true-dimension-markup", + "make-with-true-dimensions-markup", + "make-with-url-markup", + "make-woodwind-diagram-markup", + "make-wordwrap-field-markup", + "make-wordwrap-internal-markup-list", + "make-wordwrap-lines-markup-list", + "make-wordwrap-markup", + "make-wordwrap-string-internal-markup-list", + "make-wordwrap-string-markup", + "map-alist-keys", + "map-alist-vals", + "map-markup-commands-markup-list", + "map-selected-alist-keys", + "map-some-music", + "markalphabet-markup", + "marked-up-headfoot", + "marked-up-title", + "markgeneric-string", + "markletter-markup", + "markup", + "markup->string", + "markup-argument-list-error", + "markup-argument-list?", + "markup-command-list?", + "markup-command-signature", + "markup-default-to-string-method", + "markup-expression->make-markup", + "markup-function-as-string-method", + "markup-function-category", + "markup-function-properties", + "markup-function?", + "markup-join", + "markup-lambda", + "markup-lambda-listify", + "markup-lambda-worker", + "markup-list-function?", + "markup-list-lambda", + "markup-list?", + "markup-thrower-typecheck", + "markup-typecheck?", + "markup?", + "match-predicate", + "measure-counter::text", + "medium-markup", + "mensural-flag", + "merge-details", + "metronome-markup", + "middle-broken-spanner?", + "midi-program", + "midline-stencil", + "minor-modifier", + "mkdir-if-not-exist", + "mm-rest-child-list", + "mmrest-of-length", + "modern-straight-flag", + "modified-font-metric-font-scaling", + "modulo-bar-number-visible", + "moment", + "moment->fraction", + "moment-min", + "moment-pair?", + "moment<=?", + "move-chord-note", + "multi-fork", + "multi-measure-rest-by-number-markup", + "music->make-music", + "music-check-error", + "music-clone", + "music-filter", + "music-invert", + "music-is-of-type?", + "music-map", + "music-pitches", + "music-property-description", + "music-selective-filter", + "music-selective-map", + "music-separator?", + "music-type-predicate", + "musicglyph-markup", + "n-true-entries", + "narrow-glyph?", + "natural-chord-alteration", + "natural-markup", + "negate-extent", + "neo-modern-accidental-rule", + "no-flag", + "normal-flag", + "normal-size-sub-markup", + "normal-size-super-markup", + "normal-text-markup", + "normalize-fraction", + "normalsize-markup", + "not-first-broken-spanner?", + "not-last-broken-spanner?", + "note-by-number-markup", + "note-events", + "note-head::brew-ez-stencil", + "note-head::calc-duration-log", + "note-head::calc-glyph-name", + "note-head::calc-kievan-duration-log", + "note-markup", + "note-name->german-markup", + "note-name->markup", + "note-name->string", + "note-name-markup", + "note-names-language", + "note-to-cluster", + "notes-to-clusters", + "null-markup", + "number->octal-string", + "number-column-stencil", + "number-format", + "number-list?", + "number-markup", + "number-or-grob?", + "number-or-pair?", + "number-or-string?", + "number-pair-list?", + "number-pair?", + "numbered-footnotes", + "numerify", + "object-type", + "object-type-name", + "oboe-lh-I-key-stencil", + "oboe-lh-II-key-stencil", + "oboe-lh-III-key-stencil", + "oboe-lh-b-key-stencil", + "oboe-lh-bes-key-stencil", + "oboe-lh-cis-key-stencil", + "oboe-lh-d-key-stencil", + "oboe-lh-ees-key-stencil", + "oboe-lh-ees-lh-bes-key-stencil", + "oboe-lh-f-key-stencil", + "oboe-lh-gis-key-stencil", + "oboe-lh-gis-lh-low-b-key-stencil", + "oboe-lh-low-b-key-stencil", + "oboe-lh-octave-key-stencil", + "oboe-rh-a-key-stencil", + "oboe-rh-banana-key-stencil", + "oboe-rh-c-key-stencil", + "oboe-rh-c-rh-ees-key-stencil", + "oboe-rh-cis-key-stencil", + "oboe-rh-d-key-stencil", + "oboe-rh-ees-key-stencil", + "oboe-rh-f-key-stencil", + "oboe-rh-gis-key-stencil", + "octave-woodwind-text-stencil", + "offset-add", + "offset-flip-y", + "offset-fret", + "offset-multiple-types", + "offset-scale", + "offsetter", + "old-straight-flag", + "on-the-fly-markup", + "only-if-beamed", + "ordered-cons", + "other-axis", + "output-module?", + "output-scopes", + "outputproperty-compatibility", + "oval-markup", + "oval-stencil", + "overlay-markup", + "override-head-style", + "override-lines-markup-list", + "override-markup", + "override-property-setting", + "override-time-signature-setting", + "overtie-markup", + "pad-around-markup", + "pad-markup-markup", + "pad-to-box-markup", + "pad-x-markup", + "page-link-markup", + "page-ref-markup", + "pair-map", + "pango-font-name", + "pango-pf-file-name", + "pango-pf-font-name", + "pango-pf-fontindex", + "paper-variable", + "parentheses-interface::calc-angled-bracket-stencils", + "parentheses-interface::calc-parenthesis-stencils", + "parentheses-interface::print", + "parentheses-interface::y-extent", + "parenthesize-elements", + "parenthesize-markup", + "parenthesize-stencil", + "parse-and-check-version", + "parse-lily-version", + "parse-terse-string", + "path-markup", + "pattern-markup", + "percussion?", + "performance-name-from-headers", + "piccolo-rh-x-key-stencil", + "pitch-alteration-semitones", + "pitch-invert", + "pitch-of-note", + "pitch-step", + "polar->rectangular", + "polygon-markup", + "position-true-endpoint", + "postprocess-output", + "postscript->pdf", + "postscript->png", + "postscript->ps", + "postscript-markup", + "precompute-music-length", + "prepend-alist-chain", + "prepend-props", + "pretty-printable?", + "previous-span-state", + "previous-voice-state", + "print-book-with", + "print-book-with-defaults", + "print-book-with-defaults-as-systems", + "print-circled-text-callback", + "print-keys", + "print-keys-verbose", + "process-fill-value", + "property-recursive-markup", + "pure-chain-offset-callback", + "pure-from-neighbor-interface::account-for-span-bar", + "pure-from-neighbor-interface::extra-spacing-height", + "pure-from-neighbor-interface::extra-spacing-height-at-beginning-of-line", + "pure-from-neighbor-interface::extra-spacing-height-including-staff", + "pure-from-neighbor-interface::pure-height", + "put-adjacent-markup", + "quarterdiff->string", + "quote-substitute", + "raise-markup", + "randomize-rand-seed", + "ratio->fret", + "ratio->pitch", + "rational-or-procedure?", + "read-lily-expression", + "read-lily-expression-internal", + "recent-enough?", + "recompute-music-length", + "recording-group-emulate", + "regexp-split", + "relevant-book-systems", + "relevant-dump-systems", + "remove-grace-property", + "remove-step", + "remove-whitespace", + "repeat-tie::handle-tab-note-head", + "replace-markup", + "replace-step", + "replicate-modify", + "reset-stencil-colors", + "rest-by-number-markup", + "rest-markup", + "retrieve-glyph-flag", + "retrograde-music", + "return-1", + "reverse-interval", + "revert-fontSize", + "revert-head-style", + "revert-property-setting", + "revert-props", + "revert-time-signature-setting", + "rgb-color", + "rh-woodwind-text-stencil", + "rhythm-markup", + "rhythmic-location->file-string", + "rhythmic-location->string", + "rhythmic-location-bar-number", + "rhythmic-location-measure-position", + "rhythmic-location<=?", + "rhythmic-location=?", + "rhythmic-location>?", + "rhythmic-location?", + "rich-bassoon-uber-key-stencil", + "rich-e-stencil", + "rich-group-draw-rule", + "rich-group-extra-offset-rule", + "rich-path-stencil", + "rich-pe-stencil", + "right-align-markup", + "right-brace-markup", + "right-column-markup", + "ring-column-circle-stencil", + "robust-bar-number-function", + "roman-markup", + "rotate-markup", + "rounded-box-markup", + "rounded-box-stencil", + "sans-markup", + "sans-serif-stencil", + "saxophone-lh-T-key-stencil", + "saxophone-lh-b-cis-key-stencil", + "saxophone-lh-b-key-stencil", + "saxophone-lh-bes-key-stencil", + "saxophone-lh-cis-key-stencil", + "saxophone-lh-d-key-stencil", + "saxophone-lh-ees-key-stencil", + "saxophone-lh-f-key-stencil", + "saxophone-lh-front-f-key-stencil", + "saxophone-lh-gis-key-stencil", + "saxophone-lh-low-a-key-stencil", + "saxophone-lh-low-bes-key-stencil", + "saxophone-name-passerelle", + "saxophone-rh-bes-key-stencil", + "saxophone-rh-c-key-stencil", + "saxophone-rh-e-key-stencil", + "saxophone-rh-ees-key-stencil", + "saxophone-rh-fis-key-stencil", + "saxophone-rh-high-fis-key-stencil", + "saxophone-rh-low-c-key-stencil", + "saxophone-rh-side-key-stencil", + "scale->factor", + "scale-beam-thickness", + "scale-by-font-size", + "scale-fontSize", + "scale-layout", + "scale-markup", + "scale-props", + "scale?", + "scheme?", + "scm->string", + "score-lines-markup-list", + "score-markup", + "scorify-music", + "script-interface::calc-x-offset", + "script-or-side-position-cross-staff", + "search-executable", + "seconds->moment", + "segno-markup", + "select-head-glyph", + "select-option", + "self-alignment-interface::self-aligned-on-breakable", + "self-evaluating?", + "semi-tie::calc-cross-staff", + "semiflat-markup", + "semisharp-markup", + "sequential-music-to-chord-exceptions", + "sesquiflat-markup", + "sesquisharp-markup", + "session-replay", + "session-save", + "session-start-record", + "session-terminate", + "set-accidental-style", + "set-bar-number-visibility", + "set-counter-text!", + "set-default-paper-size", + "set-global-fonts", + "set-global-staff-size", + "set-mus-properties!", + "set-output-property", + "set-paper-dimension-variables", + "set-paper-dimensions", + "set-paper-size", + "sharp-markup", + "shift-duration-log", + "shift-octave", + "shift-one-duration-log", + "shift-right-at-line-begin", + "shift-semitone->pitch", + "short-glyph?", + "sign", + "silence-events", + "simple-markup", + "simple-stencil-alist", + "skip->rest", + "skip-as-needed", + "skip-of-length", + "skip-of-moment-span", + "skyline-pair-and-non-empty?", + "skyline-pair::empty?", + "slashed-digit-internal", + "slashed-digit-markup", + "slashify", + "small-markup", + "smallCaps-markup", + "smaller-markup", + "space-lines", + "span-bar::compound-bar-line", + "span-state", + "split-at-predicate", + "split-index", + "split-list", + "split-list-by-separator", + "stack-lines", + "stack-stencil-line", + "stack-stencils", + "stack-stencils-padding-list", + "stack-thirds", + "staff-ellipsis::calc-y-extent", + "staff-ellipsis::print", + "staff-highlight::height", + "staff-highlight::print", + "staff-highlight::width", + "staff-magnification-is-changing?", + "staff-symbol-line-count", + "staff-symbol-line-positions", + "staff-symbol-line-span", + "staff-symbol-y-extent-from-line-positions", + "staff-symbol::calc-widened-extent", + "standard-e-stencil", + "standard-path-stencil", + "stderr", + "stem-connectable?", + "stem-is-root?", + "stem-span-stencil", + "stem-stub::do-calculations", + "stem-stub::extra-spacing-height", + "stem-stub::pure-height", + "stem-stub::width", + "stem-tremolo::calc-tab-width", + "stem::calc-duration-log", + "stem::kievan-offset-callback", + "stencil-fretboard-extent", + "stencil-fretboard-offset", + "stencil-markup", + "stencil-true-extent", + "stencil-whiteout", + "stencil-whiteout-box", + "stencil-whiteout-outline", + "stencil-with-color", + "sticky-grob-interface::inherit-property", + "straight-flag", + "string->string-list", + "string-encode-integer", + "string-endswith", + "string-lines-markup-list", + "string-number::calc-text", + "string-or-music?", + "string-or-pair?", + "string-or-symbol?", + "string-regexp-substitute", + "string-startswith", + "string-thickness", + "strip-string-annotation", + "stroke-finger::calc-text", + "strut-markup", + "style-note-heads", + "sub-markup", + "subtract-base-fret", + "suggest-convert-ly-message", + "super-markup", + "sus-modifier", + "symbol-concatenate", + "symbol-footnotes", + "symbol-key-alist?", + "symbol-key", + "@", + "@@", + "_", + "add-to-load-path", + "and", + "begin", + "begin-deprecated", + "case", + "case-lambda", + "case-lambda*", + "cond", + "cond-expand", + "current-filename", + "current-source-location", + "debug-set!", + "define", + "define*", + "define-inlinable", + "define-library", + "define-macro", + "define-module", + "define-once", + "define-option-interface", + "define-private", + "define-public", + "define-record-type", + "define-syntax", + "define-syntax-parameter", + "define-syntax-rule", + "define-values", + "defmacro", + "defmacro-public", + "delay", + "do", + "else", + "eval-when", + "export", + "export!", + "export-syntax", + "false-if-exception", + "identifier-syntax", + "if", + "import", + "include", + "include-ci", + "include-from-path", + "include-library-declarations", + "lambda", + "lambda*", + "let", + "let*", + "let*-values", + "let-syntax", + "let-values", + "letrec", + "letrec*", + "letrec-syntax", + "library", + "load", + "match", + "match-lambda", + "match-lambda*", + "match-let", + "match-let*", + "match-letrec", + "or", + "parameterize", + "print-set!", + "quasiquote", + "quasisyntax", + "quote", + "quote-syntax", + "re-export", + "re-export-syntax", + "read-set!", + "require-extension", + "set!", + "start-stack", + "syntax", + "syntax-case", + "syntax-error", + "syntax-parameterize", + "syntax-rules", + "unless", + "unquote", + "unquote-splicing", + "unsyntax", + "unsyntax-splicing", + "use-modules", + "when", + "while", + "with-ellipsis", + "with-fluids", + "with-syntax", + "λ", +} + +scheme_builtins = { + "$sc-dispatch", + "%char-set-dump", + "%get-pre-modules-obarray", + "%get-stack-size", + "%global-site-dir", + "%init-rdelim-builtins", + "%init-rw-builtins", + "%library-dir", + "%load-announce", + "%load-hook", + "%make-void-port", + "%package-data-dir", + "%port-property", + "%print-module", + "%resolve-variable", + "%search-load-path", + "%set-port-property!", + "%site-ccache-dir", + "%site-dir", + "%start-stack", + "%string-dump", + "%symbol-dump", + "%warn-auto-compilation-enabled", + "*", + "+", + "-", + "->bool", + "->char-set", + "/", + "1+", + "1-", + "<", + "<=", + "=", + ">", + ">=", + "abort-to-prompt", + "abort-to-prompt*", + "abs", + "absolute-file-name?", + "accept", + "access?", + "acons", + "acos", + "acosh", + "add-hook!", + "addrinfo:addr", + "addrinfo:canonname", + "addrinfo:fam", + "addrinfo:flags", + "addrinfo:protocol", + "addrinfo:socktype", + "adjust-port-revealed!", + "alarm", + "alist-cons", + "alist-copy", + "alist-delete", + "alist-delete!", + "allocate-struct", + "and-map", + "and=>", + "angle", + "any", + "append", + "append!", + "append-map", + "append-map!", + "append-reverse", + "append-reverse!", + "apply", + "array->list", + "array-cell-ref", + "array-cell-set!", + "array-contents", + "array-copy!", + "array-copy-in-order!", + "array-dimensions", + "array-equal?", + "array-fill!", + "array-for-each", + "array-in-bounds?", + "array-index-map!", + "array-length", + "array-map!", + "array-map-in-order!", + "array-rank", + "array-ref", + "array-set!", + "array-shape", + "array-slice", + "array-slice-for-each", + "array-slice-for-each-in-order", + "array-type", + "array-type-code", + "array?", + "ash", + "asin", + "asinh", + "assert-load-verbosity", + "assoc", + "assoc-ref", + "assoc-remove!", + "assoc-set!", + "assq", + "assq-ref", + "assq-remove!", + "assq-set!", + "assv", + "assv-ref", + "assv-remove!", + "assv-set!", + "atan", + "atanh", + "autoload-done!", + "autoload-done-or-in-progress?", + "autoload-in-progress!", + "backtrace", + "basename", + "batch-mode?", + "beautify-user-module!", + "bind", + "bind-textdomain-codeset", + "bindtextdomain", + "bit-count", + "bit-count*", + "bit-extract", + "bit-invert!", + "bit-position", + "bit-set*!", + "bitvector", + "bitvector->list", + "bitvector-bit-clear?", + "bitvector-bit-set?", + "bitvector-clear-all-bits!", + "bitvector-clear-bit!", + "bitvector-clear-bits!", + "bitvector-count", + "bitvector-count-bits", + "bitvector-fill!", + "bitvector-flip-all-bits!", + "bitvector-length", + "bitvector-position", + "bitvector-ref", + "bitvector-set!", + "bitvector-set-all-bits!", + "bitvector-set-bit!", + "bitvector-set-bits!", + "bitvector?", + "boolean?", + "bound-identifier=?", + "break", + "break!", + "caaaar", + "caaadr", + "caaar", + "caadar", + "caaddr", + "caadr", + "caar", + "cadaar", + "cadadr", + "cadar", + "caddar", + "cadddr", + "caddr", + "cadr", + "call-with-blocked-asyncs", + "call-with-current-continuation", + "call-with-deferred-observers", + "call-with-include-port", + "call-with-input-file", + "call-with-input-string", + "call-with-module-autoload-lock", + "call-with-output-file", + "call-with-output-string", + "call-with-port", + "call-with-prompt", + "call-with-unblocked-asyncs", + "call-with-values", + "call/cc", + "canonicalize-path", + "car", + "car+cdr", + "catch", + "cdaaar", + "cdaadr", + "cdaar", + "cdadar", + "cdaddr", + "cdadr", + "cdar", + "cddaar", + "cddadr", + "cddar", + "cdddar", + "cddddr", + "cdddr", + "cddr", + "cdr", + "ceiling", + "ceiling-quotient", + "ceiling-remainder", + "ceiling/", + "centered-quotient", + "centered-remainder", + "centered/", + "char->integer", + "char-alphabetic?", + "char-ci<=?", + "char-ci=?", + "char-ci>?", + "char-downcase", + "char-general-category", + "char-is-both?", + "char-lower-case?", + "char-numeric?", + "char-ready?", + "char-set", + "char-set->list", + "char-set->string", + "char-set-adjoin", + "char-set-adjoin!", + "char-set-any", + "char-set-complement", + "char-set-complement!", + "char-set-contains?", + "char-set-copy", + "char-set-count", + "char-set-cursor", + "char-set-cursor-next", + "char-set-delete", + "char-set-delete!", + "char-set-diff+intersection", + "char-set-diff+intersection!", + "char-set-difference", + "char-set-difference!", + "char-set-every", + "char-set-filter", + "char-set-filter!", + "char-set-fold", + "char-set-for-each", + "char-set-hash", + "char-set-intersection", + "char-set-intersection!", + "char-set-map", + "char-set-ref", + "char-set-size", + "char-set-unfold", + "char-set-unfold!", + "char-set-union", + "char-set-union!", + "char-set-xor", + "char-set-xor!", + "char-set<=", + "char-set=", + "char-set?", + "char-titlecase", + "char-upcase", + "char-upper-case?", + "char-whitespace?", + "char<=?", + "char=?", + "char>?", + "char?", + "chdir", + "chmod", + "chown", + "chroot", + "circular-list", + "circular-list?", + "close", + "close-fdes", + "close-input-port", + "close-output-port", + "close-port", + "closedir", + "command-line", + "complex?", + "compose", + "concatenate", + "concatenate!", + "cond-expand-provide", + "connect", + "cons", + "cons*", + "cons-source", + "const", + "convert-assignment", + "copy-file", + "copy-random-state", + "copy-tree", + "cos", + "cosh", + "count", + "crypt", + "ctermid", + "current-dynamic-state", + "current-error-port", + "current-input-port", + "current-language", + "current-load-port", + "current-module", + "current-output-port", + "current-time", + "current-warning-port", + "datum->random-state", + "datum->syntax", + "debug-disable", + "debug-enable", + "debug-options", + "debug-options-interface", + "default-duplicate-binding-handler", + "default-duplicate-binding-procedures", + "default-prompt-tag", + "define!", + "define-module*", + "defined?", + "delete", + "delete!", + "delete-duplicates", + "delete-duplicates!", + "delete-file", + "delete1!", + "delq", + "delq!", + "delq1!", + "delv", + "delv!", + "delv1!", + "denominator", + "directory-stream?", + "dirname", + "display", + "display-application", + "display-backtrace", + "display-error", + "dotted-list?", + "doubly-weak-hash-table?", + "drain-input", + "drop", + "drop-right", + "drop-right!", + "drop-while", + "dup", + "dup->fdes", + "dup->inport", + "dup->outport", + "dup->port", + "dup2", + "duplicate-port", + "dynamic-call", + "dynamic-func", + "dynamic-link", + "dynamic-object?", + "dynamic-pointer", + "dynamic-state?", + "dynamic-unlink", + "dynamic-wind", + "effective-version", + "eighth", + "end-of-char-set?", + "endgrent", + "endhostent", + "endnetent", + "endprotoent", + "endpwent", + "endservent", + "ensure-batch-mode!", + "environ", + "eof-object?", + "eq?", + "equal?", + "eqv?", + "error", + "euclidean-quotient", + "euclidean-remainder", + "euclidean/", + "eval", + "eval-string", + "even?", + "every", + "exact->inexact", + "exact-integer-sqrt", + "exact-integer?", + "exact?", + "exception-accessor", + "exception-args", + "exception-kind", + "exception-predicate", + "exception-type?", + "exception?", + "execl", + "execle", + "execlp", + "exit", + "exp", + "expt", + "f32vector", + "f32vector->list", + "f32vector-length", + "f32vector-ref", + "f32vector-set!", + "f32vector?", + "f64vector", + "f64vector->list", + "f64vector-length", + "f64vector-ref", + "f64vector-set!", + "f64vector?", + "fcntl", + "fdes->inport", + "fdes->outport", + "fdes->ports", + "fdopen", + "fifth", + "file-encoding", + "file-exists?", + "file-is-directory?", + "file-name-separator?", + "file-port?", + "file-position", + "file-set-position", + "fileno", + "filter", + "filter!", + "filter-map", + "find", + "find-tail", + "finite?", + "first", + "flock", + "floor", + "floor-quotient", + "floor-remainder", + "floor/", + "fluid->parameter", + "fluid-bound?", + "fluid-ref", + "fluid-ref*", + "fluid-set!", + "fluid-thread-local?", + "fluid-unset!", + "fluid?", + "flush-all-ports", + "fold", + "fold-right", + "for-each", + "force", + "force-output", + "format", + "fourth", + "frame-address", + "frame-arguments", + "frame-dynamic-link", + "frame-instruction-pointer", + "frame-previous", + "frame-procedure-name", + "frame-return-address", + "frame-source", + "frame-stack-pointer", + "frame?", + "free-identifier=?", + "fsync", + "ftell", + "gai-strerror", + "gc", + "gc-disable", + "gc-dump", + "gc-enable", + "gc-run-time", + "gc-stats", + "gcd", + "generate-temporaries", + "gensym", + "get-internal-real-time", + "get-internal-run-time", + "get-output-string", + "get-print-state", + "getaddrinfo", + "getaffinity", + "getcwd", + "getegid", + "getenv", + "geteuid", + "getgid", + "getgr", + "getgrent", + "getgrgid", + "getgrnam", + "getgroups", + "gethost", + "gethostbyaddr", + "gethostbyname", + "gethostent", + "gethostname", + "getitimer", + "getlogin", + "getnet", + "getnetbyaddr", + "getnetbyname", + "getnetent", + "getpass", + "getpeername", + "getpgrp", + "getpid", + "getppid", + "getpriority", + "getproto", + "getprotobyname", + "getprotobynumber", + "getprotoent", + "getpw", + "getpwent", + "getpwnam", + "getpwuid", + "getrlimit", + "getserv", + "getservbyname", + "getservbyport", + "getservent", + "getsid", + "getsockname", + "getsockopt", + "gettext", + "gettimeofday", + "getuid", + "gmtime", + "group:gid", + "group:mem", + "group:name", + "group:passwd", + "hash", + "hash-clear!", + "hash-count", + "hash-create-handle!", + "hash-fold", + "hash-for-each", + "hash-for-each-handle", + "hash-get-handle", + "hash-map->list", + "hash-ref", + "hash-remove!", + "hash-set!", + "hash-table?", + "hashq", + "hashq-create-handle!", + "hashq-get-handle", + "hashq-ref", + "hashq-remove!", + "hashq-set!", + "hashv", + "hashv-create-handle!", + "hashv-get-handle", + "hashv-ref", + "hashv-remove!", + "hashv-set!", + "hashx-create-handle!", + "hashx-get-handle", + "hashx-ref", + "hashx-remove!", + "hashx-set!", + "hook->list", + "hook-empty?", + "hook?", + "hostent:addr-list", + "hostent:addrtype", + "hostent:aliases", + "hostent:length", + "hostent:name", + "identifier?", + "identity", + "imag-part", + "in-vicinity", + "include-deprecated-features", + "inet-lnaof", + "inet-makeaddr", + "inet-netof", + "inet-ntop", + "inet-pton", + "inexact->exact", + "inexact?", + "inf", + "inf?", + "inherit-print-state", + "input-port?", + "install-r6rs!", + "install-r7rs!", + "integer->char", + "integer-expt", + "integer-length", + "integer?", + "interaction-environment", + "iota", + "isatty?", + "issue-deprecation-warning", + "keyword->symbol", + "keyword-like-symbol->keyword", + "keyword?", + "kill", + "kw-arg-ref", + "last", + "last-pair", + "lcm", + "length", + "length+", + "link", + "list", + "list->array", + "list->bitvector", + "list->char-set", + "list->char-set!", + "list->f32vector", + "list->f64vector", + "list->s16vector", + "list->s32vector", + "list->s64vector", + "list->s8vector", + "list->string", + "list->symbol", + "list->typed-array", + "list->u16vector", + "list->u32vector", + "list->u64vector", + "list->u8vector", + "list->vector", + "list-cdr-ref", + "list-cdr-set!", + "list-copy", + "list-head", + "list-index", + "list-ref", + "list-set!", + "list-tabulate", + "list-tail", + "list=", + "list?", + "listen", + "load-compiled", + "load-extension", + "load-from-path", + "load-in-vicinity", + "load-user-init", + "local-define", + "local-define-module", + "local-ref", + "local-ref-module", + "local-remove", + "local-set!", + "localtime", + "log", + "log10", + "logand", + "logbit?", + "logcount", + "logior", + "lognot", + "logtest", + "logxor", + "lookup-duplicates-handlers", + "lset-adjoin", + "lset-diff+intersection", + "lset-diff+intersection!", + "lset-difference", + "lset-difference!", + "lset-intersection", + "lset-intersection!", + "lset-union", + "lset-union!", + "lset-xor", + "lset-xor!", + "lset<=", + "lset=", + "lstat", + "macro-binding", + "macro-name", + "macro-transformer", + "macro-type", + "macro?", + "macroexpand", + "macroexpanded?", + "magnitude", + "major-version", + "make-array", + "make-autoload-interface", + "make-bitvector", + "make-doubly-weak-hash-table", + "make-exception", + "make-exception-from-throw", + "make-exception-type", + "make-f32vector", + "make-f64vector", + "make-fluid", + "make-fresh-user-module", + "make-generalized-vector", + "make-guardian", + "make-hash-table", + "make-hook", + "make-list", + "make-module", + "make-modules-in", + "make-mutable-parameter", + "make-object-property", + "make-parameter", + "make-polar", + "make-procedure-with-setter", + "make-promise", + "make-prompt-tag", + "make-record-type", + "make-rectangular", + "make-regexp", + "make-s16vector", + "make-s32vector", + "make-s64vector", + "make-s8vector", + "make-shared-array", + "make-socket-address", + "make-soft-port", + "make-srfi-4-vector", + "make-stack", + "make-string", + "make-struct-layout", + "make-struct/no-tail", + "make-struct/simple", + "make-symbol", + "make-syntax-transformer", + "make-thread-local-fluid", + "make-typed-array", + "make-u16vector", + "make-u32vector", + "make-u64vector", + "make-u8vector", + "make-unbound-fluid", + "make-undefined-variable", + "make-variable", + "make-variable-transformer", + "make-vector", + "make-vtable", + "make-weak-key-hash-table", + "make-weak-value-hash-table", + "map", + "map!", + "map-in-order", + "max", + "member", + "memoize-expression", + "memoized-typecode", + "memq", + "memv", + "merge", + "merge!", + "micro-version", + "min", + "minor-version", + "mkdir", + "mkdtemp", + "mknod", + "mkstemp", + "mkstemp!", + "mktime", + "module-add!", + "module-autoload!", + "module-binder", + "module-bound?", + "module-call-observers", + "module-clear!", + "module-constructor", + "module-declarative?", + "module-defer-observers", + "module-define!", + "module-define-submodule!", + "module-defined?", + "module-duplicates-handlers", + "module-ensure-local-variable!", + "module-export!", + "module-export-all!", + "module-filename", + "module-for-each", + "module-generate-unique-id!", + "module-gensym", + "module-import-interface", + "module-import-obarray", + "module-kind", + "module-local-variable", + "module-locally-bound?", + "module-make-local-var!", + "module-map", + "module-modified", + "module-name", + "module-next-unique-id", + "module-obarray", + "module-obarray-get-handle", + "module-obarray-ref", + "module-obarray-remove!", + "module-obarray-set!", + "module-observe", + "module-observe-weak", + "module-observers", + "module-public-interface", + "module-re-export!", + "module-ref", + "module-ref-submodule", + "module-remove!", + "module-replace!", + "module-replacements", + "module-reverse-lookup", + "module-search", + "module-set!", + "module-submodule-binder", + "module-submodules", + "module-symbol-binding", + "module-symbol-interned?", + "module-symbol-local-binding", + "module-symbol-locally-interned?", + "module-transformer", + "module-unobserve", + "module-use!", + "module-use-interfaces!", + "module-uses", + "module-variable", + "module-version", + "module-weak-observers", + "module?", + "modulo", + "modulo-expt", + "move->fdes", + "nan", + "nan?", + "negate", + "negative?", + "nested-define!", + "nested-define-module!", + "nested-ref", + "nested-ref-module", + "nested-remove!", + "nested-set!", + "netent:addrtype", + "netent:aliases", + "netent:name", + "netent:net", + "newline", + "ngettext", + "nice", + "nil?", + "ninth", + "noop", + "not", + "not-pair?", + "null-environment", + "null-list?", + "null?", + "number->string", + "number?", + "numerator", + "object->string", + "object-address", + "object-properties", + "object-property", + "odd?", + "open", + "open-fdes", + "open-file", + "open-input-file", + "open-input-string", + "open-io-file", + "open-output-file", + "open-output-string", + "opendir", + "or-map", + "output-port?", + "pair-fold", + "pair-fold-right", + "pair-for-each", + "pair?", + "parameter-converter", + "parameter-fluid", + "parameter?", + "parse-path", + "parse-path-with-ellipsis", + "partition", + "partition!", + "passwd:dir", + "passwd:gecos", + "passwd:gid", + "passwd:name", + "passwd:passwd", + "passwd:shell", + "passwd:uid", + "pause", + "peek", + "peek-char", + "pipe", + "pk", + "port->fdes", + "port-closed?", + "port-column", + "port-conversion-strategy", + "port-encoding", + "port-filename", + "port-for-each", + "port-line", + "port-mode", + "port-revealed", + "port-with-print-state", + "port?", + "positive?", + "primitive-_exit", + "primitive-eval", + "primitive-exit", + "primitive-fork", + "primitive-load", + "primitive-load-path", + "primitive-move->fdes", + "primitive-read", + "print-disable", + "print-enable", + "print-exception", + "print-options", + "print-options-interface", + "procedure", + "procedure-documentation", + "procedure-minimum-arity", + "procedure-name", + "procedure-properties", + "procedure-property", + "procedure-source", + "procedure-with-setter?", + "procedure?", + "process-use-modules", + "program-arguments", + "promise?", + "proper-list?", + "protoent:aliases", + "protoent:name", + "protoent:proto", + "provide", + "provided?", + "purify-module!", + "putenv", + "quit", + "quotient", + "raise", + "raise-exception", + "random", + "random-state->datum", + "random-state-from-platform", + "random:exp", + "random:hollow-sphere!", + "random:normal", + "random:normal-vector!", + "random:solid-sphere!", + "random:uniform", + "rational?", + "rationalize", + "read", + "read-char", + "read-disable", + "read-enable", + "read-hash-extend", + "read-hash-procedure", + "read-hash-procedures", + "read-options", + "read-options-interface", + "read-syntax", + "readdir", + "readlink", + "real-part", + "real?", + "record-accessor", + "record-constructor", + "record-modifier", + "record-predicate", + "record-type-constructor", + "record-type-descriptor", + "record-type-extensible?", + "record-type-fields", + "record-type-has-parent?", + "record-type-mutable-fields", + "record-type-name", + "record-type-opaque?", + "record-type-parent", + "record-type-parents", + "record-type-properties", + "record-type-uid", + "record-type?", + "record?", + "recv!", + "recvfrom!", + "redirect-port", + "reduce", + "reduce-right", + "regexp-exec", + "regexp?", + "release-port-handle", + "reload-module", + "remainder", + "remove", + "remove!", + "remove-hook!", + "rename-file", + "repl-reader", + "reset-hook!", + "resolve-interface", + "resolve-module", + "resolve-r6rs-interface", + "restore-signals", + "restricted-vector-sort!", + "reverse", + "reverse!", + "reverse-list->string", + "rewinddir", + "rmdir", + "round", + "round-ash", + "round-quotient", + "round-remainder", + "round/", + "run-hook", + "s16vector", + "s16vector->list", + "s16vector-length", + "s16vector-ref", + "s16vector-set!", + "s16vector?", + "s32vector", + "s32vector->list", + "s32vector-length", + "s32vector-ref", + "s32vector-set!", + "s32vector?", + "s64vector", + "s64vector->list", + "s64vector-length", + "s64vector-ref", + "s64vector-set!", + "s64vector?", + "s8vector", + "s8vector->list", + "s8vector-length", + "s8vector-ref", + "s8vector-set!", + "s8vector?", + "save-module-excursion", + "scheme-report-environment", + "scm-error", + "search-path", + "second", + "seed->random-state", + "seek", + "select", + "self-evaluating?", + "send", + "sendfile", + "sendto", + "servent:aliases", + "servent:name", + "servent:port", + "servent:proto", + "set-autoloaded!", + "set-car!", + "set-cdr!", + "set-current-dynamic-state", + "set-current-error-port", + "set-current-input-port", + "set-current-module", + "set-current-output-port", + "set-exception-printer!", + "set-module-binder!", + "set-module-declarative?!", + "set-module-duplicates-handlers!", + "set-module-filename!", + "set-module-kind!", + "set-module-name!", + "set-module-next-unique-id!", + "set-module-obarray!", + "set-module-observers!", + "set-module-public-interface!", + "set-module-submodule-binder!", + "set-module-submodules!", + "set-module-transformer!", + "set-module-uses!", + "set-module-version!", + "set-object-properties!", + "set-object-property!", + "set-port-column!", + "set-port-conversion-strategy!", + "set-port-encoding!", + "set-port-filename!", + "set-port-line!", + "set-port-revealed!", + "set-procedure-minimum-arity!", + "set-procedure-properties!", + "set-procedure-property!", + "set-program-arguments", + "set-source-properties!", + "set-source-property!", + "set-struct-vtable-name!", + "set-symbol-property!", + "set-tm:gmtoff", + "set-tm:hour", + "set-tm:isdst", + "set-tm:mday", + "set-tm:min", + "set-tm:mon", + "set-tm:sec", + "set-tm:wday", + "set-tm:yday", + "set-tm:year", + "set-tm:zone", + "setaffinity", + "setegid", + "setenv", + "seteuid", + "setgid", + "setgr", + "setgrent", + "setgroups", + "sethost", + "sethostent", + "sethostname", + "setitimer", + "setlocale", + "setnet", + "setnetent", + "setpgid", + "setpriority", + "setproto", + "setprotoent", + "setpw", + "setpwent", + "setrlimit", + "setserv", + "setservent", + "setsid", + "setsockopt", + "setter", + "setuid", + "setvbuf", + "seventh", + "shared-array-increments", + "shared-array-offset", + "shared-array-root", + "shutdown", + "sigaction", + "simple-exceptions", + "simple-format", + "sin", + "sinh", + "sixth", + "sleep", + "sloppy-assoc", + "sloppy-assq", + "sloppy-assv", + "sockaddr:addr", + "sockaddr:fam", + "sockaddr:flowinfo", + "sockaddr:path", + "sockaddr:port", + "sockaddr:scopeid", + "socket", + "socketpair", + "sort", + "sort!", + "sort-list", + "sort-list!", + "sorted?", + "source-properties", + "source-property", + "span", + "span!", + "split-at", + "split-at!", + "sqrt", + "stable-sort", + "stable-sort!", + "stack-id", + "stack-length", + "stack-ref", + "stack?", + "stat", + "stat:atime", + "stat:atimensec", + "stat:blksize", + "stat:blocks", + "stat:ctime", + "stat:ctimensec", + "stat:dev", + "stat:gid", + "stat:ino", + "stat:mode", + "stat:mtime", + "stat:mtimensec", + "stat:nlink", + "stat:perms", + "stat:rdev", + "stat:size", + "stat:type", + "stat:uid", + "status:exit-val", + "status:stop-sig", + "status:term-sig", + "strerror", + "strftime", + "string", + "string->char-set", + "string->char-set!", + "string->list", + "string->number", + "string->symbol", + "string-any", + "string-any-c-code", + "string-append", + "string-append/shared", + "string-bytes-per-char", + "string-capitalize", + "string-capitalize!", + "string-ci->symbol", + "string-ci<", + "string-ci<=", + "string-ci<=?", + "string-ci<>", + "string-ci", + "string-ci>=", + "string-ci>=?", + "string-ci>?", + "string-compare", + "string-compare-ci", + "string-concatenate", + "string-concatenate-reverse", + "string-concatenate-reverse/shared", + "string-concatenate/shared", + "string-contains", + "string-contains-ci", + "string-copy", + "string-copy!", + "string-count", + "string-delete", + "string-downcase", + "string-downcase!", + "string-drop", + "string-drop-right", + "string-every", + "string-every-c-code", + "string-fill!", + "string-filter", + "string-fold", + "string-fold-right", + "string-for-each", + "string-for-each-index", + "string-hash", + "string-hash-ci", + "string-index", + "string-index-right", + "string-join", + "string-length", + "string-map", + "string-map!", + "string-normalize-nfc", + "string-normalize-nfd", + "string-normalize-nfkc", + "string-normalize-nfkd", + "string-null?", + "string-pad", + "string-pad-right", + "string-prefix-ci?", + "string-prefix-length", + "string-prefix-length-ci", + "string-prefix?", + "string-ref", + "string-replace", + "string-reverse", + "string-reverse!", + "string-rindex", + "string-set!", + "string-skip", + "string-skip-right", + "string-split", + "string-suffix-ci?", + "string-suffix-length", + "string-suffix-length-ci", + "string-suffix?", + "string-tabulate", + "string-take", + "string-take-right", + "string-titlecase", + "string-titlecase!", + "string-tokenize", + "string-trim", + "string-trim-both", + "string-trim-right", + "string-unfold", + "string-unfold-right", + "string-upcase", + "string-upcase!", + "string-utf8-length", + "string-xcopy!", + "string<", + "string<=", + "string<=?", + "string<>", + "string", + "string>=", + "string>=?", + "string>?", + "string?", + "strptime", + "struct-layout", + "struct-ref", + "struct-ref/unboxed", + "struct-set!", + "struct-set!/unboxed", + "struct-vtable", + "struct-vtable-name", + "struct-vtable?", + "struct?", + "substring", + "substring-fill!", + "substring-move!", + "substring/copy", + "substring/read-only", + "substring/shared", + "supports-source-properties?", + "symbol", + "symbol->keyword", + "symbol->string", + "symbol-append", + "symbol-fref", + "symbol-fset!", + "symbol-hash", + "symbol-interned?", + "symbol-pref", + "symbol-prefix-proc", + "symbol-property", + "symbol-property-remove!", + "symbol-pset!", + "symbol?", + "symlink", + "sync", + "syntax->datum", + "syntax-source", + "syntax-violation", + "system", + "system*", + "system-async-mark", + "system-error-errno", + "system-file-name-convention", + "take", + "take!", + "take-right", + "take-while", + "take-while!", + "tan", + "tanh", + "tcgetpgrp", + "tcsetpgrp", + "tenth", + "textdomain", + "third", + "throw", + "thunk?", + "times", + "tm:gmtoff", + "tm:hour", + "tm:isdst", + "tm:mday", + "tm:min", + "tm:mon", + "tm:sec", + "tm:wday", + "tm:yday", + "tm:year", + "tm:zone", + "tmpfile", + "tmpnam", + "tms:clock", + "tms:cstime", + "tms:cutime", + "tms:stime", + "tms:utime", + "transpose-array", + "truncate", + "truncate-file", + "truncate-quotient", + "truncate-remainder", + "truncate/", + "try-load-module", + "try-module-autoload", + "ttyname", + "typed-array?", + "tzset", + "u16vector", + "u16vector->list", + "u16vector-length", + "u16vector-ref", + "u16vector-set!", + "u16vector?", + "u32vector", + "u32vector->list", + "u32vector-length", + "u32vector-ref", + "u32vector-set!", + "u32vector?", + "u64vector", + "u64vector->list", + "u64vector-length", + "u64vector-ref", + "u64vector-set!", + "u64vector?", + "u8vector", + "u8vector->list", + "u8vector-length", + "u8vector-ref", + "u8vector-set!", + "u8vector?", + "ucs-range->char-set", + "ucs-range->char-set!", + "umask", + "uname", + "unfold", + "unfold-right", + "unmemoize-expression", + "unread-char", + "unread-string", + "unsetenv", + "unspecified?", + "unzip1", + "unzip2", + "unzip3", + "unzip4", + "unzip5", + "use-srfis", + "user-modules-declarative?", + "using-readline?", + "usleep", + "utime", + "utsname:machine", + "utsname:nodename", + "utsname:release", + "utsname:sysname", + "utsname:version", + "values", + "variable-bound?", + "variable-ref", + "variable-set!", + "variable-unset!", + "variable?", + "vector", + "vector->list", + "vector-copy", + "vector-fill!", + "vector-length", + "vector-move-left!", + "vector-move-right!", + "vector-ref", + "vector-set!", + "vector?", + "version", + "version-matches?", + "waitpid", + "warn", + "weak-key-hash-table?", + "weak-value-hash-table?", + "with-continuation-barrier", + "with-dynamic-state", + "with-error-to-file", + "with-error-to-port", + "with-error-to-string", + "with-exception-handler", + "with-fluid*", + "with-fluids*", + "with-input-from-file", + "with-input-from-port", + "with-input-from-string", + "with-output-to-file", + "with-output-to-port", + "with-output-to-string", + "with-throw-handler", + "write", + "write-char", + "xcons", + "xsubstring", + "zero?", + "zip", +} + diff --git a/lib/python3.12/site-packages/pygments/lexers/_scilab_builtins.py b/lib/python3.12/site-packages/pygments/lexers/_scilab_builtins.py new file mode 100644 index 0000000000000000000000000000000000000000..af49b46a8e3f66d2c87b9f39fd86d1cf4fa1b8b8 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/_scilab_builtins.py @@ -0,0 +1,3093 @@ +""" + pygments.lexers._scilab_builtins + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Builtin list for the ScilabLexer. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +# Autogenerated + +commands_kw = ( + 'abort', + 'apropos', + 'break', + 'case', + 'catch', + 'continue', + 'do', + 'else', + 'elseif', + 'end', + 'endfunction', + 'for', + 'function', + 'help', + 'if', + 'pause', + 'quit', + 'select', + 'then', + 'try', + 'while', +) + +functions_kw = ( + '!!_invoke_', + '%H5Object_e', + '%H5Object_fieldnames', + '%H5Object_p', + '%XMLAttr_6', + '%XMLAttr_e', + '%XMLAttr_i_XMLElem', + '%XMLAttr_length', + '%XMLAttr_p', + '%XMLAttr_size', + '%XMLDoc_6', + '%XMLDoc_e', + '%XMLDoc_i_XMLList', + '%XMLDoc_p', + '%XMLElem_6', + '%XMLElem_e', + '%XMLElem_i_XMLDoc', + '%XMLElem_i_XMLElem', + '%XMLElem_i_XMLList', + '%XMLElem_p', + '%XMLList_6', + '%XMLList_e', + '%XMLList_i_XMLElem', + '%XMLList_i_XMLList', + '%XMLList_length', + '%XMLList_p', + '%XMLList_size', + '%XMLNs_6', + '%XMLNs_e', + '%XMLNs_i_XMLElem', + '%XMLNs_p', + '%XMLSet_6', + '%XMLSet_e', + '%XMLSet_length', + '%XMLSet_p', + '%XMLSet_size', + '%XMLValid_p', + '%_EClass_6', + '%_EClass_e', + '%_EClass_p', + '%_EObj_0', + '%_EObj_1__EObj', + '%_EObj_1_b', + '%_EObj_1_c', + '%_EObj_1_i', + '%_EObj_1_s', + '%_EObj_2__EObj', + '%_EObj_2_b', + '%_EObj_2_c', + '%_EObj_2_i', + '%_EObj_2_s', + '%_EObj_3__EObj', + '%_EObj_3_b', + '%_EObj_3_c', + '%_EObj_3_i', + '%_EObj_3_s', + '%_EObj_4__EObj', + '%_EObj_4_b', + '%_EObj_4_c', + '%_EObj_4_i', + '%_EObj_4_s', + '%_EObj_5', + '%_EObj_6', + '%_EObj_a__EObj', + '%_EObj_a_b', + '%_EObj_a_c', + '%_EObj_a_i', + '%_EObj_a_s', + '%_EObj_d__EObj', + '%_EObj_d_b', + '%_EObj_d_c', + '%_EObj_d_i', + '%_EObj_d_s', + '%_EObj_disp', + '%_EObj_e', + '%_EObj_g__EObj', + '%_EObj_g_b', + '%_EObj_g_c', + '%_EObj_g_i', + '%_EObj_g_s', + '%_EObj_h__EObj', + '%_EObj_h_b', + '%_EObj_h_c', + '%_EObj_h_i', + '%_EObj_h_s', + '%_EObj_i__EObj', + '%_EObj_j__EObj', + '%_EObj_j_b', + '%_EObj_j_c', + '%_EObj_j_i', + '%_EObj_j_s', + '%_EObj_k__EObj', + '%_EObj_k_b', + '%_EObj_k_c', + '%_EObj_k_i', + '%_EObj_k_s', + '%_EObj_l__EObj', + '%_EObj_l_b', + '%_EObj_l_c', + '%_EObj_l_i', + '%_EObj_l_s', + '%_EObj_m__EObj', + '%_EObj_m_b', + '%_EObj_m_c', + '%_EObj_m_i', + '%_EObj_m_s', + '%_EObj_n__EObj', + '%_EObj_n_b', + '%_EObj_n_c', + '%_EObj_n_i', + '%_EObj_n_s', + '%_EObj_o__EObj', + '%_EObj_o_b', + '%_EObj_o_c', + '%_EObj_o_i', + '%_EObj_o_s', + '%_EObj_p', + '%_EObj_p__EObj', + '%_EObj_p_b', + '%_EObj_p_c', + '%_EObj_p_i', + '%_EObj_p_s', + '%_EObj_q__EObj', + '%_EObj_q_b', + '%_EObj_q_c', + '%_EObj_q_i', + '%_EObj_q_s', + '%_EObj_r__EObj', + '%_EObj_r_b', + '%_EObj_r_c', + '%_EObj_r_i', + '%_EObj_r_s', + '%_EObj_s__EObj', + '%_EObj_s_b', + '%_EObj_s_c', + '%_EObj_s_i', + '%_EObj_s_s', + '%_EObj_t', + '%_EObj_x__EObj', + '%_EObj_x_b', + '%_EObj_x_c', + '%_EObj_x_i', + '%_EObj_x_s', + '%_EObj_y__EObj', + '%_EObj_y_b', + '%_EObj_y_c', + '%_EObj_y_i', + '%_EObj_y_s', + '%_EObj_z__EObj', + '%_EObj_z_b', + '%_EObj_z_c', + '%_EObj_z_i', + '%_EObj_z_s', + '%_eigs', + '%_load', + '%b_1__EObj', + '%b_2__EObj', + '%b_3__EObj', + '%b_4__EObj', + '%b_a__EObj', + '%b_d__EObj', + '%b_g__EObj', + '%b_h__EObj', + '%b_i_XMLList', + '%b_i__EObj', + '%b_j__EObj', + '%b_k__EObj', + '%b_l__EObj', + '%b_m__EObj', + '%b_n__EObj', + '%b_o__EObj', + '%b_p__EObj', + '%b_q__EObj', + '%b_r__EObj', + '%b_s__EObj', + '%b_x__EObj', + '%b_y__EObj', + '%b_z__EObj', + '%c_1__EObj', + '%c_2__EObj', + '%c_3__EObj', + '%c_4__EObj', + '%c_a__EObj', + '%c_d__EObj', + '%c_g__EObj', + '%c_h__EObj', + '%c_i_XMLAttr', + '%c_i_XMLDoc', + '%c_i_XMLElem', + '%c_i_XMLList', + '%c_i__EObj', + '%c_j__EObj', + '%c_k__EObj', + '%c_l__EObj', + '%c_m__EObj', + '%c_n__EObj', + '%c_o__EObj', + '%c_p__EObj', + '%c_q__EObj', + '%c_r__EObj', + '%c_s__EObj', + '%c_x__EObj', + '%c_y__EObj', + '%c_z__EObj', + '%ce_i_XMLList', + '%fptr_i_XMLList', + '%h_i_XMLList', + '%hm_i_XMLList', + '%i_1__EObj', + '%i_2__EObj', + '%i_3__EObj', + '%i_4__EObj', + '%i_a__EObj', + '%i_abs', + '%i_cumprod', + '%i_cumsum', + '%i_d__EObj', + '%i_diag', + '%i_g__EObj', + '%i_h__EObj', + '%i_i_XMLList', + '%i_i__EObj', + '%i_j__EObj', + '%i_k__EObj', + '%i_l__EObj', + '%i_m__EObj', + '%i_matrix', + '%i_max', + '%i_maxi', + '%i_min', + '%i_mini', + '%i_mput', + '%i_n__EObj', + '%i_o__EObj', + '%i_p', + '%i_p__EObj', + '%i_prod', + '%i_q__EObj', + '%i_r__EObj', + '%i_s__EObj', + '%i_sum', + '%i_tril', + '%i_triu', + '%i_x__EObj', + '%i_y__EObj', + '%i_z__EObj', + '%ip_i_XMLList', + '%l_i_XMLList', + '%l_i__EObj', + '%lss_i_XMLList', + '%mc_i_XMLList', + '%msp_full', + '%msp_i_XMLList', + '%msp_spget', + '%p_i_XMLList', + '%ptr_i_XMLList', + '%r_i_XMLList', + '%s_1__EObj', + '%s_2__EObj', + '%s_3__EObj', + '%s_4__EObj', + '%s_a__EObj', + '%s_d__EObj', + '%s_g__EObj', + '%s_h__EObj', + '%s_i_XMLList', + '%s_i__EObj', + '%s_j__EObj', + '%s_k__EObj', + '%s_l__EObj', + '%s_m__EObj', + '%s_n__EObj', + '%s_o__EObj', + '%s_p__EObj', + '%s_q__EObj', + '%s_r__EObj', + '%s_s__EObj', + '%s_x__EObj', + '%s_y__EObj', + '%s_z__EObj', + '%sp_i_XMLList', + '%spb_i_XMLList', + '%st_i_XMLList', + 'Calendar', + 'ClipBoard', + 'Matplot', + 'Matplot1', + 'PlaySound', + 'TCL_DeleteInterp', + 'TCL_DoOneEvent', + 'TCL_EvalFile', + 'TCL_EvalStr', + 'TCL_ExistArray', + 'TCL_ExistInterp', + 'TCL_ExistVar', + 'TCL_GetVar', + 'TCL_GetVersion', + 'TCL_SetVar', + 'TCL_UnsetVar', + 'TCL_UpVar', + '_', + '_code2str', + '_d', + '_str2code', + 'about', + 'abs', + 'acos', + 'addModulePreferences', + 'addcolor', + 'addf', + 'addhistory', + 'addinter', + 'addlocalizationdomain', + 'amell', + 'and', + 'argn', + 'arl2_ius', + 'ascii', + 'asin', + 'atan', + 'backslash', + 'balanc', + 'banner', + 'base2dec', + 'basename', + 'bdiag', + 'beep', + 'besselh', + 'besseli', + 'besselj', + 'besselk', + 'bessely', + 'beta', + 'bezout', + 'bfinit', + 'blkfc1i', + 'blkslvi', + 'bool2s', + 'browsehistory', + 'browsevar', + 'bsplin3val', + 'buildDoc', + 'buildouttb', + 'bvode', + 'c_link', + 'call', + 'callblk', + 'captions', + 'cd', + 'cdfbet', + 'cdfbin', + 'cdfchi', + 'cdfchn', + 'cdff', + 'cdffnc', + 'cdfgam', + 'cdfnbn', + 'cdfnor', + 'cdfpoi', + 'cdft', + 'ceil', + 'champ', + 'champ1', + 'chdir', + 'chol', + 'clc', + 'clean', + 'clear', + 'clearfun', + 'clearglobal', + 'closeEditor', + 'closeEditvar', + 'closeXcos', + 'code2str', + 'coeff', + 'color', + 'comp', + 'completion', + 'conj', + 'contour2di', + 'contr', + 'conv2', + 'convstr', + 'copy', + 'copyfile', + 'corr', + 'cos', + 'coserror', + 'createdir', + 'cshep2d', + 'csvDefault', + 'csvIsnum', + 'csvRead', + 'csvStringToDouble', + 'csvTextScan', + 'csvWrite', + 'ctree2', + 'ctree3', + 'ctree4', + 'cumprod', + 'cumsum', + 'curblock', + 'curblockc', + 'daskr', + 'dasrt', + 'dassl', + 'data2sig', + 'datatipCreate', + 'datatipManagerMode', + 'datatipMove', + 'datatipRemove', + 'datatipSetDisplay', + 'datatipSetInterp', + 'datatipSetOrientation', + 'datatipSetStyle', + 'datatipToggle', + 'dawson', + 'dct', + 'debug', + 'dec2base', + 'deff', + 'definedfields', + 'degree', + 'delbpt', + 'delete', + 'deletefile', + 'delip', + 'delmenu', + 'det', + 'dgettext', + 'dhinf', + 'diag', + 'diary', + 'diffobjs', + 'disp', + 'dispbpt', + 'displayhistory', + 'disposefftwlibrary', + 'dlgamma', + 'dnaupd', + 'dneupd', + 'double', + 'drawaxis', + 'drawlater', + 'drawnow', + 'driver', + 'dsaupd', + 'dsearch', + 'dseupd', + 'dst', + 'duplicate', + 'editvar', + 'emptystr', + 'end_scicosim', + 'ereduc', + 'erf', + 'erfc', + 'erfcx', + 'erfi', + 'errcatch', + 'errclear', + 'error', + 'eval_cshep2d', + 'exec', + 'execstr', + 'exists', + 'exit', + 'exp', + 'expm', + 'exportUI', + 'export_to_hdf5', + 'eye', + 'fadj2sp', + 'fec', + 'feval', + 'fft', + 'fftw', + 'fftw_flags', + 'fftw_forget_wisdom', + 'fftwlibraryisloaded', + 'figure', + 'file', + 'filebrowser', + 'fileext', + 'fileinfo', + 'fileparts', + 'filesep', + 'find', + 'findBD', + 'findfiles', + 'fire_closing_finished', + 'floor', + 'format', + 'fort', + 'fprintfMat', + 'freq', + 'frexp', + 'fromc', + 'fromjava', + 'fscanfMat', + 'fsolve', + 'fstair', + 'full', + 'fullpath', + 'funcprot', + 'funptr', + 'gamma', + 'gammaln', + 'geom3d', + 'get', + 'getURL', + 'get_absolute_file_path', + 'get_fftw_wisdom', + 'getblocklabel', + 'getcallbackobject', + 'getdate', + 'getdebuginfo', + 'getdefaultlanguage', + 'getdrives', + 'getdynlibext', + 'getenv', + 'getfield', + 'gethistory', + 'gethistoryfile', + 'getinstalledlookandfeels', + 'getio', + 'getlanguage', + 'getlongpathname', + 'getlookandfeel', + 'getmd5', + 'getmemory', + 'getmodules', + 'getos', + 'getpid', + 'getrelativefilename', + 'getscicosvars', + 'getscilabmode', + 'getshortpathname', + 'gettext', + 'getvariablesonstack', + 'getversion', + 'glist', + 'global', + 'glue', + 'grand', + 'graphicfunction', + 'grayplot', + 'grep', + 'gsort', + 'gstacksize', + 'h5attr', + 'h5close', + 'h5cp', + 'h5dataset', + 'h5dump', + 'h5exists', + 'h5flush', + 'h5get', + 'h5group', + 'h5isArray', + 'h5isAttr', + 'h5isCompound', + 'h5isFile', + 'h5isGroup', + 'h5isList', + 'h5isRef', + 'h5isSet', + 'h5isSpace', + 'h5isType', + 'h5isVlen', + 'h5label', + 'h5ln', + 'h5ls', + 'h5mount', + 'h5mv', + 'h5open', + 'h5read', + 'h5readattr', + 'h5rm', + 'h5umount', + 'h5write', + 'h5writeattr', + 'havewindow', + 'helpbrowser', + 'hess', + 'hinf', + 'historymanager', + 'historysize', + 'host', + 'htmlDump', + 'htmlRead', + 'htmlReadStr', + 'htmlWrite', + 'iconvert', + 'ieee', + 'ilib_verbose', + 'imag', + 'impl', + 'import_from_hdf5', + 'imult', + 'inpnvi', + 'int', + 'int16', + 'int2d', + 'int32', + 'int3d', + 'int8', + 'interp', + 'interp2d', + 'interp3d', + 'intg', + 'intppty', + 'inttype', + 'inv', + 'invoke_lu', + 'is_handle_valid', + 'is_hdf5_file', + 'isalphanum', + 'isascii', + 'isdef', + 'isdigit', + 'isdir', + 'isequal', + 'isequalbitwise', + 'iserror', + 'isfile', + 'isglobal', + 'isletter', + 'isnum', + 'isreal', + 'iswaitingforinput', + 'jallowClassReloading', + 'jarray', + 'jautoTranspose', + 'jautoUnwrap', + 'javaclasspath', + 'javalibrarypath', + 'jcast', + 'jcompile', + 'jconvMatrixMethod', + 'jcreatejar', + 'jdeff', + 'jdisableTrace', + 'jenableTrace', + 'jexists', + 'jgetclassname', + 'jgetfield', + 'jgetfields', + 'jgetinfo', + 'jgetmethods', + 'jimport', + 'jinvoke', + 'jinvoke_db', + 'jnewInstance', + 'jremove', + 'jsetfield', + 'junwrap', + 'junwraprem', + 'jwrap', + 'jwrapinfloat', + 'kron', + 'lasterror', + 'ldiv', + 'ldivf', + 'legendre', + 'length', + 'lib', + 'librarieslist', + 'libraryinfo', + 'light', + 'linear_interpn', + 'lines', + 'link', + 'linmeq', + 'list', + 'listvar_in_hdf5', + 'load', + 'loadGui', + 'loadScicos', + 'loadXcos', + 'loadfftwlibrary', + 'loadhistory', + 'log', + 'log1p', + 'lsq', + 'lsq_splin', + 'lsqrsolve', + 'lsslist', + 'lstcat', + 'lstsize', + 'ltitr', + 'lu', + 'ludel', + 'lufact', + 'luget', + 'lusolve', + 'macr2lst', + 'macr2tree', + 'matfile_close', + 'matfile_listvar', + 'matfile_open', + 'matfile_varreadnext', + 'matfile_varwrite', + 'matrix', + 'max', + 'maxfiles', + 'mclearerr', + 'mclose', + 'meof', + 'merror', + 'messagebox', + 'mfprintf', + 'mfscanf', + 'mget', + 'mgeti', + 'mgetl', + 'mgetstr', + 'min', + 'mlist', + 'mode', + 'model2blk', + 'mopen', + 'move', + 'movefile', + 'mprintf', + 'mput', + 'mputl', + 'mputstr', + 'mscanf', + 'mseek', + 'msprintf', + 'msscanf', + 'mtell', + 'mtlb_mode', + 'mtlb_sparse', + 'mucomp', + 'mulf', + 'name2rgb', + 'nearfloat', + 'newaxes', + 'newest', + 'newfun', + 'nnz', + 'norm', + 'notify', + 'number_properties', + 'ode', + 'odedc', + 'ones', + 'openged', + 'opentk', + 'optim', + 'or', + 'ordmmd', + 'parallel_concurrency', + 'parallel_run', + 'param3d', + 'param3d1', + 'part', + 'pathconvert', + 'pathsep', + 'phase_simulation', + 'plot2d', + 'plot2d1', + 'plot2d2', + 'plot2d3', + 'plot2d4', + 'plot3d', + 'plot3d1', + 'plotbrowser', + 'pointer_xproperty', + 'poly', + 'ppol', + 'pppdiv', + 'predef', + 'preferences', + 'print', + 'printf', + 'printfigure', + 'printsetupbox', + 'prod', + 'progressionbar', + 'prompt', + 'pwd', + 'qld', + 'qp_solve', + 'qr', + 'raise_window', + 'rand', + 'rankqr', + 'rat', + 'rcond', + 'rdivf', + 'read', + 'read4b', + 'read_csv', + 'readb', + 'readgateway', + 'readmps', + 'real', + 'realtime', + 'realtimeinit', + 'regexp', + 'relocate_handle', + 'remez', + 'removeModulePreferences', + 'removedir', + 'removelinehistory', + 'res_with_prec', + 'resethistory', + 'residu', + 'resume', + 'return', + 'ricc', + 'rlist', + 'roots', + 'rotate_axes', + 'round', + 'rpem', + 'rtitr', + 'rubberbox', + 'save', + 'saveGui', + 'saveafterncommands', + 'saveconsecutivecommands', + 'savehistory', + 'schur', + 'sci_haltscicos', + 'sci_tree2', + 'sci_tree3', + 'sci_tree4', + 'sciargs', + 'scicos_debug', + 'scicos_debug_count', + 'scicos_time', + 'scicosim', + 'scinotes', + 'sctree', + 'semidef', + 'set', + 'set_blockerror', + 'set_fftw_wisdom', + 'set_xproperty', + 'setbpt', + 'setdefaultlanguage', + 'setenv', + 'setfield', + 'sethistoryfile', + 'setlanguage', + 'setlookandfeel', + 'setmenu', + 'sfact', + 'sfinit', + 'show_window', + 'sident', + 'sig2data', + 'sign', + 'simp', + 'simp_mode', + 'sin', + 'size', + 'slash', + 'sleep', + 'sorder', + 'sparse', + 'spchol', + 'spcompack', + 'spec', + 'spget', + 'splin', + 'splin2d', + 'splin3d', + 'splitURL', + 'spones', + 'sprintf', + 'sqrt', + 'stacksize', + 'str2code', + 'strcat', + 'strchr', + 'strcmp', + 'strcspn', + 'strindex', + 'string', + 'stringbox', + 'stripblanks', + 'strncpy', + 'strrchr', + 'strrev', + 'strsplit', + 'strspn', + 'strstr', + 'strsubst', + 'strtod', + 'strtok', + 'subf', + 'sum', + 'svd', + 'swap_handles', + 'symfcti', + 'syredi', + 'system_getproperty', + 'system_setproperty', + 'ta2lpd', + 'tan', + 'taucs_chdel', + 'taucs_chfact', + 'taucs_chget', + 'taucs_chinfo', + 'taucs_chsolve', + 'tempname', + 'testmatrix', + 'timer', + 'tlist', + 'tohome', + 'tokens', + 'toolbar', + 'toprint', + 'tr_zer', + 'tril', + 'triu', + 'type', + 'typename', + 'uiDisplayTree', + 'uicontextmenu', + 'uicontrol', + 'uigetcolor', + 'uigetdir', + 'uigetfile', + 'uigetfont', + 'uimenu', + 'uint16', + 'uint32', + 'uint8', + 'uipopup', + 'uiputfile', + 'uiwait', + 'ulink', + 'umf_ludel', + 'umf_lufact', + 'umf_luget', + 'umf_luinfo', + 'umf_lusolve', + 'umfpack', + 'unglue', + 'unix', + 'unsetmenu', + 'unzoom', + 'updatebrowsevar', + 'usecanvas', + 'useeditor', + 'user', + 'var2vec', + 'varn', + 'vec2var', + 'waitbar', + 'warnBlockByUID', + 'warning', + 'what', + 'where', + 'whereis', + 'who', + 'winsid', + 'with_module', + 'writb', + 'write', + 'write4b', + 'write_csv', + 'x_choose', + 'x_choose_modeless', + 'x_dialog', + 'x_mdialog', + 'xarc', + 'xarcs', + 'xarrows', + 'xchange', + 'xchoicesi', + 'xclick', + 'xcos', + 'xcosAddToolsMenu', + 'xcosConfigureXmlFile', + 'xcosDiagramToScilab', + 'xcosPalCategoryAdd', + 'xcosPalDelete', + 'xcosPalDisable', + 'xcosPalEnable', + 'xcosPalGenerateIcon', + 'xcosPalGet', + 'xcosPalLoad', + 'xcosPalMove', + 'xcosSimulationStarted', + 'xcosUpdateBlock', + 'xdel', + 'xend', + 'xfarc', + 'xfarcs', + 'xfpoly', + 'xfpolys', + 'xfrect', + 'xget', + 'xgetmouse', + 'xgraduate', + 'xgrid', + 'xinit', + 'xlfont', + 'xls_open', + 'xls_read', + 'xmlAddNs', + 'xmlAppend', + 'xmlAsNumber', + 'xmlAsText', + 'xmlDTD', + 'xmlDelete', + 'xmlDocument', + 'xmlDump', + 'xmlElement', + 'xmlFormat', + 'xmlGetNsByHref', + 'xmlGetNsByPrefix', + 'xmlGetOpenDocs', + 'xmlIsValidObject', + 'xmlName', + 'xmlNs', + 'xmlRead', + 'xmlReadStr', + 'xmlRelaxNG', + 'xmlRemove', + 'xmlSchema', + 'xmlSetAttributes', + 'xmlValidate', + 'xmlWrite', + 'xmlXPath', + 'xname', + 'xpause', + 'xpoly', + 'xpolys', + 'xrect', + 'xrects', + 'xs2bmp', + 'xs2emf', + 'xs2eps', + 'xs2gif', + 'xs2jpg', + 'xs2pdf', + 'xs2png', + 'xs2ppm', + 'xs2ps', + 'xs2svg', + 'xsegs', + 'xset', + 'xstring', + 'xstringb', + 'xtitle', + 'zeros', + 'znaupd', + 'zneupd', + 'zoom_rect', +) + +macros_kw = ( + '!_deff_wrapper', + '%0_i_st', + '%3d_i_h', + '%Block_xcosUpdateBlock', + '%TNELDER_p', + '%TNELDER_string', + '%TNMPLOT_p', + '%TNMPLOT_string', + '%TOPTIM_p', + '%TOPTIM_string', + '%TSIMPLEX_p', + '%TSIMPLEX_string', + '%_EVoid_p', + '%_gsort', + '%_listvarinfile', + '%_rlist', + '%_save', + '%_sodload', + '%_strsplit', + '%_unwrap', + '%ar_p', + '%asn', + '%b_a_b', + '%b_a_s', + '%b_c_s', + '%b_c_spb', + '%b_cumprod', + '%b_cumsum', + '%b_d_s', + '%b_diag', + '%b_e', + '%b_f_s', + '%b_f_spb', + '%b_g_s', + '%b_g_spb', + '%b_grand', + '%b_h_s', + '%b_h_spb', + '%b_i_b', + '%b_i_ce', + '%b_i_h', + '%b_i_hm', + '%b_i_s', + '%b_i_sp', + '%b_i_spb', + '%b_i_st', + '%b_iconvert', + '%b_l_b', + '%b_l_s', + '%b_m_b', + '%b_m_s', + '%b_matrix', + '%b_n_hm', + '%b_o_hm', + '%b_p_s', + '%b_prod', + '%b_r_b', + '%b_r_s', + '%b_s_b', + '%b_s_s', + '%b_string', + '%b_sum', + '%b_tril', + '%b_triu', + '%b_x_b', + '%b_x_s', + '%bicg', + '%bicgstab', + '%c_a_c', + '%c_b_c', + '%c_b_s', + '%c_diag', + '%c_dsearch', + '%c_e', + '%c_eye', + '%c_f_s', + '%c_grand', + '%c_i_c', + '%c_i_ce', + '%c_i_h', + '%c_i_hm', + '%c_i_lss', + '%c_i_r', + '%c_i_s', + '%c_i_st', + '%c_matrix', + '%c_n_l', + '%c_n_st', + '%c_o_l', + '%c_o_st', + '%c_ones', + '%c_rand', + '%c_tril', + '%c_triu', + '%cblock_c_cblock', + '%cblock_c_s', + '%cblock_e', + '%cblock_f_cblock', + '%cblock_p', + '%cblock_size', + '%ce_6', + '%ce_c_ce', + '%ce_e', + '%ce_f_ce', + '%ce_i_ce', + '%ce_i_s', + '%ce_i_st', + '%ce_matrix', + '%ce_p', + '%ce_size', + '%ce_string', + '%ce_t', + '%cgs', + '%champdat_i_h', + '%choose', + '%diagram_xcos', + '%dir_p', + '%fptr_i_st', + '%grand_perm', + '%grayplot_i_h', + '%h_i_st', + '%hmS_k_hmS_generic', + '%hm_1_hm', + '%hm_1_s', + '%hm_2_hm', + '%hm_2_s', + '%hm_3_hm', + '%hm_3_s', + '%hm_4_hm', + '%hm_4_s', + '%hm_5', + '%hm_a_hm', + '%hm_a_r', + '%hm_a_s', + '%hm_abs', + '%hm_and', + '%hm_bool2s', + '%hm_c_hm', + '%hm_ceil', + '%hm_conj', + '%hm_cos', + '%hm_cumprod', + '%hm_cumsum', + '%hm_d_hm', + '%hm_d_s', + '%hm_degree', + '%hm_dsearch', + '%hm_e', + '%hm_exp', + '%hm_eye', + '%hm_f_hm', + '%hm_find', + '%hm_floor', + '%hm_g_hm', + '%hm_grand', + '%hm_gsort', + '%hm_h_hm', + '%hm_i_b', + '%hm_i_ce', + '%hm_i_h', + '%hm_i_hm', + '%hm_i_i', + '%hm_i_p', + '%hm_i_r', + '%hm_i_s', + '%hm_i_st', + '%hm_iconvert', + '%hm_imag', + '%hm_int', + '%hm_isnan', + '%hm_isreal', + '%hm_j_hm', + '%hm_j_s', + '%hm_k_hm', + '%hm_k_s', + '%hm_log', + '%hm_m_p', + '%hm_m_r', + '%hm_m_s', + '%hm_matrix', + '%hm_max', + '%hm_mean', + '%hm_median', + '%hm_min', + '%hm_n_b', + '%hm_n_c', + '%hm_n_hm', + '%hm_n_i', + '%hm_n_p', + '%hm_n_s', + '%hm_o_b', + '%hm_o_c', + '%hm_o_hm', + '%hm_o_i', + '%hm_o_p', + '%hm_o_s', + '%hm_ones', + '%hm_or', + '%hm_p', + '%hm_prod', + '%hm_q_hm', + '%hm_r_s', + '%hm_rand', + '%hm_real', + '%hm_round', + '%hm_s', + '%hm_s_hm', + '%hm_s_r', + '%hm_s_s', + '%hm_sign', + '%hm_sin', + '%hm_size', + '%hm_sqrt', + '%hm_stdev', + '%hm_string', + '%hm_sum', + '%hm_x_hm', + '%hm_x_p', + '%hm_x_s', + '%hm_zeros', + '%i_1_s', + '%i_2_s', + '%i_3_s', + '%i_4_s', + '%i_Matplot', + '%i_a_i', + '%i_a_s', + '%i_and', + '%i_ascii', + '%i_b_s', + '%i_bezout', + '%i_champ', + '%i_champ1', + '%i_contour', + '%i_contour2d', + '%i_d_i', + '%i_d_s', + '%i_dsearch', + '%i_e', + '%i_fft', + '%i_g_i', + '%i_gcd', + '%i_grand', + '%i_h_i', + '%i_i_ce', + '%i_i_h', + '%i_i_hm', + '%i_i_i', + '%i_i_s', + '%i_i_st', + '%i_j_i', + '%i_j_s', + '%i_l_s', + '%i_lcm', + '%i_length', + '%i_m_i', + '%i_m_s', + '%i_mfprintf', + '%i_mprintf', + '%i_msprintf', + '%i_n_s', + '%i_o_s', + '%i_or', + '%i_p_i', + '%i_p_s', + '%i_plot2d', + '%i_plot2d1', + '%i_plot2d2', + '%i_q_s', + '%i_r_i', + '%i_r_s', + '%i_round', + '%i_s_i', + '%i_s_s', + '%i_sign', + '%i_string', + '%i_x_i', + '%i_x_s', + '%ip_a_s', + '%ip_i_st', + '%ip_m_s', + '%ip_n_ip', + '%ip_o_ip', + '%ip_p', + '%ip_part', + '%ip_s_s', + '%ip_string', + '%k', + '%l_i_h', + '%l_i_s', + '%l_i_st', + '%l_isequal', + '%l_n_c', + '%l_n_l', + '%l_n_m', + '%l_n_p', + '%l_n_s', + '%l_n_st', + '%l_o_c', + '%l_o_l', + '%l_o_m', + '%l_o_p', + '%l_o_s', + '%l_o_st', + '%lss_a_lss', + '%lss_a_p', + '%lss_a_r', + '%lss_a_s', + '%lss_c_lss', + '%lss_c_p', + '%lss_c_r', + '%lss_c_s', + '%lss_e', + '%lss_eye', + '%lss_f_lss', + '%lss_f_p', + '%lss_f_r', + '%lss_f_s', + '%lss_i_ce', + '%lss_i_lss', + '%lss_i_p', + '%lss_i_r', + '%lss_i_s', + '%lss_i_st', + '%lss_inv', + '%lss_l_lss', + '%lss_l_p', + '%lss_l_r', + '%lss_l_s', + '%lss_m_lss', + '%lss_m_p', + '%lss_m_r', + '%lss_m_s', + '%lss_n_lss', + '%lss_n_p', + '%lss_n_r', + '%lss_n_s', + '%lss_norm', + '%lss_o_lss', + '%lss_o_p', + '%lss_o_r', + '%lss_o_s', + '%lss_ones', + '%lss_r_lss', + '%lss_r_p', + '%lss_r_r', + '%lss_r_s', + '%lss_rand', + '%lss_s', + '%lss_s_lss', + '%lss_s_p', + '%lss_s_r', + '%lss_s_s', + '%lss_size', + '%lss_t', + '%lss_v_lss', + '%lss_v_p', + '%lss_v_r', + '%lss_v_s', + '%lt_i_s', + '%m_n_l', + '%m_o_l', + '%mc_i_h', + '%mc_i_s', + '%mc_i_st', + '%mc_n_st', + '%mc_o_st', + '%mc_string', + '%mps_p', + '%mps_string', + '%msp_a_s', + '%msp_abs', + '%msp_e', + '%msp_find', + '%msp_i_s', + '%msp_i_st', + '%msp_length', + '%msp_m_s', + '%msp_maxi', + '%msp_n_msp', + '%msp_nnz', + '%msp_o_msp', + '%msp_p', + '%msp_sparse', + '%msp_spones', + '%msp_t', + '%p_a_lss', + '%p_a_r', + '%p_c_lss', + '%p_c_r', + '%p_cumprod', + '%p_cumsum', + '%p_d_p', + '%p_d_r', + '%p_d_s', + '%p_det', + '%p_e', + '%p_f_lss', + '%p_f_r', + '%p_grand', + '%p_i_ce', + '%p_i_h', + '%p_i_hm', + '%p_i_lss', + '%p_i_p', + '%p_i_r', + '%p_i_s', + '%p_i_st', + '%p_inv', + '%p_j_s', + '%p_k_p', + '%p_k_r', + '%p_k_s', + '%p_l_lss', + '%p_l_p', + '%p_l_r', + '%p_l_s', + '%p_m_hm', + '%p_m_lss', + '%p_m_r', + '%p_matrix', + '%p_n_l', + '%p_n_lss', + '%p_n_r', + '%p_o_l', + '%p_o_lss', + '%p_o_r', + '%p_o_sp', + '%p_p_s', + '%p_part', + '%p_prod', + '%p_q_p', + '%p_q_r', + '%p_q_s', + '%p_r_lss', + '%p_r_p', + '%p_r_r', + '%p_r_s', + '%p_s_lss', + '%p_s_r', + '%p_simp', + '%p_string', + '%p_sum', + '%p_v_lss', + '%p_v_p', + '%p_v_r', + '%p_v_s', + '%p_x_hm', + '%p_x_r', + '%p_y_p', + '%p_y_r', + '%p_y_s', + '%p_z_p', + '%p_z_r', + '%p_z_s', + '%pcg', + '%plist_p', + '%plist_string', + '%r_0', + '%r_a_hm', + '%r_a_lss', + '%r_a_p', + '%r_a_r', + '%r_a_s', + '%r_c_lss', + '%r_c_p', + '%r_c_r', + '%r_c_s', + '%r_clean', + '%r_cumprod', + '%r_cumsum', + '%r_d_p', + '%r_d_r', + '%r_d_s', + '%r_det', + '%r_diag', + '%r_e', + '%r_eye', + '%r_f_lss', + '%r_f_p', + '%r_f_r', + '%r_f_s', + '%r_i_ce', + '%r_i_hm', + '%r_i_lss', + '%r_i_p', + '%r_i_r', + '%r_i_s', + '%r_i_st', + '%r_inv', + '%r_j_s', + '%r_k_p', + '%r_k_r', + '%r_k_s', + '%r_l_lss', + '%r_l_p', + '%r_l_r', + '%r_l_s', + '%r_m_hm', + '%r_m_lss', + '%r_m_p', + '%r_m_r', + '%r_m_s', + '%r_matrix', + '%r_n_lss', + '%r_n_p', + '%r_n_r', + '%r_n_s', + '%r_norm', + '%r_o_lss', + '%r_o_p', + '%r_o_r', + '%r_o_s', + '%r_ones', + '%r_p', + '%r_p_s', + '%r_prod', + '%r_q_p', + '%r_q_r', + '%r_q_s', + '%r_r_lss', + '%r_r_p', + '%r_r_r', + '%r_r_s', + '%r_rand', + '%r_s', + '%r_s_hm', + '%r_s_lss', + '%r_s_p', + '%r_s_r', + '%r_s_s', + '%r_simp', + '%r_size', + '%r_string', + '%r_sum', + '%r_t', + '%r_tril', + '%r_triu', + '%r_v_lss', + '%r_v_p', + '%r_v_r', + '%r_v_s', + '%r_varn', + '%r_x_p', + '%r_x_r', + '%r_x_s', + '%r_y_p', + '%r_y_r', + '%r_y_s', + '%r_z_p', + '%r_z_r', + '%r_z_s', + '%s_1_hm', + '%s_1_i', + '%s_2_hm', + '%s_2_i', + '%s_3_hm', + '%s_3_i', + '%s_4_hm', + '%s_4_i', + '%s_5', + '%s_a_b', + '%s_a_hm', + '%s_a_i', + '%s_a_ip', + '%s_a_lss', + '%s_a_msp', + '%s_a_r', + '%s_a_sp', + '%s_and', + '%s_b_i', + '%s_b_s', + '%s_bezout', + '%s_c_b', + '%s_c_cblock', + '%s_c_lss', + '%s_c_r', + '%s_c_sp', + '%s_d_b', + '%s_d_i', + '%s_d_p', + '%s_d_r', + '%s_d_sp', + '%s_e', + '%s_f_b', + '%s_f_cblock', + '%s_f_lss', + '%s_f_r', + '%s_f_sp', + '%s_g_b', + '%s_g_s', + '%s_gcd', + '%s_grand', + '%s_h_b', + '%s_h_s', + '%s_i_b', + '%s_i_c', + '%s_i_ce', + '%s_i_h', + '%s_i_hm', + '%s_i_i', + '%s_i_lss', + '%s_i_p', + '%s_i_r', + '%s_i_s', + '%s_i_sp', + '%s_i_spb', + '%s_i_st', + '%s_j_i', + '%s_k_hm', + '%s_k_p', + '%s_k_r', + '%s_k_sp', + '%s_l_b', + '%s_l_hm', + '%s_l_i', + '%s_l_lss', + '%s_l_p', + '%s_l_r', + '%s_l_s', + '%s_l_sp', + '%s_lcm', + '%s_m_b', + '%s_m_hm', + '%s_m_i', + '%s_m_ip', + '%s_m_lss', + '%s_m_msp', + '%s_m_r', + '%s_matrix', + '%s_n_hm', + '%s_n_i', + '%s_n_l', + '%s_n_lss', + '%s_n_r', + '%s_n_st', + '%s_o_hm', + '%s_o_i', + '%s_o_l', + '%s_o_lss', + '%s_o_r', + '%s_o_st', + '%s_or', + '%s_p_b', + '%s_p_i', + '%s_pow', + '%s_q_hm', + '%s_q_i', + '%s_q_p', + '%s_q_r', + '%s_q_sp', + '%s_r_b', + '%s_r_i', + '%s_r_lss', + '%s_r_p', + '%s_r_r', + '%s_r_s', + '%s_r_sp', + '%s_s_b', + '%s_s_hm', + '%s_s_i', + '%s_s_ip', + '%s_s_lss', + '%s_s_r', + '%s_s_sp', + '%s_simp', + '%s_v_lss', + '%s_v_p', + '%s_v_r', + '%s_v_s', + '%s_x_b', + '%s_x_hm', + '%s_x_i', + '%s_x_r', + '%s_y_p', + '%s_y_r', + '%s_y_sp', + '%s_z_p', + '%s_z_r', + '%s_z_sp', + '%sn', + '%sp_a_s', + '%sp_a_sp', + '%sp_and', + '%sp_c_s', + '%sp_ceil', + '%sp_conj', + '%sp_cos', + '%sp_cumprod', + '%sp_cumsum', + '%sp_d_s', + '%sp_d_sp', + '%sp_det', + '%sp_diag', + '%sp_e', + '%sp_exp', + '%sp_f_s', + '%sp_floor', + '%sp_grand', + '%sp_gsort', + '%sp_i_ce', + '%sp_i_h', + '%sp_i_s', + '%sp_i_sp', + '%sp_i_st', + '%sp_int', + '%sp_inv', + '%sp_k_s', + '%sp_k_sp', + '%sp_l_s', + '%sp_l_sp', + '%sp_length', + '%sp_max', + '%sp_min', + '%sp_norm', + '%sp_or', + '%sp_p_s', + '%sp_prod', + '%sp_q_s', + '%sp_q_sp', + '%sp_r_s', + '%sp_r_sp', + '%sp_round', + '%sp_s_s', + '%sp_s_sp', + '%sp_sin', + '%sp_sqrt', + '%sp_string', + '%sp_sum', + '%sp_tril', + '%sp_triu', + '%sp_y_s', + '%sp_y_sp', + '%sp_z_s', + '%sp_z_sp', + '%spb_and', + '%spb_c_b', + '%spb_cumprod', + '%spb_cumsum', + '%spb_diag', + '%spb_e', + '%spb_f_b', + '%spb_g_b', + '%spb_g_spb', + '%spb_h_b', + '%spb_h_spb', + '%spb_i_b', + '%spb_i_ce', + '%spb_i_h', + '%spb_i_st', + '%spb_or', + '%spb_prod', + '%spb_sum', + '%spb_tril', + '%spb_triu', + '%st_6', + '%st_c_st', + '%st_e', + '%st_f_st', + '%st_i_b', + '%st_i_c', + '%st_i_fptr', + '%st_i_h', + '%st_i_i', + '%st_i_ip', + '%st_i_lss', + '%st_i_msp', + '%st_i_p', + '%st_i_r', + '%st_i_s', + '%st_i_sp', + '%st_i_spb', + '%st_i_st', + '%st_matrix', + '%st_n_c', + '%st_n_l', + '%st_n_mc', + '%st_n_p', + '%st_n_s', + '%st_o_c', + '%st_o_l', + '%st_o_mc', + '%st_o_p', + '%st_o_s', + '%st_o_tl', + '%st_p', + '%st_size', + '%st_string', + '%st_t', + '%ticks_i_h', + '%xls_e', + '%xls_p', + '%xlssheet_e', + '%xlssheet_p', + '%xlssheet_size', + '%xlssheet_string', + 'DominationRank', + 'G_make', + 'IsAScalar', + 'NDcost', + 'OS_Version', + 'PlotSparse', + 'ReadHBSparse', + 'TCL_CreateSlave', + 'abcd', + 'abinv', + 'accept_func_default', + 'accept_func_vfsa', + 'acf', + 'acosd', + 'acosh', + 'acoshm', + 'acosm', + 'acot', + 'acotd', + 'acoth', + 'acsc', + 'acscd', + 'acsch', + 'add_demo', + 'add_help_chapter', + 'add_module_help_chapter', + 'add_param', + 'add_profiling', + 'adj2sp', + 'aff2ab', + 'ana_style', + 'analpf', + 'analyze', + 'aplat', + 'arhnk', + 'arl2', + 'arma2p', + 'arma2ss', + 'armac', + 'armax', + 'armax1', + 'arobasestring2strings', + 'arsimul', + 'ascii2string', + 'asciimat', + 'asec', + 'asecd', + 'asech', + 'asind', + 'asinh', + 'asinhm', + 'asinm', + 'assert_checkalmostequal', + 'assert_checkequal', + 'assert_checkerror', + 'assert_checkfalse', + 'assert_checkfilesequal', + 'assert_checktrue', + 'assert_comparecomplex', + 'assert_computedigits', + 'assert_cond2reltol', + 'assert_cond2reqdigits', + 'assert_generror', + 'atand', + 'atanh', + 'atanhm', + 'atanm', + 'atomsAutoload', + 'atomsAutoloadAdd', + 'atomsAutoloadDel', + 'atomsAutoloadList', + 'atomsCategoryList', + 'atomsCheckModule', + 'atomsDepTreeShow', + 'atomsGetConfig', + 'atomsGetInstalled', + 'atomsGetInstalledPath', + 'atomsGetLoaded', + 'atomsGetLoadedPath', + 'atomsInstall', + 'atomsIsInstalled', + 'atomsIsLoaded', + 'atomsList', + 'atomsLoad', + 'atomsQuit', + 'atomsRemove', + 'atomsRepositoryAdd', + 'atomsRepositoryDel', + 'atomsRepositoryList', + 'atomsRestoreConfig', + 'atomsSaveConfig', + 'atomsSearch', + 'atomsSetConfig', + 'atomsShow', + 'atomsSystemInit', + 'atomsSystemUpdate', + 'atomsTest', + 'atomsUpdate', + 'atomsVersion', + 'augment', + 'auread', + 'auwrite', + 'balreal', + 'bench_run', + 'bilin', + 'bilt', + 'bin2dec', + 'binomial', + 'bitand', + 'bitcmp', + 'bitget', + 'bitor', + 'bitset', + 'bitxor', + 'black', + 'blanks', + 'bloc2exp', + 'bloc2ss', + 'block_parameter_error', + 'bode', + 'bode_asymp', + 'bstap', + 'buttmag', + 'bvodeS', + 'bytecode', + 'bytecodewalk', + 'cainv', + 'calendar', + 'calerf', + 'calfrq', + 'canon', + 'casc', + 'cat', + 'cat_code', + 'cb_m2sci_gui', + 'ccontrg', + 'cell', + 'cell2mat', + 'cellstr', + 'center', + 'cepstrum', + 'cfspec', + 'char', + 'chart', + 'cheb1mag', + 'cheb2mag', + 'check_gateways', + 'check_modules_xml', + 'check_versions', + 'chepol', + 'chfact', + 'chsolve', + 'classmarkov', + 'clean_help', + 'clock', + 'cls2dls', + 'cmb_lin', + 'cmndred', + 'cmoment', + 'coding_ga_binary', + 'coding_ga_identity', + 'coff', + 'coffg', + 'colcomp', + 'colcompr', + 'colinout', + 'colregul', + 'companion', + 'complex', + 'compute_initial_temp', + 'cond', + 'cond2sp', + 'condestsp', + 'configure_msifort', + 'configure_msvc', + 'conjgrad', + 'cont_frm', + 'cont_mat', + 'contrss', + 'conv', + 'convert_to_float', + 'convertindex', + 'convol', + 'convol2d', + 'copfac', + 'correl', + 'cosd', + 'cosh', + 'coshm', + 'cosm', + 'cotd', + 'cotg', + 'coth', + 'cothm', + 'cov', + 'covar', + 'createXConfiguration', + 'createfun', + 'createstruct', + 'cross', + 'crossover_ga_binary', + 'crossover_ga_default', + 'csc', + 'cscd', + 'csch', + 'csgn', + 'csim', + 'cspect', + 'ctr_gram', + 'czt', + 'dae', + 'daeoptions', + 'damp', + 'datafit', + 'date', + 'datenum', + 'datevec', + 'dbphi', + 'dcf', + 'ddp', + 'dec2bin', + 'dec2hex', + 'dec2oct', + 'del_help_chapter', + 'del_module_help_chapter', + 'demo_begin', + 'demo_choose', + 'demo_compiler', + 'demo_end', + 'demo_file_choice', + 'demo_folder_choice', + 'demo_function_choice', + 'demo_gui', + 'demo_run', + 'demo_viewCode', + 'denom', + 'derivat', + 'derivative', + 'des2ss', + 'des2tf', + 'detectmsifort64tools', + 'detectmsvc64tools', + 'determ', + 'detr', + 'detrend', + 'devtools_run_builder', + 'dhnorm', + 'diff', + 'diophant', + 'dir', + 'dirname', + 'dispfiles', + 'dllinfo', + 'dscr', + 'dsimul', + 'dt_ility', + 'dtsi', + 'edit', + 'edit_error', + 'editor', + 'eigenmarkov', + 'eigs', + 'ell1mag', + 'enlarge_shape', + 'entropy', + 'eomday', + 'epred', + 'eqfir', + 'eqiir', + 'equil', + 'equil1', + 'erfinv', + 'etime', + 'eval', + 'evans', + 'evstr', + 'example_run', + 'expression2code', + 'extract_help_examples', + 'factor', + 'factorial', + 'factors', + 'faurre', + 'ffilt', + 'fft2', + 'fftshift', + 'fieldnames', + 'filt_sinc', + 'filter', + 'findABCD', + 'findAC', + 'findBDK', + 'findR', + 'find_freq', + 'find_links', + 'find_scicos_version', + 'findm', + 'findmsifortcompiler', + 'findmsvccompiler', + 'findx0BD', + 'firstnonsingleton', + 'fix', + 'fixedpointgcd', + 'flipdim', + 'flts', + 'fminsearch', + 'formatBlackTip', + 'formatBodeMagTip', + 'formatBodePhaseTip', + 'formatGainplotTip', + 'formatHallModuleTip', + 'formatHallPhaseTip', + 'formatNicholsGainTip', + 'formatNicholsPhaseTip', + 'formatNyquistTip', + 'formatPhaseplotTip', + 'formatSgridDampingTip', + 'formatSgridFreqTip', + 'formatZgridDampingTip', + 'formatZgridFreqTip', + 'format_txt', + 'fourplan', + 'frep2tf', + 'freson', + 'frfit', + 'frmag', + 'fseek_origin', + 'fsfirlin', + 'fspec', + 'fspecg', + 'fstabst', + 'ftest', + 'ftuneq', + 'fullfile', + 'fullrf', + 'fullrfk', + 'fun2string', + 'g_margin', + 'gainplot', + 'gamitg', + 'gcare', + 'gcd', + 'gencompilationflags_unix', + 'generateBlockImage', + 'generateBlockImages', + 'generic_i_ce', + 'generic_i_h', + 'generic_i_hm', + 'generic_i_s', + 'generic_i_st', + 'genlib', + 'genmarkov', + 'geomean', + 'getDiagramVersion', + 'getModelicaPath', + 'getPreferencesValue', + 'get_file_path', + 'get_function_path', + 'get_param', + 'get_profile', + 'get_scicos_version', + 'getd', + 'getscilabkeywords', + 'getshell', + 'gettklib', + 'gfare', + 'gfrancis', + 'givens', + 'glever', + 'gmres', + 'group', + 'gschur', + 'gspec', + 'gtild', + 'h2norm', + 'h_cl', + 'h_inf', + 'h_inf_st', + 'h_norm', + 'hallchart', + 'halt', + 'hank', + 'hankelsv', + 'harmean', + 'haveacompiler', + 'head_comments', + 'help_from_sci', + 'help_skeleton', + 'hermit', + 'hex2dec', + 'hilb', + 'hilbert', + 'histc', + 'horner', + 'householder', + 'hrmt', + 'htrianr', + 'hypermat', + 'idct', + 'idst', + 'ifft', + 'ifftshift', + 'iir', + 'iirgroup', + 'iirlp', + 'iirmod', + 'ilib_build', + 'ilib_build_jar', + 'ilib_compile', + 'ilib_for_link', + 'ilib_gen_Make', + 'ilib_gen_Make_unix', + 'ilib_gen_cleaner', + 'ilib_gen_gateway', + 'ilib_gen_loader', + 'ilib_include_flag', + 'ilib_mex_build', + 'im_inv', + 'importScicosDiagram', + 'importScicosPal', + 'importXcosDiagram', + 'imrep2ss', + 'ind2sub', + 'inistate', + 'init_ga_default', + 'init_param', + 'initial_scicos_tables', + 'input', + 'instruction2code', + 'intc', + 'intdec', + 'integrate', + 'interp1', + 'interpln', + 'intersect', + 'intl', + 'intsplin', + 'inttrap', + 'inv_coeff', + 'invr', + 'invrs', + 'invsyslin', + 'iqr', + 'isLeapYear', + 'is_absolute_path', + 'is_param', + 'iscell', + 'iscellstr', + 'iscolumn', + 'isempty', + 'isfield', + 'isinf', + 'ismatrix', + 'isnan', + 'isrow', + 'isscalar', + 'issparse', + 'issquare', + 'isstruct', + 'isvector', + 'jmat', + 'justify', + 'kalm', + 'karmarkar', + 'kernel', + 'kpure', + 'krac2', + 'kroneck', + 'lattn', + 'lattp', + 'launchtest', + 'lcf', + 'lcm', + 'lcmdiag', + 'leastsq', + 'leqe', + 'leqr', + 'lev', + 'levin', + 'lex_sort', + 'lft', + 'lin', + 'lin2mu', + 'lincos', + 'lindquist', + 'linf', + 'linfn', + 'linsolve', + 'linspace', + 'list2vec', + 'list_param', + 'listfiles', + 'listfunctions', + 'listvarinfile', + 'lmisolver', + 'lmitool', + 'loadXcosLibs', + 'loadmatfile', + 'loadwave', + 'log10', + 'log2', + 'logm', + 'logspace', + 'lqe', + 'lqg', + 'lqg2stan', + 'lqg_ltr', + 'lqr', + 'ls', + 'lyap', + 'm2sci_gui', + 'm_circle', + 'macglov', + 'macrovar', + 'mad', + 'makecell', + 'manedit', + 'mapsound', + 'markp2ss', + 'matfile2sci', + 'mdelete', + 'mean', + 'meanf', + 'median', + 'members', + 'mese', + 'meshgrid', + 'mfft', + 'mfile2sci', + 'minreal', + 'minss', + 'mkdir', + 'modulo', + 'moment', + 'mrfit', + 'msd', + 'mstr2sci', + 'mtlb', + 'mtlb_0', + 'mtlb_a', + 'mtlb_all', + 'mtlb_any', + 'mtlb_axes', + 'mtlb_axis', + 'mtlb_beta', + 'mtlb_box', + 'mtlb_choices', + 'mtlb_close', + 'mtlb_colordef', + 'mtlb_cond', + 'mtlb_cov', + 'mtlb_cumprod', + 'mtlb_cumsum', + 'mtlb_dec2hex', + 'mtlb_delete', + 'mtlb_diag', + 'mtlb_diff', + 'mtlb_dir', + 'mtlb_double', + 'mtlb_e', + 'mtlb_echo', + 'mtlb_error', + 'mtlb_eval', + 'mtlb_exist', + 'mtlb_eye', + 'mtlb_false', + 'mtlb_fft', + 'mtlb_fftshift', + 'mtlb_filter', + 'mtlb_find', + 'mtlb_findstr', + 'mtlb_fliplr', + 'mtlb_fopen', + 'mtlb_format', + 'mtlb_fprintf', + 'mtlb_fread', + 'mtlb_fscanf', + 'mtlb_full', + 'mtlb_fwrite', + 'mtlb_get', + 'mtlb_grid', + 'mtlb_hold', + 'mtlb_i', + 'mtlb_ifft', + 'mtlb_image', + 'mtlb_imp', + 'mtlb_int16', + 'mtlb_int32', + 'mtlb_int8', + 'mtlb_is', + 'mtlb_isa', + 'mtlb_isfield', + 'mtlb_isletter', + 'mtlb_isspace', + 'mtlb_l', + 'mtlb_legendre', + 'mtlb_linspace', + 'mtlb_logic', + 'mtlb_logical', + 'mtlb_loglog', + 'mtlb_lower', + 'mtlb_max', + 'mtlb_mean', + 'mtlb_median', + 'mtlb_mesh', + 'mtlb_meshdom', + 'mtlb_min', + 'mtlb_more', + 'mtlb_num2str', + 'mtlb_ones', + 'mtlb_pcolor', + 'mtlb_plot', + 'mtlb_prod', + 'mtlb_qr', + 'mtlb_qz', + 'mtlb_rand', + 'mtlb_randn', + 'mtlb_rcond', + 'mtlb_realmax', + 'mtlb_realmin', + 'mtlb_s', + 'mtlb_semilogx', + 'mtlb_semilogy', + 'mtlb_setstr', + 'mtlb_size', + 'mtlb_sort', + 'mtlb_sortrows', + 'mtlb_sprintf', + 'mtlb_sscanf', + 'mtlb_std', + 'mtlb_strcmp', + 'mtlb_strcmpi', + 'mtlb_strfind', + 'mtlb_strrep', + 'mtlb_subplot', + 'mtlb_sum', + 'mtlb_t', + 'mtlb_toeplitz', + 'mtlb_tril', + 'mtlb_triu', + 'mtlb_true', + 'mtlb_type', + 'mtlb_uint16', + 'mtlb_uint32', + 'mtlb_uint8', + 'mtlb_upper', + 'mtlb_var', + 'mtlb_zeros', + 'mu2lin', + 'mutation_ga_binary', + 'mutation_ga_default', + 'mvcorrel', + 'mvvacov', + 'nancumsum', + 'nand2mean', + 'nanmax', + 'nanmean', + 'nanmeanf', + 'nanmedian', + 'nanmin', + 'nanreglin', + 'nanstdev', + 'nansum', + 'narsimul', + 'ndgrid', + 'ndims', + 'nehari', + 'neigh_func_csa', + 'neigh_func_default', + 'neigh_func_fsa', + 'neigh_func_vfsa', + 'neldermead_cget', + 'neldermead_configure', + 'neldermead_costf', + 'neldermead_defaultoutput', + 'neldermead_destroy', + 'neldermead_function', + 'neldermead_get', + 'neldermead_log', + 'neldermead_new', + 'neldermead_restart', + 'neldermead_search', + 'neldermead_updatesimp', + 'nextpow2', + 'nfreq', + 'nicholschart', + 'nlev', + 'nmplot_cget', + 'nmplot_configure', + 'nmplot_contour', + 'nmplot_destroy', + 'nmplot_function', + 'nmplot_get', + 'nmplot_historyplot', + 'nmplot_log', + 'nmplot_new', + 'nmplot_outputcmd', + 'nmplot_restart', + 'nmplot_search', + 'nmplot_simplexhistory', + 'noisegen', + 'nonreg_test_run', + 'now', + 'nthroot', + 'null', + 'num2cell', + 'numderivative', + 'numdiff', + 'numer', + 'nyquist', + 'nyquistfrequencybounds', + 'obs_gram', + 'obscont', + 'observer', + 'obsv_mat', + 'obsvss', + 'oct2dec', + 'odeoptions', + 'optim_ga', + 'optim_moga', + 'optim_nsga', + 'optim_nsga2', + 'optim_sa', + 'optimbase_cget', + 'optimbase_checkbounds', + 'optimbase_checkcostfun', + 'optimbase_checkx0', + 'optimbase_configure', + 'optimbase_destroy', + 'optimbase_function', + 'optimbase_get', + 'optimbase_hasbounds', + 'optimbase_hasconstraints', + 'optimbase_hasnlcons', + 'optimbase_histget', + 'optimbase_histset', + 'optimbase_incriter', + 'optimbase_isfeasible', + 'optimbase_isinbounds', + 'optimbase_isinnonlincons', + 'optimbase_log', + 'optimbase_logshutdown', + 'optimbase_logstartup', + 'optimbase_new', + 'optimbase_outputcmd', + 'optimbase_outstruct', + 'optimbase_proj2bnds', + 'optimbase_set', + 'optimbase_stoplog', + 'optimbase_terminate', + 'optimget', + 'optimplotfunccount', + 'optimplotfval', + 'optimplotx', + 'optimset', + 'optimsimplex_center', + 'optimsimplex_check', + 'optimsimplex_compsomefv', + 'optimsimplex_computefv', + 'optimsimplex_deltafv', + 'optimsimplex_deltafvmax', + 'optimsimplex_destroy', + 'optimsimplex_dirmat', + 'optimsimplex_fvmean', + 'optimsimplex_fvstdev', + 'optimsimplex_fvvariance', + 'optimsimplex_getall', + 'optimsimplex_getallfv', + 'optimsimplex_getallx', + 'optimsimplex_getfv', + 'optimsimplex_getn', + 'optimsimplex_getnbve', + 'optimsimplex_getve', + 'optimsimplex_getx', + 'optimsimplex_gradientfv', + 'optimsimplex_log', + 'optimsimplex_new', + 'optimsimplex_reflect', + 'optimsimplex_setall', + 'optimsimplex_setallfv', + 'optimsimplex_setallx', + 'optimsimplex_setfv', + 'optimsimplex_setn', + 'optimsimplex_setnbve', + 'optimsimplex_setve', + 'optimsimplex_setx', + 'optimsimplex_shrink', + 'optimsimplex_size', + 'optimsimplex_sort', + 'optimsimplex_xbar', + 'orth', + 'output_ga_default', + 'output_moga_default', + 'output_nsga2_default', + 'output_nsga_default', + 'p_margin', + 'pack', + 'pareto_filter', + 'parrot', + 'pbig', + 'pca', + 'pcg', + 'pdiv', + 'pen2ea', + 'pencan', + 'pencost', + 'penlaur', + 'perctl', + 'perl', + 'perms', + 'permute', + 'pertrans', + 'pfactors', + 'pfss', + 'phasemag', + 'phaseplot', + 'phc', + 'pinv', + 'playsnd', + 'plotprofile', + 'plzr', + 'pmodulo', + 'pol2des', + 'pol2str', + 'polar', + 'polfact', + 'prbs_a', + 'prettyprint', + 'primes', + 'princomp', + 'profile', + 'proj', + 'projsl', + 'projspec', + 'psmall', + 'pspect', + 'qmr', + 'qpsolve', + 'quart', + 'quaskro', + 'rafiter', + 'randpencil', + 'range', + 'rank', + 'readxls', + 'recompilefunction', + 'recons', + 'reglin', + 'regress', + 'remezb', + 'remove_param', + 'remove_profiling', + 'repfreq', + 'replace_Ix_by_Fx', + 'repmat', + 'reset_profiling', + 'resize_matrix', + 'returntoscilab', + 'rhs2code', + 'ric_desc', + 'riccati', + 'rmdir', + 'routh_t', + 'rowcomp', + 'rowcompr', + 'rowinout', + 'rowregul', + 'rowshuff', + 'rref', + 'sample', + 'samplef', + 'samwr', + 'savematfile', + 'savewave', + 'scanf', + 'sci2exp', + 'sciGUI_init', + 'sci_sparse', + 'scicos_getvalue', + 'scicos_simulate', + 'scicos_workspace_init', + 'scisptdemo', + 'scitest', + 'sdiff', + 'sec', + 'secd', + 'sech', + 'selection_ga_elitist', + 'selection_ga_random', + 'sensi', + 'setPreferencesValue', + 'set_param', + 'setdiff', + 'sgrid', + 'show_margins', + 'show_pca', + 'showprofile', + 'signm', + 'sinc', + 'sincd', + 'sind', + 'sinh', + 'sinhm', + 'sinm', + 'sm2des', + 'sm2ss', + 'smga', + 'smooth', + 'solve', + 'sound', + 'soundsec', + 'sp2adj', + 'spaninter', + 'spanplus', + 'spantwo', + 'specfact', + 'speye', + 'sprand', + 'spzeros', + 'sqroot', + 'sqrtm', + 'squarewave', + 'squeeze', + 'srfaur', + 'srkf', + 'ss2des', + 'ss2ss', + 'ss2tf', + 'sskf', + 'ssprint', + 'ssrand', + 'st_deviation', + 'st_i_generic', + 'st_ility', + 'stabil', + 'statgain', + 'stdev', + 'stdevf', + 'steadycos', + 'strange', + 'strcmpi', + 'struct', + 'sub2ind', + 'sva', + 'svplot', + 'sylm', + 'sylv', + 'sysconv', + 'sysdiag', + 'sysfact', + 'syslin', + 'syssize', + 'system', + 'systmat', + 'tabul', + 'tand', + 'tanh', + 'tanhm', + 'tanm', + 'tbx_build_blocks', + 'tbx_build_cleaner', + 'tbx_build_gateway', + 'tbx_build_gateway_clean', + 'tbx_build_gateway_loader', + 'tbx_build_help', + 'tbx_build_help_loader', + 'tbx_build_loader', + 'tbx_build_localization', + 'tbx_build_macros', + 'tbx_build_pal_loader', + 'tbx_build_src', + 'tbx_builder', + 'tbx_builder_gateway', + 'tbx_builder_gateway_lang', + 'tbx_builder_help', + 'tbx_builder_help_lang', + 'tbx_builder_macros', + 'tbx_builder_src', + 'tbx_builder_src_lang', + 'tbx_generate_pofile', + 'temp_law_csa', + 'temp_law_default', + 'temp_law_fsa', + 'temp_law_huang', + 'temp_law_vfsa', + 'test_clean', + 'test_on_columns', + 'test_run', + 'test_run_level', + 'testexamples', + 'tf2des', + 'tf2ss', + 'thrownan', + 'tic', + 'time_id', + 'toc', + 'toeplitz', + 'tokenpos', + 'toolboxes', + 'trace', + 'trans', + 'translatepaths', + 'tree2code', + 'trfmod', + 'trianfml', + 'trimmean', + 'trisolve', + 'trzeros', + 'typeof', + 'ui_observer', + 'union', + 'unique', + 'unit_test_run', + 'unix_g', + 'unix_s', + 'unix_w', + 'unix_x', + 'unobs', + 'unpack', + 'unwrap', + 'variance', + 'variancef', + 'vec2list', + 'vectorfind', + 'ver', + 'warnobsolete', + 'wavread', + 'wavwrite', + 'wcenter', + 'weekday', + 'wfir', + 'wfir_gui', + 'whereami', + 'who_user', + 'whos', + 'wiener', + 'wigner', + 'window', + 'winlist', + 'with_javasci', + 'with_macros_source', + 'with_modelica_compiler', + 'with_tk', + 'xcorr', + 'xcosBlockEval', + 'xcosBlockInterface', + 'xcosCodeGeneration', + 'xcosConfigureModelica', + 'xcosPal', + 'xcosPalAdd', + 'xcosPalAddBlock', + 'xcosPalExport', + 'xcosPalGenerateAllIcons', + 'xcosShowBlockWarning', + 'xcosValidateBlockSet', + 'xcosValidateCompareBlock', + 'xcos_compile', + 'xcos_debug_gui', + 'xcos_run', + 'xcos_simulate', + 'xcov', + 'xmltochm', + 'xmltoformat', + 'xmltohtml', + 'xmltojar', + 'xmltopdf', + 'xmltops', + 'xmltoweb', + 'yulewalk', + 'zeropen', + 'zgrid', + 'zpbutt', + 'zpch1', + 'zpch2', + 'zpell', +) + +variables_kw = ( + '$', + '%F', + '%T', + '%e', + '%eps', + '%f', + '%fftw', + '%gui', + '%i', + '%inf', + '%io', + '%modalWarning', + '%nan', + '%pi', + '%s', + '%t', + '%tk', + '%toolboxes', + '%toolboxes_dir', + '%z', + 'PWD', + 'SCI', + 'SCIHOME', + 'TMPDIR', + 'arnoldilib', + 'assertlib', + 'atomslib', + 'cacsdlib', + 'compatibility_functilib', + 'corelib', + 'data_structureslib', + 'demo_toolslib', + 'development_toolslib', + 'differential_equationlib', + 'dynamic_linklib', + 'elementary_functionslib', + 'enull', + 'evoid', + 'external_objectslib', + 'fd', + 'fileiolib', + 'functionslib', + 'genetic_algorithmslib', + 'helptoolslib', + 'home', + 'integerlib', + 'interpolationlib', + 'iolib', + 'jnull', + 'jvoid', + 'linear_algebralib', + 'm2scilib', + 'matiolib', + 'modules_managerlib', + 'neldermeadlib', + 'optimbaselib', + 'optimizationlib', + 'optimsimplexlib', + 'output_streamlib', + 'overloadinglib', + 'parameterslib', + 'polynomialslib', + 'preferenceslib', + 'randliblib', + 'scicos_autolib', + 'scicos_utilslib', + 'scinoteslib', + 'signal_processinglib', + 'simulated_annealinglib', + 'soundlib', + 'sparselib', + 'special_functionslib', + 'spreadsheetlib', + 'statisticslib', + 'stringlib', + 'tclscilib', + 'timelib', + 'umfpacklib', + 'xcoslib', +) + + +if __name__ == '__main__': # pragma: no cover + import subprocess + from pygments.util import format_lines, duplicates_removed + + mapping = {'variables': 'builtin'} + + def extract_completion(var_type): + s = subprocess.Popen(['scilab', '-nwni'], stdin=subprocess.PIPE, + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + output = s.communicate(f'''\ +fd = mopen("/dev/stderr", "wt"); +mputl(strcat(completion("", "{var_type}"), "||"), fd); +mclose(fd)\n''') + if '||' not in output[1]: + raise Exception(output[0]) + # Invalid DISPLAY causes this to be output: + text = output[1].strip() + if text.startswith('Error: unable to open display \n'): + text = text[len('Error: unable to open display \n'):] + return text.split('||') + + new_data = {} + seen = set() # only keep first type for a given word + for t in ('functions', 'commands', 'macros', 'variables'): + new_data[t] = duplicates_removed(extract_completion(t), seen) + seen.update(set(new_data[t])) + + + with open(__file__, encoding='utf-8') as f: + content = f.read() + + header = content[:content.find('# Autogenerated')] + footer = content[content.find("if __name__ == '__main__':"):] + + with open(__file__, 'w', encoding='utf-8') as f: + f.write(header) + f.write('# Autogenerated\n\n') + for k, v in sorted(new_data.items()): + f.write(format_lines(k + '_kw', v) + '\n\n') + f.write(footer) diff --git a/lib/python3.12/site-packages/pygments/lexers/_sourcemod_builtins.py b/lib/python3.12/site-packages/pygments/lexers/_sourcemod_builtins.py new file mode 100644 index 0000000000000000000000000000000000000000..c98478c6f9ebf32547010598a90d7dcb7565592d --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/_sourcemod_builtins.py @@ -0,0 +1,1151 @@ +""" + pygments.lexers._sourcemod_builtins + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + This file contains the names of SourceMod functions. + + Do not edit the FUNCTIONS list by hand. + + Run with `python -I` to regenerate. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +FUNCTIONS = ( + 'OnEntityCreated', + 'OnEntityDestroyed', + 'OnGetGameDescription', + 'OnLevelInit', + 'SDKHook', + 'SDKHookEx', + 'SDKUnhook', + 'SDKHooks_TakeDamage', + 'SDKHooks_DropWeapon', + 'TopMenuHandler', + 'CreateTopMenu', + 'LoadTopMenuConfig', + 'AddToTopMenu', + 'GetTopMenuInfoString', + 'GetTopMenuObjName', + 'RemoveFromTopMenu', + 'DisplayTopMenu', + 'DisplayTopMenuCategory', + 'FindTopMenuCategory', + 'SetTopMenuTitleCaching', + 'OnAdminMenuCreated', + 'OnAdminMenuReady', + 'GetAdminTopMenu', + 'AddTargetsToMenu', + 'AddTargetsToMenu2', + 'RedisplayAdminMenu', + 'TEHook', + 'AddTempEntHook', + 'RemoveTempEntHook', + 'TE_Start', + 'TE_IsValidProp', + 'TE_WriteNum', + 'TE_ReadNum', + 'TE_WriteFloat', + 'TE_ReadFloat', + 'TE_WriteVector', + 'TE_ReadVector', + 'TE_WriteAngles', + 'TE_WriteFloatArray', + 'TE_Send', + 'TE_WriteEncodedEnt', + 'TE_SendToAll', + 'TE_SendToClient', + 'CreateKeyValues', + 'KvSetString', + 'KvSetNum', + 'KvSetUInt64', + 'KvSetFloat', + 'KvSetColor', + 'KvSetVector', + 'KvGetString', + 'KvGetNum', + 'KvGetFloat', + 'KvGetColor', + 'KvGetUInt64', + 'KvGetVector', + 'KvJumpToKey', + 'KvJumpToKeySymbol', + 'KvGotoFirstSubKey', + 'KvGotoNextKey', + 'KvSavePosition', + 'KvDeleteKey', + 'KvDeleteThis', + 'KvGoBack', + 'KvRewind', + 'KvGetSectionName', + 'KvSetSectionName', + 'KvGetDataType', + 'KeyValuesToFile', + 'FileToKeyValues', + 'StringToKeyValues', + 'KvSetEscapeSequences', + 'KvNodesInStack', + 'KvCopySubkeys', + 'KvFindKeyById', + 'KvGetNameSymbol', + 'KvGetSectionSymbol', + 'TE_SetupSparks', + 'TE_SetupSmoke', + 'TE_SetupDust', + 'TE_SetupMuzzleFlash', + 'TE_SetupMetalSparks', + 'TE_SetupEnergySplash', + 'TE_SetupArmorRicochet', + 'TE_SetupGlowSprite', + 'TE_SetupExplosion', + 'TE_SetupBloodSprite', + 'TE_SetupBeamRingPoint', + 'TE_SetupBeamPoints', + 'TE_SetupBeamLaser', + 'TE_SetupBeamRing', + 'TE_SetupBeamFollow', + 'HookEvent', + 'HookEventEx', + 'UnhookEvent', + 'CreateEvent', + 'FireEvent', + 'CancelCreatedEvent', + 'GetEventBool', + 'SetEventBool', + 'GetEventInt', + 'SetEventInt', + 'GetEventFloat', + 'SetEventFloat', + 'GetEventString', + 'SetEventString', + 'GetEventName', + 'SetEventBroadcast', + 'GetUserMessageType', + 'GetUserMessageId', + 'GetUserMessageName', + 'StartMessage', + 'StartMessageEx', + 'EndMessage', + 'MsgHook', + 'MsgPostHook', + 'HookUserMessage', + 'UnhookUserMessage', + 'StartMessageAll', + 'StartMessageOne', + 'InactivateClient', + 'ReconnectClient', + 'GetMaxEntities', + 'GetEntityCount', + 'IsValidEntity', + 'IsValidEdict', + 'IsEntNetworkable', + 'CreateEdict', + 'RemoveEdict', + 'GetEdictFlags', + 'SetEdictFlags', + 'GetEdictClassname', + 'GetEntityNetClass', + 'ChangeEdictState', + 'GetEntData', + 'SetEntData', + 'GetEntDataFloat', + 'SetEntDataFloat', + 'GetEntDataEnt2', + 'SetEntDataEnt2', + 'GetEntDataVector', + 'SetEntDataVector', + 'GetEntDataString', + 'SetEntDataString', + 'FindSendPropOffs', + 'FindSendPropInfo', + 'FindDataMapOffs', + 'FindDataMapInfo', + 'GetEntSendPropOffs', + 'GetEntProp', + 'SetEntProp', + 'GetEntPropFloat', + 'SetEntPropFloat', + 'GetEntPropEnt', + 'SetEntPropEnt', + 'GetEntPropVector', + 'SetEntPropVector', + 'GetEntPropString', + 'SetEntPropString', + 'GetEntPropArraySize', + 'GetEntDataArray', + 'SetEntDataArray', + 'GetEntityAddress', + 'GetEntityClassname', + 'float', + 'FloatMul', + 'FloatDiv', + 'FloatAdd', + 'FloatSub', + 'FloatFraction', + 'RoundToZero', + 'RoundToCeil', + 'RoundToFloor', + 'RoundToNearest', + 'FloatCompare', + 'SquareRoot', + 'Pow', + 'Exponential', + 'Logarithm', + 'Sine', + 'Cosine', + 'Tangent', + 'FloatAbs', + 'ArcTangent', + 'ArcCosine', + 'ArcSine', + 'ArcTangent2', + 'RoundFloat', + 'operator%', + 'DegToRad', + 'RadToDeg', + 'GetURandomInt', + 'GetURandomFloat', + 'SetURandomSeed', + 'SetURandomSeedSimple', + 'RemovePlayerItem', + 'GivePlayerItem', + 'GetPlayerWeaponSlot', + 'IgniteEntity', + 'ExtinguishEntity', + 'TeleportEntity', + 'ForcePlayerSuicide', + 'SlapPlayer', + 'FindEntityByClassname', + 'GetClientEyeAngles', + 'CreateEntityByName', + 'DispatchSpawn', + 'DispatchKeyValue', + 'DispatchKeyValueFloat', + 'DispatchKeyValueVector', + 'GetClientAimTarget', + 'GetTeamCount', + 'GetTeamName', + 'GetTeamScore', + 'SetTeamScore', + 'GetTeamClientCount', + 'SetEntityModel', + 'GetPlayerDecalFile', + 'GetPlayerJingleFile', + 'GetServerNetStats', + 'EquipPlayerWeapon', + 'ActivateEntity', + 'SetClientInfo', + 'GivePlayerAmmo', + 'SetClientListeningFlags', + 'GetClientListeningFlags', + 'SetListenOverride', + 'GetListenOverride', + 'IsClientMuted', + 'TR_GetPointContents', + 'TR_GetPointContentsEnt', + 'TR_TraceRay', + 'TR_TraceHull', + 'TR_TraceRayFilter', + 'TR_TraceHullFilter', + 'TR_TraceRayEx', + 'TR_TraceHullEx', + 'TR_TraceRayFilterEx', + 'TR_TraceHullFilterEx', + 'TR_GetFraction', + 'TR_GetEndPosition', + 'TR_GetEntityIndex', + 'TR_DidHit', + 'TR_GetHitGroup', + 'TR_GetPlaneNormal', + 'TR_PointOutsideWorld', + 'SortIntegers', + 'SortFloats', + 'SortStrings', + 'SortFunc1D', + 'SortCustom1D', + 'SortCustom2D', + 'SortADTArray', + 'SortFuncADTArray', + 'SortADTArrayCustom', + 'CompileRegex', + 'MatchRegex', + 'GetRegexSubString', + 'SimpleRegexMatch', + 'TF2_GetPlayerClass', + 'TF2_SetPlayerClass', + 'TF2_RemoveWeaponSlot', + 'TF2_RemoveAllWeapons', + 'TF2_IsPlayerInCondition', + 'TF2_GetObjectType', + 'TF2_GetObjectMode', + 'NominateMap', + 'RemoveNominationByMap', + 'RemoveNominationByOwner', + 'GetExcludeMapList', + 'GetNominatedMapList', + 'CanMapChooserStartVote', + 'InitiateMapChooserVote', + 'HasEndOfMapVoteFinished', + 'EndOfMapVoteEnabled', + 'OnNominationRemoved', + 'OnMapVoteStarted', + 'CreateTimer', + 'KillTimer', + 'TriggerTimer', + 'GetTickedTime', + 'GetMapTimeLeft', + 'GetMapTimeLimit', + 'ExtendMapTimeLimit', + 'GetTickInterval', + 'OnMapTimeLeftChanged', + 'IsServerProcessing', + 'CreateDataTimer', + 'ByteCountToCells', + 'CreateArray', + 'ClearArray', + 'CloneArray', + 'ResizeArray', + 'GetArraySize', + 'PushArrayCell', + 'PushArrayString', + 'PushArrayArray', + 'GetArrayCell', + 'GetArrayString', + 'GetArrayArray', + 'SetArrayCell', + 'SetArrayString', + 'SetArrayArray', + 'ShiftArrayUp', + 'RemoveFromArray', + 'SwapArrayItems', + 'FindStringInArray', + 'FindValueInArray', + 'ProcessTargetString', + 'ReplyToTargetError', + 'MultiTargetFilter', + 'AddMultiTargetFilter', + 'RemoveMultiTargetFilter', + 'OnBanClient', + 'OnBanIdentity', + 'OnRemoveBan', + 'BanClient', + 'BanIdentity', + 'RemoveBan', + 'CreateTrie', + 'SetTrieValue', + 'SetTrieArray', + 'SetTrieString', + 'GetTrieValue', + 'GetTrieArray', + 'GetTrieString', + 'RemoveFromTrie', + 'ClearTrie', + 'GetTrieSize', + 'GetFunctionByName', + 'CreateGlobalForward', + 'CreateForward', + 'GetForwardFunctionCount', + 'AddToForward', + 'RemoveFromForward', + 'RemoveAllFromForward', + 'Call_StartForward', + 'Call_StartFunction', + 'Call_PushCell', + 'Call_PushCellRef', + 'Call_PushFloat', + 'Call_PushFloatRef', + 'Call_PushArray', + 'Call_PushArrayEx', + 'Call_PushString', + 'Call_PushStringEx', + 'Call_Finish', + 'Call_Cancel', + 'NativeCall', + 'CreateNative', + 'ThrowNativeError', + 'GetNativeStringLength', + 'GetNativeString', + 'SetNativeString', + 'GetNativeCell', + 'GetNativeCellRef', + 'SetNativeCellRef', + 'GetNativeArray', + 'SetNativeArray', + 'FormatNativeString', + 'RequestFrameCallback', + 'RequestFrame', + 'OnRebuildAdminCache', + 'DumpAdminCache', + 'AddCommandOverride', + 'GetCommandOverride', + 'UnsetCommandOverride', + 'CreateAdmGroup', + 'FindAdmGroup', + 'SetAdmGroupAddFlag', + 'GetAdmGroupAddFlag', + 'GetAdmGroupAddFlags', + 'SetAdmGroupImmuneFrom', + 'GetAdmGroupImmuneCount', + 'GetAdmGroupImmuneFrom', + 'AddAdmGroupCmdOverride', + 'GetAdmGroupCmdOverride', + 'RegisterAuthIdentType', + 'CreateAdmin', + 'GetAdminUsername', + 'BindAdminIdentity', + 'SetAdminFlag', + 'GetAdminFlag', + 'GetAdminFlags', + 'AdminInheritGroup', + 'GetAdminGroupCount', + 'GetAdminGroup', + 'SetAdminPassword', + 'GetAdminPassword', + 'FindAdminByIdentity', + 'RemoveAdmin', + 'FlagBitsToBitArray', + 'FlagBitArrayToBits', + 'FlagArrayToBits', + 'FlagBitsToArray', + 'FindFlagByName', + 'FindFlagByChar', + 'FindFlagChar', + 'ReadFlagString', + 'CanAdminTarget', + 'CreateAuthMethod', + 'SetAdmGroupImmunityLevel', + 'GetAdmGroupImmunityLevel', + 'SetAdminImmunityLevel', + 'GetAdminImmunityLevel', + 'FlagToBit', + 'BitToFlag', + 'ServerCommand', + 'ServerCommandEx', + 'InsertServerCommand', + 'ServerExecute', + 'ClientCommand', + 'FakeClientCommand', + 'FakeClientCommandEx', + 'PrintToServer', + 'PrintToConsole', + 'ReplyToCommand', + 'GetCmdReplySource', + 'SetCmdReplySource', + 'IsChatTrigger', + 'ShowActivity2', + 'ShowActivity', + 'ShowActivityEx', + 'FormatActivitySource', + 'SrvCmd', + 'RegServerCmd', + 'ConCmd', + 'RegConsoleCmd', + 'RegAdminCmd', + 'GetCmdArgs', + 'GetCmdArg', + 'GetCmdArgString', + 'CreateConVar', + 'FindConVar', + 'ConVarChanged', + 'HookConVarChange', + 'UnhookConVarChange', + 'GetConVarBool', + 'SetConVarBool', + 'GetConVarInt', + 'SetConVarInt', + 'GetConVarFloat', + 'SetConVarFloat', + 'GetConVarString', + 'SetConVarString', + 'ResetConVar', + 'GetConVarDefault', + 'GetConVarFlags', + 'SetConVarFlags', + 'GetConVarBounds', + 'SetConVarBounds', + 'GetConVarName', + 'QueryClientConVar', + 'GetCommandIterator', + 'ReadCommandIterator', + 'CheckCommandAccess', + 'CheckAccess', + 'IsValidConVarChar', + 'GetCommandFlags', + 'SetCommandFlags', + 'FindFirstConCommand', + 'FindNextConCommand', + 'SendConVarValue', + 'AddServerTag', + 'RemoveServerTag', + 'CommandListener', + 'AddCommandListener', + 'RemoveCommandListener', + 'CommandExists', + 'OnClientSayCommand', + 'OnClientSayCommand_Post', + 'TF2_IgnitePlayer', + 'TF2_RespawnPlayer', + 'TF2_RegeneratePlayer', + 'TF2_AddCondition', + 'TF2_RemoveCondition', + 'TF2_SetPlayerPowerPlay', + 'TF2_DisguisePlayer', + 'TF2_RemovePlayerDisguise', + 'TF2_StunPlayer', + 'TF2_MakeBleed', + 'TF2_GetClass', + 'TF2_CalcIsAttackCritical', + 'TF2_OnIsHolidayActive', + 'TF2_IsHolidayActive', + 'TF2_IsPlayerInDuel', + 'TF2_RemoveWearable', + 'TF2_OnConditionAdded', + 'TF2_OnConditionRemoved', + 'TF2_OnWaitingForPlayersStart', + 'TF2_OnWaitingForPlayersEnd', + 'TF2_OnPlayerTeleport', + 'SQL_Connect', + 'SQL_DefConnect', + 'SQL_ConnectCustom', + 'SQLite_UseDatabase', + 'SQL_CheckConfig', + 'SQL_GetDriver', + 'SQL_ReadDriver', + 'SQL_GetDriverIdent', + 'SQL_GetDriverProduct', + 'SQL_SetCharset', + 'SQL_GetAffectedRows', + 'SQL_GetInsertId', + 'SQL_GetError', + 'SQL_EscapeString', + 'SQL_QuoteString', + 'SQL_FastQuery', + 'SQL_Query', + 'SQL_PrepareQuery', + 'SQL_FetchMoreResults', + 'SQL_HasResultSet', + 'SQL_GetRowCount', + 'SQL_GetFieldCount', + 'SQL_FieldNumToName', + 'SQL_FieldNameToNum', + 'SQL_FetchRow', + 'SQL_MoreRows', + 'SQL_Rewind', + 'SQL_FetchString', + 'SQL_FetchFloat', + 'SQL_FetchInt', + 'SQL_IsFieldNull', + 'SQL_FetchSize', + 'SQL_BindParamInt', + 'SQL_BindParamFloat', + 'SQL_BindParamString', + 'SQL_Execute', + 'SQL_LockDatabase', + 'SQL_UnlockDatabase', + 'SQLTCallback', + 'SQL_IsSameConnection', + 'SQL_TConnect', + 'SQL_TQuery', + 'SQL_CreateTransaction', + 'SQL_AddQuery', + 'SQLTxnSuccess', + 'SQLTxnFailure', + 'SQL_ExecuteTransaction', + 'CloseHandle', + 'CloneHandle', + 'MenuHandler', + 'CreateMenu', + 'DisplayMenu', + 'DisplayMenuAtItem', + 'AddMenuItem', + 'InsertMenuItem', + 'RemoveMenuItem', + 'RemoveAllMenuItems', + 'GetMenuItem', + 'GetMenuSelectionPosition', + 'GetMenuItemCount', + 'SetMenuPagination', + 'GetMenuPagination', + 'GetMenuStyle', + 'SetMenuTitle', + 'GetMenuTitle', + 'CreatePanelFromMenu', + 'GetMenuExitButton', + 'SetMenuExitButton', + 'GetMenuExitBackButton', + 'SetMenuExitBackButton', + 'SetMenuNoVoteButton', + 'CancelMenu', + 'GetMenuOptionFlags', + 'SetMenuOptionFlags', + 'IsVoteInProgress', + 'CancelVote', + 'VoteMenu', + 'VoteMenuToAll', + 'VoteHandler', + 'SetVoteResultCallback', + 'CheckVoteDelay', + 'IsClientInVotePool', + 'RedrawClientVoteMenu', + 'GetMenuStyleHandle', + 'CreatePanel', + 'CreateMenuEx', + 'GetClientMenu', + 'CancelClientMenu', + 'GetMaxPageItems', + 'GetPanelStyle', + 'SetPanelTitle', + 'DrawPanelItem', + 'DrawPanelText', + 'CanPanelDrawFlags', + 'SetPanelKeys', + 'SendPanelToClient', + 'GetPanelTextRemaining', + 'GetPanelCurrentKey', + 'SetPanelCurrentKey', + 'RedrawMenuItem', + 'InternalShowMenu', + 'GetMenuVoteInfo', + 'IsNewVoteAllowed', + 'PrefetchSound', + 'EmitAmbientSound', + 'FadeClientVolume', + 'StopSound', + 'EmitSound', + 'EmitSentence', + 'GetDistGainFromSoundLevel', + 'AmbientSHook', + 'NormalSHook', + 'AddAmbientSoundHook', + 'AddNormalSoundHook', + 'RemoveAmbientSoundHook', + 'RemoveNormalSoundHook', + 'EmitSoundToClient', + 'EmitSoundToAll', + 'ATTN_TO_SNDLEVEL', + 'GetGameSoundParams', + 'EmitGameSound', + 'EmitAmbientGameSound', + 'EmitGameSoundToClient', + 'EmitGameSoundToAll', + 'PrecacheScriptSound', + 'strlen', + 'StrContains', + 'strcmp', + 'strncmp', + 'StrEqual', + 'strcopy', + 'Format', + 'FormatEx', + 'VFormat', + 'StringToInt', + 'StringToIntEx', + 'IntToString', + 'StringToFloat', + 'StringToFloatEx', + 'FloatToString', + 'BreakString', + 'TrimString', + 'SplitString', + 'ReplaceString', + 'ReplaceStringEx', + 'GetCharBytes', + 'IsCharAlpha', + 'IsCharNumeric', + 'IsCharSpace', + 'IsCharMB', + 'IsCharUpper', + 'IsCharLower', + 'StripQuotes', + 'CharToUpper', + 'CharToLower', + 'FindCharInString', + 'StrCat', + 'ExplodeString', + 'ImplodeStrings', + 'GetVectorLength', + 'GetVectorDistance', + 'GetVectorDotProduct', + 'GetVectorCrossProduct', + 'NormalizeVector', + 'GetAngleVectors', + 'GetVectorAngles', + 'GetVectorVectors', + 'AddVectors', + 'SubtractVectors', + 'ScaleVector', + 'NegateVector', + 'MakeVectorFromPoints', + 'BaseComm_IsClientGagged', + 'BaseComm_IsClientMuted', + 'BaseComm_SetClientGag', + 'BaseComm_SetClientMute', + 'FormatUserLogText', + 'FindPluginByFile', + 'FindTarget', + 'AcceptEntityInput', + 'SetVariantBool', + 'SetVariantString', + 'SetVariantInt', + 'SetVariantFloat', + 'SetVariantVector3D', + 'SetVariantPosVector3D', + 'SetVariantColor', + 'SetVariantEntity', + 'GameRules_GetProp', + 'GameRules_SetProp', + 'GameRules_GetPropFloat', + 'GameRules_SetPropFloat', + 'GameRules_GetPropEnt', + 'GameRules_SetPropEnt', + 'GameRules_GetPropVector', + 'GameRules_SetPropVector', + 'GameRules_GetPropString', + 'GameRules_SetPropString', + 'GameRules_GetRoundState', + 'OnClientConnect', + 'OnClientConnected', + 'OnClientPutInServer', + 'OnClientDisconnect', + 'OnClientDisconnect_Post', + 'OnClientCommand', + 'OnClientSettingsChanged', + 'OnClientAuthorized', + 'OnClientPreAdminCheck', + 'OnClientPostAdminFilter', + 'OnClientPostAdminCheck', + 'GetMaxClients', + 'GetMaxHumanPlayers', + 'GetClientCount', + 'GetClientName', + 'GetClientIP', + 'GetClientAuthString', + 'GetClientAuthId', + 'GetSteamAccountID', + 'GetClientUserId', + 'IsClientConnected', + 'IsClientInGame', + 'IsClientInKickQueue', + 'IsClientAuthorized', + 'IsFakeClient', + 'IsClientSourceTV', + 'IsClientReplay', + 'IsClientObserver', + 'IsPlayerAlive', + 'GetClientInfo', + 'GetClientTeam', + 'SetUserAdmin', + 'GetUserAdmin', + 'AddUserFlags', + 'RemoveUserFlags', + 'SetUserFlagBits', + 'GetUserFlagBits', + 'CanUserTarget', + 'RunAdminCacheChecks', + 'NotifyPostAdminCheck', + 'CreateFakeClient', + 'SetFakeClientConVar', + 'GetClientHealth', + 'GetClientModel', + 'GetClientWeapon', + 'GetClientMaxs', + 'GetClientMins', + 'GetClientAbsAngles', + 'GetClientAbsOrigin', + 'GetClientArmor', + 'GetClientDeaths', + 'GetClientFrags', + 'GetClientDataRate', + 'IsClientTimingOut', + 'GetClientTime', + 'GetClientLatency', + 'GetClientAvgLatency', + 'GetClientAvgLoss', + 'GetClientAvgChoke', + 'GetClientAvgData', + 'GetClientAvgPackets', + 'GetClientOfUserId', + 'KickClient', + 'KickClientEx', + 'ChangeClientTeam', + 'GetClientSerial', + 'GetClientFromSerial', + 'FindStringTable', + 'GetNumStringTables', + 'GetStringTableNumStrings', + 'GetStringTableMaxStrings', + 'GetStringTableName', + 'FindStringIndex', + 'ReadStringTable', + 'GetStringTableDataLength', + 'GetStringTableData', + 'SetStringTableData', + 'AddToStringTable', + 'LockStringTables', + 'AddFileToDownloadsTable', + 'GetEntityFlags', + 'SetEntityFlags', + 'GetEntityMoveType', + 'SetEntityMoveType', + 'GetEntityRenderMode', + 'SetEntityRenderMode', + 'GetEntityRenderFx', + 'SetEntityRenderFx', + 'SetEntityRenderColor', + 'GetEntityGravity', + 'SetEntityGravity', + 'SetEntityHealth', + 'GetClientButtons', + 'EntityOutput', + 'HookEntityOutput', + 'UnhookEntityOutput', + 'HookSingleEntityOutput', + 'UnhookSingleEntityOutput', + 'SMC_CreateParser', + 'SMC_ParseFile', + 'SMC_GetErrorString', + 'SMC_ParseStart', + 'SMC_SetParseStart', + 'SMC_ParseEnd', + 'SMC_SetParseEnd', + 'SMC_NewSection', + 'SMC_KeyValue', + 'SMC_EndSection', + 'SMC_SetReaders', + 'SMC_RawLine', + 'SMC_SetRawLine', + 'BfWriteBool', + 'BfWriteByte', + 'BfWriteChar', + 'BfWriteShort', + 'BfWriteWord', + 'BfWriteNum', + 'BfWriteFloat', + 'BfWriteString', + 'BfWriteEntity', + 'BfWriteAngle', + 'BfWriteCoord', + 'BfWriteVecCoord', + 'BfWriteVecNormal', + 'BfWriteAngles', + 'BfReadBool', + 'BfReadByte', + 'BfReadChar', + 'BfReadShort', + 'BfReadWord', + 'BfReadNum', + 'BfReadFloat', + 'BfReadString', + 'BfReadEntity', + 'BfReadAngle', + 'BfReadCoord', + 'BfReadVecCoord', + 'BfReadVecNormal', + 'BfReadAngles', + 'BfGetNumBytesLeft', + 'CreateProfiler', + 'StartProfiling', + 'StopProfiling', + 'GetProfilerTime', + 'OnPluginStart', + 'AskPluginLoad2', + 'OnPluginEnd', + 'OnPluginPauseChange', + 'OnGameFrame', + 'OnMapStart', + 'OnMapEnd', + 'OnConfigsExecuted', + 'OnAutoConfigsBuffered', + 'OnAllPluginsLoaded', + 'GetMyHandle', + 'GetPluginIterator', + 'MorePlugins', + 'ReadPlugin', + 'GetPluginStatus', + 'GetPluginFilename', + 'IsPluginDebugging', + 'GetPluginInfo', + 'FindPluginByNumber', + 'SetFailState', + 'ThrowError', + 'GetTime', + 'FormatTime', + 'LoadGameConfigFile', + 'GameConfGetOffset', + 'GameConfGetKeyValue', + 'GameConfGetAddress', + 'GetSysTickCount', + 'AutoExecConfig', + 'RegPluginLibrary', + 'LibraryExists', + 'GetExtensionFileStatus', + 'OnLibraryAdded', + 'OnLibraryRemoved', + 'ReadMapList', + 'SetMapListCompatBind', + 'OnClientFloodCheck', + 'OnClientFloodResult', + 'CanTestFeatures', + 'GetFeatureStatus', + 'RequireFeature', + 'LoadFromAddress', + 'StoreToAddress', + 'CreateStack', + 'PushStackCell', + 'PushStackString', + 'PushStackArray', + 'PopStackCell', + 'PopStackString', + 'PopStackArray', + 'IsStackEmpty', + 'PopStack', + 'OnPlayerRunCmd', + 'BuildPath', + 'OpenDirectory', + 'ReadDirEntry', + 'OpenFile', + 'DeleteFile', + 'ReadFileLine', + 'ReadFile', + 'ReadFileString', + 'WriteFile', + 'WriteFileString', + 'WriteFileLine', + 'ReadFileCell', + 'WriteFileCell', + 'IsEndOfFile', + 'FileSeek', + 'FilePosition', + 'FileExists', + 'RenameFile', + 'DirExists', + 'FileSize', + 'FlushFile', + 'RemoveDir', + 'CreateDirectory', + 'GetFileTime', + 'LogToOpenFile', + 'LogToOpenFileEx', + 'PbReadInt', + 'PbReadFloat', + 'PbReadBool', + 'PbReadString', + 'PbReadColor', + 'PbReadAngle', + 'PbReadVector', + 'PbReadVector2D', + 'PbGetRepeatedFieldCount', + 'PbSetInt', + 'PbSetFloat', + 'PbSetBool', + 'PbSetString', + 'PbSetColor', + 'PbSetAngle', + 'PbSetVector', + 'PbSetVector2D', + 'PbAddInt', + 'PbAddFloat', + 'PbAddBool', + 'PbAddString', + 'PbAddColor', + 'PbAddAngle', + 'PbAddVector', + 'PbAddVector2D', + 'PbRemoveRepeatedFieldValue', + 'PbReadMessage', + 'PbReadRepeatedMessage', + 'PbAddMessage', + 'SetNextMap', + 'GetNextMap', + 'ForceChangeLevel', + 'GetMapHistorySize', + 'GetMapHistory', + 'GeoipCode2', + 'GeoipCode3', + 'GeoipCountry', + 'MarkNativeAsOptional', + 'RegClientCookie', + 'FindClientCookie', + 'SetClientCookie', + 'GetClientCookie', + 'SetAuthIdCookie', + 'AreClientCookiesCached', + 'OnClientCookiesCached', + 'CookieMenuHandler', + 'SetCookiePrefabMenu', + 'SetCookieMenuItem', + 'ShowCookieMenu', + 'GetCookieIterator', + 'ReadCookieIterator', + 'GetCookieAccess', + 'GetClientCookieTime', + 'LoadTranslations', + 'SetGlobalTransTarget', + 'GetClientLanguage', + 'GetServerLanguage', + 'GetLanguageCount', + 'GetLanguageInfo', + 'SetClientLanguage', + 'GetLanguageByCode', + 'GetLanguageByName', + 'CS_OnBuyCommand', + 'CS_OnCSWeaponDrop', + 'CS_OnGetWeaponPrice', + 'CS_OnTerminateRound', + 'CS_RespawnPlayer', + 'CS_SwitchTeam', + 'CS_DropWeapon', + 'CS_TerminateRound', + 'CS_GetTranslatedWeaponAlias', + 'CS_GetWeaponPrice', + 'CS_GetClientClanTag', + 'CS_SetClientClanTag', + 'CS_GetTeamScore', + 'CS_SetTeamScore', + 'CS_GetMVPCount', + 'CS_SetMVPCount', + 'CS_GetClientContributionScore', + 'CS_SetClientContributionScore', + 'CS_GetClientAssists', + 'CS_SetClientAssists', + 'CS_AliasToWeaponID', + 'CS_WeaponIDToAlias', + 'CS_IsValidWeaponID', + 'CS_UpdateClientModel', + 'LogToGame', + 'SetRandomSeed', + 'GetRandomFloat', + 'GetRandomInt', + 'IsMapValid', + 'IsDedicatedServer', + 'GetEngineTime', + 'GetGameTime', + 'GetGameTickCount', + 'GetGameDescription', + 'GetGameFolderName', + 'GetCurrentMap', + 'PrecacheModel', + 'PrecacheSentenceFile', + 'PrecacheDecal', + 'PrecacheGeneric', + 'IsModelPrecached', + 'IsDecalPrecached', + 'IsGenericPrecached', + 'PrecacheSound', + 'IsSoundPrecached', + 'CreateDialog', + 'GetEngineVersion', + 'PrintToChat', + 'PrintToChatAll', + 'PrintCenterText', + 'PrintCenterTextAll', + 'PrintHintText', + 'PrintHintTextToAll', + 'ShowVGUIPanel', + 'CreateHudSynchronizer', + 'SetHudTextParams', + 'SetHudTextParamsEx', + 'ShowSyncHudText', + 'ClearSyncHud', + 'ShowHudText', + 'ShowMOTDPanel', + 'DisplayAskConnectBox', + 'EntIndexToEntRef', + 'EntRefToEntIndex', + 'MakeCompatEntRef', + 'SetClientViewEntity', + 'SetLightStyle', + 'GetClientEyePosition', + 'CreateDataPack', + 'WritePackCell', + 'WritePackFloat', + 'WritePackString', + 'ReadPackCell', + 'ReadPackFloat', + 'ReadPackString', + 'ResetPack', + 'GetPackPosition', + 'SetPackPosition', + 'IsPackReadable', + 'LogMessage', + 'LogToFile', + 'LogToFileEx', + 'LogAction', + 'LogError', + 'OnLogAction', + 'GameLogHook', + 'AddGameLogHook', + 'RemoveGameLogHook', + 'FindTeamByName', + 'StartPrepSDKCall', + 'PrepSDKCall_SetVirtual', + 'PrepSDKCall_SetSignature', + 'PrepSDKCall_SetAddress', + 'PrepSDKCall_SetFromConf', + 'PrepSDKCall_SetReturnInfo', + 'PrepSDKCall_AddParameter', + 'EndPrepSDKCall', + 'SDKCall', + 'GetPlayerResourceEntity', +) + + +if __name__ == '__main__': # pragma: no cover + import re + from urllib.request import FancyURLopener + + from pygments.util import format_lines + + class Opener(FancyURLopener): + version = 'Mozilla/5.0 (Pygments Sourcemod Builtins Update)' + + opener = Opener() + + def get_version(): + f = opener.open('http://docs.sourcemod.net/api/index.php') + r = re.compile(r'SourceMod v\.([\d\.]+(?:-\w+)?)') + for line in f: + m = r.search(line.decode()) + if m is not None: + return m.groups()[0] + raise ValueError('No version in api docs') + + def get_sm_functions(): + f = opener.open('http://docs.sourcemod.net/api/SMfuncs.js') + r = re.compile(r'SMfunctions\[\d+\] = Array \("(?:public )?([^,]+)",".+"\);') + functions = [] + for line in f: + m = r.match(line.decode()) + if m is not None: + functions.append(m.groups()[0]) + return functions + + def regenerate(filename, natives): + with open(filename, encoding='utf-8') as fp: + content = fp.read() + + header = content[:content.find('FUNCTIONS = (')] + footer = content[content.find("if __name__ == '__main__':")-1:] + + + with open(filename, 'w', encoding='utf-8') as fp: + fp.write(header) + fp.write(format_lines('FUNCTIONS', natives)) + fp.write('\n\n' + footer) + + def run(): + version = get_version() + print(f'> Downloading function index for SourceMod {version}') + functions = get_sm_functions() + print('> %d functions found:' % len(functions)) + + functionlist = [] + for full_function_name in functions: + print(f'>> {full_function_name}') + functionlist.append(full_function_name) + + regenerate(__file__, functionlist) + + + run() diff --git a/lib/python3.12/site-packages/pygments/lexers/_vim_builtins.py b/lib/python3.12/site-packages/pygments/lexers/_vim_builtins.py new file mode 100644 index 0000000000000000000000000000000000000000..abbbf993a354084011c0f66b90cc2f14e1d4d62f --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/_vim_builtins.py @@ -0,0 +1,1938 @@ +""" + pygments.lexers._vim_builtins + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + This file is autogenerated by scripts/get_vimkw.py + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +# Split up in multiple functions so it's importable by jython, which has a +# per-method size limit. + +def _getauto(): + var = ( + ('BufAdd','BufAdd'), + ('BufCreate','BufCreate'), + ('BufDelete','BufDelete'), + ('BufEnter','BufEnter'), + ('BufFilePost','BufFilePost'), + ('BufFilePre','BufFilePre'), + ('BufHidden','BufHidden'), + ('BufLeave','BufLeave'), + ('BufNew','BufNew'), + ('BufNewFile','BufNewFile'), + ('BufRead','BufRead'), + ('BufReadCmd','BufReadCmd'), + ('BufReadPost','BufReadPost'), + ('BufReadPre','BufReadPre'), + ('BufUnload','BufUnload'), + ('BufWinEnter','BufWinEnter'), + ('BufWinLeave','BufWinLeave'), + ('BufWipeout','BufWipeout'), + ('BufWrite','BufWrite'), + ('BufWriteCmd','BufWriteCmd'), + ('BufWritePost','BufWritePost'), + ('BufWritePre','BufWritePre'), + ('Cmd','Cmd'), + ('CmdwinEnter','CmdwinEnter'), + ('CmdwinLeave','CmdwinLeave'), + ('ColorScheme','ColorScheme'), + ('CompleteDone','CompleteDone'), + ('CursorHold','CursorHold'), + ('CursorHoldI','CursorHoldI'), + ('CursorMoved','CursorMoved'), + ('CursorMovedI','CursorMovedI'), + ('EncodingChanged','EncodingChanged'), + ('FileAppendCmd','FileAppendCmd'), + ('FileAppendPost','FileAppendPost'), + ('FileAppendPre','FileAppendPre'), + ('FileChangedRO','FileChangedRO'), + ('FileChangedShell','FileChangedShell'), + ('FileChangedShellPost','FileChangedShellPost'), + ('FileEncoding','FileEncoding'), + ('FileReadCmd','FileReadCmd'), + ('FileReadPost','FileReadPost'), + ('FileReadPre','FileReadPre'), + ('FileType','FileType'), + ('FileWriteCmd','FileWriteCmd'), + ('FileWritePost','FileWritePost'), + ('FileWritePre','FileWritePre'), + ('FilterReadPost','FilterReadPost'), + ('FilterReadPre','FilterReadPre'), + ('FilterWritePost','FilterWritePost'), + ('FilterWritePre','FilterWritePre'), + ('FocusGained','FocusGained'), + ('FocusLost','FocusLost'), + ('FuncUndefined','FuncUndefined'), + ('GUIEnter','GUIEnter'), + ('GUIFailed','GUIFailed'), + ('InsertChange','InsertChange'), + ('InsertCharPre','InsertCharPre'), + ('InsertEnter','InsertEnter'), + ('InsertLeave','InsertLeave'), + ('MenuPopup','MenuPopup'), + ('QuickFixCmdPost','QuickFixCmdPost'), + ('QuickFixCmdPre','QuickFixCmdPre'), + ('QuitPre','QuitPre'), + ('RemoteReply','RemoteReply'), + ('SessionLoadPost','SessionLoadPost'), + ('ShellCmdPost','ShellCmdPost'), + ('ShellFilterPost','ShellFilterPost'), + ('SourceCmd','SourceCmd'), + ('SourcePre','SourcePre'), + ('SpellFileMissing','SpellFileMissing'), + ('StdinReadPost','StdinReadPost'), + ('StdinReadPre','StdinReadPre'), + ('SwapExists','SwapExists'), + ('Syntax','Syntax'), + ('TabEnter','TabEnter'), + ('TabLeave','TabLeave'), + ('TermChanged','TermChanged'), + ('TermResponse','TermResponse'), + ('TextChanged','TextChanged'), + ('TextChangedI','TextChangedI'), + ('User','User'), + ('UserGettingBored','UserGettingBored'), + ('VimEnter','VimEnter'), + ('VimLeave','VimLeave'), + ('VimLeavePre','VimLeavePre'), + ('VimResized','VimResized'), + ('WinEnter','WinEnter'), + ('WinLeave','WinLeave'), + ('event','event'), + ) + return var +auto = _getauto() + +def _getcommand(): + var = ( + ('a','a'), + ('ab','ab'), + ('abc','abclear'), + ('abo','aboveleft'), + ('al','all'), + ('ar','ar'), + ('ar','args'), + ('arga','argadd'), + ('argd','argdelete'), + ('argdo','argdo'), + ('arge','argedit'), + ('argg','argglobal'), + ('argl','arglocal'), + ('argu','argument'), + ('as','ascii'), + ('au','au'), + ('b','buffer'), + ('bN','bNext'), + ('ba','ball'), + ('bad','badd'), + ('bd','bdelete'), + ('bel','belowright'), + ('bf','bfirst'), + ('bl','blast'), + ('bm','bmodified'), + ('bn','bnext'), + ('bo','botright'), + ('bp','bprevious'), + ('br','br'), + ('br','brewind'), + ('brea','break'), + ('breaka','breakadd'), + ('breakd','breakdel'), + ('breakl','breaklist'), + ('bro','browse'), + ('bu','bu'), + ('buf','buf'), + ('bufdo','bufdo'), + ('buffers','buffers'), + ('bun','bunload'), + ('bw','bwipeout'), + ('c','c'), + ('c','change'), + ('cN','cN'), + ('cN','cNext'), + ('cNf','cNf'), + ('cNf','cNfile'), + ('cabc','cabclear'), + ('cad','cad'), + ('cad','caddexpr'), + ('caddb','caddbuffer'), + ('caddf','caddfile'), + ('cal','call'), + ('cat','catch'), + ('cb','cbuffer'), + ('cc','cc'), + ('ccl','cclose'), + ('cd','cd'), + ('ce','center'), + ('cex','cexpr'), + ('cf','cfile'), + ('cfir','cfirst'), + ('cg','cgetfile'), + ('cgetb','cgetbuffer'), + ('cgete','cgetexpr'), + ('changes','changes'), + ('chd','chdir'), + ('che','checkpath'), + ('checkt','checktime'), + ('cl','cl'), + ('cl','clist'), + ('cla','clast'), + ('clo','close'), + ('cmapc','cmapclear'), + ('cn','cn'), + ('cn','cnext'), + ('cnew','cnewer'), + ('cnf','cnf'), + ('cnf','cnfile'), + ('co','copy'), + ('col','colder'), + ('colo','colorscheme'), + ('com','com'), + ('comc','comclear'), + ('comp','compiler'), + ('con','con'), + ('con','continue'), + ('conf','confirm'), + ('cope','copen'), + ('cp','cprevious'), + ('cpf','cpfile'), + ('cq','cquit'), + ('cr','crewind'), + ('cs','cs'), + ('cscope','cscope'), + ('cstag','cstag'), + ('cuna','cunabbrev'), + ('cw','cwindow'), + ('d','d'), + ('d','delete'), + ('de','de'), + ('debug','debug'), + ('debugg','debuggreedy'), + ('del','del'), + ('delc','delcommand'), + ('delel','delel'), + ('delep','delep'), + ('deletel','deletel'), + ('deletep','deletep'), + ('deletl','deletl'), + ('deletp','deletp'), + ('delf','delf'), + ('delf','delfunction'), + ('dell','dell'), + ('delm','delmarks'), + ('delp','delp'), + ('dep','dep'), + ('di','di'), + ('di','display'), + ('diffg','diffget'), + ('diffo','diffoff'), + ('diffp','diffpatch'), + ('diffpu','diffput'), + ('diffs','diffsplit'), + ('difft','diffthis'), + ('diffu','diffupdate'), + ('dig','dig'), + ('dig','digraphs'), + ('dir','dir'), + ('dj','djump'), + ('dl','dl'), + ('dli','dlist'), + ('do','do'), + ('doau','doau'), + ('dp','dp'), + ('dr','drop'), + ('ds','dsearch'), + ('dsp','dsplit'), + ('e','e'), + ('e','edit'), + ('ea','ea'), + ('earlier','earlier'), + ('ec','ec'), + ('echoe','echoerr'), + ('echom','echomsg'), + ('echon','echon'), + ('el','else'), + ('elsei','elseif'), + ('em','emenu'), + ('en','en'), + ('en','endif'), + ('endf','endf'), + ('endf','endfunction'), + ('endfo','endfor'), + ('endfun','endfun'), + ('endt','endtry'), + ('endw','endwhile'), + ('ene','enew'), + ('ex','ex'), + ('exi','exit'), + ('exu','exusage'), + ('f','f'), + ('f','file'), + ('files','files'), + ('filet','filet'), + ('filetype','filetype'), + ('fin','fin'), + ('fin','find'), + ('fina','finally'), + ('fini','finish'), + ('fir','first'), + ('fix','fixdel'), + ('fo','fold'), + ('foldc','foldclose'), + ('foldd','folddoopen'), + ('folddoc','folddoclosed'), + ('foldo','foldopen'), + ('for','for'), + ('fu','fu'), + ('fu','function'), + ('fun','fun'), + ('g','g'), + ('go','goto'), + ('gr','grep'), + ('grepa','grepadd'), + ('gui','gui'), + ('gvim','gvim'), + ('h','h'), + ('h','help'), + ('ha','hardcopy'), + ('helpf','helpfind'), + ('helpg','helpgrep'), + ('helpt','helptags'), + ('hi','hi'), + ('hid','hide'), + ('his','history'), + ('i','i'), + ('ia','ia'), + ('iabc','iabclear'), + ('if','if'), + ('ij','ijump'), + ('il','ilist'), + ('imapc','imapclear'), + ('in','in'), + ('intro','intro'), + ('is','isearch'), + ('isp','isplit'), + ('iuna','iunabbrev'), + ('j','join'), + ('ju','jumps'), + ('k','k'), + ('kee','keepmarks'), + ('keepa','keepa'), + ('keepalt','keepalt'), + ('keepj','keepjumps'), + ('keepp','keeppatterns'), + ('l','l'), + ('l','list'), + ('lN','lN'), + ('lN','lNext'), + ('lNf','lNf'), + ('lNf','lNfile'), + ('la','la'), + ('la','last'), + ('lad','lad'), + ('lad','laddexpr'), + ('laddb','laddbuffer'), + ('laddf','laddfile'), + ('lan','lan'), + ('lan','language'), + ('lat','lat'), + ('later','later'), + ('lb','lbuffer'), + ('lc','lcd'), + ('lch','lchdir'), + ('lcl','lclose'), + ('lcs','lcs'), + ('lcscope','lcscope'), + ('le','left'), + ('lefta','leftabove'), + ('lex','lexpr'), + ('lf','lfile'), + ('lfir','lfirst'), + ('lg','lgetfile'), + ('lgetb','lgetbuffer'), + ('lgete','lgetexpr'), + ('lgr','lgrep'), + ('lgrepa','lgrepadd'), + ('lh','lhelpgrep'), + ('ll','ll'), + ('lla','llast'), + ('lli','llist'), + ('lmak','lmake'), + ('lmapc','lmapclear'), + ('lne','lne'), + ('lne','lnext'), + ('lnew','lnewer'), + ('lnf','lnf'), + ('lnf','lnfile'), + ('lo','lo'), + ('lo','loadview'), + ('loadk','loadk'), + ('loadkeymap','loadkeymap'), + ('loc','lockmarks'), + ('lockv','lockvar'), + ('lol','lolder'), + ('lop','lopen'), + ('lp','lprevious'), + ('lpf','lpfile'), + ('lr','lrewind'), + ('ls','ls'), + ('lt','ltag'), + ('lua','lua'), + ('luado','luado'), + ('luafile','luafile'), + ('lv','lvimgrep'), + ('lvimgrepa','lvimgrepadd'), + ('lw','lwindow'), + ('m','move'), + ('ma','ma'), + ('ma','mark'), + ('mak','make'), + ('marks','marks'), + ('mat','match'), + ('menut','menut'), + ('menut','menutranslate'), + ('mes','mes'), + ('messages','messages'), + ('mk','mk'), + ('mk','mkexrc'), + ('mks','mksession'), + ('mksp','mkspell'), + ('mkv','mkv'), + ('mkv','mkvimrc'), + ('mkvie','mkview'), + ('mo','mo'), + ('mod','mode'), + ('mz','mz'), + ('mz','mzscheme'), + ('mzf','mzfile'), + ('n','n'), + ('n','next'), + ('nb','nbkey'), + ('nbc','nbclose'), + ('nbs','nbstart'), + ('ne','ne'), + ('new','new'), + ('nmapc','nmapclear'), + ('noa','noa'), + ('noautocmd','noautocmd'), + ('noh','nohlsearch'), + ('nu','number'), + ('o','o'), + ('o','open'), + ('ol','oldfiles'), + ('omapc','omapclear'), + ('on','only'), + ('opt','options'), + ('ownsyntax','ownsyntax'), + ('p','p'), + ('p','print'), + ('pc','pclose'), + ('pe','pe'), + ('pe','perl'), + ('ped','pedit'), + ('perld','perldo'), + ('po','pop'), + ('popu','popu'), + ('popu','popup'), + ('pp','ppop'), + ('pr','pr'), + ('pre','preserve'), + ('prev','previous'), + ('pro','pro'), + ('prof','profile'), + ('profd','profdel'), + ('promptf','promptfind'), + ('promptr','promptrepl'), + ('ps','psearch'), + ('ptN','ptN'), + ('ptN','ptNext'), + ('pta','ptag'), + ('ptf','ptfirst'), + ('ptj','ptjump'), + ('ptl','ptlast'), + ('ptn','ptn'), + ('ptn','ptnext'), + ('ptp','ptprevious'), + ('ptr','ptrewind'), + ('pts','ptselect'), + ('pu','put'), + ('pw','pwd'), + ('py','py'), + ('py','python'), + ('py3','py3'), + ('py3','py3'), + ('py3do','py3do'), + ('pydo','pydo'), + ('pyf','pyfile'), + ('python3','python3'), + ('q','q'), + ('q','quit'), + ('qa','qall'), + ('quita','quitall'), + ('r','r'), + ('r','read'), + ('re','re'), + ('rec','recover'), + ('red','red'), + ('red','redo'), + ('redi','redir'), + ('redr','redraw'), + ('redraws','redrawstatus'), + ('reg','registers'), + ('res','resize'), + ('ret','retab'), + ('retu','return'), + ('rew','rewind'), + ('ri','right'), + ('rightb','rightbelow'), + ('ru','ru'), + ('ru','runtime'), + ('rub','ruby'), + ('rubyd','rubydo'), + ('rubyf','rubyfile'), + ('rundo','rundo'), + ('rv','rviminfo'), + ('sN','sNext'), + ('sa','sargument'), + ('sal','sall'), + ('san','sandbox'), + ('sav','saveas'), + ('sb','sbuffer'), + ('sbN','sbNext'), + ('sba','sball'), + ('sbf','sbfirst'), + ('sbl','sblast'), + ('sbm','sbmodified'), + ('sbn','sbnext'), + ('sbp','sbprevious'), + ('sbr','sbrewind'), + ('scrip','scrip'), + ('scrip','scriptnames'), + ('scripte','scriptencoding'), + ('scs','scs'), + ('scscope','scscope'), + ('se','set'), + ('setf','setfiletype'), + ('setg','setglobal'), + ('setl','setlocal'), + ('sf','sfind'), + ('sfir','sfirst'), + ('sh','shell'), + ('si','si'), + ('sig','sig'), + ('sign','sign'), + ('sil','silent'), + ('sim','simalt'), + ('sl','sl'), + ('sl','sleep'), + ('sla','slast'), + ('sm','smagic'), + ('sm','smap'), + ('sme','sme'), + ('smenu','smenu'), + ('sn','snext'), + ('sni','sniff'), + ('sno','snomagic'), + ('snoreme','snoreme'), + ('snoremenu','snoremenu'), + ('so','so'), + ('so','source'), + ('sor','sort'), + ('sp','split'), + ('spe','spe'), + ('spe','spellgood'), + ('spelld','spelldump'), + ('spelli','spellinfo'), + ('spellr','spellrepall'), + ('spellu','spellundo'), + ('spellw','spellwrong'), + ('spr','sprevious'), + ('sre','srewind'), + ('st','st'), + ('st','stop'), + ('sta','stag'), + ('star','star'), + ('star','startinsert'), + ('start','start'), + ('startg','startgreplace'), + ('startr','startreplace'), + ('stj','stjump'), + ('stopi','stopinsert'), + ('sts','stselect'), + ('sun','sunhide'), + ('sunme','sunme'), + ('sunmenu','sunmenu'), + ('sus','suspend'), + ('sv','sview'), + ('sw','swapname'), + ('sy','sy'), + ('syn','syn'), + ('sync','sync'), + ('syncbind','syncbind'), + ('syntime','syntime'), + ('t','t'), + ('tN','tN'), + ('tN','tNext'), + ('ta','ta'), + ('ta','tag'), + ('tab','tab'), + ('tabN','tabN'), + ('tabN','tabNext'), + ('tabc','tabclose'), + ('tabd','tabdo'), + ('tabe','tabedit'), + ('tabf','tabfind'), + ('tabfir','tabfirst'), + ('tabl','tablast'), + ('tabm','tabmove'), + ('tabn','tabnext'), + ('tabnew','tabnew'), + ('tabo','tabonly'), + ('tabp','tabprevious'), + ('tabr','tabrewind'), + ('tabs','tabs'), + ('tags','tags'), + ('tc','tcl'), + ('tcld','tcldo'), + ('tclf','tclfile'), + ('te','tearoff'), + ('tf','tfirst'), + ('th','throw'), + ('tj','tjump'), + ('tl','tlast'), + ('tm','tm'), + ('tm','tmenu'), + ('tn','tn'), + ('tn','tnext'), + ('to','topleft'), + ('tp','tprevious'), + ('tr','tr'), + ('tr','trewind'), + ('try','try'), + ('ts','tselect'), + ('tu','tu'), + ('tu','tunmenu'), + ('u','u'), + ('u','undo'), + ('un','un'), + ('una','unabbreviate'), + ('undoj','undojoin'), + ('undol','undolist'), + ('unh','unhide'), + ('unl','unl'), + ('unlo','unlockvar'), + ('uns','unsilent'), + ('up','update'), + ('v','v'), + ('ve','ve'), + ('ve','version'), + ('verb','verbose'), + ('vert','vertical'), + ('vi','vi'), + ('vi','visual'), + ('vie','view'), + ('vim','vimgrep'), + ('vimgrepa','vimgrepadd'), + ('viu','viusage'), + ('vmapc','vmapclear'), + ('vne','vnew'), + ('vs','vsplit'), + ('w','w'), + ('w','write'), + ('wN','wNext'), + ('wa','wall'), + ('wh','while'), + ('win','win'), + ('win','winsize'), + ('winc','wincmd'), + ('windo','windo'), + ('winp','winpos'), + ('wn','wnext'), + ('wp','wprevious'), + ('wq','wq'), + ('wqa','wqall'), + ('ws','wsverb'), + ('wundo','wundo'), + ('wv','wviminfo'), + ('x','x'), + ('x','xit'), + ('xa','xall'), + ('xmapc','xmapclear'), + ('xme','xme'), + ('xmenu','xmenu'), + ('xnoreme','xnoreme'), + ('xnoremenu','xnoremenu'), + ('xunme','xunme'), + ('xunmenu','xunmenu'), + ('xwininfo','xwininfo'), + ('y','yank'), + ) + return var +command = _getcommand() + +def _getoption(): + var = ( + ('acd','acd'), + ('ai','ai'), + ('akm','akm'), + ('al','al'), + ('aleph','aleph'), + ('allowrevins','allowrevins'), + ('altkeymap','altkeymap'), + ('ambiwidth','ambiwidth'), + ('ambw','ambw'), + ('anti','anti'), + ('antialias','antialias'), + ('ar','ar'), + ('arab','arab'), + ('arabic','arabic'), + ('arabicshape','arabicshape'), + ('ari','ari'), + ('arshape','arshape'), + ('autochdir','autochdir'), + ('autoindent','autoindent'), + ('autoread','autoread'), + ('autowrite','autowrite'), + ('autowriteall','autowriteall'), + ('aw','aw'), + ('awa','awa'), + ('background','background'), + ('backspace','backspace'), + ('backup','backup'), + ('backupcopy','backupcopy'), + ('backupdir','backupdir'), + ('backupext','backupext'), + ('backupskip','backupskip'), + ('balloondelay','balloondelay'), + ('ballooneval','ballooneval'), + ('balloonexpr','balloonexpr'), + ('bdir','bdir'), + ('bdlay','bdlay'), + ('beval','beval'), + ('bex','bex'), + ('bexpr','bexpr'), + ('bg','bg'), + ('bh','bh'), + ('bin','bin'), + ('binary','binary'), + ('biosk','biosk'), + ('bioskey','bioskey'), + ('bk','bk'), + ('bkc','bkc'), + ('bl','bl'), + ('bomb','bomb'), + ('breakat','breakat'), + ('brk','brk'), + ('browsedir','browsedir'), + ('bs','bs'), + ('bsdir','bsdir'), + ('bsk','bsk'), + ('bt','bt'), + ('bufhidden','bufhidden'), + ('buflisted','buflisted'), + ('buftype','buftype'), + ('casemap','casemap'), + ('cb','cb'), + ('cc','cc'), + ('ccv','ccv'), + ('cd','cd'), + ('cdpath','cdpath'), + ('cedit','cedit'), + ('cf','cf'), + ('cfu','cfu'), + ('ch','ch'), + ('charconvert','charconvert'), + ('ci','ci'), + ('cin','cin'), + ('cindent','cindent'), + ('cink','cink'), + ('cinkeys','cinkeys'), + ('cino','cino'), + ('cinoptions','cinoptions'), + ('cinw','cinw'), + ('cinwords','cinwords'), + ('clipboard','clipboard'), + ('cmdheight','cmdheight'), + ('cmdwinheight','cmdwinheight'), + ('cmp','cmp'), + ('cms','cms'), + ('co','co'), + ('cocu','cocu'), + ('cole','cole'), + ('colorcolumn','colorcolumn'), + ('columns','columns'), + ('com','com'), + ('comments','comments'), + ('commentstring','commentstring'), + ('compatible','compatible'), + ('complete','complete'), + ('completefunc','completefunc'), + ('completeopt','completeopt'), + ('concealcursor','concealcursor'), + ('conceallevel','conceallevel'), + ('confirm','confirm'), + ('consk','consk'), + ('conskey','conskey'), + ('copyindent','copyindent'), + ('cot','cot'), + ('cp','cp'), + ('cpo','cpo'), + ('cpoptions','cpoptions'), + ('cpt','cpt'), + ('crb','crb'), + ('cryptmethod','cryptmethod'), + ('cscopepathcomp','cscopepathcomp'), + ('cscopeprg','cscopeprg'), + ('cscopequickfix','cscopequickfix'), + ('cscoperelative','cscoperelative'), + ('cscopetag','cscopetag'), + ('cscopetagorder','cscopetagorder'), + ('cscopeverbose','cscopeverbose'), + ('cspc','cspc'), + ('csprg','csprg'), + ('csqf','csqf'), + ('csre','csre'), + ('cst','cst'), + ('csto','csto'), + ('csverb','csverb'), + ('cuc','cuc'), + ('cul','cul'), + ('cursorbind','cursorbind'), + ('cursorcolumn','cursorcolumn'), + ('cursorline','cursorline'), + ('cwh','cwh'), + ('debug','debug'), + ('deco','deco'), + ('def','def'), + ('define','define'), + ('delcombine','delcombine'), + ('dex','dex'), + ('dg','dg'), + ('dict','dict'), + ('dictionary','dictionary'), + ('diff','diff'), + ('diffexpr','diffexpr'), + ('diffopt','diffopt'), + ('digraph','digraph'), + ('dip','dip'), + ('dir','dir'), + ('directory','directory'), + ('display','display'), + ('dy','dy'), + ('ea','ea'), + ('ead','ead'), + ('eadirection','eadirection'), + ('eb','eb'), + ('ed','ed'), + ('edcompatible','edcompatible'), + ('ef','ef'), + ('efm','efm'), + ('ei','ei'), + ('ek','ek'), + ('enc','enc'), + ('encoding','encoding'), + ('endofline','endofline'), + ('eol','eol'), + ('ep','ep'), + ('equalalways','equalalways'), + ('equalprg','equalprg'), + ('errorbells','errorbells'), + ('errorfile','errorfile'), + ('errorformat','errorformat'), + ('esckeys','esckeys'), + ('et','et'), + ('eventignore','eventignore'), + ('ex','ex'), + ('expandtab','expandtab'), + ('exrc','exrc'), + ('fcl','fcl'), + ('fcs','fcs'), + ('fdc','fdc'), + ('fde','fde'), + ('fdi','fdi'), + ('fdl','fdl'), + ('fdls','fdls'), + ('fdm','fdm'), + ('fdn','fdn'), + ('fdo','fdo'), + ('fdt','fdt'), + ('fen','fen'), + ('fenc','fenc'), + ('fencs','fencs'), + ('fex','fex'), + ('ff','ff'), + ('ffs','ffs'), + ('fic','fic'), + ('fileencoding','fileencoding'), + ('fileencodings','fileencodings'), + ('fileformat','fileformat'), + ('fileformats','fileformats'), + ('fileignorecase','fileignorecase'), + ('filetype','filetype'), + ('fillchars','fillchars'), + ('fk','fk'), + ('fkmap','fkmap'), + ('flp','flp'), + ('fml','fml'), + ('fmr','fmr'), + ('fo','fo'), + ('foldclose','foldclose'), + ('foldcolumn','foldcolumn'), + ('foldenable','foldenable'), + ('foldexpr','foldexpr'), + ('foldignore','foldignore'), + ('foldlevel','foldlevel'), + ('foldlevelstart','foldlevelstart'), + ('foldmarker','foldmarker'), + ('foldmethod','foldmethod'), + ('foldminlines','foldminlines'), + ('foldnestmax','foldnestmax'), + ('foldopen','foldopen'), + ('foldtext','foldtext'), + ('formatexpr','formatexpr'), + ('formatlistpat','formatlistpat'), + ('formatoptions','formatoptions'), + ('formatprg','formatprg'), + ('fp','fp'), + ('fs','fs'), + ('fsync','fsync'), + ('ft','ft'), + ('gcr','gcr'), + ('gd','gd'), + ('gdefault','gdefault'), + ('gfm','gfm'), + ('gfn','gfn'), + ('gfs','gfs'), + ('gfw','gfw'), + ('ghr','ghr'), + ('go','go'), + ('gp','gp'), + ('grepformat','grepformat'), + ('grepprg','grepprg'), + ('gtl','gtl'), + ('gtt','gtt'), + ('guicursor','guicursor'), + ('guifont','guifont'), + ('guifontset','guifontset'), + ('guifontwide','guifontwide'), + ('guiheadroom','guiheadroom'), + ('guioptions','guioptions'), + ('guipty','guipty'), + ('guitablabel','guitablabel'), + ('guitabtooltip','guitabtooltip'), + ('helpfile','helpfile'), + ('helpheight','helpheight'), + ('helplang','helplang'), + ('hf','hf'), + ('hh','hh'), + ('hi','hi'), + ('hid','hid'), + ('hidden','hidden'), + ('highlight','highlight'), + ('history','history'), + ('hk','hk'), + ('hkmap','hkmap'), + ('hkmapp','hkmapp'), + ('hkp','hkp'), + ('hl','hl'), + ('hlg','hlg'), + ('hls','hls'), + ('hlsearch','hlsearch'), + ('ic','ic'), + ('icon','icon'), + ('iconstring','iconstring'), + ('ignorecase','ignorecase'), + ('im','im'), + ('imactivatefunc','imactivatefunc'), + ('imactivatekey','imactivatekey'), + ('imaf','imaf'), + ('imak','imak'), + ('imc','imc'), + ('imcmdline','imcmdline'), + ('imd','imd'), + ('imdisable','imdisable'), + ('imi','imi'), + ('iminsert','iminsert'), + ('ims','ims'), + ('imsearch','imsearch'), + ('imsf','imsf'), + ('imstatusfunc','imstatusfunc'), + ('inc','inc'), + ('include','include'), + ('includeexpr','includeexpr'), + ('incsearch','incsearch'), + ('inde','inde'), + ('indentexpr','indentexpr'), + ('indentkeys','indentkeys'), + ('indk','indk'), + ('inex','inex'), + ('inf','inf'), + ('infercase','infercase'), + ('inoremap','inoremap'), + ('insertmode','insertmode'), + ('invacd','invacd'), + ('invai','invai'), + ('invakm','invakm'), + ('invallowrevins','invallowrevins'), + ('invaltkeymap','invaltkeymap'), + ('invanti','invanti'), + ('invantialias','invantialias'), + ('invar','invar'), + ('invarab','invarab'), + ('invarabic','invarabic'), + ('invarabicshape','invarabicshape'), + ('invari','invari'), + ('invarshape','invarshape'), + ('invautochdir','invautochdir'), + ('invautoindent','invautoindent'), + ('invautoread','invautoread'), + ('invautowrite','invautowrite'), + ('invautowriteall','invautowriteall'), + ('invaw','invaw'), + ('invawa','invawa'), + ('invbackup','invbackup'), + ('invballooneval','invballooneval'), + ('invbeval','invbeval'), + ('invbin','invbin'), + ('invbinary','invbinary'), + ('invbiosk','invbiosk'), + ('invbioskey','invbioskey'), + ('invbk','invbk'), + ('invbl','invbl'), + ('invbomb','invbomb'), + ('invbuflisted','invbuflisted'), + ('invcf','invcf'), + ('invci','invci'), + ('invcin','invcin'), + ('invcindent','invcindent'), + ('invcompatible','invcompatible'), + ('invconfirm','invconfirm'), + ('invconsk','invconsk'), + ('invconskey','invconskey'), + ('invcopyindent','invcopyindent'), + ('invcp','invcp'), + ('invcrb','invcrb'), + ('invcscoperelative','invcscoperelative'), + ('invcscopetag','invcscopetag'), + ('invcscopeverbose','invcscopeverbose'), + ('invcsre','invcsre'), + ('invcst','invcst'), + ('invcsverb','invcsverb'), + ('invcuc','invcuc'), + ('invcul','invcul'), + ('invcursorbind','invcursorbind'), + ('invcursorcolumn','invcursorcolumn'), + ('invcursorline','invcursorline'), + ('invdeco','invdeco'), + ('invdelcombine','invdelcombine'), + ('invdg','invdg'), + ('invdiff','invdiff'), + ('invdigraph','invdigraph'), + ('invea','invea'), + ('inveb','inveb'), + ('inved','inved'), + ('invedcompatible','invedcompatible'), + ('invek','invek'), + ('invendofline','invendofline'), + ('inveol','inveol'), + ('invequalalways','invequalalways'), + ('inverrorbells','inverrorbells'), + ('invesckeys','invesckeys'), + ('invet','invet'), + ('invex','invex'), + ('invexpandtab','invexpandtab'), + ('invexrc','invexrc'), + ('invfen','invfen'), + ('invfic','invfic'), + ('invfileignorecase','invfileignorecase'), + ('invfk','invfk'), + ('invfkmap','invfkmap'), + ('invfoldenable','invfoldenable'), + ('invgd','invgd'), + ('invgdefault','invgdefault'), + ('invguipty','invguipty'), + ('invhid','invhid'), + ('invhidden','invhidden'), + ('invhk','invhk'), + ('invhkmap','invhkmap'), + ('invhkmapp','invhkmapp'), + ('invhkp','invhkp'), + ('invhls','invhls'), + ('invhlsearch','invhlsearch'), + ('invic','invic'), + ('invicon','invicon'), + ('invignorecase','invignorecase'), + ('invim','invim'), + ('invimc','invimc'), + ('invimcmdline','invimcmdline'), + ('invimd','invimd'), + ('invimdisable','invimdisable'), + ('invincsearch','invincsearch'), + ('invinf','invinf'), + ('invinfercase','invinfercase'), + ('invinsertmode','invinsertmode'), + ('invis','invis'), + ('invjoinspaces','invjoinspaces'), + ('invjs','invjs'), + ('invlazyredraw','invlazyredraw'), + ('invlbr','invlbr'), + ('invlinebreak','invlinebreak'), + ('invlisp','invlisp'), + ('invlist','invlist'), + ('invloadplugins','invloadplugins'), + ('invlpl','invlpl'), + ('invlz','invlz'), + ('invma','invma'), + ('invmacatsui','invmacatsui'), + ('invmagic','invmagic'), + ('invmh','invmh'), + ('invml','invml'), + ('invmod','invmod'), + ('invmodeline','invmodeline'), + ('invmodifiable','invmodifiable'), + ('invmodified','invmodified'), + ('invmore','invmore'), + ('invmousef','invmousef'), + ('invmousefocus','invmousefocus'), + ('invmousehide','invmousehide'), + ('invnu','invnu'), + ('invnumber','invnumber'), + ('invodev','invodev'), + ('invopendevice','invopendevice'), + ('invpaste','invpaste'), + ('invpi','invpi'), + ('invpreserveindent','invpreserveindent'), + ('invpreviewwindow','invpreviewwindow'), + ('invprompt','invprompt'), + ('invpvw','invpvw'), + ('invreadonly','invreadonly'), + ('invrelativenumber','invrelativenumber'), + ('invremap','invremap'), + ('invrestorescreen','invrestorescreen'), + ('invrevins','invrevins'), + ('invri','invri'), + ('invrightleft','invrightleft'), + ('invrl','invrl'), + ('invrnu','invrnu'), + ('invro','invro'), + ('invrs','invrs'), + ('invru','invru'), + ('invruler','invruler'), + ('invsb','invsb'), + ('invsc','invsc'), + ('invscb','invscb'), + ('invscrollbind','invscrollbind'), + ('invscs','invscs'), + ('invsecure','invsecure'), + ('invsft','invsft'), + ('invshellslash','invshellslash'), + ('invshelltemp','invshelltemp'), + ('invshiftround','invshiftround'), + ('invshortname','invshortname'), + ('invshowcmd','invshowcmd'), + ('invshowfulltag','invshowfulltag'), + ('invshowmatch','invshowmatch'), + ('invshowmode','invshowmode'), + ('invsi','invsi'), + ('invsm','invsm'), + ('invsmartcase','invsmartcase'), + ('invsmartindent','invsmartindent'), + ('invsmarttab','invsmarttab'), + ('invsmd','invsmd'), + ('invsn','invsn'), + ('invsol','invsol'), + ('invspell','invspell'), + ('invsplitbelow','invsplitbelow'), + ('invsplitright','invsplitright'), + ('invspr','invspr'), + ('invsr','invsr'), + ('invssl','invssl'), + ('invsta','invsta'), + ('invstartofline','invstartofline'), + ('invstmp','invstmp'), + ('invswapfile','invswapfile'), + ('invswf','invswf'), + ('invta','invta'), + ('invtagbsearch','invtagbsearch'), + ('invtagrelative','invtagrelative'), + ('invtagstack','invtagstack'), + ('invtbi','invtbi'), + ('invtbidi','invtbidi'), + ('invtbs','invtbs'), + ('invtermbidi','invtermbidi'), + ('invterse','invterse'), + ('invtextauto','invtextauto'), + ('invtextmode','invtextmode'), + ('invtf','invtf'), + ('invtgst','invtgst'), + ('invtildeop','invtildeop'), + ('invtimeout','invtimeout'), + ('invtitle','invtitle'), + ('invto','invto'), + ('invtop','invtop'), + ('invtr','invtr'), + ('invttimeout','invttimeout'), + ('invttybuiltin','invttybuiltin'), + ('invttyfast','invttyfast'), + ('invtx','invtx'), + ('invudf','invudf'), + ('invundofile','invundofile'), + ('invvb','invvb'), + ('invvisualbell','invvisualbell'), + ('invwa','invwa'), + ('invwarn','invwarn'), + ('invwb','invwb'), + ('invweirdinvert','invweirdinvert'), + ('invwfh','invwfh'), + ('invwfw','invwfw'), + ('invwic','invwic'), + ('invwildignorecase','invwildignorecase'), + ('invwildmenu','invwildmenu'), + ('invwinfixheight','invwinfixheight'), + ('invwinfixwidth','invwinfixwidth'), + ('invwiv','invwiv'), + ('invwmnu','invwmnu'), + ('invwrap','invwrap'), + ('invwrapscan','invwrapscan'), + ('invwrite','invwrite'), + ('invwriteany','invwriteany'), + ('invwritebackup','invwritebackup'), + ('invws','invws'), + ('is','is'), + ('isf','isf'), + ('isfname','isfname'), + ('isi','isi'), + ('isident','isident'), + ('isk','isk'), + ('iskeyword','iskeyword'), + ('isp','isp'), + ('isprint','isprint'), + ('joinspaces','joinspaces'), + ('js','js'), + ('key','key'), + ('keymap','keymap'), + ('keymodel','keymodel'), + ('keywordprg','keywordprg'), + ('km','km'), + ('kmp','kmp'), + ('kp','kp'), + ('langmap','langmap'), + ('langmenu','langmenu'), + ('laststatus','laststatus'), + ('lazyredraw','lazyredraw'), + ('lbr','lbr'), + ('lcs','lcs'), + ('linebreak','linebreak'), + ('lines','lines'), + ('linespace','linespace'), + ('lisp','lisp'), + ('lispwords','lispwords'), + ('list','list'), + ('listchars','listchars'), + ('lm','lm'), + ('lmap','lmap'), + ('loadplugins','loadplugins'), + ('lpl','lpl'), + ('ls','ls'), + ('lsp','lsp'), + ('lw','lw'), + ('lz','lz'), + ('ma','ma'), + ('macatsui','macatsui'), + ('magic','magic'), + ('makeef','makeef'), + ('makeprg','makeprg'), + ('mat','mat'), + ('matchpairs','matchpairs'), + ('matchtime','matchtime'), + ('maxcombine','maxcombine'), + ('maxfuncdepth','maxfuncdepth'), + ('maxmapdepth','maxmapdepth'), + ('maxmem','maxmem'), + ('maxmempattern','maxmempattern'), + ('maxmemtot','maxmemtot'), + ('mco','mco'), + ('mef','mef'), + ('menuitems','menuitems'), + ('mfd','mfd'), + ('mh','mh'), + ('mis','mis'), + ('mkspellmem','mkspellmem'), + ('ml','ml'), + ('mls','mls'), + ('mm','mm'), + ('mmd','mmd'), + ('mmp','mmp'), + ('mmt','mmt'), + ('mod','mod'), + ('modeline','modeline'), + ('modelines','modelines'), + ('modifiable','modifiable'), + ('modified','modified'), + ('more','more'), + ('mouse','mouse'), + ('mousef','mousef'), + ('mousefocus','mousefocus'), + ('mousehide','mousehide'), + ('mousem','mousem'), + ('mousemodel','mousemodel'), + ('mouses','mouses'), + ('mouseshape','mouseshape'), + ('mouset','mouset'), + ('mousetime','mousetime'), + ('mp','mp'), + ('mps','mps'), + ('msm','msm'), + ('mzq','mzq'), + ('mzquantum','mzquantum'), + ('nf','nf'), + ('nnoremap','nnoremap'), + ('noacd','noacd'), + ('noai','noai'), + ('noakm','noakm'), + ('noallowrevins','noallowrevins'), + ('noaltkeymap','noaltkeymap'), + ('noanti','noanti'), + ('noantialias','noantialias'), + ('noar','noar'), + ('noarab','noarab'), + ('noarabic','noarabic'), + ('noarabicshape','noarabicshape'), + ('noari','noari'), + ('noarshape','noarshape'), + ('noautochdir','noautochdir'), + ('noautoindent','noautoindent'), + ('noautoread','noautoread'), + ('noautowrite','noautowrite'), + ('noautowriteall','noautowriteall'), + ('noaw','noaw'), + ('noawa','noawa'), + ('nobackup','nobackup'), + ('noballooneval','noballooneval'), + ('nobeval','nobeval'), + ('nobin','nobin'), + ('nobinary','nobinary'), + ('nobiosk','nobiosk'), + ('nobioskey','nobioskey'), + ('nobk','nobk'), + ('nobl','nobl'), + ('nobomb','nobomb'), + ('nobuflisted','nobuflisted'), + ('nocf','nocf'), + ('noci','noci'), + ('nocin','nocin'), + ('nocindent','nocindent'), + ('nocompatible','nocompatible'), + ('noconfirm','noconfirm'), + ('noconsk','noconsk'), + ('noconskey','noconskey'), + ('nocopyindent','nocopyindent'), + ('nocp','nocp'), + ('nocrb','nocrb'), + ('nocscoperelative','nocscoperelative'), + ('nocscopetag','nocscopetag'), + ('nocscopeverbose','nocscopeverbose'), + ('nocsre','nocsre'), + ('nocst','nocst'), + ('nocsverb','nocsverb'), + ('nocuc','nocuc'), + ('nocul','nocul'), + ('nocursorbind','nocursorbind'), + ('nocursorcolumn','nocursorcolumn'), + ('nocursorline','nocursorline'), + ('nodeco','nodeco'), + ('nodelcombine','nodelcombine'), + ('nodg','nodg'), + ('nodiff','nodiff'), + ('nodigraph','nodigraph'), + ('noea','noea'), + ('noeb','noeb'), + ('noed','noed'), + ('noedcompatible','noedcompatible'), + ('noek','noek'), + ('noendofline','noendofline'), + ('noeol','noeol'), + ('noequalalways','noequalalways'), + ('noerrorbells','noerrorbells'), + ('noesckeys','noesckeys'), + ('noet','noet'), + ('noex','noex'), + ('noexpandtab','noexpandtab'), + ('noexrc','noexrc'), + ('nofen','nofen'), + ('nofic','nofic'), + ('nofileignorecase','nofileignorecase'), + ('nofk','nofk'), + ('nofkmap','nofkmap'), + ('nofoldenable','nofoldenable'), + ('nogd','nogd'), + ('nogdefault','nogdefault'), + ('noguipty','noguipty'), + ('nohid','nohid'), + ('nohidden','nohidden'), + ('nohk','nohk'), + ('nohkmap','nohkmap'), + ('nohkmapp','nohkmapp'), + ('nohkp','nohkp'), + ('nohls','nohls'), + ('nohlsearch','nohlsearch'), + ('noic','noic'), + ('noicon','noicon'), + ('noignorecase','noignorecase'), + ('noim','noim'), + ('noimc','noimc'), + ('noimcmdline','noimcmdline'), + ('noimd','noimd'), + ('noimdisable','noimdisable'), + ('noincsearch','noincsearch'), + ('noinf','noinf'), + ('noinfercase','noinfercase'), + ('noinsertmode','noinsertmode'), + ('nois','nois'), + ('nojoinspaces','nojoinspaces'), + ('nojs','nojs'), + ('nolazyredraw','nolazyredraw'), + ('nolbr','nolbr'), + ('nolinebreak','nolinebreak'), + ('nolisp','nolisp'), + ('nolist','nolist'), + ('noloadplugins','noloadplugins'), + ('nolpl','nolpl'), + ('nolz','nolz'), + ('noma','noma'), + ('nomacatsui','nomacatsui'), + ('nomagic','nomagic'), + ('nomh','nomh'), + ('noml','noml'), + ('nomod','nomod'), + ('nomodeline','nomodeline'), + ('nomodifiable','nomodifiable'), + ('nomodified','nomodified'), + ('nomore','nomore'), + ('nomousef','nomousef'), + ('nomousefocus','nomousefocus'), + ('nomousehide','nomousehide'), + ('nonu','nonu'), + ('nonumber','nonumber'), + ('noodev','noodev'), + ('noopendevice','noopendevice'), + ('nopaste','nopaste'), + ('nopi','nopi'), + ('nopreserveindent','nopreserveindent'), + ('nopreviewwindow','nopreviewwindow'), + ('noprompt','noprompt'), + ('nopvw','nopvw'), + ('noreadonly','noreadonly'), + ('norelativenumber','norelativenumber'), + ('noremap','noremap'), + ('norestorescreen','norestorescreen'), + ('norevins','norevins'), + ('nori','nori'), + ('norightleft','norightleft'), + ('norl','norl'), + ('nornu','nornu'), + ('noro','noro'), + ('nors','nors'), + ('noru','noru'), + ('noruler','noruler'), + ('nosb','nosb'), + ('nosc','nosc'), + ('noscb','noscb'), + ('noscrollbind','noscrollbind'), + ('noscs','noscs'), + ('nosecure','nosecure'), + ('nosft','nosft'), + ('noshellslash','noshellslash'), + ('noshelltemp','noshelltemp'), + ('noshiftround','noshiftround'), + ('noshortname','noshortname'), + ('noshowcmd','noshowcmd'), + ('noshowfulltag','noshowfulltag'), + ('noshowmatch','noshowmatch'), + ('noshowmode','noshowmode'), + ('nosi','nosi'), + ('nosm','nosm'), + ('nosmartcase','nosmartcase'), + ('nosmartindent','nosmartindent'), + ('nosmarttab','nosmarttab'), + ('nosmd','nosmd'), + ('nosn','nosn'), + ('nosol','nosol'), + ('nospell','nospell'), + ('nosplitbelow','nosplitbelow'), + ('nosplitright','nosplitright'), + ('nospr','nospr'), + ('nosr','nosr'), + ('nossl','nossl'), + ('nosta','nosta'), + ('nostartofline','nostartofline'), + ('nostmp','nostmp'), + ('noswapfile','noswapfile'), + ('noswf','noswf'), + ('nota','nota'), + ('notagbsearch','notagbsearch'), + ('notagrelative','notagrelative'), + ('notagstack','notagstack'), + ('notbi','notbi'), + ('notbidi','notbidi'), + ('notbs','notbs'), + ('notermbidi','notermbidi'), + ('noterse','noterse'), + ('notextauto','notextauto'), + ('notextmode','notextmode'), + ('notf','notf'), + ('notgst','notgst'), + ('notildeop','notildeop'), + ('notimeout','notimeout'), + ('notitle','notitle'), + ('noto','noto'), + ('notop','notop'), + ('notr','notr'), + ('nottimeout','nottimeout'), + ('nottybuiltin','nottybuiltin'), + ('nottyfast','nottyfast'), + ('notx','notx'), + ('noudf','noudf'), + ('noundofile','noundofile'), + ('novb','novb'), + ('novisualbell','novisualbell'), + ('nowa','nowa'), + ('nowarn','nowarn'), + ('nowb','nowb'), + ('noweirdinvert','noweirdinvert'), + ('nowfh','nowfh'), + ('nowfw','nowfw'), + ('nowic','nowic'), + ('nowildignorecase','nowildignorecase'), + ('nowildmenu','nowildmenu'), + ('nowinfixheight','nowinfixheight'), + ('nowinfixwidth','nowinfixwidth'), + ('nowiv','nowiv'), + ('nowmnu','nowmnu'), + ('nowrap','nowrap'), + ('nowrapscan','nowrapscan'), + ('nowrite','nowrite'), + ('nowriteany','nowriteany'), + ('nowritebackup','nowritebackup'), + ('nows','nows'), + ('nrformats','nrformats'), + ('nu','nu'), + ('number','number'), + ('numberwidth','numberwidth'), + ('nuw','nuw'), + ('odev','odev'), + ('oft','oft'), + ('ofu','ofu'), + ('omnifunc','omnifunc'), + ('opendevice','opendevice'), + ('operatorfunc','operatorfunc'), + ('opfunc','opfunc'), + ('osfiletype','osfiletype'), + ('pa','pa'), + ('para','para'), + ('paragraphs','paragraphs'), + ('paste','paste'), + ('pastetoggle','pastetoggle'), + ('patchexpr','patchexpr'), + ('patchmode','patchmode'), + ('path','path'), + ('pdev','pdev'), + ('penc','penc'), + ('pex','pex'), + ('pexpr','pexpr'), + ('pfn','pfn'), + ('ph','ph'), + ('pheader','pheader'), + ('pi','pi'), + ('pm','pm'), + ('pmbcs','pmbcs'), + ('pmbfn','pmbfn'), + ('popt','popt'), + ('preserveindent','preserveindent'), + ('previewheight','previewheight'), + ('previewwindow','previewwindow'), + ('printdevice','printdevice'), + ('printencoding','printencoding'), + ('printexpr','printexpr'), + ('printfont','printfont'), + ('printheader','printheader'), + ('printmbcharset','printmbcharset'), + ('printmbfont','printmbfont'), + ('printoptions','printoptions'), + ('prompt','prompt'), + ('pt','pt'), + ('pumheight','pumheight'), + ('pvh','pvh'), + ('pvw','pvw'), + ('qe','qe'), + ('quoteescape','quoteescape'), + ('rdt','rdt'), + ('re','re'), + ('readonly','readonly'), + ('redrawtime','redrawtime'), + ('regexpengine','regexpengine'), + ('relativenumber','relativenumber'), + ('remap','remap'), + ('report','report'), + ('restorescreen','restorescreen'), + ('revins','revins'), + ('ri','ri'), + ('rightleft','rightleft'), + ('rightleftcmd','rightleftcmd'), + ('rl','rl'), + ('rlc','rlc'), + ('rnu','rnu'), + ('ro','ro'), + ('rs','rs'), + ('rtp','rtp'), + ('ru','ru'), + ('ruf','ruf'), + ('ruler','ruler'), + ('rulerformat','rulerformat'), + ('runtimepath','runtimepath'), + ('sb','sb'), + ('sbo','sbo'), + ('sbr','sbr'), + ('sc','sc'), + ('scb','scb'), + ('scr','scr'), + ('scroll','scroll'), + ('scrollbind','scrollbind'), + ('scrolljump','scrolljump'), + ('scrolloff','scrolloff'), + ('scrollopt','scrollopt'), + ('scs','scs'), + ('sect','sect'), + ('sections','sections'), + ('secure','secure'), + ('sel','sel'), + ('selection','selection'), + ('selectmode','selectmode'), + ('sessionoptions','sessionoptions'), + ('sft','sft'), + ('sh','sh'), + ('shcf','shcf'), + ('shell','shell'), + ('shellcmdflag','shellcmdflag'), + ('shellpipe','shellpipe'), + ('shellquote','shellquote'), + ('shellredir','shellredir'), + ('shellslash','shellslash'), + ('shelltemp','shelltemp'), + ('shelltype','shelltype'), + ('shellxescape','shellxescape'), + ('shellxquote','shellxquote'), + ('shiftround','shiftround'), + ('shiftwidth','shiftwidth'), + ('shm','shm'), + ('shortmess','shortmess'), + ('shortname','shortname'), + ('showbreak','showbreak'), + ('showcmd','showcmd'), + ('showfulltag','showfulltag'), + ('showmatch','showmatch'), + ('showmode','showmode'), + ('showtabline','showtabline'), + ('shq','shq'), + ('si','si'), + ('sidescroll','sidescroll'), + ('sidescrolloff','sidescrolloff'), + ('siso','siso'), + ('sj','sj'), + ('slm','slm'), + ('sm','sm'), + ('smartcase','smartcase'), + ('smartindent','smartindent'), + ('smarttab','smarttab'), + ('smc','smc'), + ('smd','smd'), + ('sn','sn'), + ('so','so'), + ('softtabstop','softtabstop'), + ('sol','sol'), + ('sp','sp'), + ('spc','spc'), + ('spell','spell'), + ('spellcapcheck','spellcapcheck'), + ('spellfile','spellfile'), + ('spelllang','spelllang'), + ('spellsuggest','spellsuggest'), + ('spf','spf'), + ('spl','spl'), + ('splitbelow','splitbelow'), + ('splitright','splitright'), + ('spr','spr'), + ('sps','sps'), + ('sr','sr'), + ('srr','srr'), + ('ss','ss'), + ('ssl','ssl'), + ('ssop','ssop'), + ('st','st'), + ('sta','sta'), + ('stal','stal'), + ('startofline','startofline'), + ('statusline','statusline'), + ('stl','stl'), + ('stmp','stmp'), + ('sts','sts'), + ('su','su'), + ('sua','sua'), + ('suffixes','suffixes'), + ('suffixesadd','suffixesadd'), + ('sw','sw'), + ('swapfile','swapfile'), + ('swapsync','swapsync'), + ('swb','swb'), + ('swf','swf'), + ('switchbuf','switchbuf'), + ('sws','sws'), + ('sxe','sxe'), + ('sxq','sxq'), + ('syn','syn'), + ('synmaxcol','synmaxcol'), + ('syntax','syntax'), + ('t_AB','t_AB'), + ('t_AF','t_AF'), + ('t_AL','t_AL'), + ('t_CS','t_CS'), + ('t_CV','t_CV'), + ('t_Ce','t_Ce'), + ('t_Co','t_Co'), + ('t_Cs','t_Cs'), + ('t_DL','t_DL'), + ('t_EI','t_EI'), + ('t_F1','t_F1'), + ('t_F2','t_F2'), + ('t_F3','t_F3'), + ('t_F4','t_F4'), + ('t_F5','t_F5'), + ('t_F6','t_F6'), + ('t_F7','t_F7'), + ('t_F8','t_F8'), + ('t_F9','t_F9'), + ('t_IE','t_IE'), + ('t_IS','t_IS'), + ('t_K1','t_K1'), + ('t_K3','t_K3'), + ('t_K4','t_K4'), + ('t_K5','t_K5'), + ('t_K6','t_K6'), + ('t_K7','t_K7'), + ('t_K8','t_K8'), + ('t_K9','t_K9'), + ('t_KA','t_KA'), + ('t_KB','t_KB'), + ('t_KC','t_KC'), + ('t_KD','t_KD'), + ('t_KE','t_KE'), + ('t_KF','t_KF'), + ('t_KG','t_KG'), + ('t_KH','t_KH'), + ('t_KI','t_KI'), + ('t_KJ','t_KJ'), + ('t_KK','t_KK'), + ('t_KL','t_KL'), + ('t_RI','t_RI'), + ('t_RV','t_RV'), + ('t_SI','t_SI'), + ('t_Sb','t_Sb'), + ('t_Sf','t_Sf'), + ('t_WP','t_WP'), + ('t_WS','t_WS'), + ('t_ZH','t_ZH'), + ('t_ZR','t_ZR'), + ('t_al','t_al'), + ('t_bc','t_bc'), + ('t_cd','t_cd'), + ('t_ce','t_ce'), + ('t_cl','t_cl'), + ('t_cm','t_cm'), + ('t_cs','t_cs'), + ('t_da','t_da'), + ('t_db','t_db'), + ('t_dl','t_dl'), + ('t_fs','t_fs'), + ('t_k1','t_k1'), + ('t_k2','t_k2'), + ('t_k3','t_k3'), + ('t_k4','t_k4'), + ('t_k5','t_k5'), + ('t_k6','t_k6'), + ('t_k7','t_k7'), + ('t_k8','t_k8'), + ('t_k9','t_k9'), + ('t_kB','t_kB'), + ('t_kD','t_kD'), + ('t_kI','t_kI'), + ('t_kN','t_kN'), + ('t_kP','t_kP'), + ('t_kb','t_kb'), + ('t_kd','t_kd'), + ('t_ke','t_ke'), + ('t_kh','t_kh'), + ('t_kl','t_kl'), + ('t_kr','t_kr'), + ('t_ks','t_ks'), + ('t_ku','t_ku'), + ('t_le','t_le'), + ('t_mb','t_mb'), + ('t_md','t_md'), + ('t_me','t_me'), + ('t_mr','t_mr'), + ('t_ms','t_ms'), + ('t_nd','t_nd'), + ('t_op','t_op'), + ('t_se','t_se'), + ('t_so','t_so'), + ('t_sr','t_sr'), + ('t_te','t_te'), + ('t_ti','t_ti'), + ('t_ts','t_ts'), + ('t_u7','t_u7'), + ('t_ue','t_ue'), + ('t_us','t_us'), + ('t_ut','t_ut'), + ('t_vb','t_vb'), + ('t_ve','t_ve'), + ('t_vi','t_vi'), + ('t_vs','t_vs'), + ('t_xs','t_xs'), + ('ta','ta'), + ('tabline','tabline'), + ('tabpagemax','tabpagemax'), + ('tabstop','tabstop'), + ('tag','tag'), + ('tagbsearch','tagbsearch'), + ('taglength','taglength'), + ('tagrelative','tagrelative'), + ('tags','tags'), + ('tagstack','tagstack'), + ('tal','tal'), + ('tb','tb'), + ('tbi','tbi'), + ('tbidi','tbidi'), + ('tbis','tbis'), + ('tbs','tbs'), + ('tenc','tenc'), + ('term','term'), + ('termbidi','termbidi'), + ('termencoding','termencoding'), + ('terse','terse'), + ('textauto','textauto'), + ('textmode','textmode'), + ('textwidth','textwidth'), + ('tf','tf'), + ('tgst','tgst'), + ('thesaurus','thesaurus'), + ('tildeop','tildeop'), + ('timeout','timeout'), + ('timeoutlen','timeoutlen'), + ('title','title'), + ('titlelen','titlelen'), + ('titleold','titleold'), + ('titlestring','titlestring'), + ('tl','tl'), + ('tm','tm'), + ('to','to'), + ('toolbar','toolbar'), + ('toolbariconsize','toolbariconsize'), + ('top','top'), + ('tpm','tpm'), + ('tr','tr'), + ('ts','ts'), + ('tsl','tsl'), + ('tsr','tsr'), + ('ttimeout','ttimeout'), + ('ttimeoutlen','ttimeoutlen'), + ('ttm','ttm'), + ('tty','tty'), + ('ttybuiltin','ttybuiltin'), + ('ttyfast','ttyfast'), + ('ttym','ttym'), + ('ttymouse','ttymouse'), + ('ttyscroll','ttyscroll'), + ('ttytype','ttytype'), + ('tw','tw'), + ('tx','tx'), + ('uc','uc'), + ('udf','udf'), + ('udir','udir'), + ('ul','ul'), + ('undodir','undodir'), + ('undofile','undofile'), + ('undolevels','undolevels'), + ('undoreload','undoreload'), + ('updatecount','updatecount'), + ('updatetime','updatetime'), + ('ur','ur'), + ('ut','ut'), + ('vb','vb'), + ('vbs','vbs'), + ('vdir','vdir'), + ('ve','ve'), + ('verbose','verbose'), + ('verbosefile','verbosefile'), + ('vfile','vfile'), + ('vi','vi'), + ('viewdir','viewdir'), + ('viewoptions','viewoptions'), + ('viminfo','viminfo'), + ('virtualedit','virtualedit'), + ('visualbell','visualbell'), + ('vnoremap','vnoremap'), + ('vop','vop'), + ('wa','wa'), + ('wak','wak'), + ('warn','warn'), + ('wb','wb'), + ('wc','wc'), + ('wcm','wcm'), + ('wd','wd'), + ('weirdinvert','weirdinvert'), + ('wfh','wfh'), + ('wfw','wfw'), + ('wh','wh'), + ('whichwrap','whichwrap'), + ('wi','wi'), + ('wic','wic'), + ('wig','wig'), + ('wildchar','wildchar'), + ('wildcharm','wildcharm'), + ('wildignore','wildignore'), + ('wildignorecase','wildignorecase'), + ('wildmenu','wildmenu'), + ('wildmode','wildmode'), + ('wildoptions','wildoptions'), + ('wim','wim'), + ('winaltkeys','winaltkeys'), + ('window','window'), + ('winfixheight','winfixheight'), + ('winfixwidth','winfixwidth'), + ('winheight','winheight'), + ('winminheight','winminheight'), + ('winminwidth','winminwidth'), + ('winwidth','winwidth'), + ('wiv','wiv'), + ('wiw','wiw'), + ('wm','wm'), + ('wmh','wmh'), + ('wmnu','wmnu'), + ('wmw','wmw'), + ('wop','wop'), + ('wrap','wrap'), + ('wrapmargin','wrapmargin'), + ('wrapscan','wrapscan'), + ('write','write'), + ('writeany','writeany'), + ('writebackup','writebackup'), + ('writedelay','writedelay'), + ('ws','ws'), + ('ww','ww'), + ) + return var +option = _getoption() + diff --git a/lib/python3.12/site-packages/pygments/lexers/ada.py b/lib/python3.12/site-packages/pygments/lexers/ada.py new file mode 100644 index 0000000000000000000000000000000000000000..cb286ca7c74a8cbf5a94220499f2b8f45dd94840 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/ada.py @@ -0,0 +1,144 @@ +""" + pygments.lexers.ada + ~~~~~~~~~~~~~~~~~~~ + + Lexers for Ada family languages. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, include, bygroups, words, using, this, \ + default +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation +from pygments.lexers._ada_builtins import KEYWORD_LIST, BUILTIN_LIST + +__all__ = ['AdaLexer'] + + +class AdaLexer(RegexLexer): + """ + For Ada source code. + """ + + name = 'Ada' + aliases = ['ada', 'ada95', 'ada2005'] + filenames = ['*.adb', '*.ads', '*.ada'] + mimetypes = ['text/x-ada'] + url = 'https://www.adaic.org' + version_added = '1.3' + + flags = re.MULTILINE | re.IGNORECASE + + tokens = { + 'root': [ + (r'[^\S\n]+', Text), + (r'--.*?\n', Comment.Single), + (r'[^\S\n]+', Text), + (r'function|procedure|entry', Keyword.Declaration, 'subprogram'), + (r'(subtype|type)(\s+)(\w+)', + bygroups(Keyword.Declaration, Text, Keyword.Type), 'type_def'), + (r'task|protected', Keyword.Declaration), + (r'(subtype)(\s+)', bygroups(Keyword.Declaration, Text)), + (r'(end)(\s+)', bygroups(Keyword.Reserved, Text), 'end'), + (r'(pragma)(\s+)(\w+)', bygroups(Keyword.Reserved, Text, + Comment.Preproc)), + (r'(true|false|null)\b', Keyword.Constant), + # builtin types + (words(BUILTIN_LIST, suffix=r'\b'), Keyword.Type), + (r'(and(\s+then)?|in|mod|not|or(\s+else)|rem)\b', Operator.Word), + (r'generic|private', Keyword.Declaration), + (r'package', Keyword.Declaration, 'package'), + (r'array\b', Keyword.Reserved, 'array_def'), + (r'(with|use)(\s+)', bygroups(Keyword.Namespace, Text), 'import'), + (r'(\w+)(\s*)(:)(\s*)(constant)', + bygroups(Name.Constant, Text, Punctuation, Text, + Keyword.Reserved)), + (r'<<\w+>>', Name.Label), + (r'(\w+)(\s*)(:)(\s*)(declare|begin|loop|for|while)', + bygroups(Name.Label, Text, Punctuation, Text, Keyword.Reserved)), + # keywords + (words(KEYWORD_LIST, prefix=r'\b', suffix=r'\b'), + Keyword.Reserved), + (r'"[^"]*"', String), + include('attribute'), + include('numbers'), + (r"'[^']'", String.Character), + (r'(\w+)(\s*|[(,])', bygroups(Name, using(this))), + (r"(<>|=>|:=|@|[\[\]]|[()|:;,.'])", Punctuation), + (r'[*<>+=/&-]', Operator), + (r'\n+', Text), + ], + 'numbers': [ + (r'[0-9_]+#[0-9a-f_\.]+#', Number.Hex), + (r'[0-9_]+\.[0-9_]*', Number.Float), + (r'[0-9_]+', Number.Integer), + ], + 'attribute': [ + (r"(')(\w+)", bygroups(Punctuation, Name.Attribute)), + ], + 'subprogram': [ + (r'\(', Punctuation, ('#pop', 'formal_part')), + (r';', Punctuation, '#pop'), + (r'is\b', Keyword.Reserved, '#pop'), + (r'"[^"]+"|\w+', Name.Function), + include('root'), + ], + 'end': [ + ('(if|case|record|loop|select)', Keyword.Reserved), + (r'"[^"]+"|[\w.]+', Name.Function), + (r'\s+', Text), + (';', Punctuation, '#pop'), + ], + 'type_def': [ + (r';', Punctuation, '#pop'), + (r'\(', Punctuation, 'formal_part'), + (r'\[', Punctuation, 'formal_part'), + (r'with|and|use', Keyword.Reserved), + (r'array\b', Keyword.Reserved, ('#pop', 'array_def')), + (r'record\b', Keyword.Reserved, ('record_def')), + (r'(null record)(;)', bygroups(Keyword.Reserved, Punctuation), '#pop'), + include('root'), + ], + 'array_def': [ + (r';', Punctuation, '#pop'), + (r'(\w+)(\s+)(range)', bygroups(Keyword.Type, Text, Keyword.Reserved)), + include('root'), + ], + 'record_def': [ + (r'end record', Keyword.Reserved, '#pop'), + include('root'), + ], + 'import': [ + # TODO: use Name.Namespace if appropriate. This needs + # work to disinguish imports from aspects. + (r'[\w.]+', Name, '#pop'), + default('#pop'), + ], + 'formal_part': [ + (r'\)', Punctuation, '#pop'), + (r'\]', Punctuation, '#pop'), + (r'\w+', Name.Variable), + (r',|:[^=]', Punctuation), + (r'(in|not|null|out|access)\b', Keyword.Reserved), + include('root'), + ], + 'package': [ + ('body', Keyword.Declaration), + (r'is\s+new|renames', Keyword.Reserved), + ('is', Keyword.Reserved, '#pop'), + (';', Punctuation, '#pop'), + (r'\(', Punctuation, 'package_instantiation'), + (r'([\w.]+)', Name.Class), + include('root'), + ], + 'package_instantiation': [ + (r'("[^"]+"|\w+)(\s+)(=>)', bygroups(Name.Variable, Text, Punctuation)), + (r'[\w.\'"]', Text), + (r'\)', Punctuation, '#pop'), + include('root'), + ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/ampl.py b/lib/python3.12/site-packages/pygments/lexers/ampl.py new file mode 100644 index 0000000000000000000000000000000000000000..bc4082b1b188f7f1e85bfa48c8f5de440973ab00 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/ampl.py @@ -0,0 +1,87 @@ +""" + pygments.lexers.ampl + ~~~~~~~~~~~~~~~~~~~~ + + Lexers for the AMPL language. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, bygroups, using, this, words +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Whitespace + +__all__ = ['AmplLexer'] + + +class AmplLexer(RegexLexer): + """ + For AMPL source code. + """ + name = 'Ampl' + url = 'http://ampl.com/' + aliases = ['ampl'] + filenames = ['*.run'] + version_added = '2.2' + + tokens = { + 'root': [ + (r'\n', Text), + (r'\s+', Whitespace), + (r'#.*?\n', Comment.Single), + (r'/[*](.|\n)*?[*]/', Comment.Multiline), + (words(( + 'call', 'cd', 'close', 'commands', 'data', 'delete', 'display', + 'drop', 'end', 'environ', 'exit', 'expand', 'include', 'load', + 'model', 'objective', 'option', 'problem', 'purge', 'quit', + 'redeclare', 'reload', 'remove', 'reset', 'restore', 'shell', + 'show', 'solexpand', 'solution', 'solve', 'update', 'unload', + 'xref', 'coeff', 'coef', 'cover', 'obj', 'interval', 'default', + 'from', 'to', 'to_come', 'net_in', 'net_out', 'dimen', + 'dimension', 'check', 'complements', 'write', 'function', + 'pipe', 'format', 'if', 'then', 'else', 'in', 'while', 'repeat', + 'for'), suffix=r'\b'), Keyword.Reserved), + (r'(integer|binary|symbolic|ordered|circular|reversed|INOUT|IN|OUT|LOCAL)', + Keyword.Type), + (r'\".*?\"', String.Double), + (r'\'.*?\'', String.Single), + (r'[()\[\]{},;:]+', Punctuation), + (r'\b(\w+)(\.)(astatus|init0|init|lb0|lb1|lb2|lb|lrc|' + r'lslack|rc|relax|slack|sstatus|status|ub0|ub1|ub2|' + r'ub|urc|uslack|val)', + bygroups(Name.Variable, Punctuation, Keyword.Reserved)), + (r'(set|param|var|arc|minimize|maximize|subject to|s\.t\.|subj to|' + r'node|table|suffix|read table|write table)(\s+)(\w+)', + bygroups(Keyword.Declaration, Whitespace, Name.Variable)), + (r'(param)(\s*)(:)(\s*)(\w+)(\s*)(:)(\s*)((\w|\s)+)', + bygroups(Keyword.Declaration, Whitespace, Punctuation, Whitespace, + Name.Variable, Whitespace, Punctuation, Whitespace, Name.Variable)), + (r'(let|fix|unfix)(\s*)((?:\{.*\})?)(\s*)(\w+)', + bygroups(Keyword.Declaration, Whitespace, using(this), Whitespace, + Name.Variable)), + (words(( + 'abs', 'acos', 'acosh', 'alias', 'asin', 'asinh', 'atan', 'atan2', + 'atanh', 'ceil', 'ctime', 'cos', 'exp', 'floor', 'log', 'log10', + 'max', 'min', 'precision', 'round', 'sin', 'sinh', 'sqrt', 'tan', + 'tanh', 'time', 'trunc', 'Beta', 'Cauchy', 'Exponential', 'Gamma', + 'Irand224', 'Normal', 'Normal01', 'Poisson', 'Uniform', 'Uniform01', + 'num', 'num0', 'ichar', 'char', 'length', 'substr', 'sprintf', + 'match', 'sub', 'gsub', 'print', 'printf', 'next', 'nextw', 'prev', + 'prevw', 'first', 'last', 'ord', 'ord0', 'card', 'arity', + 'indexarity'), prefix=r'\b', suffix=r'\b'), Name.Builtin), + (r'(\+|\-|\*|/|\*\*|=|<=|>=|==|\||\^|<|>|\!|\.\.|:=|\&|\!=|<<|>>)', + Operator), + (words(( + 'or', 'exists', 'forall', 'and', 'in', 'not', 'within', 'union', + 'diff', 'difference', 'symdiff', 'inter', 'intersect', + 'intersection', 'cross', 'setof', 'by', 'less', 'sum', 'prod', + 'product', 'div', 'mod'), suffix=r'\b'), + Keyword.Reserved), # Operator.Name but not enough emphasized with that + (r'(\d+\.(?!\.)\d*|\.(?!.)\d+)([eE][+-]?\d+)?', Number.Float), + (r'\d+([eE][+-]?\d+)?', Number.Integer), + (r'[+-]?Infinity', Number.Integer), + (r'(\w+|(\.(?!\.)))', Text) + ] + + } diff --git a/lib/python3.12/site-packages/pygments/lexers/apdlexer.py b/lib/python3.12/site-packages/pygments/lexers/apdlexer.py new file mode 100644 index 0000000000000000000000000000000000000000..98beedfbe7059098a20ee81ab62ea117ff898de1 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/apdlexer.py @@ -0,0 +1,593 @@ +""" + pygments.lexers.apdlexer + ~~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for ANSYS Parametric Design Language. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, include, words, default +from pygments.token import Comment, Keyword, Name, Number, Operator, \ + String, Generic, Punctuation, Whitespace, Escape + +__all__ = ['apdlexer'] + + +class apdlexer(RegexLexer): + """ + For APDL source code. + """ + name = 'ANSYS parametric design language' + aliases = ['ansys', 'apdl'] + filenames = ['*.ans'] + url = 'https://www.ansys.com' + version_added = '2.9' + + flags = re.IGNORECASE + + # list of elements + elafunb = ("SURF152", "SURF153", "SURF154", "SURF156", "SHELL157", + "SURF159", "LINK160", "BEAM161", "PLANE162", + "SHELL163", "SOLID164", "COMBI165", "MASS166", + "LINK167", "SOLID168", "TARGE169", "TARGE170", + "CONTA171", "CONTA172", "CONTA173", "CONTA174", + "CONTA175", "CONTA176", "CONTA177", "CONTA178", + "PRETS179", "LINK180", "SHELL181", "PLANE182", + "PLANE183", "MPC184", "SOLID185", "SOLID186", + "SOLID187", "BEAM188", "BEAM189", "SOLSH190", + "INTER192", "INTER193", "INTER194", "INTER195", + "MESH200", "FOLLW201", "INTER202", "INTER203", + "INTER204", "INTER205", "SHELL208", "SHELL209", + "CPT212", "CPT213", "COMBI214", "CPT215", "CPT216", + "CPT217", "FLUID220", "FLUID221", "PLANE223", + "SOLID226", "SOLID227", "PLANE230", "SOLID231", + "SOLID232", "PLANE233", "SOLID236", "SOLID237", + "PLANE238", "SOLID239", "SOLID240", "HSFLD241", + "HSFLD242", "SURF251", "SURF252", "REINF263", + "REINF264", "REINF265", "SOLID272", "SOLID273", + "SOLID278", "SOLID279", "SHELL281", "SOLID285", + "PIPE288", "PIPE289", "ELBOW290", "USER300", "BEAM3", + "BEAM4", "BEAM23", "BEAM24", "BEAM44", "BEAM54", + "COMBIN7", "FLUID79", "FLUID80", "FLUID81", "FLUID141", + "FLUID142", "INFIN9", "INFIN47", "PLANE13", "PLANE25", + "PLANE42", "PLANE53", "PLANE67", "PLANE82", "PLANE83", + "PLANE145", "PLANE146", "CONTAC12", "CONTAC52", + "LINK1", "LINK8", "LINK10", "LINK32", "PIPE16", + "PIPE17", "PIPE18", "PIPE20", "PIPE59", "PIPE60", + "SHELL41", "SHELL43", "SHELL57", "SHELL63", "SHELL91", + "SHELL93", "SHELL99", "SHELL150", "SOLID5", "SOLID45", + "SOLID46", "SOLID65", "SOLID69", "SOLID92", "SOLID95", + "SOLID117", "SOLID127", "SOLID128", "SOLID147", + "SOLID148", "SOLID191", "VISCO88", "VISCO89", + "VISCO106", "VISCO107", "VISCO108", "TRANS109") + + elafunc = ("PGRAPH", "/VT", "VTIN", "VTRFIL", "VTTEMP", "PGRSET", + "VTCLR", "VTMETH", "VTRSLT", "VTVMOD", "PGSELE", + "VTDISC", "VTMP", "VTSEC", "PGWRITE", "VTEVAL", "VTOP", + "VTSFE", "POUTRES", "VTFREQ", "VTPOST", "VTSL", + "FLDATA1-40", "HFPCSWP", "MSDATA", "MSVARY", "QFACT", + "FLOCHECK", "HFPOWER", "MSMASS", "PERI", "SPADP", + "FLREAD", "HFPORT", "MSMETH", "PLFSS", "SPARM", + "FLOTRAN", "HFSCAT", "MSMIR", "PLSCH", "SPFSS", + "HFADP", "ICE", "MSNOMF", "PLSYZ", "SPICE", "HFARRAY", + "ICEDELE", "MSPROP", "PLTD", "SPSCAN", "HFDEEM", + "ICELIST", "MSQUAD", "PLTLINE", "SPSWP", "HFEIGOPT", + "ICVFRC", "MSRELAX", "PLVFRC", "HFEREFINE", "LPRT", + "MSSOLU", "/PICE", "HFMODPRT", "MSADV", "MSSPEC", + "PLWAVE", "HFPA", "MSCAP", "MSTERM", "PRSYZ") + + elafund = ("*VOPER", "VOVLAP", "*VPLOT", "VPLOT", "VPTN", "*VPUT", + "VPUT", "*VREAD", "VROTAT", "VSBA", "VSBV", "VSBW", + "/VSCALE", "*VSCFUN", "VSEL", "VSLA", "*VSTAT", "VSUM", + "VSWEEP", "VSYMM", "VTRAN", "VTYPE", "/VUP", "*VWRITE", + "/WAIT", "WAVES", "WERASE", "WFRONT", "/WINDOW", + "WMID", "WMORE", "WPAVE", "WPCSYS", "WPLANE", "WPOFFS", + "WPROTA", "WPSTYL", "WRFULL", "WRITE", "WRITEMAP", + "*WRK", "WSORT", "WSPRINGS", "WSTART", "WTBCREATE", + "XFDATA", "XFENRICH", "XFLIST", "/XFRM", "/XRANGE", + "XVAR", "/YRANGE", "/ZOOM", "/WB", "XMLO", "/XML", + "CNTR", "EBLOCK", "CMBLOCK", "NBLOCK", "/TRACK", + "CWZPLOT", "~EUI", "NELE", "EALL", "NALL", "FLITEM", + "LSLN", "PSOLVE", "ASLN", "/VERIFY", "/SSS", "~CFIN", + "*EVAL", "*MOONEY", "/RUNSTAT", "ALPFILL", + "ARCOLLAPSE", "ARDETACH", "ARFILL", "ARMERGE", + "ARSPLIT", "FIPLOT", "GAPFINISH", "GAPLIST", + "GAPMERGE", "GAPOPT", "GAPPLOT", "LNCOLLAPSE", + "LNDETACH", "LNFILL", "LNMERGE", "LNSPLIT", "PCONV", + "PLCONV", "PEMOPTS", "PEXCLUDE", "PINCLUDE", "PMETH", + "/PMETH", "PMOPTS", "PPLOT", "PPRANGE", "PRCONV", + "PRECISION", "RALL", "RFILSZ", "RITER", "RMEMRY", + "RSPEED", "RSTAT", "RTIMST", "/RUNST", "RWFRNT", + "SARPLOT", "SHSD", "SLPPLOT", "SLSPLOT", "VCVFILL", + "/OPT", "OPEQN", "OPFACT", "OPFRST", "OPGRAD", + "OPKEEP", "OPLOOP", "OPPRNT", "OPRAND", "OPSUBP", + "OPSWEEP", "OPTYPE", "OPUSER", "OPVAR", "OPADD", + "OPCLR", "OPDEL", "OPMAKE", "OPSEL", "OPANL", "OPDATA", + "OPRESU", "OPSAVE", "OPEXE", "OPLFA", "OPLGR", + "OPLIST", "OPLSW", "OPRFA", "OPRGR", "OPRSW", + "PILECALC", "PILEDISPSET", "PILEGEN", "PILELOAD", + "PILEMASS", "PILERUN", "PILESEL", "PILESTIF", + "PLVAROPT", "PRVAROPT", "TOCOMP", "TODEF", "TOFREQ", + "TOTYPE", "TOVAR", "TOEXE", "TOLOOP", "TOGRAPH", + "TOLIST", "TOPLOT", "TOPRINT", "TOSTAT", "TZAMESH", + "TZDELE", "TZEGEN", "XVAROPT", "PGSAVE", "SOLCONTROL", + "TOTAL", "VTGEOM", "VTREAL", "VTSTAT") + + elafune = ("/ANUM", "AOFFST", "AOVLAP", "APLOT", "APPEND", "APTN", + "ARCLEN", "ARCTRM", "AREAS", "AREFINE", "AREMESH", + "AREVERSE", "AROTAT", "ARSCALE", "ARSYM", "ASBA", + "ASBL", "ASBV", "ASBW", "ASCRES", "ASEL", "ASIFILE", + "*ASK", "ASKIN", "ASLL", "ASLV", "ASOL", "/ASSIGN", + "ASUB", "ASUM", "ATAN", "ATRAN", "ATYPE", "/AUTO", + "AUTOTS", "/AUX2", "/AUX3", "/AUX12", "/AUX15", + "AVPRIN", "AVRES", "AWAVE", "/AXLAB", "*AXPY", + "/BATCH", "BCSOPTION", "BETAD", "BF", "BFA", "BFADELE", + "BFALIST", "BFCUM", "BFDELE", "BFE", "BFECUM", + "BFEDELE", "BFELIST", "BFESCAL", "BFINT", "BFK", + "BFKDELE", "BFKLIST", "BFL", "BFLDELE", "BFLIST", + "BFLLIST", "BFSCALE", "BFTRAN", "BFUNIF", "BFV", + "BFVDELE", "BFVLIST", "BIOOPT", "BIOT", "BLC4", "BLC5", + "BLOCK", "BOOL", "BOPTN", "BSAX", "BSMD", "BSM1", + "BSM2", "BSPLIN", "BSS1", "BSS2", "BSTE", "BSTQ", + "BTOL", "BUCOPT", "C", "CALC", "CAMPBELL", "CBDOF", + "CBMD", "CBMX", "CBTE", "CBTMP", "CDOPT", "CDREAD", + "CDWRITE", "CE", "CECHECK", "CECMOD", "CECYC", + "CEDELE", "CEINTF", "CELIST", "CENTER", "CEQN", + "CERIG", "CESGEN", "CFACT", "*CFCLOS", "*CFOPEN", + "*CFWRITE", "/CFORMAT", "CGLOC", "CGOMGA", "CGROW", + "CHECK", "CHKMSH", "CINT", "CIRCLE", "CISOL", + "/CLABEL", "/CLEAR", "CLOCAL", "CLOG", "/CLOG", + "CLRMSHLN", "CM", "CMACEL", "/CMAP", "CMATRIX", + "CMDELE", "CMDOMEGA", "CMEDIT", "CMGRP", "CMLIST", + "CMMOD", "CMOMEGA", "CMPLOT", "CMROTATE", "CMSEL", + "CMSFILE", "CMSOPT", "CMWRITE", "CNCHECK", "CNKMOD", + "CNTR", "CNVTOL", "/COLOR", "*COMP", "COMBINE", + "COMPRESS", "CON4", "CONE", "/CONFIG", "CONJUG", + "/CONTOUR", "/COPY", "CORIOLIS", "COUPLE", "COVAL", + "CP", "CPCYC", "CPDELE", "CPINTF", "/CPLANE", "CPLGEN", + "CPLIST", "CPMERGE", "CPNGEN", "CPSGEN", "CQC", + "*CREATE", "CRPLIM", "CS", "CSCIR", "CSDELE", "CSKP", + "CSLIST", "CSWPLA", "CSYS", "/CTYPE", "CURR2D", + "CUTCONTROL", "/CVAL", "CVAR", "/CWD", "CYCCALC", + "/CYCEXPAND", "CYCFILES", "CYCFREQ", "*CYCLE", + "CYCLIC", "CYCOPT", "CYCPHASE", "CYCSPEC", "CYL4", + "CYL5", "CYLIND", "CZDEL", "CZMESH", "D", "DA", + "DADELE", "DALIST", "DAMORPH", "DATA", "DATADEF", + "DCGOMG", "DCUM", "DCVSWP", "DDASPEC", "DDELE", + "DDOPTION", "DEACT", "DEFINE", "*DEL", "DELETE", + "/DELETE", "DELTIM", "DELTIME", "DEMORPH", "DERIV", "DESIZE", + "DESOL", "DETAB", "/DEVDISP", "/DEVICE", "/DFLAB", + "DFLX", "DFSWAVE", "DIG", "DIGIT", "*DIM", + "/DIRECTORY", "DISPLAY", "/DIST", "DJ", "DJDELE", + "DJLIST", "DK", "DKDELE", "DKLIST", "DL", "DLDELE", + "DLIST", "DLLIST", "*DMAT", "DMOVE", "DMPEXT", + "DMPOPTION", "DMPRAT", "DMPSTR", "DNSOL", "*DO", "DOF", + "DOFSEL", "DOMEGA", "*DOT", "*DOWHILE", "DSCALE", + "/DSCALE", "DSET", "DSPOPTION", "DSUM", "DSURF", + "DSYM", "DSYS", "DTRAN", "DUMP", "/DV3D", "DVAL", + "DVMORPH", "DYNOPT", "E", "EALIVE", "EDADAPT", "EDALE", + "EDASMP", "EDBOUND", "EDBX", "EDBVIS", "EDCADAPT", + "EDCGEN", "EDCLIST", "EDCMORE", "EDCNSTR", "EDCONTACT", + "EDCPU", "EDCRB", "EDCSC", "EDCTS", "EDCURVE", + "EDDAMP", "EDDBL", "EDDC", "EDDRELAX", "EDDUMP", + "EDELE", "EDENERGY", "EDFPLOT", "EDGCALE", "/EDGE", + "EDHGLS", "EDHIST", "EDHTIME", "EDINT", "EDIPART", + "EDIS", "EDLCS", "EDLOAD", "EDMP", "EDNB", "EDNDTSD", + "EDNROT", "EDOPT", "EDOUT", "EDPART", "EDPC", "EDPL", + "EDPVEL", "EDRC", "EDRD", "EDREAD", "EDRI", "EDRST", + "EDRUN", "EDSHELL", "EDSOLV", "EDSP", "EDSTART", + "EDTERM", "EDTP", "EDVEL", "EDWELD", "EDWRITE", + "EEXTRUDE", "/EFACET", "EGEN", "*EIGEN", "EINFIN", + "EINTF", "EKILL", "ELBOW", "ELEM", "ELIST", "*ELSE", + "*ELSEIF", "EMAGERR", "EMATWRITE", "EMF", "EMFT", + "EMID", "EMIS", "EMODIF", "EMORE", "EMSYM", "EMTGEN", + "EMUNIT", "EN", "*END", "*ENDDO", "*ENDIF", + "ENDRELEASE", "ENERSOL", "ENGEN", "ENORM", "ENSYM", + "EORIENT", "EPLOT", "EQSLV", "ERASE", "/ERASE", + "EREAD", "EREFINE", "EREINF", "ERESX", "ERNORM", + "ERRANG", "ESCHECK", "ESEL", "/ESHAPE", "ESIZE", + "ESLA", "ESLL", "ESLN", "ESLV", "ESOL", "ESORT", + "ESSOLV", "ESTIF", "ESURF", "ESYM", "ESYS", "ET", + "ETABLE", "ETCHG", "ETCONTROL", "ETDELE", "ETLIST", + "ETYPE", "EUSORT", "EWRITE", "*EXIT", "/EXIT", "EXP", + "EXPAND", "/EXPAND", "EXPASS", "*EXPORT", "EXPROFILE", + "EXPSOL", "EXTOPT", "EXTREM", "EXUNIT", "F", "/FACET", + "FATIGUE", "FC", "FCCHECK", "FCDELE", "FCLIST", "FCUM", + "FCTYP", "FDELE", "/FDELE", "FE", "FEBODY", "FECONS", + "FEFOR", "FELIST", "FESURF", "*FFT", "FILE", + "FILEAUX2", "FILEAUX3", "FILEDISP", "FILL", "FILLDATA", + "/FILNAME", "FINISH", "FITEM", "FJ", "FJDELE", + "FJLIST", "FK", "FKDELE", "FKLIST", "FL", "FLIST", + "FLLIST", "FLST", "FLUXV", "FLUREAD", "FMAGBC", + "FMAGSUM", "/FOCUS", "FOR2D", "FORCE", "FORM", + "/FORMAT", "FP", "FPLIST", "*FREE", "FREQ", "FRQSCL", + "FS", "FSCALE", "FSDELE", "FSLIST", "FSNODE", "FSPLOT", + "FSSECT", "FSSPARM", "FSUM", "FTCALC", "FTRAN", + "FTSIZE", "FTWRITE", "FTYPE", "FVMESH", "GAP", "GAPF", + "GAUGE", "GCDEF", "GCGEN", "/GCMD", "/GCOLUMN", + "GENOPT", "GEOM", "GEOMETRY", "*GET", "/GFILE", + "/GFORMAT", "/GLINE", "/GMARKER", "GMATRIX", "GMFACE", + "*GO", "/GO", "/GOLIST", "/GOPR", "GP", "GPDELE", + "GPLIST", "GPLOT", "/GRAPHICS", "/GRESUME", "/GRID", + "/GROPT", "GRP", "/GRTYP", "/GSAVE", "GSBDATA", + "GSGDATA", "GSLIST", "GSSOL", "/GST", "GSUM", "/GTHK", + "/GTYPE", "HARFRQ", "/HBC", "HBMAT", "/HEADER", "HELP", + "HELPDISP", "HEMIOPT", "HFANG", "HFSYM", "HMAGSOLV", + "HPGL", "HPTCREATE", "HPTDELETE", "HRCPLX", "HREXP", + "HROPT", "HROCEAN", "HROUT", "IC", "ICDELE", "ICLIST", + "/ICLWID", "/ICSCALE", "*IF", "IGESIN", "IGESOUT", + "/IMAGE", "IMAGIN", "IMESH", "IMMED", "IMPD", + "INISTATE", "*INIT", "/INPUT", "/INQUIRE", "INRES", + "INRTIA", "INT1", "INTSRF", "IOPTN", "IRLF", "IRLIST", + "*ITENGINE", "JPEG", "JSOL", "K", "KATT", "KBC", + "KBETW", "KCALC", "KCENTER", "KCLEAR", "KDELE", + "KDIST", "KEEP", "KESIZE", "KEYOPT", "KEYPTS", "KEYW", + "KFILL", "KGEN", "KL", "KLIST", "KMESH", "KMODIF", + "KMOVE", "KNODE", "KPLOT", "KPSCALE", "KREFINE", + "KSCALE", "KSCON", "KSEL", "KSLL", "KSLN", "KSUM", + "KSYMM", "KTRAN", "KUSE", "KWPAVE", "KWPLAN", "L", + "L2ANG", "L2TAN", "LANG", "LARC", "/LARC", "LAREA", + "LARGE", "LATT", "LAYER", "LAYERP26", "LAYLIST", + "LAYPLOT", "LCABS", "LCASE", "LCCALC", "LCCAT", + "LCDEF", "LCFACT", "LCFILE", "LCLEAR", "LCOMB", + "LCOPER", "LCSEL", "LCSL", "LCSUM", "LCWRITE", + "LCZERO", "LDELE", "LDIV", "LDRAG", "LDREAD", "LESIZE", + "LEXTND", "LFILLT", "LFSURF", "LGEN", "LGLUE", + "LGWRITE", "/LIGHT", "LINA", "LINE", "/LINE", "LINES", + "LINL", "LINP", "LINV", "LIST", "*LIST", "LLIST", + "LMATRIX", "LMESH", "LNSRCH", "LOCAL", "LOVLAP", + "LPLOT", "LPTN", "LREFINE", "LREVERSE", "LROTAT", + "LSBA", "*LSBAC", "LSBL", "LSBV", "LSBW", "LSCLEAR", + "LSDELE", "*LSDUMP", "LSEL", "*LSENGINE", "*LSFACTOR", + "LSLA", "LSLK", "LSOPER", "/LSPEC", "LSREAD", + "*LSRESTORE", "LSSCALE", "LSSOLVE", "LSTR", "LSUM", + "LSWRITE", "/LSYMBOL", "LSYMM", "LTAN", "LTRAN", + "LUMPM", "LVSCALE", "LWPLAN", "M", "MADAPT", "MAGOPT", + "MAGSOLV", "/MAIL", "MAP", "/MAP", "MAP2DTO3D", + "MAPSOLVE", "MAPVAR", "MASTER", "MAT", "MATER", + "MCHECK", "MDAMP", "MDELE", "MDPLOT", "MEMM", "/MENU", + "MESHING", "MFANALYSIS", "MFBUCKET", "MFCALC", "MFCI", + "MFCLEAR", "MFCMMAND", "MFCONV", "MFDTIME", "MFELEM", + "MFEM", "MFEXTER", "MFFNAME", "MFFR", "MFIMPORT", + "MFINTER", "MFITER", "MFLCOMM", "MFLIST", "MFMAP", + "MFORDER", "MFOUTPUT", "*MFOURI", "MFPSIMUL", "MFRC", + "MFRELAX", "MFRSTART", "MFSORDER", "MFSURFACE", + "MFTIME", "MFTOL", "*MFUN", "MFVOLUME", "MFWRITE", + "MGEN", "MIDTOL", "/MKDIR", "MLIST", "MMASS", "MMF", + "MODCONT", "MODE", "MODIFY", "MODMSH", "MODSELOPTION", + "MODOPT", "MONITOR", "*MOPER", "MOPT", "MORPH", "MOVE", + "MP", "MPAMOD", "MPCHG", "MPCOPY", "MPDATA", "MPDELE", + "MPDRES", "/MPLIB", "MPLIST", "MPPLOT", "MPREAD", + "MPRINT", "MPTEMP", "MPTGEN", "MPTRES", "MPWRITE", + "/MREP", "MSAVE", "*MSG", "MSHAPE", "MSHCOPY", + "MSHKEY", "MSHMID", "MSHPATTERN", "MSOLVE", "/MSTART", + "MSTOLE", "*MULT", "*MWRITE", "MXPAND", "N", "NANG", + "NAXIS", "NCNV", "NDELE", "NDIST", "NDSURF", "NEQIT", + "/NERR", "NFORCE", "NGEN", "NKPT", "NLADAPTIVE", + "NLDIAG", "NLDPOST", "NLGEOM", "NLHIST", "NLIST", + "NLMESH", "NLOG", "NLOPT", "NMODIF", "NOCOLOR", + "NODES", "/NOERASE", "/NOLIST", "NOOFFSET", "NOORDER", + "/NOPR", "NORA", "NORL", "/NORMAL", "NPLOT", "NPRINT", + "NREAD", "NREFINE", "NRLSUM", "*NRM", "NROPT", + "NROTAT", "NRRANG", "NSCALE", "NSEL", "NSLA", "NSLE", + "NSLK", "NSLL", "NSLV", "NSMOOTH", "NSOL", "NSORT", + "NSTORE", "NSUBST", "NSVR", "NSYM", "/NUMBER", + "NUMCMP", "NUMEXP", "NUMMRG", "NUMOFF", "NUMSTR", + "NUMVAR", "NUSORT", "NWPAVE", "NWPLAN", "NWRITE", + "OCDATA", "OCDELETE", "OCLIST", "OCREAD", "OCTABLE", + "OCTYPE", "OCZONE", "OMEGA", "OPERATE", "OPNCONTROL", + "OUTAERO", "OUTOPT", "OUTPR", "/OUTPUT", "OUTRES", + "OVCHECK", "PADELE", "/PAGE", "PAGET", "PAPUT", + "PARESU", "PARTSEL", "PARRES", "PARSAV", "PASAVE", + "PATH", "PAUSE", "/PBC", "/PBF", "PCALC", "PCGOPT", + "PCIRC", "/PCIRCLE", "/PCOPY", "PCROSS", "PDANL", + "PDCDF", "PDCFLD", "PDCLR", "PDCMAT", "PDCORR", + "PDDMCS", "PDDOEL", "PDEF", "PDEXE", "PDHIST", + "PDINQR", "PDLHS", "PDMETH", "PDOT", "PDPINV", + "PDPLOT", "PDPROB", "PDRESU", "PDROPT", "/PDS", + "PDSAVE", "PDSCAT", "PDSENS", "PDSHIS", "PDUSER", + "PDVAR", "PDWRITE", "PERBC2D", "PERTURB", "PFACT", + "PHYSICS", "PIVCHECK", "PLCAMP", "PLCFREQ", "PLCHIST", + "PLCINT", "PLCPLX", "PLCRACK", "PLDISP", "PLESOL", + "PLETAB", "PLFAR", "PLF2D", "PLGEOM", "PLLS", "PLMAP", + "PLMC", "PLNEAR", "PLNSOL", "/PLOPTS", "PLORB", "PLOT", + "PLOTTING", "PLPAGM", "PLPATH", "PLSECT", "PLST", + "PLTIME", "PLTRAC", "PLVAR", "PLVECT", "PLZZ", + "/PMACRO", "PMAP", "PMGTRAN", "PMLOPT", "PMLSIZE", + "/PMORE", "PNGR", "/PNUM", "POINT", "POLY", "/POLYGON", + "/POST1", "/POST26", "POWERH", "PPATH", "PRANGE", + "PRAS", "PRCAMP", "PRCINT", "PRCPLX", "PRED", + "PRENERGY", "/PREP7", "PRERR", "PRESOL", "PRETAB", + "PRFAR", "PRI2", "PRIM", "PRINT", "*PRINT", "PRISM", + "PRITER", "PRJSOL", "PRNEAR", "PRNLD", "PRNSOL", + "PROD", "PRORB", "PRPATH", "PRRFOR", "PRRSOL", + "PRSCONTROL", "PRSECT", "PRTIME", "PRVAR", "PRVECT", + "PSCONTROL", "PSCR", "PSDCOM", "PSDFRQ", "PSDGRAPH", + "PSDRES", "PSDSPL", "PSDUNIT", "PSDVAL", "PSDWAV", + "/PSEARCH", "PSEL", "/PSF", "PSMAT", "PSMESH", + "/PSPEC", "/PSTATUS", "PSTRES", "/PSYMB", "PTR", + "PTXY", "PVECT", "/PWEDGE", "QDVAL", "QRDOPT", "QSOPT", + "QUAD", "/QUIT", "QUOT", "R", "RACE", "RADOPT", + "RAPPND", "RATE", "/RATIO", "RBE3", "RCON", "RCYC", + "RDEC", "RDELE", "READ", "REAL", "REALVAR", "RECTNG", + "REMESH", "/RENAME", "REORDER", "*REPEAT", "/REPLOT", + "RESCOMBINE", "RESCONTROL", "RESET", "/RESET", "RESP", + "RESUME", "RESVEC", "RESWRITE", "*RETURN", "REXPORT", + "REZONE", "RFORCE", "/RGB", "RIGID", "RIGRESP", + "RIMPORT", "RLIST", "RMALIST", "RMANL", "RMASTER", + "RMCAP", "RMCLIST", "/RMDIR", "RMFLVEC", "RMLVSCALE", + "RMMLIST", "RMMRANGE", "RMMSELECT", "RMNDISP", + "RMNEVEC", "RMODIF", "RMORE", "RMPORDER", "RMRESUME", + "RMRGENERATE", "RMROPTIONS", "RMRPLOT", "RMRSTATUS", + "RMSAVE", "RMSMPLE", "RMUSE", "RMXPORT", "ROCK", + "ROSE", "RPOLY", "RPR4", "RPRISM", "RPSD", "RSFIT", + "RSOPT", "RSPLIT", "RSPLOT", "RSPRNT", "RSSIMS", + "RSTMAC", "RSTOFF", "RSURF", "RSYMM", "RSYS", "RTHICK", + "SABS", "SADD", "SALLOW", "SAVE", "SBCLIST", "SBCTRAN", + "SDELETE", "SE", "SECCONTROL", "SECDATA", + "SECFUNCTION", "SECJOINT", "/SECLIB", "SECLOCK", + "SECMODIF", "SECNUM", "SECOFFSET", "SECPLOT", + "SECREAD", "SECSTOP", "SECTYPE", "SECWRITE", "SED", + "SEDLIST", "SEEXP", "/SEG", "SEGEN", "SELIST", "SELM", + "SELTOL", "SENERGY", "SEOPT", "SESYMM", "*SET", "SET", + "SETFGAP", "SETRAN", "SEXP", "SF", "SFA", "SFACT", + "SFADELE", "SFALIST", "SFBEAM", "SFCALC", "SFCUM", + "SFDELE", "SFE", "SFEDELE", "SFELIST", "SFFUN", + "SFGRAD", "SFL", "SFLDELE", "SFLEX", "SFLIST", + "SFLLIST", "SFSCALE", "SFTRAN", "/SHADE", "SHELL", + "/SHOW", "/SHOWDISP", "SHPP", "/SHRINK", "SLIST", + "SLOAD", "SMALL", "*SMAT", "SMAX", "/SMBC", "SMBODY", + "SMCONS", "SMFOR", "SMIN", "SMOOTH", "SMRTSIZE", + "SMSURF", "SMULT", "SNOPTION", "SOLU", "/SOLU", + "SOLUOPT", "SOLVE", "SORT", "SOURCE", "SPACE", + "SPCNOD", "SPCTEMP", "SPDAMP", "SPEC", "SPFREQ", + "SPGRAPH", "SPH4", "SPH5", "SPHERE", "SPLINE", "SPLOT", + "SPMWRITE", "SPOINT", "SPOPT", "SPREAD", "SPTOPT", + "SPOWER", "SPUNIT", "SPVAL", "SQRT", "*SREAD", "SRSS", + "SSBT", "/SSCALE", "SSLN", "SSMT", "SSPA", "SSPB", + "SSPD", "SSPE", "SSPM", "SSUM", "SSTATE", "STABILIZE", + "STAOPT", "STAT", "*STATUS", "/STATUS", "STEF", + "STORE", "SUBOPT", "SUBSET", "SUCALC", + "SUCR", "SUDEL", "SUEVAL", "SUGET", "SUMAP", "SUMTYPE", + "SUPL", "SUPR", "SURESU", "SUSAVE", "SUSEL", "SUVECT", + "SV", "SVPLOT", "SVTYP", "SWADD", "SWDEL", "SWGEN", + "SWLIST", "SYNCHRO", "/SYP", "/SYS", "TALLOW", + "TARGET", "*TAXIS", "TB", "TBCOPY", "TBDATA", "TBDELE", + "TBEO", "TBIN", "TBFIELD", "TBFT", "TBLE", "TBLIST", + "TBMODIF", "TBPLOT", "TBPT", "TBTEMP", "TCHG", "/TEE", + "TERM", "THEXPAND", "THOPT", "TIFF", "TIME", + "TIMERANGE", "TIMINT", "TIMP", "TINTP", + "/TLABEL", "TOFFST", "*TOPER", "TORQ2D", "TORQC2D", + "TORQSUM", "TORUS", "TRANS", "TRANSFER", "*TREAD", + "TREF", "/TRIAD", "/TRLCY", "TRNOPT", "TRPDEL", + "TRPLIS", "TRPOIN", "TRTIME", "TSHAP", "/TSPEC", + "TSRES", "TUNIF", "TVAR", "/TXTRE", "/TYPE", "TYPE", + "/UCMD", "/UDOC", "/UI", "UIMP", "/UIS", "*ULIB", "/UPF", + "UNDELETE", "UNDO", "/UNITS", "UNPAUSE", "UPCOORD", + "UPGEOM", "*USE", "/USER", "USRCAL", "USRDOF", + "USRELEM", "V", "V2DOPT", "VA", "*VABS", "VADD", + "VARDEL", "VARNAM", "VATT", "VCLEAR", "*VCOL", + "/VCONE", "VCROSS", "*VCUM", "VDDAM", "VDELE", "VDGL", + "VDOT", "VDRAG", "*VEC", "*VEDIT", "VEORIENT", "VEXT", + "*VFACT", "*VFILL", "VFOPT", "VFQUERY", "VFSM", + "*VFUN", "VGEN", "*VGET", "VGET", "VGLUE", "/VIEW", + "VIMP", "VINP", "VINV", "*VITRP", "*VLEN", "VLIST", + "VLSCALE", "*VMASK", "VMESH", "VOFFST", "VOLUMES") + + # list of in-built () functions + elafunf = ("NX()", "NY()", "NZ()", "KX()", "KY()", "KZ()", "LX()", + "LY()", "LZ()", "LSX()", "LSY()", "LSZ()", "NODE()", + "KP()", "DISTND()", "DISTKP()", "DISTEN()", "ANGLEN()", + "ANGLEK()", "NNEAR()", "KNEAR()", "ENEARN()", + "AREAND()", "AREAKP()", "ARNODE()", "NORMNX()", + "NORMNY()", "NORMNZ()", "NORMKX()", "NORMKY()", + "NORMKZ()", "ENEXTN()", "NELEM()", "NODEDOF()", + "ELADJ()", "NDFACE()", "NMFACE()", "ARFACE()", "UX()", + "UY()", "UZ()", "ROTX()", "ROTY()", "ROTZ()", "TEMP()", + "PRES()", "VX()", "VY()", "VZ()", "ENKE()", "ENDS()", + "VOLT()", "MAG()", "AX()", "AY()", "AZ()", + "VIRTINQR()", "KWGET()", "VALCHR()", "VALHEX()", + "CHRHEX()", "STRFILL()", "STRCOMP()", "STRPOS()", + "STRLENG()", "UPCASE()", "LWCASE()", "JOIN()", + "SPLIT()", "ABS()", "SIGN()", "CXABS()", "EXP()", + "LOG()", "LOG10()", "SQRT()", "NINT()", "MOD()", + "RAND()", "GDIS()", "SIN()", "COS()", "TAN()", + "SINH()", "COSH()", "TANH()", "ASIN()", "ACOS()", + "ATAN()", "ATAN2()") + + elafung = ("NSEL()", "ESEL()", "KSEL()", "LSEL()", "ASEL()", + "VSEL()", "NDNEXT()", "ELNEXT()", "KPNEXT()", + "LSNEXT()", "ARNEXT()", "VLNEXT()", "CENTRX()", + "CENTRY()", "CENTRZ()") + + elafunh = ("~CAT5IN", "~CATIAIN", "~PARAIN", "~PROEIN", "~SATIN", + "~UGIN", "A", "AADD", "AATT", "ABEXTRACT", "*ABBR", + "ABBRES", "ABBSAV", "ABS", "ACCAT", "ACCOPTION", + "ACEL", "ACLEAR", "ADAMS", "ADAPT", "ADD", "ADDAM", + "ADELE", "ADGL", "ADRAG", "AESIZE", "AFILLT", "AFLIST", + "AFSURF", "*AFUN", "AGEN", "AGLUE", "AINA", "AINP", + "AINV", "AL", "ALIST", "ALLSEL", "ALPHAD", "AMAP", + "AMESH", "/AN3D", "ANCNTR", "ANCUT", "ANCYC", "ANDATA", + "ANDSCL", "ANDYNA", "/ANFILE", "ANFLOW", "/ANGLE", + "ANHARM", "ANIM", "ANISOS", "ANMODE", "ANMRES", + "/ANNOT", "ANORM", "ANPRES", "ANSOL", "ANSTOAQWA", + "ANSTOASAS", "ANTIME", "ANTYPE") + + special = ("/COM", "/TITLE", "STITLE") + + elements = ("SOLID5", + "LINK11", + "PLANE13", + "COMBIN14", + "MASS2", + "PLANE25", + "MATRIX27", + "FLUID29", + "FLUID30", + "LINK31", + "LINK33", + "LINK34", + "PLANE35", + "SOURC36", + "COMBIN37", + "FLUID38", + "COMBIN39", + "COMBIN40", + "INFIN47", + "MATRIX50", + "PLANE55", + "SHELL61", + "LINK68", + "SOLID70", + "MASS71", + "PLANE75", + "PLANE77", + "PLANE78", + "PLANE83", + "SOLID87", + "SOLID90", + "CIRCU94", + "SOLID96", + "SOLID98", + "INFIN110", + "INFIN111", + "FLUID116", + "PLANE121", + "SOLID122", + "SOLID123", + "CIRCU124", + "CIRCU125", + "TRANS126", + "FLUID129", + "FLUID130", + "SHELL131", + "SHELL132", + "FLUID136", + "FLUID138", + "FLUID139", + "SURF151", + "SURF152", + "SURF153", + "SURF154", + "SURF155", + "SURF156", + "SHELL157", + "SURF159", + "TARGE169", + "TARGE170", + "CONTA172", + "CONTA174", + "CONTA175", + "CONTA177", + "CONTA178", + "PRETS179", + "LINK180", + "SHELL181", + "PLANE182", + "PLANE183", + "MPC184", + "SOLID185", + "SOLID186", + "SOLID187", + "BEAM188", + "BEAM189", + "SOLSH190", + "INTER192", + "INTER193", + "INTER194", + "INTER195", + "MESH200", + "FOLLW201", + "INTER202", + "INTER203", + "INTER204", + "INTER205", + "SHELL208", + "SHELL209", + "CPT212", + "CPT213", + "COMBI214", + "CPT215", + "CPT216", + "CPT217", + "FLUID218", + "FLUID220", + "FLUID221", + "PLANE222", + "PLANE223", + "SOLID225", + "SOLID226", + "SOLID227", + "PLANE230", + "SOLID231", + "SOLID232", + "PLANE233", + "SOLID236", + "SOLID237", + "PLANE238", + "SOLID239", + "SOLID240", + "HSFLD241", + "HSFLD242", + "COMBI250", + "SURF251", + "SURF252", + "INFIN257", + "REINF263", + "REINF264", + "REINF265", + "SOLID272", + "SOLID273", + "SOLID278", + "SOLID279", + "CABLE280", + "SHELL281", + "SOLID285", + "PIPE288", + "PIPE289", + "ELBOW290", + "SOLID291", + "PLANE292", + "PLANE293", + "USER300") + + tokens = { + 'root': [ + (r'[^\S\n]+', Whitespace), + (words((elafunb+elafunc+elafund+elafune+elafunh+special), suffix=r'\b'), Keyword, 'non-keyword'), + default('non-keyword'), + ], + 'non-keyword': [ + (r'!.*\n', Comment, '#pop'), + (r'%.*?%', Escape), + include('strings'), + include('nums'), + (words((elafunf+elafung), suffix=r'\b'), Name.Builtin), + (words((elements), suffix=r'\b'), Name.Property), + include('core'), + (r'AR[0-9]+', Name.Variable.Instance), + (r'[a-z_][a-z0-9_]*', Name.Variable), + (r'\n+', Whitespace, '#pop'), + (r'[^\S\n]+', Whitespace), + ], + 'core': [ + # Operators + (r'(\*\*|\*|\+|-|\/|<|>|<=|>=|==|\/=|=|\(|\))', Operator), + (r'/EOF', Generic.Emph), + (r'[\.(),:&;]', Punctuation), + ], + 'strings': [ + (r'(?s)"(\\\\|\\[0-7]+|\\.|[^"\\])*"', String.Double), + (r"(?s)'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single), + (r'[$%]', String.Symbol), + ], + 'nums': [ + (r'[+-]?\d*\.\d+([efEF][-+]?\d+)?', Number.Float), # with dot + (r'([+-]?\d+([efEF][-+]?\d+))', Number.Float), # With scientific notation + (r'\b\d+(?![.ef])', Number.Integer), # integer simple + ] + } diff --git a/lib/python3.12/site-packages/pygments/lexers/arrow.py b/lib/python3.12/site-packages/pygments/lexers/arrow.py new file mode 100644 index 0000000000000000000000000000000000000000..e686cf1b66add90338132d7ea5f65928ccf3627f --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/arrow.py @@ -0,0 +1,116 @@ +""" + pygments.lexers.arrow + ~~~~~~~~~~~~~~~~~~~~~ + + Lexer for Arrow. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, bygroups, default, include +from pygments.token import Text, Operator, Keyword, Punctuation, Name, \ + String, Number, Whitespace + +__all__ = ['ArrowLexer'] + +TYPES = r'\b(int|bool|char)((?:\[\])*)(?=\s+)' +IDENT = r'([a-zA-Z_][a-zA-Z0-9_]*)' +DECL = TYPES + r'(\s+)' + IDENT + + +class ArrowLexer(RegexLexer): + """ + Lexer for Arrow + """ + + name = 'Arrow' + url = 'https://pypi.org/project/py-arrow-lang/' + aliases = ['arrow'] + filenames = ['*.arw'] + version_added = '2.7' + + tokens = { + 'root': [ + (r'\s+', Whitespace), + (r'^[|\s]+', Punctuation), + include('blocks'), + include('statements'), + include('expressions'), + ], + 'blocks': [ + (r'(function)(\n+)(/-->)(\s*)' + + DECL + # 4 groups + r'(\()', bygroups( + Keyword.Reserved, Whitespace, Punctuation, + Whitespace, Keyword.Type, Punctuation, Whitespace, + Name.Function, Punctuation + ), 'fparams'), + (r'/-->$|\\-->$|/--<|\\--<|\^', Punctuation), + ], + 'statements': [ + (DECL, bygroups(Keyword.Type, Punctuation, Text, Name.Variable)), + (r'\[', Punctuation, 'index'), + (r'=', Operator), + (r'require|main', Keyword.Reserved), + (r'print', Keyword.Reserved, 'print'), + ], + 'expressions': [ + (r'\s+', Whitespace), + (r'[0-9]+', Number.Integer), + (r'true|false', Keyword.Constant), + (r"'", String.Char, 'char'), + (r'"', String.Double, 'string'), + (r'\{', Punctuation, 'array'), + (r'==|!=|<|>|\+|-|\*|/|%', Operator), + (r'and|or|not|length', Operator.Word), + (r'(input)(\s+)(int|char\[\])', bygroups( + Keyword.Reserved, Whitespace, Keyword.Type + )), + (IDENT + r'(\()', bygroups( + Name.Function, Punctuation + ), 'fargs'), + (IDENT, Name.Variable), + (r'\[', Punctuation, 'index'), + (r'\(', Punctuation, 'expressions'), + (r'\)', Punctuation, '#pop'), + ], + 'print': [ + include('expressions'), + (r',', Punctuation), + default('#pop'), + ], + 'fparams': [ + (DECL, bygroups(Keyword.Type, Punctuation, Whitespace, Name.Variable)), + (r',', Punctuation), + (r'\)', Punctuation, '#pop'), + ], + 'escape': [ + (r'\\(["\\/abfnrtv]|[0-9]{1,3}|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})', + String.Escape), + ], + 'char': [ + (r"'", String.Char, '#pop'), + include('escape'), + (r"[^'\\]", String.Char), + ], + 'string': [ + (r'"', String.Double, '#pop'), + include('escape'), + (r'[^"\\]+', String.Double), + ], + 'array': [ + include('expressions'), + (r'\}', Punctuation, '#pop'), + (r',', Punctuation), + ], + 'fargs': [ + include('expressions'), + (r'\)', Punctuation, '#pop'), + (r',', Punctuation), + ], + 'index': [ + include('expressions'), + (r'\]', Punctuation, '#pop'), + ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/boa.py b/lib/python3.12/site-packages/pygments/lexers/boa.py new file mode 100644 index 0000000000000000000000000000000000000000..6f4e8cdaf788ed51481b481eaf6edfade5453747 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/boa.py @@ -0,0 +1,97 @@ +""" + pygments.lexers.boa + ~~~~~~~~~~~~~~~~~~~ + + Lexers for the Boa language. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, words +from pygments.token import String, Comment, Keyword, Name, Number, Operator, \ + Punctuation, Whitespace + +__all__ = ['BoaLexer'] + + +class BoaLexer(RegexLexer): + """ + Lexer for the Boa language. + """ + name = 'Boa' + aliases = ['boa'] + filenames = ['*.boa'] + url = 'https://boa.cs.iastate.edu/docs' + version_added = '2.4' + + reserved = words( + ('input', 'output', 'of', 'weight', 'before', 'after', 'stop', + 'ifall', 'foreach', 'exists', 'function', 'break', 'switch', 'case', + 'visitor', 'default', 'return', 'visit', 'while', 'if', 'else'), + suffix=r'\b', prefix=r'\b') + keywords = words( + ('bottom', 'collection', 'maximum', 'mean', 'minimum', 'set', 'sum', + 'top', 'string', 'int', 'bool', 'float', 'time', 'false', 'true', + 'array', 'map', 'stack', 'enum', 'type'), suffix=r'\b', prefix=r'\b') + classes = words( + ('Project', 'ForgeKind', 'CodeRepository', 'Revision', 'RepositoryKind', + 'ChangedFile', 'FileKind', 'ASTRoot', 'Namespace', 'Declaration', 'Type', + 'Method', 'Variable', 'Statement', 'Expression', 'Modifier', + 'StatementKind', 'ExpressionKind', 'ModifierKind', 'Visibility', + 'TypeKind', 'Person', 'ChangeKind'), + suffix=r'\b', prefix=r'\b') + operators = ('->', ':=', ':', '=', '<<', '!', '++', '||', + '&&', '+', '-', '*', ">", "<") + string_sep = ('`', '\"') + built_in_functions = words( + ( + # Array functions + 'new', 'sort', + # Date & Time functions + 'yearof', 'dayofyear', 'hourof', 'minuteof', 'secondof', 'now', + 'addday', 'addmonth', 'addweek', 'addyear', 'dayofmonth', 'dayofweek', + 'dayofyear', 'formattime', 'trunctoday', 'trunctohour', 'trunctominute', + 'trunctomonth', 'trunctosecond', 'trunctoyear', + # Map functions + 'clear', 'haskey', 'keys', 'lookup', 'remove', 'values', + # Math functions + 'abs', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', + 'ceil', 'cos', 'cosh', 'exp', 'floor', 'highbit', 'isfinite', 'isinf', + 'isnan', 'isnormal', 'log', 'log10', 'max', 'min', 'nrand', 'pow', + 'rand', 'round', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc', + # Other functions + 'def', 'hash', 'len', + # Set functions + 'add', 'contains', 'remove', + # String functions + 'format', 'lowercase', 'match', 'matchposns', 'matchstrs', 'regex', + 'split', 'splitall', 'splitn', 'strfind', 'strreplace', 'strrfind', + 'substring', 'trim', 'uppercase', + # Type Conversion functions + 'bool', 'float', 'int', 'string', 'time', + # Domain-Specific functions + 'getast', 'getsnapshot', 'hasfiletype', 'isfixingrevision', 'iskind', + 'isliteral', + ), + prefix=r'\b', + suffix=r'\(') + + tokens = { + 'root': [ + (r'#.*?$', Comment.Single), + (r'/\*.*?\*/', Comment.Multiline), + (reserved, Keyword.Reserved), + (built_in_functions, Name.Function), + (keywords, Keyword.Type), + (classes, Name.Classes), + (words(operators), Operator), + (r'[][(),;{}\\.]', Punctuation), + (r'"(\\\\|\\[^\\]|[^"\\])*"', String.Double), + (r"`(\\\\|\\[^\\]|[^`\\])*`", String.Backtick), + (words(string_sep), String.Delimiter), + (r'[a-zA-Z_]+', Name.Variable), + (r'[0-9]+', Number.Integer), + (r'\s+', Whitespace), # Whitespace + ] + } diff --git a/lib/python3.12/site-packages/pygments/lexers/c_cpp.py b/lib/python3.12/site-packages/pygments/lexers/c_cpp.py new file mode 100644 index 0000000000000000000000000000000000000000..399f2bc4f2207455e3deb3fd7967e1ee8c88e25b --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/c_cpp.py @@ -0,0 +1,414 @@ +""" + pygments.lexers.c_cpp + ~~~~~~~~~~~~~~~~~~~~~ + + Lexers for C/C++ languages. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, include, bygroups, using, \ + this, inherit, default, words +from pygments.util import get_bool_opt +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Whitespace + +__all__ = ['CLexer', 'CppLexer'] + + +class CFamilyLexer(RegexLexer): + """ + For C family source code. This is used as a base class to avoid repetitious + definitions. + """ + + # The trailing ?, rather than *, avoids a geometric performance drop here. + #: only one /* */ style comment + _ws1 = r'\s*(?:/[*].*?[*]/\s*)?' + + # Hexadecimal part in an hexadecimal integer/floating-point literal. + # This includes decimal separators matching. + _hexpart = r'[0-9a-fA-F](\'?[0-9a-fA-F])*' + # Decimal part in an decimal integer/floating-point literal. + # This includes decimal separators matching. + _decpart = r'\d(\'?\d)*' + # Integer literal suffix (e.g. 'ull' or 'll'). + _intsuffix = r'(([uU][lL]{0,2})|[lL]{1,2}[uU]?)?' + + # Identifier regex with C and C++ Universal Character Name (UCN) support. + _ident = r'(?!\d)(?:[\w$]|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8})+' + _namespaced_ident = r'(?!\d)(?:[\w$]|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|::)+' + + # Single and multiline comment regexes + # Beware not to use *? for the inner content! When these regexes + # are embedded in larger regexes, that can cause the stuff*? to + # match more than it would have if the regex had been used in + # a standalone way ... + _comment_single = r'//(?:.|(?<=\\)\n)*\n' + _comment_multiline = r'/(?:\\\n)?[*](?:[^*]|[*](?!(?:\\\n)?/))*[*](?:\\\n)?/' + + # Regex to match optional comments + _possible_comments = rf'\s*(?:(?:(?:{_comment_single})|(?:{_comment_multiline}))\s*)*' + + tokens = { + 'whitespace': [ + # preprocessor directives: without whitespace + (r'^#if\s+0', Comment.Preproc, 'if0'), + ('^#', Comment.Preproc, 'macro'), + # or with whitespace + ('^(' + _ws1 + r')(#if\s+0)', + bygroups(using(this), Comment.Preproc), 'if0'), + ('^(' + _ws1 + ')(#)', + bygroups(using(this), Comment.Preproc), 'macro'), + # Labels: + # Line start and possible indentation. + (r'(^[ \t]*)' + # Not followed by keywords which can be mistaken as labels. + r'(?!(?:public|private|protected|default)\b)' + # Actual label, followed by a single colon. + r'(' + _ident + r')(\s*)(:)(?!:)', + bygroups(Whitespace, Name.Label, Whitespace, Punctuation)), + (r'\n', Whitespace), + (r'[^\S\n]+', Whitespace), + (r'\\\n', Text), # line continuation + (_comment_single, Comment.Single), + (_comment_multiline, Comment.Multiline), + # Open until EOF, so no ending delimiter + (r'/(\\\n)?[*][\w\W]*', Comment.Multiline), + ], + 'statements': [ + include('keywords'), + include('types'), + (r'([LuU]|u8)?(")', bygroups(String.Affix, String), 'string'), + (r"([LuU]|u8)?(')(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])(')", + bygroups(String.Affix, String.Char, String.Char, String.Char)), + + # Hexadecimal floating-point literals (C11, C++17) + (r'0[xX](' + _hexpart + r'\.' + _hexpart + r'|\.' + _hexpart + + r'|' + _hexpart + r')[pP][+-]?' + _hexpart + r'[lL]?', Number.Float), + + (r'(-)?(' + _decpart + r'\.' + _decpart + r'|\.' + _decpart + r'|' + + _decpart + r')[eE][+-]?' + _decpart + r'[fFlL]?', Number.Float), + (r'(-)?((' + _decpart + r'\.(' + _decpart + r')?|\.' + + _decpart + r')[fFlL]?)|(' + _decpart + r'[fFlL])', Number.Float), + (r'(-)?0[xX]' + _hexpart + _intsuffix, Number.Hex), + (r'(-)?0[bB][01](\'?[01])*' + _intsuffix, Number.Bin), + (r'(-)?0(\'?[0-7])+' + _intsuffix, Number.Oct), + (r'(-)?' + _decpart + _intsuffix, Number.Integer), + (r'[~!%^&*+=|?:<>/-]', Operator), + (r'[()\[\],.]', Punctuation), + (r'(true|false|NULL)\b', Name.Builtin), + (_ident, Name) + ], + 'types': [ + (words(('int8', 'int16', 'int32', 'int64', 'wchar_t'), prefix=r'__', + suffix=r'\b'), Keyword.Reserved), + (words(('bool', 'int', 'long', 'float', 'short', 'double', 'char', + 'unsigned', 'signed', 'void', '_BitInt', + '__int128'), suffix=r'\b'), Keyword.Type) + ], + 'keywords': [ + (r'(struct|union)(\s+)', bygroups(Keyword, Whitespace), 'classname'), + (r'case\b', Keyword, 'case-value'), + (words(('asm', 'auto', 'break', 'const', 'continue', 'default', + 'do', 'else', 'enum', 'extern', 'for', 'goto', 'if', + 'register', 'restricted', 'return', 'sizeof', 'struct', + 'static', 'switch', 'typedef', 'volatile', 'while', 'union', + 'thread_local', 'alignas', 'alignof', 'static_assert', '_Pragma'), + suffix=r'\b'), Keyword), + (words(('inline', '_inline', '__inline', 'naked', 'restrict', + 'thread'), suffix=r'\b'), Keyword.Reserved), + # Vector intrinsics + (r'(__m(128i|128d|128|64))\b', Keyword.Reserved), + # Microsoft-isms + (words(( + 'asm', 'based', 'except', 'stdcall', 'cdecl', + 'fastcall', 'declspec', 'finally', 'try', + 'leave', 'w64', 'unaligned', 'raise', 'noop', + 'identifier', 'forceinline', 'assume'), + prefix=r'__', suffix=r'\b'), Keyword.Reserved) + ], + 'root': [ + include('whitespace'), + include('keywords'), + # functions + (r'(' + _namespaced_ident + r'(?:[&*\s])+)' # return arguments + r'(' + _possible_comments + r')' + r'(' + _namespaced_ident + r')' # method name + r'(' + _possible_comments + r')' + r'(\([^;"\')]*?\))' # signature + r'(' + _possible_comments + r')' + r'([^;{/"\']*)(\{)', + bygroups(using(this), using(this, state='whitespace'), + Name.Function, using(this, state='whitespace'), + using(this), using(this, state='whitespace'), + using(this), Punctuation), + 'function'), + # function declarations + (r'(' + _namespaced_ident + r'(?:[&*\s])+)' # return arguments + r'(' + _possible_comments + r')' + r'(' + _namespaced_ident + r')' # method name + r'(' + _possible_comments + r')' + r'(\([^;"\')]*?\))' # signature + r'(' + _possible_comments + r')' + r'([^;/"\']*)(;)', + bygroups(using(this), using(this, state='whitespace'), + Name.Function, using(this, state='whitespace'), + using(this), using(this, state='whitespace'), + using(this), Punctuation)), + include('types'), + default('statement'), + ], + 'statement': [ + include('whitespace'), + include('statements'), + (r'\}', Punctuation), + (r'[{;]', Punctuation, '#pop'), + ], + 'function': [ + include('whitespace'), + include('statements'), + (';', Punctuation), + (r'\{', Punctuation, '#push'), + (r'\}', Punctuation, '#pop'), + ], + 'string': [ + (r'"', String, '#pop'), + (r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|' + r'u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|[0-7]{1,3})', String.Escape), + (r'[^\\"\n]+', String), # all other characters + (r'\\\n', String), # line continuation + (r'\\', String), # stray backslash + ], + 'macro': [ + (r'('+_ws1+r')(include)('+_ws1+r')("[^"]+")([^\n]*)', + bygroups(using(this), Comment.Preproc, using(this), + Comment.PreprocFile, Comment.Single)), + (r'('+_ws1+r')(include)('+_ws1+r')(<[^>]+>)([^\n]*)', + bygroups(using(this), Comment.Preproc, using(this), + Comment.PreprocFile, Comment.Single)), + (r'[^/\n]+', Comment.Preproc), + (r'/[*](.|\n)*?[*]/', Comment.Multiline), + (r'//.*?\n', Comment.Single, '#pop'), + (r'/', Comment.Preproc), + (r'(?<=\\)\n', Comment.Preproc), + (r'\n', Comment.Preproc, '#pop'), + ], + 'if0': [ + (r'^\s*#if.*?(?)', Text, '#pop'), + default('#pop') + ], + # Mark identifiers preceded by `case` keyword as constants. + 'case-value': [ + (r'(?)', Text, '#pop'), + default('#pop') + ], + 'keywords': [ + (r'(class|concept|typename)(\s+)', bygroups(Keyword, Whitespace), 'classname'), + (words(( + 'catch', 'const_cast', 'delete', 'dynamic_cast', 'explicit', + 'export', 'friend', 'mutable', 'new', 'operator', + 'private', 'protected', 'public', 'reinterpret_cast', 'class', + '__restrict', 'static_cast', 'template', 'this', 'throw', 'throws', + 'try', 'typeid', 'using', 'virtual', 'constexpr', 'nullptr', 'concept', + 'decltype', 'noexcept', 'override', 'final', 'constinit', 'consteval', + 'co_await', 'co_return', 'co_yield', 'requires', 'import', 'module', + 'typename', 'and', 'and_eq', 'bitand', 'bitor', 'compl', 'not', + 'not_eq', 'or', 'or_eq', 'xor', 'xor_eq'), + suffix=r'\b'), Keyword), + (r'namespace\b', Keyword, 'namespace'), + (r'(enum)(\s+)', bygroups(Keyword, Whitespace), 'enumname'), + inherit + ], + 'types': [ + (r'char(16_t|32_t|8_t)\b', Keyword.Type), + inherit + ], + 'namespace': [ + (r'[;{]', Punctuation, ('#pop', 'root')), + (r'inline\b', Keyword.Reserved), + (CFamilyLexer._ident, Name.Namespace), + include('statement') + ] + } + + def analyse_text(text): + if re.search('#include <[a-z_]+>', text): + return 0.2 + if re.search('using namespace ', text): + return 0.4 diff --git a/lib/python3.12/site-packages/pygments/lexers/cddl.py b/lib/python3.12/site-packages/pygments/lexers/cddl.py new file mode 100644 index 0000000000000000000000000000000000000000..fa0c85f10b0b59e38e4c151fb5dc997807a5e3e9 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/cddl.py @@ -0,0 +1,172 @@ +""" + pygments.lexers.cddl + ~~~~~~~~~~~~~~~~~~~~ + + Lexer for the Concise data definition language (CDDL), a notational + convention to express CBOR and JSON data structures. + + More information: + https://datatracker.ietf.org/doc/rfc8610/ + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, bygroups, include, words +from pygments.token import Comment, Error, Keyword, Name, Number, Operator, \ + Punctuation, String, Whitespace + +__all__ = ['CddlLexer'] + + +class CddlLexer(RegexLexer): + """ + Lexer for CDDL definitions. + """ + name = "CDDL" + url = 'https://datatracker.ietf.org/doc/rfc8610/' + aliases = ["cddl"] + filenames = ["*.cddl"] + mimetypes = ["text/x-cddl"] + version_added = '2.8' + + _prelude_types = [ + "any", + "b64legacy", + "b64url", + "bigfloat", + "bigint", + "bignint", + "biguint", + "bool", + "bstr", + "bytes", + "cbor-any", + "decfrac", + "eb16", + "eb64legacy", + "eb64url", + "encoded-cbor", + "false", + "float", + "float16", + "float16-32", + "float32", + "float32-64", + "float64", + "int", + "integer", + "mime-message", + "nil", + "nint", + "null", + "number", + "regexp", + "tdate", + "text", + "time", + "true", + "tstr", + "uint", + "undefined", + "unsigned", + "uri", + ] + + _controls = [ + ".and", + ".bits", + ".cbor", + ".cborseq", + ".default", + ".eq", + ".ge", + ".gt", + ".le", + ".lt", + ".ne", + ".regexp", + ".size", + ".within", + ] + + _re_id = ( + r"[$@A-Z_a-z]" + r"(?:[\-\.]+(?=[$@0-9A-Z_a-z])|[$@0-9A-Z_a-z])*" + + ) + + # While the spec reads more like "an int must not start with 0" we use a + # lookahead here that says "after a 0 there must be no digit". This makes the + # '0' the invalid character in '01', which looks nicer when highlighted. + _re_uint = r"(?:0b[01]+|0x[0-9a-fA-F]+|[1-9]\d*|0(?!\d))" + _re_int = r"-?" + _re_uint + + tokens = { + "commentsandwhitespace": [(r"\s+", Whitespace), (r";.+$", Comment.Single)], + "root": [ + include("commentsandwhitespace"), + # tag types + (rf"#(\d\.{_re_uint})?", Keyword.Type), # type or any + # occurrence + ( + rf"({_re_uint})?(\*)({_re_uint})?", + bygroups(Number, Operator, Number), + ), + (r"\?|\+", Operator), # occurrence + (r"\^", Operator), # cuts + (r"(\.\.\.|\.\.)", Operator), # rangeop + (words(_controls, suffix=r"\b"), Operator.Word), # ctlops + # into choice op + (rf"&(?=\s*({_re_id}|\())", Operator), + (rf"~(?=\s*{_re_id})", Operator), # unwrap op + (r"//|/(?!/)", Operator), # double und single slash + (r"=>|/==|/=|=", Operator), + (r"[\[\]{}\(\),<>:]", Punctuation), + # Bytestrings + (r"(b64)(')", bygroups(String.Affix, String.Single), "bstrb64url"), + (r"(h)(')", bygroups(String.Affix, String.Single), "bstrh"), + (r"'", String.Single, "bstr"), + # Barewords as member keys (must be matched before values, types, typenames, + # groupnames). + # Token type is String as barewords are always interpreted as such. + (rf"({_re_id})(\s*)(:)", + bygroups(String, Whitespace, Punctuation)), + # predefined types + (words(_prelude_types, prefix=r"(?![\-_$@])\b", suffix=r"\b(?![\-_$@])"), + Name.Builtin), + # user-defined groupnames, typenames + (_re_id, Name.Class), + # values + (r"0b[01]+", Number.Bin), + (r"0o[0-7]+", Number.Oct), + (r"0x[0-9a-fA-F]+(\.[0-9a-fA-F]+)?p[+-]?\d+", Number.Hex), # hexfloat + (r"0x[0-9a-fA-F]+", Number.Hex), # hex + # Float + (rf"{_re_int}(?=(\.\d|e[+-]?\d))(?:\.\d+)?(?:e[+-]?\d+)?", + Number.Float), + # Int + (_re_int, Number.Integer), + (r'"(\\\\|\\"|[^"])*"', String.Double), + ], + "bstrb64url": [ + (r"'", String.Single, "#pop"), + include("commentsandwhitespace"), + (r"\\.", String.Escape), + (r"[0-9a-zA-Z\-_=]+", String.Single), + (r".", Error), + # (r";.+$", Token.Other), + ], + "bstrh": [ + (r"'", String.Single, "#pop"), + include("commentsandwhitespace"), + (r"\\.", String.Escape), + (r"[0-9a-fA-F]+", String.Single), + (r".", Error), + ], + "bstr": [ + (r"'", String.Single, "#pop"), + (r"\\.", String.Escape), + (r"[^'\\]+", String.Single), + ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/chapel.py b/lib/python3.12/site-packages/pygments/lexers/chapel.py new file mode 100644 index 0000000000000000000000000000000000000000..955a1579a963cf49618aedc0176003382761b953 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/chapel.py @@ -0,0 +1,139 @@ +""" + pygments.lexers.chapel + ~~~~~~~~~~~~~~~~~~~~~~ + + Lexer for the Chapel language. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, bygroups, words +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Whitespace + +__all__ = ['ChapelLexer'] + + +class ChapelLexer(RegexLexer): + """ + For Chapel source. + """ + name = 'Chapel' + url = 'https://chapel-lang.org/' + filenames = ['*.chpl'] + aliases = ['chapel', 'chpl'] + version_added = '2.0' + # mimetypes = ['text/x-chapel'] + + known_types = ('bool', 'bytes', 'complex', 'imag', 'int', 'locale', + 'nothing', 'opaque', 'range', 'real', 'string', 'uint', + 'void') + + type_modifiers_par = ('atomic', 'single', 'sync') + type_modifiers_mem = ('borrowed', 'owned', 'shared', 'unmanaged') + type_modifiers = (*type_modifiers_par, *type_modifiers_mem) + + declarations = ('config', 'const', 'in', 'inout', 'out', 'param', 'ref', + 'type', 'var') + + constants = ('false', 'nil', 'none', 'true') + + other_keywords = ('align', 'as', + 'begin', 'break', 'by', + 'catch', 'cobegin', 'coforall', 'continue', + 'defer', 'delete', 'dmapped', 'do', 'domain', + 'else', 'enum', 'except', 'export', 'extern', + 'for', 'forall', 'foreach', 'forwarding', + 'if', 'implements', 'import', 'index', 'init', 'inline', + 'label', 'lambda', 'let', 'lifetime', 'local', + 'new', 'noinit', + 'on', 'only', 'otherwise', 'override', + 'pragma', 'primitive', 'private', 'prototype', 'public', + 'reduce', 'require', 'return', + 'scan', 'select', 'serial', 'sparse', 'subdomain', + 'then', 'this', 'throw', 'throws', 'try', + 'use', + 'when', 'where', 'while', 'with', + 'yield', + 'zip') + + tokens = { + 'root': [ + (r'\n', Whitespace), + (r'\s+', Whitespace), + (r'\\\n', Text), + + (r'//(.*?)\n', Comment.Single), + (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline), + + (words(declarations, suffix=r'\b'), Keyword.Declaration), + (words(constants, suffix=r'\b'), Keyword.Constant), + (words(known_types, suffix=r'\b'), Keyword.Type), + (words((*type_modifiers, *other_keywords), suffix=r'\b'), Keyword), + + (r'@', Keyword, 'attributename'), + (r'(iter)(\s+)', bygroups(Keyword, Whitespace), 'procname'), + (r'(proc)(\s+)', bygroups(Keyword, Whitespace), 'procname'), + (r'(operator)(\s+)', bygroups(Keyword, Whitespace), 'procname'), + (r'(class|interface|module|record|union)(\s+)', bygroups(Keyword, Whitespace), + 'classname'), + + # imaginary integers + (r'\d+i', Number), + (r'\d+\.\d*([Ee][-+]\d+)?i', Number), + (r'\.\d+([Ee][-+]\d+)?i', Number), + (r'\d+[Ee][-+]\d+i', Number), + + # reals cannot end with a period due to lexical ambiguity with + # .. operator. See reference for rationale. + (r'(\d*\.\d+)([eE][+-]?[0-9]+)?i?', Number.Float), + (r'\d+[eE][+-]?[0-9]+i?', Number.Float), + + # integer literals + # -- binary + (r'0[bB][01]+', Number.Bin), + # -- hex + (r'0[xX][0-9a-fA-F]+', Number.Hex), + # -- octal + (r'0[oO][0-7]+', Number.Oct), + # -- decimal + (r'[0-9]+', Number.Integer), + + # strings + (r'"(\\\\|\\"|[^"])*"', String), + (r"'(\\\\|\\'|[^'])*'", String), + + # tokens + (r'(=|\+=|-=|\*=|/=|\*\*=|%=|&=|\|=|\^=|&&=|\|\|=|<<=|>>=|' + r'<=>|<~>|\.\.|by|#|\.\.\.|' + r'&&|\|\||!|&|\||\^|~|<<|>>|' + r'==|!=|<=|>=|<|>|' + r'[+\-*/%]|\*\*)', Operator), + (r'[:;,.?()\[\]{}]', Punctuation), + + # identifiers + (r'[a-zA-Z_][\w$]*', Name.Other), + ], + 'classname': [ + (r'[a-zA-Z_][\w$]*', Name.Class, '#pop'), + ], + 'procname': [ + (r'([a-zA-Z_][.\w$]*|' # regular function name, including secondary + r'\~[a-zA-Z_][.\w$]*|' # support for legacy destructors + r'[+*/!~%<>=&^|\-:]{1,2})', # operators + Name.Function, '#pop'), + + # allow `proc (atomic T).foo` + (r'\(', Punctuation, "receivertype"), + (r'\)+\.', Punctuation), + ], + 'receivertype': [ + (words(type_modifiers, suffix=r'\b'), Keyword), + (words(known_types, suffix=r'\b'), Keyword.Type), + (r'[^()]*', Name.Other, '#pop'), + ], + 'attributename': [ + (r'[a-zA-Z_][.\w$]*', Name.Decorator, '#pop'), + ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/codeql.py b/lib/python3.12/site-packages/pygments/lexers/codeql.py new file mode 100644 index 0000000000000000000000000000000000000000..3d06bec6c803ca8a5c12e7b19344064258323008 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/codeql.py @@ -0,0 +1,80 @@ +""" + pygments.lexers.codeql + ~~~~~~~~~~~~~~~~~~~~~~ + + Lexer for CodeQL query language. + + The grammar is originating from: + https://github.com/github/vscode-codeql/blob/main/syntaxes/README.md + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +__all__ = ['CodeQLLexer'] + +import re + +from pygments.lexer import RegexLexer, words +from pygments.token import Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Whitespace + +class CodeQLLexer(RegexLexer): + name = 'CodeQL' + aliases = ['codeql', 'ql'] + filenames = ['*.ql', '*.qll'] + mimetypes = [] + url = 'https://github.com/github/codeql' + version_added = '2.19' + + flags = re.MULTILINE | re.UNICODE + + tokens = { + 'root': [ + # Whitespace and comments + (r'\s+', Whitespace), + (r'//.*?\n', Comment.Single), + (r'/\*', Comment.Multiline, 'multiline-comments'), + + # Keywords + (words(( + 'module', 'import', 'class', 'extends', 'implements', + 'predicate', 'select', 'where', 'from', 'as', 'and', 'or', 'not', + 'in', 'if', 'then', 'else', 'exists', 'forall', 'instanceof', + 'private', 'predicate', 'abstract', 'cached', 'external', + 'final', 'library', 'override', 'query' + ), suffix=r'\b'), Keyword.Builtin), + + # Special Keywords + (words(('this'), # class related keywords + prefix=r'\b', suffix=r'\b\??:?'), Name.Builtin.Pseudo), + + # Types + (words(( + 'boolean', 'date', 'float', 'int', 'string' + ), suffix=r'\b'), Keyword.Type), + + # Literals + (r'"(\\\\|\\[^\\]|[^"\\])*"', String), + (r'[0-9]+\.[0-9]+', Number.Float), + (r'[0-9]+', Number.Integer), + + # Operators + (r'<=|>=|<|>|=|!=|\+|-|\*|/', Operator), + + # Punctuation + (r'[.,;:\[\]{}()]+', Punctuation), + + # Identifiers + (r'@[a-zA-Z_]\w*', Name.Variable), # Variables with @ prefix + (r'[A-Z][a-zA-Z0-9_]*', Name.Class), # Types and classes + (r'[a-z][a-zA-Z0-9_]*', Name.Variable), # Variables and predicates + ], + 'multiline-comments': [ + (r'[^*/]+', Comment.Multiline), + (r'/\*', Comment.Multiline, '#push'), + (r'\*/', Comment.Multiline, '#pop'), + (r'[*/]', Comment.Multiline), + ], + + } \ No newline at end of file diff --git a/lib/python3.12/site-packages/pygments/lexers/comal.py b/lib/python3.12/site-packages/pygments/lexers/comal.py new file mode 100644 index 0000000000000000000000000000000000000000..3c89a59eaa94e55ea4e2814e966b5bcd3afba585 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/comal.py @@ -0,0 +1,81 @@ +""" + pygments.lexers.comal + ~~~~~~~~~~~~~~~~~~~~~ + + Lexer for COMAL-80. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, words +from pygments.token import Comment, Whitespace, Operator, Keyword, String, \ + Number, Name, Punctuation + +__all__ = ["Comal80Lexer"] + + +class Comal80Lexer(RegexLexer): + """ + For COMAL-80 source code. + """ + + name = 'COMAL-80' + url = 'https://en.wikipedia.org/wiki/COMAL' + aliases = ['comal', 'comal80'] + filenames = ['*.cml', '*.comal'] + version_added = '' + flags = re.IGNORECASE + # + # COMAL allows for some strange characters in names which we list here so + # keywords and word operators will not be recognized at the start of an + # identifier. + # + _suffix = r"\b(?!['\[\]←£\\])" + _identifier = r"[a-z]['\[\]←£\\\w]*" + + tokens = { + 'root': [ + (r'//.*\n', Comment.Single), + (r'\s+', Whitespace), + (r':[=+-]|\<\>|[-+*/^↑<>=]', Operator), + (r'(and +then|or +else)' + _suffix, Operator.Word), + (words([ + 'and', 'bitand', 'bitor', 'bitxor', 'div', 'in', 'mod', 'not', + 'or'], suffix=_suffix,), Operator.Word), + (words([ + 'append', 'at', 'case', 'chain', 'close', 'copy', 'create', 'cursor', + 'data', 'delete', 'dir', 'do', 'elif', 'else', 'end', 'endcase', 'endif', + 'endfor', 'endloop', 'endtrap', 'endwhile', 'exec', 'exit', 'file', + 'for', 'goto', 'handler', 'if', 'input', 'let', 'loop', 'mount', 'null', + 'of', 'open', 'otherwise', 'output', 'page', 'pass', 'poke', 'print', + 'random', 'read', 'repeat', 'report', 'return', 'rename', 'restore', + 'select', 'step', 'stop', 'sys', 'then', 'to', 'trap', 'unit', 'unit$', + 'until', 'using', 'when', 'while', 'write', 'zone'], suffix=_suffix), + Keyword.Reserved), + (words([ + 'closed', 'dim', 'endfunc', 'endproc', 'external', 'func', 'import', + 'proc', 'ref', 'use'], suffix=_suffix), Keyword.Declaration), + (words([ + 'abs', 'atn', 'chr$', 'cos', 'eod', 'eof', 'err', 'errfile', 'errtext', + 'esc', 'exp', 'int', 'key$', 'len', 'log', 'ord', 'peek', 'randomize', + 'rnd', 'sgn', 'sin', 'spc$', 'sqr', 'status$', 'str$', 'tab', 'tan', + 'time', 'val'], suffix=_suffix), Name.Builtin), + (words(['false', 'pi', 'true'], suffix=_suffix), Keyword.Constant), + (r'"', String, 'string'), + (_identifier + r":(?=[ \n/])", Name.Label), + (_identifier + r"[$#]?", Name), + (r'%[01]+', Number.Bin), + (r'\$[0-9a-f]+', Number.Hex), + (r'\d*\.\d*(e[-+]?\d+)?', Number.Float), + (r'\d+', Number.Integer), + (r'[(),:;]', Punctuation), + ], + 'string': [ + (r'[^"]+', String), + (r'"[0-9]*"', String.Escape), + (r'"', String, '#pop'), + ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/configs.py b/lib/python3.12/site-packages/pygments/lexers/configs.py new file mode 100644 index 0000000000000000000000000000000000000000..5e7f47b6dda035b95b3db2cf3655733393d092d3 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/configs.py @@ -0,0 +1,1433 @@ +""" + pygments.lexers.configs + ~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for configuration file formats. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import ExtendedRegexLexer, RegexLexer, default, words, \ + bygroups, include, using, line_re +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Whitespace, Literal, Error, Generic +from pygments.lexers.shell import BashLexer +from pygments.lexers.data import JsonLexer + +__all__ = ['IniLexer', 'SystemdLexer', 'DesktopLexer', 'RegeditLexer', 'PropertiesLexer', + 'KconfigLexer', 'Cfengine3Lexer', 'ApacheConfLexer', 'SquidConfLexer', + 'NginxConfLexer', 'LighttpdConfLexer', 'DockerLexer', + 'TerraformLexer', 'TermcapLexer', 'TerminfoLexer', + 'PkgConfigLexer', 'PacmanConfLexer', 'AugeasLexer', 'TOMLLexer', + 'NestedTextLexer', 'SingularityLexer', 'UnixConfigLexer'] + + +class IniLexer(RegexLexer): + """ + Lexer for configuration files in INI style. + """ + + name = 'INI' + aliases = ['ini', 'cfg', 'dosini'] + filenames = [ + '*.ini', '*.cfg', '*.inf', '.editorconfig', + ] + mimetypes = ['text/x-ini', 'text/inf'] + url = 'https://en.wikipedia.org/wiki/INI_file' + version_added = '' + + tokens = { + 'root': [ + (r'\s+', Whitespace), + (r'[;#].*', Comment.Single), + (r'(\[.*?\])([ \t]*)$', bygroups(Keyword, Whitespace)), + (r'''(.*?)([ \t]*)([=:])([ \t]*)(["'])''', + bygroups(Name.Attribute, Whitespace, Operator, Whitespace, String), + "quoted_value"), + (r'(.*?)([ \t]*)([=:])([ \t]*)([^;#\n]*)(\\)(\s+)', + bygroups(Name.Attribute, Whitespace, Operator, Whitespace, String, + Text, Whitespace), + "value"), + (r'(.*?)([ \t]*)([=:])([ \t]*)([^ ;#\n]*(?: +[^ ;#\n]+)*)', + bygroups(Name.Attribute, Whitespace, Operator, Whitespace, String)), + # standalone option, supported by some INI parsers + (r'(.+?)$', Name.Attribute), + ], + 'quoted_value': [ + (r'''([^"'\n]*)(["'])(\s*)''', + bygroups(String, String, Whitespace), "#pop"), + (r'[;#].*', Comment.Single), + (r'$', String, "#pop"), + ], + 'value': [ # line continuation + (r'\s+', Whitespace), + (r'(\s*)(.*)(\\)([ \t]*)', + bygroups(Whitespace, String, Text, Whitespace)), + (r'.*$', String, "#pop"), + ], + } + + def analyse_text(text): + npos = text.find('\n') + if npos < 3: + return False + if text[0] == '[' and text[npos-1] == ']': + return 0.8 + return False + + +class DesktopLexer(RegexLexer): + """ + Lexer for .desktop files. + """ + + name = 'Desktop file' + url = "https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html" + aliases = ['desktop'] + filenames = ['*.desktop'] + mimetypes = ['application/x-desktop'] + version_added = '2.16' + + tokens = { + 'root': [ + (r'^[ \t]*\n', Whitespace), + (r'^(#.*)(\n)', bygroups(Comment.Single, Whitespace)), + (r'(\[[^\]\n]+\])(\n)', bygroups(Keyword, Whitespace)), + (r'([-A-Za-z0-9]+)(\[[^\] \t=]+\])?([ \t]*)(=)([ \t]*)([^\n]*)([ \t\n]*\n)', + bygroups(Name.Attribute, Name.Namespace, Whitespace, Operator, Whitespace, String, Whitespace)), + ], + } + + def analyse_text(text): + if text.startswith("[Desktop Entry]"): + return 1.0 + if re.search(r"^\[Desktop Entry\][ \t]*$", text[:500], re.MULTILINE) is not None: + return 0.9 + return 0.0 + + +class SystemdLexer(RegexLexer): + """ + Lexer for systemd unit files. + """ + + name = 'Systemd' + url = "https://www.freedesktop.org/software/systemd/man/systemd.syntax.html" + aliases = ['systemd'] + filenames = [ + '*.service', '*.socket', '*.device', '*.mount', '*.automount', + '*.swap', '*.target', '*.path', '*.timer', '*.slice', '*.scope', + ] + version_added = '2.16' + + tokens = { + 'root': [ + (r'^[ \t]*\n', Whitespace), + (r'^([;#].*)(\n)', bygroups(Comment.Single, Whitespace)), + (r'(\[[^\]\n]+\])(\n)', bygroups(Keyword, Whitespace)), + (r'([^=]+)([ \t]*)(=)([ \t]*)([^\n]*)(\\)(\n)', + bygroups(Name.Attribute, Whitespace, Operator, Whitespace, String, + Text, Whitespace), + "value"), + (r'([^=]+)([ \t]*)(=)([ \t]*)([^\n]*)(\n)', + bygroups(Name.Attribute, Whitespace, Operator, Whitespace, String, Whitespace)), + ], + 'value': [ + # line continuation + (r'^([;#].*)(\n)', bygroups(Comment.Single, Whitespace)), + (r'([ \t]*)([^\n]*)(\\)(\n)', + bygroups(Whitespace, String, Text, Whitespace)), + (r'([ \t]*)([^\n]*)(\n)', + bygroups(Whitespace, String, Whitespace), "#pop"), + ], + } + + def analyse_text(text): + if text.startswith("[Unit]"): + return 1.0 + if re.search(r"^\[Unit\][ \t]*$", text[:500], re.MULTILINE) is not None: + return 0.9 + return 0.0 + + +class RegeditLexer(RegexLexer): + """ + Lexer for Windows Registry files produced by regedit. + """ + + name = 'reg' + url = 'http://en.wikipedia.org/wiki/Windows_Registry#.REG_files' + aliases = ['registry'] + filenames = ['*.reg'] + mimetypes = ['text/x-windows-registry'] + version_added = '1.6' + + tokens = { + 'root': [ + (r'Windows Registry Editor.*', Text), + (r'\s+', Whitespace), + (r'[;#].*', Comment.Single), + (r'(\[)(-?)(HKEY_[A-Z_]+)(.*?\])$', + bygroups(Keyword, Operator, Name.Builtin, Keyword)), + # String keys, which obey somewhat normal escaping + (r'("(?:\\"|\\\\|[^"])+")([ \t]*)(=)([ \t]*)', + bygroups(Name.Attribute, Whitespace, Operator, Whitespace), + 'value'), + # Bare keys (includes @) + (r'(.*?)([ \t]*)(=)([ \t]*)', + bygroups(Name.Attribute, Whitespace, Operator, Whitespace), + 'value'), + ], + 'value': [ + (r'-', Operator, '#pop'), # delete value + (r'(dword|hex(?:\([0-9a-fA-F]\))?)(:)([0-9a-fA-F,]+)', + bygroups(Name.Variable, Punctuation, Number), '#pop'), + # As far as I know, .reg files do not support line continuation. + (r'.+', String, '#pop'), + default('#pop'), + ] + } + + def analyse_text(text): + return text.startswith('Windows Registry Editor') + + +class PropertiesLexer(RegexLexer): + """ + Lexer for configuration files in Java's properties format. + + Note: trailing whitespace counts as part of the value as per spec + """ + + name = 'Properties' + aliases = ['properties', 'jproperties'] + filenames = ['*.properties'] + mimetypes = ['text/x-java-properties'] + url = 'https://en.wikipedia.org/wiki/.properties' + version_added = '1.4' + + tokens = { + 'root': [ + # comments + (r'[!#].*|/{2}.*', Comment.Single), + # ending a comment or whitespace-only line + (r'\n', Whitespace), + # eat whitespace at the beginning of a line + (r'^[^\S\n]+', Whitespace), + # start lexing a key + default('key'), + ], + 'key': [ + # non-escaped key characters + (r'[^\\:=\s]+', Name.Attribute), + # escapes + include('escapes'), + # separator is the first non-escaped whitespace or colon or '=' on the line; + # if it's whitespace, = and : are gobbled after it + (r'([^\S\n]*)([:=])([^\S\n]*)', + bygroups(Whitespace, Operator, Whitespace), + ('#pop', 'value')), + (r'[^\S\n]+', Whitespace, ('#pop', 'value')), + # maybe we got no value after all + (r'\n', Whitespace, '#pop'), + ], + 'value': [ + # non-escaped value characters + (r'[^\\\n]+', String), + # escapes + include('escapes'), + # end the value on an unescaped newline + (r'\n', Whitespace, '#pop'), + ], + 'escapes': [ + # line continuations; these gobble whitespace at the beginning of the next line + (r'(\\\n)([^\S\n]*)', bygroups(String.Escape, Whitespace)), + # other escapes + (r'\\(.|\n)', String.Escape), + ], + } + + +def _rx_indent(level): + # Kconfig *always* interprets a tab as 8 spaces, so this is the default. + # Edit this if you are in an environment where KconfigLexer gets expanded + # input (tabs expanded to spaces) and the expansion tab width is != 8, + # e.g. in connection with Trac (trac.ini, [mimeviewer], tab_width). + # Value range here is 2 <= {tab_width} <= 8. + tab_width = 8 + # Regex matching a given indentation {level}, assuming that indentation is + # a multiple of {tab_width}. In other cases there might be problems. + if tab_width == 2: + space_repeat = '+' + else: + space_repeat = '{1,%d}' % (tab_width - 1) + if level == 1: + level_repeat = '' + else: + level_repeat = f'{{{level}}}' + return rf'(?:\t| {space_repeat}\t| {{{tab_width}}}){level_repeat}.*\n' + + +class KconfigLexer(RegexLexer): + """ + For Linux-style Kconfig files. + """ + + name = 'Kconfig' + aliases = ['kconfig', 'menuconfig', 'linux-config', 'kernel-config'] + version_added = '1.6' + # Adjust this if new kconfig file names appear in your environment + filenames = ['Kconfig*', '*Config.in*', 'external.in*', + 'standard-modules.in'] + mimetypes = ['text/x-kconfig'] + url = 'https://www.kernel.org/doc/html/latest/kbuild/kconfig-language.html' + + # No re.MULTILINE, indentation-aware help text needs line-by-line handling + flags = 0 + + def call_indent(level): + # If indentation >= {level} is detected, enter state 'indent{level}' + return (_rx_indent(level), String.Doc, f'indent{level}') + + def do_indent(level): + # Print paragraphs of indentation level >= {level} as String.Doc, + # ignoring blank lines. Then return to 'root' state. + return [ + (_rx_indent(level), String.Doc), + (r'\s*\n', Text), + default('#pop:2') + ] + + tokens = { + 'root': [ + (r'\s+', Whitespace), + (r'#.*?\n', Comment.Single), + (words(( + 'mainmenu', 'config', 'menuconfig', 'choice', 'endchoice', + 'comment', 'menu', 'endmenu', 'visible if', 'if', 'endif', + 'source', 'prompt', 'select', 'depends on', 'default', + 'range', 'option'), suffix=r'\b'), + Keyword), + (r'(---help---|help)[\t ]*\n', Keyword, 'help'), + (r'(bool|tristate|string|hex|int|defconfig_list|modules|env)\b', + Name.Builtin), + (r'[!=&|]', Operator), + (r'[()]', Punctuation), + (r'[0-9]+', Number.Integer), + (r"'(''|[^'])*'", String.Single), + (r'"(""|[^"])*"', String.Double), + (r'\S+', Text), + ], + # Help text is indented, multi-line and ends when a lower indentation + # level is detected. + 'help': [ + # Skip blank lines after help token, if any + (r'\s*\n', Text), + # Determine the first help line's indentation level heuristically(!). + # Attention: this is not perfect, but works for 99% of "normal" + # indentation schemes up to a max. indentation level of 7. + call_indent(7), + call_indent(6), + call_indent(5), + call_indent(4), + call_indent(3), + call_indent(2), + call_indent(1), + default('#pop'), # for incomplete help sections without text + ], + # Handle text for indentation levels 7 to 1 + 'indent7': do_indent(7), + 'indent6': do_indent(6), + 'indent5': do_indent(5), + 'indent4': do_indent(4), + 'indent3': do_indent(3), + 'indent2': do_indent(2), + 'indent1': do_indent(1), + } + + +class Cfengine3Lexer(RegexLexer): + """ + Lexer for CFEngine3 policy files. + """ + + name = 'CFEngine3' + url = 'http://cfengine.org' + aliases = ['cfengine3', 'cf3'] + filenames = ['*.cf'] + mimetypes = [] + version_added = '1.5' + + tokens = { + 'root': [ + (r'#.*?\n', Comment), + (r'(body)(\s+)(\S+)(\s+)(control)', + bygroups(Keyword, Whitespace, Keyword, Whitespace, Keyword)), + (r'(body|bundle)(\s+)(\S+)(\s+)(\w+)(\()', + bygroups(Keyword, Whitespace, Keyword, Whitespace, Name.Function, Punctuation), + 'arglist'), + (r'(body|bundle)(\s+)(\S+)(\s+)(\w+)', + bygroups(Keyword, Whitespace, Keyword, Whitespace, Name.Function)), + (r'(")([^"]+)(")(\s+)(string|slist|int|real)(\s*)(=>)(\s*)', + bygroups(Punctuation, Name.Variable, Punctuation, + Whitespace, Keyword.Type, Whitespace, Operator, Whitespace)), + (r'(\S+)(\s*)(=>)(\s*)', + bygroups(Keyword.Reserved, Whitespace, Operator, Text)), + (r'"', String, 'string'), + (r'(\w+)(\()', bygroups(Name.Function, Punctuation)), + (r'([\w.!&|()]+)(::)', bygroups(Name.Class, Punctuation)), + (r'(\w+)(:)', bygroups(Keyword.Declaration, Punctuation)), + (r'@[{(][^)}]+[})]', Name.Variable), + (r'[(){},;]', Punctuation), + (r'=>', Operator), + (r'->', Operator), + (r'\d+\.\d+', Number.Float), + (r'\d+', Number.Integer), + (r'\w+', Name.Function), + (r'\s+', Whitespace), + ], + 'string': [ + (r'\$[{(]', String.Interpol, 'interpol'), + (r'\\.', String.Escape), + (r'"', String, '#pop'), + (r'\n', String), + (r'.', String), + ], + 'interpol': [ + (r'\$[{(]', String.Interpol, '#push'), + (r'[})]', String.Interpol, '#pop'), + (r'[^${()}]+', String.Interpol), + ], + 'arglist': [ + (r'\)', Punctuation, '#pop'), + (r',', Punctuation), + (r'\w+', Name.Variable), + (r'\s+', Whitespace), + ], + } + + +class ApacheConfLexer(RegexLexer): + """ + Lexer for configuration files following the Apache config file + format. + """ + + name = 'ApacheConf' + aliases = ['apacheconf', 'aconf', 'apache'] + filenames = ['.htaccess', 'apache.conf', 'apache2.conf'] + mimetypes = ['text/x-apacheconf'] + url = 'https://httpd.apache.org/docs/current/configuring.html' + version_added = '0.6' + flags = re.MULTILINE | re.IGNORECASE + + tokens = { + 'root': [ + (r'\s+', Whitespace), + (r'#(.*\\\n)+.*$|(#.*?)$', Comment), + (r'(<[^\s>/][^\s>]*)(?:(\s+)(.*))?(>)', + bygroups(Name.Tag, Whitespace, String, Name.Tag)), + (r'(]+)(>)', + bygroups(Name.Tag, Name.Tag)), + (r'[a-z]\w*', Name.Builtin, 'value'), + (r'\.+', Text), + ], + 'value': [ + (r'\\\n', Text), + (r'\n+', Whitespace, '#pop'), + (r'\\', Text), + (r'[^\S\n]+', Whitespace), + (r'\d+\.\d+\.\d+\.\d+(?:/\d+)?', Number), + (r'\d+', Number), + (r'/([*a-z0-9][*\w./-]+)', String.Other), + (r'(on|off|none|any|all|double|email|dns|min|minimal|' + r'os|productonly|full|emerg|alert|crit|error|warn|' + r'notice|info|debug|registry|script|inetd|standalone|' + r'user|group)\b', Keyword), + (r'"([^"\\]*(?:\\(.|\n)[^"\\]*)*)"', String.Double), + (r'[^\s"\\]+', Text) + ], + } + + +class SquidConfLexer(RegexLexer): + """ + Lexer for squid configuration files. + """ + + name = 'SquidConf' + url = 'http://www.squid-cache.org/' + aliases = ['squidconf', 'squid.conf', 'squid'] + filenames = ['squid.conf'] + mimetypes = ['text/x-squidconf'] + version_added = '0.9' + flags = re.IGNORECASE + + keywords = ( + "access_log", "acl", "always_direct", "announce_host", + "announce_period", "announce_port", "announce_to", "anonymize_headers", + "append_domain", "as_whois_server", "auth_param_basic", + "authenticate_children", "authenticate_program", "authenticate_ttl", + "broken_posts", "buffered_logs", "cache_access_log", "cache_announce", + "cache_dir", "cache_dns_program", "cache_effective_group", + "cache_effective_user", "cache_host", "cache_host_acl", + "cache_host_domain", "cache_log", "cache_mem", "cache_mem_high", + "cache_mem_low", "cache_mgr", "cachemgr_passwd", "cache_peer", + "cache_peer_access", "cache_replacement_policy", "cache_stoplist", + "cache_stoplist_pattern", "cache_store_log", "cache_swap", + "cache_swap_high", "cache_swap_log", "cache_swap_low", "client_db", + "client_lifetime", "client_netmask", "connect_timeout", "coredump_dir", + "dead_peer_timeout", "debug_options", "delay_access", "delay_class", + "delay_initial_bucket_level", "delay_parameters", "delay_pools", + "deny_info", "dns_children", "dns_defnames", "dns_nameservers", + "dns_testnames", "emulate_httpd_log", "err_html_text", + "fake_user_agent", "firewall_ip", "forwarded_for", "forward_snmpd_port", + "fqdncache_size", "ftpget_options", "ftpget_program", "ftp_list_width", + "ftp_passive", "ftp_user", "half_closed_clients", "header_access", + "header_replace", "hierarchy_stoplist", "high_response_time_warning", + "high_page_fault_warning", "hosts_file", "htcp_port", "http_access", + "http_anonymizer", "httpd_accel", "httpd_accel_host", + "httpd_accel_port", "httpd_accel_uses_host_header", + "httpd_accel_with_proxy", "http_port", "http_reply_access", + "icp_access", "icp_hit_stale", "icp_port", "icp_query_timeout", + "ident_lookup", "ident_lookup_access", "ident_timeout", + "incoming_http_average", "incoming_icp_average", "inside_firewall", + "ipcache_high", "ipcache_low", "ipcache_size", "local_domain", + "local_ip", "logfile_rotate", "log_fqdn", "log_icp_queries", + "log_mime_hdrs", "maximum_object_size", "maximum_single_addr_tries", + "mcast_groups", "mcast_icp_query_timeout", "mcast_miss_addr", + "mcast_miss_encode_key", "mcast_miss_port", "memory_pools", + "memory_pools_limit", "memory_replacement_policy", "mime_table", + "min_http_poll_cnt", "min_icp_poll_cnt", "minimum_direct_hops", + "minimum_object_size", "minimum_retry_timeout", "miss_access", + "negative_dns_ttl", "negative_ttl", "neighbor_timeout", + "neighbor_type_domain", "netdb_high", "netdb_low", "netdb_ping_period", + "netdb_ping_rate", "never_direct", "no_cache", "passthrough_proxy", + "pconn_timeout", "pid_filename", "pinger_program", "positive_dns_ttl", + "prefer_direct", "proxy_auth", "proxy_auth_realm", "query_icmp", + "quick_abort", "quick_abort_max", "quick_abort_min", + "quick_abort_pct", "range_offset_limit", "read_timeout", + "redirect_children", "redirect_program", + "redirect_rewrites_host_header", "reference_age", + "refresh_pattern", "reload_into_ims", "request_body_max_size", + "request_size", "request_timeout", "shutdown_lifetime", + "single_parent_bypass", "siteselect_timeout", "snmp_access", + "snmp_incoming_address", "snmp_port", "source_ping", "ssl_proxy", + "store_avg_object_size", "store_objects_per_bucket", + "strip_query_terms", "swap_level1_dirs", "swap_level2_dirs", + "tcp_incoming_address", "tcp_outgoing_address", "tcp_recv_bufsize", + "test_reachability", "udp_hit_obj", "udp_hit_obj_size", + "udp_incoming_address", "udp_outgoing_address", "unique_hostname", + "unlinkd_program", "uri_whitespace", "useragent_log", + "visible_hostname", "wais_relay", "wais_relay_host", "wais_relay_port", + ) + + opts = ( + "proxy-only", "weight", "ttl", "no-query", "default", "round-robin", + "multicast-responder", "on", "off", "all", "deny", "allow", "via", + "parent", "no-digest", "heap", "lru", "realm", "children", "q1", "q2", + "credentialsttl", "none", "disable", "offline_toggle", "diskd", + ) + + actions = ( + "shutdown", "info", "parameter", "server_list", "client_list", + r'squid.conf', + ) + + actions_stats = ( + "objects", "vm_objects", "utilization", "ipcache", "fqdncache", "dns", + "redirector", "io", "reply_headers", "filedescriptors", "netdb", + ) + + actions_log = ("status", "enable", "disable", "clear") + + acls = ( + "url_regex", "urlpath_regex", "referer_regex", "port", "proto", + "req_mime_type", "rep_mime_type", "method", "browser", "user", "src", + "dst", "time", "dstdomain", "ident", "snmp_community", + ) + + ipv4_group = r'(\d+|0x[0-9a-f]+)' + ipv4 = rf'({ipv4_group}(\.{ipv4_group}){{3}})' + ipv6_group = r'([0-9a-f]{0,4})' + ipv6 = rf'({ipv6_group}(:{ipv6_group}){{1,7}})' + bare_ip = rf'({ipv4}|{ipv6})' + # XXX: /integer is a subnet mark, but what is /IP ? + # There is no test where it is used. + ip = rf'{bare_ip}(/({bare_ip}|\d+))?' + + tokens = { + 'root': [ + (r'\s+', Whitespace), + (r'#', Comment, 'comment'), + (words(keywords, prefix=r'\b', suffix=r'\b'), Keyword), + (words(opts, prefix=r'\b', suffix=r'\b'), Name.Constant), + # Actions + (words(actions, prefix=r'\b', suffix=r'\b'), String), + (words(actions_stats, prefix=r'stats/', suffix=r'\b'), String), + (words(actions_log, prefix=r'log/', suffix=r'='), String), + (words(acls, prefix=r'\b', suffix=r'\b'), Keyword), + (ip, Number.Float), + (r'(?:\b\d+\b(?:-\b\d+|%)?)', Number), + (r'\S+', Text), + ], + 'comment': [ + (r'\s*TAG:.*', String.Escape, '#pop'), + (r'.+', Comment, '#pop'), + default('#pop'), + ], + } + + +class NginxConfLexer(RegexLexer): + """ + Lexer for Nginx configuration files. + """ + name = 'Nginx configuration file' + url = 'http://nginx.net/' + aliases = ['nginx'] + filenames = ['nginx.conf'] + mimetypes = ['text/x-nginx-conf'] + version_added = '0.11' + + tokens = { + 'root': [ + (r'(include)(\s+)([^\s;]+)', bygroups(Keyword, Whitespace, Name)), + (r'[^\s;#]+', Keyword, 'stmt'), + include('base'), + ], + 'block': [ + (r'\}', Punctuation, '#pop:2'), + (r'[^\s;#]+', Keyword.Namespace, 'stmt'), + include('base'), + ], + 'stmt': [ + (r'\{', Punctuation, 'block'), + (r';', Punctuation, '#pop'), + include('base'), + ], + 'base': [ + (r'#.*\n', Comment.Single), + (r'on|off', Name.Constant), + (r'\$[^\s;#()]+', Name.Variable), + (r'([a-z0-9.-]+)(:)([0-9]+)', + bygroups(Name, Punctuation, Number.Integer)), + (r'[a-z-]+/[a-z-+]+', String), # mimetype + # (r'[a-zA-Z._-]+', Keyword), + (r'[0-9]+[km]?\b', Number.Integer), + (r'(~)(\s*)([^\s{]+)', bygroups(Punctuation, Whitespace, String.Regex)), + (r'[:=~]', Punctuation), + (r'[^\s;#{}$]+', String), # catch all + (r'/[^\s;#]*', Name), # pathname + (r'\s+', Whitespace), + (r'[$;]', Text), # leftover characters + ], + } + + +class LighttpdConfLexer(RegexLexer): + """ + Lexer for Lighttpd configuration files. + """ + name = 'Lighttpd configuration file' + url = 'http://lighttpd.net/' + aliases = ['lighttpd', 'lighty'] + filenames = ['lighttpd.conf'] + mimetypes = ['text/x-lighttpd-conf'] + version_added = '0.11' + + tokens = { + 'root': [ + (r'#.*\n', Comment.Single), + (r'/\S*', Name), # pathname + (r'[a-zA-Z._-]+', Keyword), + (r'\d+\.\d+\.\d+\.\d+(?:/\d+)?', Number), + (r'[0-9]+', Number), + (r'=>|=~|\+=|==|=|\+', Operator), + (r'\$[A-Z]+', Name.Builtin), + (r'[(){}\[\],]', Punctuation), + (r'"([^"\\]*(?:\\.[^"\\]*)*)"', String.Double), + (r'\s+', Whitespace), + ], + + } + + +class DockerLexer(RegexLexer): + """ + Lexer for Docker configuration files. + """ + name = 'Docker' + url = 'http://docker.io' + aliases = ['docker', 'dockerfile'] + filenames = ['Dockerfile', '*.docker'] + mimetypes = ['text/x-dockerfile-config'] + version_added = '2.0' + + _keywords = (r'(?:MAINTAINER|EXPOSE|WORKDIR|USER|STOPSIGNAL)') + _bash_keywords = (r'(?:RUN|CMD|ENTRYPOINT|ENV|ARG|LABEL|ADD|COPY)') + _lb = r'(?:\s*\\?\s*)' # dockerfile line break regex + flags = re.IGNORECASE | re.MULTILINE + + tokens = { + 'root': [ + (r'#.*', Comment), + (r'(FROM)([ \t]*)(\S*)([ \t]*)(?:(AS)([ \t]*)(\S*))?', + bygroups(Keyword, Whitespace, String, Whitespace, Keyword, Whitespace, String)), + (rf'(ONBUILD)(\s+)({_lb})', bygroups(Keyword, Whitespace, using(BashLexer))), + (rf'(HEALTHCHECK)(\s+)(({_lb}--\w+=\w+{_lb})*)', + bygroups(Keyword, Whitespace, using(BashLexer))), + (rf'(VOLUME|ENTRYPOINT|CMD|SHELL)(\s+)({_lb})(\[.*?\])', + bygroups(Keyword, Whitespace, using(BashLexer), using(JsonLexer))), + (rf'(LABEL|ENV|ARG)(\s+)(({_lb}\w+=\w+{_lb})*)', + bygroups(Keyword, Whitespace, using(BashLexer))), + (rf'({_keywords}|VOLUME)\b(\s+)(.*)', bygroups(Keyword, Whitespace, String)), + (rf'({_bash_keywords})(\s+)', bygroups(Keyword, Whitespace)), + (r'(.*\\\n)*.+', using(BashLexer)), + ] + } + + +class TerraformLexer(ExtendedRegexLexer): + """ + Lexer for terraformi ``.tf`` files. + """ + + name = 'Terraform' + url = 'https://www.terraform.io/' + aliases = ['terraform', 'tf', 'hcl'] + filenames = ['*.tf', '*.hcl'] + mimetypes = ['application/x-tf', 'application/x-terraform'] + version_added = '2.1' + + classes = ('backend', 'data', 'module', 'output', 'provider', + 'provisioner', 'resource', 'variable') + classes_re = "({})".format(('|').join(classes)) + + types = ('string', 'number', 'bool', 'list', 'tuple', 'map', 'set', 'object', 'null') + + numeric_functions = ('abs', 'ceil', 'floor', 'log', 'max', + 'mix', 'parseint', 'pow', 'signum') + + string_functions = ('chomp', 'format', 'formatlist', 'indent', + 'join', 'lower', 'regex', 'regexall', 'replace', + 'split', 'strrev', 'substr', 'title', 'trim', + 'trimprefix', 'trimsuffix', 'trimspace', 'upper' + ) + + collection_functions = ('alltrue', 'anytrue', 'chunklist', 'coalesce', + 'coalescelist', 'compact', 'concat', 'contains', + 'distinct', 'element', 'flatten', 'index', 'keys', + 'length', 'list', 'lookup', 'map', 'matchkeys', + 'merge', 'range', 'reverse', 'setintersection', + 'setproduct', 'setsubtract', 'setunion', 'slice', + 'sort', 'sum', 'transpose', 'values', 'zipmap' + ) + + encoding_functions = ('base64decode', 'base64encode', 'base64gzip', + 'csvdecode', 'jsondecode', 'jsonencode', 'textdecodebase64', + 'textencodebase64', 'urlencode', 'yamldecode', 'yamlencode') + + filesystem_functions = ('abspath', 'dirname', 'pathexpand', 'basename', + 'file', 'fileexists', 'fileset', 'filebase64', 'templatefile') + + date_time_functions = ('formatdate', 'timeadd', 'timestamp') + + hash_crypto_functions = ('base64sha256', 'base64sha512', 'bcrypt', 'filebase64sha256', + 'filebase64sha512', 'filemd5', 'filesha1', 'filesha256', 'filesha512', + 'md5', 'rsadecrypt', 'sha1', 'sha256', 'sha512', 'uuid', 'uuidv5') + + ip_network_functions = ('cidrhost', 'cidrnetmask', 'cidrsubnet', 'cidrsubnets') + + type_conversion_functions = ('can', 'defaults', 'tobool', 'tolist', 'tomap', + 'tonumber', 'toset', 'tostring', 'try') + + builtins = numeric_functions + string_functions + collection_functions + encoding_functions +\ + filesystem_functions + date_time_functions + hash_crypto_functions + ip_network_functions +\ + type_conversion_functions + builtins_re = "({})".format(('|').join(builtins)) + + def heredoc_callback(self, match, ctx): + # Parse a terraform heredoc + # match: 1 = <<[-]?, 2 = name 3 = rest of line + + start = match.start(1) + yield start, Operator, match.group(1) # <<[-]? + yield match.start(2), String.Delimiter, match.group(2) # heredoc name + + ctx.pos = match.start(3) + ctx.end = match.end(3) + yield ctx.pos, String.Heredoc, match.group(3) + ctx.pos = match.end() + + hdname = match.group(2) + tolerant = True # leading whitespace is always accepted + + lines = [] + + for match in line_re.finditer(ctx.text, ctx.pos): + if tolerant: + check = match.group().strip() + else: + check = match.group().rstrip() + if check == hdname: + for amatch in lines: + yield amatch.start(), String.Heredoc, amatch.group() + yield match.start(), String.Delimiter, match.group() + ctx.pos = match.end() + break + else: + lines.append(match) + else: + # end of heredoc not found -- error! + for amatch in lines: + yield amatch.start(), Error, amatch.group() + ctx.end = len(ctx.text) + + tokens = { + 'root': [ + include('basic'), + include('whitespace'), + + # Strings + (r'(".*")', bygroups(String.Double)), + + # Constants + (words(('true', 'false'), prefix=r'\b', suffix=r'\b'), Name.Constant), + + # Types + (words(types, prefix=r'\b', suffix=r'\b'), Keyword.Type), + + include('identifier'), + include('punctuation'), + (r'[0-9]+', Number), + ], + 'basic': [ + (r'\s*/\*', Comment.Multiline, 'comment'), + (r'\s*(#|//).*\n', Comment.Single), + include('whitespace'), + + # e.g. terraform { + # e.g. egress { + (r'(\s*)([0-9a-zA-Z-_]+)(\s*)(=?)(\s*)(\{)', + bygroups(Whitespace, Name.Builtin, Whitespace, Operator, Whitespace, Punctuation)), + + # Assignment with attributes, e.g. something = ... + (r'(\s*)([0-9a-zA-Z-_]+)(\s*)(=)(\s*)', + bygroups(Whitespace, Name.Attribute, Whitespace, Operator, Whitespace)), + + # Assignment with environment variables and similar, e.g. "something" = ... + # or key value assignment, e.g. "SlotName" : ... + (r'(\s*)("\S+")(\s*)([=:])(\s*)', + bygroups(Whitespace, Literal.String.Double, Whitespace, Operator, Whitespace)), + + # Functions, e.g. jsonencode(element("value")) + (builtins_re + r'(\()', bygroups(Name.Function, Punctuation)), + + # List of attributes, e.g. ignore_changes = [last_modified, filename] + (r'(\[)([a-z_,\s]+)(\])', bygroups(Punctuation, Name.Builtin, Punctuation)), + + # e.g. resource "aws_security_group" "allow_tls" { + # e.g. backend "consul" { + (classes_re + r'(\s+)("[0-9a-zA-Z-_]+")?(\s*)("[0-9a-zA-Z-_]+")(\s+)(\{)', + bygroups(Keyword.Reserved, Whitespace, Name.Class, Whitespace, Name.Variable, Whitespace, Punctuation)), + + # here-doc style delimited strings + (r'(<<-?)\s*([a-zA-Z_]\w*)(.*?\n)', heredoc_callback), + ], + 'identifier': [ + (r'\b(var\.[0-9a-zA-Z-_\.\[\]]+)\b', bygroups(Name.Variable)), + (r'\b([0-9a-zA-Z-_\[\]]+\.[0-9a-zA-Z-_\.\[\]]+)\b', + bygroups(Name.Variable)), + ], + 'punctuation': [ + (r'[\[\]()\{\},.?:!=]', Punctuation), + ], + 'comment': [ + (r'[^*/]', Comment.Multiline), + (r'/\*', Comment.Multiline, '#push'), + (r'\*/', Comment.Multiline, '#pop'), + (r'[*/]', Comment.Multiline) + ], + 'whitespace': [ + (r'\n', Whitespace), + (r'\s+', Whitespace), + (r'(\\)(\n)', bygroups(Text, Whitespace)), + ], + } + + +class TermcapLexer(RegexLexer): + """ + Lexer for termcap database source. + + This is very simple and minimal. + """ + name = 'Termcap' + aliases = ['termcap'] + filenames = ['termcap', 'termcap.src'] + mimetypes = [] + url = 'https://en.wikipedia.org/wiki/Termcap' + version_added = '2.1' + + # NOTE: + # * multiline with trailing backslash + # * separator is ':' + # * to embed colon as data, we must use \072 + # * space after separator is not allowed (mayve) + tokens = { + 'root': [ + (r'^#.*', Comment), + (r'^[^\s#:|]+', Name.Tag, 'names'), + (r'\s+', Whitespace), + ], + 'names': [ + (r'\n', Whitespace, '#pop'), + (r':', Punctuation, 'defs'), + (r'\|', Punctuation), + (r'[^:|]+', Name.Attribute), + ], + 'defs': [ + (r'(\\)(\n[ \t]*)', bygroups(Text, Whitespace)), + (r'\n[ \t]*', Whitespace, '#pop:2'), + (r'(#)([0-9]+)', bygroups(Operator, Number)), + (r'=', Operator, 'data'), + (r':', Punctuation), + (r'[^\s:=#]+', Name.Class), + ], + 'data': [ + (r'\\072', Literal), + (r':', Punctuation, '#pop'), + (r'[^:\\]+', Literal), # for performance + (r'.', Literal), + ], + } + + +class TerminfoLexer(RegexLexer): + """ + Lexer for terminfo database source. + + This is very simple and minimal. + """ + name = 'Terminfo' + aliases = ['terminfo'] + filenames = ['terminfo', 'terminfo.src'] + mimetypes = [] + url = 'https://en.wikipedia.org/wiki/Terminfo' + version_added = '2.1' + + # NOTE: + # * multiline with leading whitespace + # * separator is ',' + # * to embed comma as data, we can use \, + # * space after separator is allowed + tokens = { + 'root': [ + (r'^#.*$', Comment), + (r'^[^\s#,|]+', Name.Tag, 'names'), + (r'\s+', Whitespace), + ], + 'names': [ + (r'\n', Whitespace, '#pop'), + (r'(,)([ \t]*)', bygroups(Punctuation, Whitespace), 'defs'), + (r'\|', Punctuation), + (r'[^,|]+', Name.Attribute), + ], + 'defs': [ + (r'\n[ \t]+', Whitespace), + (r'\n', Whitespace, '#pop:2'), + (r'(#)([0-9]+)', bygroups(Operator, Number)), + (r'=', Operator, 'data'), + (r'(,)([ \t]*)', bygroups(Punctuation, Whitespace)), + (r'[^\s,=#]+', Name.Class), + ], + 'data': [ + (r'\\[,\\]', Literal), + (r'(,)([ \t]*)', bygroups(Punctuation, Whitespace), '#pop'), + (r'[^\\,]+', Literal), # for performance + (r'.', Literal), + ], + } + + +class PkgConfigLexer(RegexLexer): + """ + Lexer for pkg-config + (see also `manual page `_). + """ + + name = 'PkgConfig' + url = 'http://www.freedesktop.org/wiki/Software/pkg-config/' + aliases = ['pkgconfig'] + filenames = ['*.pc'] + mimetypes = [] + version_added = '2.1' + + tokens = { + 'root': [ + (r'#.*$', Comment.Single), + + # variable definitions + (r'^(\w+)(=)', bygroups(Name.Attribute, Operator)), + + # keyword lines + (r'^([\w.]+)(:)', + bygroups(Name.Tag, Punctuation), 'spvalue'), + + # variable references + include('interp'), + + # fallback + (r'\s+', Whitespace), + (r'[^${}#=:\n.]+', Text), + (r'.', Text), + ], + 'interp': [ + # you can escape literal "$" as "$$" + (r'\$\$', Text), + + # variable references + (r'\$\{', String.Interpol, 'curly'), + ], + 'curly': [ + (r'\}', String.Interpol, '#pop'), + (r'\w+', Name.Attribute), + ], + 'spvalue': [ + include('interp'), + + (r'#.*$', Comment.Single, '#pop'), + (r'\n', Whitespace, '#pop'), + + # fallback + (r'\s+', Whitespace), + (r'[^${}#\n\s]+', Text), + (r'.', Text), + ], + } + + +class PacmanConfLexer(RegexLexer): + """ + Lexer for pacman.conf. + + Actually, IniLexer works almost fine for this format, + but it yield error token. It is because pacman.conf has + a form without assignment like: + + UseSyslog + Color + TotalDownload + CheckSpace + VerbosePkgLists + + These are flags to switch on. + """ + + name = 'PacmanConf' + url = 'https://www.archlinux.org/pacman/pacman.conf.5.html' + aliases = ['pacmanconf'] + filenames = ['pacman.conf'] + mimetypes = [] + version_added = '2.1' + + tokens = { + 'root': [ + # comment + (r'#.*$', Comment.Single), + + # section header + (r'^(\s*)(\[.*?\])(\s*)$', bygroups(Whitespace, Keyword, Whitespace)), + + # variable definitions + # (Leading space is allowed...) + (r'(\w+)(\s*)(=)', + bygroups(Name.Attribute, Whitespace, Operator)), + + # flags to on + (r'^(\s*)(\w+)(\s*)$', + bygroups(Whitespace, Name.Attribute, Whitespace)), + + # built-in special values + (words(( + '$repo', # repository + '$arch', # architecture + '%o', # outfile + '%u', # url + ), suffix=r'\b'), + Name.Variable), + + # fallback + (r'\s+', Whitespace), + (r'.', Text), + ], + } + + +class AugeasLexer(RegexLexer): + """ + Lexer for Augeas. + """ + name = 'Augeas' + url = 'http://augeas.net' + aliases = ['augeas'] + filenames = ['*.aug'] + version_added = '2.4' + + tokens = { + 'root': [ + (r'(module)(\s*)([^\s=]+)', bygroups(Keyword.Namespace, Whitespace, Name.Namespace)), + (r'(let)(\s*)([^\s=]+)', bygroups(Keyword.Declaration, Whitespace, Name.Variable)), + (r'(del|store|value|counter|seq|key|label|autoload|incl|excl|transform|test|get|put)(\s+)', bygroups(Name.Builtin, Whitespace)), + (r'(\()([^:]+)(\:)(unit|string|regexp|lens|tree|filter)(\))', bygroups(Punctuation, Name.Variable, Punctuation, Keyword.Type, Punctuation)), + (r'\(\*', Comment.Multiline, 'comment'), + (r'[*+\-.;=?|]', Operator), + (r'[()\[\]{}]', Operator), + (r'"', String.Double, 'string'), + (r'\/', String.Regex, 'regex'), + (r'([A-Z]\w*)(\.)(\w+)', bygroups(Name.Namespace, Punctuation, Name.Variable)), + (r'.', Name.Variable), + (r'\s+', Whitespace), + ], + 'string': [ + (r'\\.', String.Escape), + (r'[^"]', String.Double), + (r'"', String.Double, '#pop'), + ], + 'regex': [ + (r'\\.', String.Escape), + (r'[^/]', String.Regex), + (r'\/', String.Regex, '#pop'), + ], + 'comment': [ + (r'[^*)]', Comment.Multiline), + (r'\(\*', Comment.Multiline, '#push'), + (r'\*\)', Comment.Multiline, '#pop'), + (r'[)*]', Comment.Multiline) + ], + } + + +class TOMLLexer(RegexLexer): + """ + Lexer for TOML, a simple language for config files. + """ + + name = 'TOML' + aliases = ['toml'] + filenames = ['*.toml', 'Pipfile', 'poetry.lock'] + mimetypes = ['application/toml'] + url = 'https://toml.io' + version_added = '2.4' + + # Based on the TOML spec: https://toml.io/en/v1.0.0 + + # The following is adapted from CPython's tomllib: + _time = r"\d\d:\d\d:\d\d(\.\d+)?" + _datetime = rf"""(?x) + \d\d\d\d-\d\d-\d\d # date, e.g., 1988-10-27 + ( + [Tt ] {_time} # optional time + ( + [Zz]|[+-]\d\d:\d\d # optional time offset + )? + )? + """ + + tokens = { + 'root': [ + # Note that we make an effort in order to distinguish + # moments at which we're parsing a key and moments at + # which we're parsing a value. In the TOML code + # + # 1234 = 1234 + # + # the first "1234" should be Name, the second Integer. + + # Whitespace + (r'\s+', Whitespace), + + # Comment + (r'#.*', Comment.Single), + + # Assignment keys + include('key'), + + # After "=", find a value + (r'(=)(\s*)', bygroups(Operator, Whitespace), 'value'), + + # Table header + (r'\[\[?', Keyword, 'table-key'), + ], + 'key': [ + # Start of bare key (only ASCII is allowed here). + (r'[A-Za-z0-9_-]+', Name), + # Quoted key + (r'"', String.Double, 'basic-string'), + (r"'", String.Single, 'literal-string'), + # Dots act as separators in keys + (r'\.', Punctuation), + ], + 'table-key': [ + # This is like 'key', but highlights the name components + # and separating dots as Keyword because it looks better + # when the whole table header is Keyword. We do highlight + # strings as strings though. + # Start of bare key (only ASCII is allowed here). + (r'[A-Za-z0-9_-]+', Keyword), + (r'"', String.Double, 'basic-string'), + (r"'", String.Single, 'literal-string'), + (r'\.', Keyword), + (r'\]\]?', Keyword, '#pop'), + + # Inline whitespace allowed + (r'[ \t]+', Whitespace), + ], + 'value': [ + # Datetime, baretime + (_datetime, Literal.Date, '#pop'), + (_time, Literal.Date, '#pop'), + + # Recognize as float if there is a fractional part + # and/or an exponent. + (r'[+-]?\d[0-9_]*[eE][+-]?\d[0-9_]*', Number.Float, '#pop'), + (r'[+-]?\d[0-9_]*\.\d[0-9_]*([eE][+-]?\d[0-9_]*)?', + Number.Float, '#pop'), + + # Infinities and NaN + (r'[+-]?(inf|nan)', Number.Float, '#pop'), + + # Integers + (r'-?0b[01_]+', Number.Bin, '#pop'), + (r'-?0o[0-7_]+', Number.Oct, '#pop'), + (r'-?0x[0-9a-fA-F_]+', Number.Hex, '#pop'), + (r'[+-]?[0-9_]+', Number.Integer, '#pop'), + + # Strings + (r'"""', String.Double, ('#pop', 'multiline-basic-string')), + (r'"', String.Double, ('#pop', 'basic-string')), + (r"'''", String.Single, ('#pop', 'multiline-literal-string')), + (r"'", String.Single, ('#pop', 'literal-string')), + + # Booleans + (r'true|false', Keyword.Constant, '#pop'), + + # Start of array + (r'\[', Punctuation, ('#pop', 'array')), + + # Start of inline table + (r'\{', Punctuation, ('#pop', 'inline-table')), + ], + 'array': [ + # Whitespace, including newlines, is ignored inside arrays, + # and comments are allowed. + (r'\s+', Whitespace), + (r'#.*', Comment.Single), + + # Delimiters + (r',', Punctuation), + + # End of array + (r'\]', Punctuation, '#pop'), + + # Parse a value and come back + default('value'), + ], + 'inline-table': [ + # Note that unlike inline arrays, inline tables do not + # allow newlines or comments. + (r'[ \t]+', Whitespace), + + # Keys + include('key'), + + # Values + (r'(=)(\s*)', bygroups(Punctuation, Whitespace), 'value'), + + # Delimiters + (r',', Punctuation), + + # End of inline table + (r'\}', Punctuation, '#pop'), + ], + 'basic-string': [ + (r'"', String.Double, '#pop'), + include('escapes'), + (r'[^"\\]+', String.Double), + ], + 'literal-string': [ + (r".*?'", String.Single, '#pop'), + ], + 'multiline-basic-string': [ + (r'"""', String.Double, '#pop'), + (r'(\\)(\n)', bygroups(String.Escape, Whitespace)), + include('escapes'), + (r'[^"\\]+', String.Double), + (r'"', String.Double), + ], + 'multiline-literal-string': [ + (r"'''", String.Single, '#pop'), + (r"[^']+", String.Single), + (r"'", String.Single), + ], + 'escapes': [ + (r'\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}', String.Escape), + (r'\\.', String.Escape), + ], + } + +class NestedTextLexer(RegexLexer): + """ + Lexer for *NextedText*, a human-friendly data format. + + .. versionchanged:: 2.16 + Added support for *NextedText* v3.0. + """ + + name = 'NestedText' + url = 'https://nestedtext.org' + aliases = ['nestedtext', 'nt'] + filenames = ['*.nt'] + version_added = '2.9' + + tokens = { + 'root': [ + # Comment: # ... + (r'^([ ]*)(#.*)$', bygroups(Whitespace, Comment)), + + # Inline dictionary: {...} + (r'^([ ]*)(\{)', bygroups(Whitespace, Punctuation), 'inline_dict'), + + # Inline list: [...] + (r'^([ ]*)(\[)', bygroups(Whitespace, Punctuation), 'inline_list'), + + # empty multiline string item: > + (r'^([ ]*)(>)$', bygroups(Whitespace, Punctuation)), + + # multiline string item: > ... + (r'^([ ]*)(>)( )(.*?)([ \t]*)$', bygroups(Whitespace, Punctuation, Whitespace, Text, Whitespace)), + + # empty list item: - + (r'^([ ]*)(-)$', bygroups(Whitespace, Punctuation)), + + # list item: - ... + (r'^([ ]*)(-)( )(.*?)([ \t]*)$', bygroups(Whitespace, Punctuation, Whitespace, Text, Whitespace)), + + # empty multiline key item: : + (r'^([ ]*)(:)$', bygroups(Whitespace, Punctuation)), + + # multiline key item: : ... + (r'^([ ]*)(:)( )([^\n]*?)([ \t]*)$', bygroups(Whitespace, Punctuation, Whitespace, Name.Tag, Whitespace)), + + # empty dict key item: ...: + (r'^([ ]*)([^\{\[\s].*?)(:)$', bygroups(Whitespace, Name.Tag, Punctuation)), + + # dict key item: ...: ... + (r'^([ ]*)([^\{\[\s].*?)(:)( )(.*?)([ \t]*)$', bygroups(Whitespace, Name.Tag, Punctuation, Whitespace, Text, Whitespace)), + ], + 'inline_list': [ + include('whitespace'), + (r'[^\{\}\[\],\s]+', Text), + include('inline_value'), + (r',', Punctuation), + (r'\]', Punctuation, '#pop'), + (r'\n', Error, '#pop'), + ], + 'inline_dict': [ + include('whitespace'), + (r'[^\{\}\[\],:\s]+', Name.Tag), + (r':', Punctuation, 'inline_dict_value'), + (r'\}', Punctuation, '#pop'), + (r'\n', Error, '#pop'), + ], + 'inline_dict_value': [ + include('whitespace'), + (r'[^\{\}\[\],:\s]+', Text), + include('inline_value'), + (r',', Punctuation, '#pop'), + (r'\}', Punctuation, '#pop:2'), + ], + 'inline_value': [ + include('whitespace'), + (r'\{', Punctuation, 'inline_dict'), + (r'\[', Punctuation, 'inline_list'), + ], + 'whitespace': [ + (r'[ \t]+', Whitespace), + ], + } + + +class SingularityLexer(RegexLexer): + """ + Lexer for Singularity definition files. + """ + + name = 'Singularity' + url = 'https://www.sylabs.io/guides/3.0/user-guide/definition_files.html' + aliases = ['singularity'] + filenames = ['*.def', 'Singularity'] + version_added = '2.6' + flags = re.IGNORECASE | re.MULTILINE | re.DOTALL + + _headers = r'^(\s*)(bootstrap|from|osversion|mirrorurl|include|registry|namespace|includecmd)(:)' + _section = r'^(%(?:pre|post|setup|environment|help|labels|test|runscript|files|startscript))(\s*)' + _appsect = r'^(%app(?:install|help|run|labels|env|test|files))(\s*)' + + tokens = { + 'root': [ + (_section, bygroups(Generic.Heading, Whitespace), 'script'), + (_appsect, bygroups(Generic.Heading, Whitespace), 'script'), + (_headers, bygroups(Whitespace, Keyword, Text)), + (r'\s*#.*?\n', Comment), + (r'\b(([0-9]+\.?[0-9]*)|(\.[0-9]+))\b', Number), + (r'[ \t]+', Whitespace), + (r'(?!^\s*%).', Text), + ], + 'script': [ + (r'(.+?(?=^\s*%))|(.*)', using(BashLexer), '#pop'), + ], + } + + def analyse_text(text): + """This is a quite simple script file, but there are a few keywords + which seem unique to this language.""" + result = 0 + if re.search(r'\b(?:osversion|includecmd|mirrorurl)\b', text, re.IGNORECASE): + result += 0.5 + + if re.search(SingularityLexer._section[1:], text): + result += 0.49 + + return result + + +class UnixConfigLexer(RegexLexer): + """ + Lexer for Unix/Linux config files using colon-separated values, e.g. + + * ``/etc/group`` + * ``/etc/passwd`` + * ``/etc/shadow`` + """ + + name = 'Unix/Linux config files' + aliases = ['unixconfig', 'linuxconfig'] + filenames = [] + url = 'https://en.wikipedia.org/wiki/Configuration_file#Unix_and_Unix-like_operating_systems' + version_added = '2.12' + + tokens = { + 'root': [ + (r'^#.*', Comment), + (r'\n', Whitespace), + (r':', Punctuation), + (r'[0-9]+', Number), + (r'((?!\n)[a-zA-Z0-9\_\-\s\(\),]){2,}', Text), + (r'[^:\n]+', String), + ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/dalvik.py b/lib/python3.12/site-packages/pygments/lexers/dalvik.py new file mode 100644 index 0000000000000000000000000000000000000000..1ac332bfa21b1129d56c869a1266b3263f6a4dd6 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/dalvik.py @@ -0,0 +1,126 @@ +""" + pygments.lexers.dalvik + ~~~~~~~~~~~~~~~~~~~~~~ + + Pygments lexers for Dalvik VM-related languages. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, include, bygroups +from pygments.token import Keyword, Text, Comment, Name, String, Number, \ + Punctuation, Whitespace + +__all__ = ['SmaliLexer'] + + +class SmaliLexer(RegexLexer): + """ + For Smali (Android/Dalvik) assembly + code. + """ + name = 'Smali' + url = 'http://code.google.com/p/smali/' + aliases = ['smali'] + filenames = ['*.smali'] + mimetypes = ['text/smali'] + version_added = '1.6' + + tokens = { + 'root': [ + include('comment'), + include('label'), + include('field'), + include('method'), + include('class'), + include('directive'), + include('access-modifier'), + include('instruction'), + include('literal'), + include('punctuation'), + include('type'), + include('whitespace') + ], + 'directive': [ + (r'^([ \t]*)(\.(?:class|super|implements|field|subannotation|annotation|' + r'enum|method|registers|locals|array-data|packed-switch|' + r'sparse-switch|catchall|catch|line|parameter|local|prologue|' + r'epilogue|source))', bygroups(Whitespace, Keyword)), + (r'^([ \t]*)(\.end)( )(field|subannotation|annotation|method|array-data|' + 'packed-switch|sparse-switch|parameter|local)', + bygroups(Whitespace, Keyword, Whitespace, Keyword)), + (r'^([ \t]*)(\.restart)( )(local)', + bygroups(Whitespace, Keyword, Whitespace, Keyword)), + ], + 'access-modifier': [ + (r'(public|private|protected|static|final|synchronized|bridge|' + r'varargs|native|abstract|strictfp|synthetic|constructor|' + r'declared-synchronized|interface|enum|annotation|volatile|' + r'transient)', Keyword), + ], + 'whitespace': [ + (r'\n', Whitespace), + (r'\s+', Whitespace), + ], + 'instruction': [ + (r'\b[vp]\d+\b', Name.Builtin), # registers + (r'(\b[a-z][A-Za-z0-9/-]+)(\s+)', bygroups(Text, Whitespace)), # instructions + ], + 'literal': [ + (r'".*"', String), + (r'0x[0-9A-Fa-f]+t?', Number.Hex), + (r'[0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), + (r'[0-9]+L?', Number.Integer), + ], + 'field': [ + (r'(\$?\b)([\w$]*)(:)', + bygroups(Punctuation, Name.Variable, Punctuation)), + ], + 'method': [ + (r'<(?:cl)?init>', Name.Function), # constructor + (r'(\$?\b)([\w$]*)(\()', + bygroups(Punctuation, Name.Function, Punctuation)), + ], + 'label': [ + (r':\w+', Name.Label), + ], + 'class': [ + # class names in the form Lcom/namespace/ClassName; + # I only want to color the ClassName part, so the namespace part is + # treated as 'Text' + (r'(L)((?:[\w$]+/)*)([\w$]+)(;)', + bygroups(Keyword.Type, Text, Name.Class, Text)), + ], + 'punctuation': [ + (r'->', Punctuation), + (r'[{},():=.-]', Punctuation), + ], + 'type': [ + (r'[ZBSCIJFDV\[]+', Keyword.Type), + ], + 'comment': [ + (r'#.*?\n', Comment), + ], + } + + def analyse_text(text): + score = 0 + if re.search(r'^\s*\.class\s', text, re.MULTILINE): + score += 0.5 + if re.search(r'\b((check-cast|instance-of|throw-verification-error' + r')\b|(-to|add|[ais]get|[ais]put|and|cmpl|const|div|' + r'if|invoke|move|mul|neg|not|or|rem|return|rsub|shl|' + r'shr|sub|ushr)[-/])|{|}', text, re.MULTILINE): + score += 0.3 + if re.search(r'(\.(catchall|epilogue|restart local|prologue)|' + r'\b(array-data|class-change-error|declared-synchronized|' + r'(field|inline|vtable)@0x[0-9a-fA-F]|generic-error|' + r'illegal-class-access|illegal-field-access|' + r'illegal-method-access|instantiation-error|no-error|' + r'no-such-class|no-such-field|no-such-method|' + r'packed-switch|sparse-switch))\b', text, re.MULTILINE): + score += 0.6 + return score diff --git a/lib/python3.12/site-packages/pygments/lexers/dax.py b/lib/python3.12/site-packages/pygments/lexers/dax.py new file mode 100644 index 0000000000000000000000000000000000000000..9c333947ea3aca688049a96b63b4b76543488579 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/dax.py @@ -0,0 +1,135 @@ +""" + pygments.lexers.dax + ~~~~~~~~~~~~~~~~~~~ + + Lexer for LilyPond. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, words +from pygments.token import Comment, Punctuation, Whitespace,\ + Name, Operator, String, Number, Text + +__all__ = ['DaxLexer'] + + +class DaxLexer(RegexLexer): + """ + Lexer for Power BI DAX + Referenced from: https://github.com/sql-bi/SyntaxHighlighterBrushDax + """ + name = 'Dax' + aliases = ['dax'] + filenames = ['*.dax'] + url = 'https://learn.microsoft.com/en-us/dax/dax-function-reference' + mimetypes = [] + version_added = '2.15' + + tokens = { + 'root': [ + (r'\s+', Whitespace), + (r"--.*\n?", Comment.Single), # Comment: Double dash comment + (r"//.*\n?", Comment.Single), # Comment: Double backslash comment + (r'/\*', Comment.Multiline, 'multiline-comments'), + (words(('abs', 'accrint', 'accrintm', 'acos', 'acosh', 'acot', 'acoth', + 'addcolumns', 'addmissingitems', 'all', 'allcrossfiltered', + 'allexcept', 'allnoblankrow', 'allselected', 'amordegrc', 'amorlinc', + 'and','approximatedistinctcount', 'asin', 'asinh', 'atan', 'atanh', + 'average', 'averagea', 'averagex', 'beta.dist', 'beta.inv', + 'bitand', 'bitlshift', 'bitor', 'bitrshift', 'bitxor', 'blank', + 'calculate', 'calculatetable', 'calendar', 'calendarauto', 'ceiling', + 'chisq.dist', 'chisq.dist.rt', 'chisq.inv', 'chisq.inv.rt', + 'closingbalancemonth', 'closingbalancequarter', 'closingbalanceyear', + 'coalesce', 'columnstatistics', 'combin', 'combina', 'combinevalues', + 'concatenate', 'concatenatex', 'confidence.norm', 'confidence.t', + 'contains', 'containsrow', 'containsstring', 'containsstringexact', + 'convert', 'cos', 'cosh', 'cot', 'coth', 'count', 'counta', 'countax', + 'countblank', 'countrows', 'countx', 'coupdaybs', 'coupdays', + 'coupdaysnc', 'coupncd', 'coupnum', 'couppcd', 'crossfilter', + 'crossjoin', 'cumipmt', 'cumprinc', 'currency', 'currentgroup', + 'customdata', 'datatable', 'date', 'dateadd', 'datediff', + 'datesbetween', 'datesinperiod', 'datesmtd', 'datesqtd', + 'datesytd', 'datevalue', 'day', 'db', 'ddb', 'degrees', 'detailrows', + 'disc', 'distinct', 'distinctcount', 'distinctcountnoblank', + 'divide', 'dollarde', 'dollarfr', 'duration', 'earlier', 'earliest', + 'edate', 'effect', 'endofmonth', 'endofquarter', 'endofyear', + 'eomonth', 'error', 'evaluateandlog', 'even', 'exact', 'except', + 'exp', 'expon.dist', 'fact', 'false', 'filter', 'filters', 'find', + 'firstdate', 'firstnonblank', 'firstnonblankvalue', 'fixed', 'floor', + 'format', 'fv', 'gcd', 'generate', 'generateall', 'generateseries', + 'geomean', 'geomeanx', 'groupby', 'hash', 'hasonefilter', + 'hasonevalue', 'hour', 'if', 'if.eager', 'iferror', 'ignore', 'index', + 'int', 'intersect', 'intrate', 'ipmt', 'isafter', 'isblank', + 'iscrossfiltered', 'isempty', 'iserror', 'iseven', 'isfiltered', + 'isinscope', 'islogical', 'isnontext', 'isnumber', 'iso.ceiling', + 'isodd', 'isonorafter', 'ispmt', 'isselectedmeasure', 'issubtotal', + 'istext', 'keepfilters', 'keywordmatch', 'lastdate', 'lastnonblank', + 'lastnonblankvalue', 'lcm', 'left', 'len', 'linest', 'linestx', 'ln', + 'log', 'log10', 'lookupvalue', 'lower', 'max', 'maxa', 'maxx', + 'mduration', 'median', 'medianx', 'mid', 'min', 'mina', 'minute', + 'minx', 'mod', 'month', 'mround', 'nameof', 'naturalinnerjoin', + 'naturalleftouterjoin', 'networkdays', 'nextday', 'nextmonth', + 'nextquarter', 'nextyear', 'nominal', 'nonvisual', 'norm.dist', + 'norm.inv', 'norm.s.dist', 'norm.s.inv', 'not', 'now', 'nper', 'odd', + 'oddfprice', 'oddfyield', 'oddlprice', 'oddlyield', 'offset', + 'openingbalancemonth', 'openingbalancequarter', 'openingbalanceyear', + 'or', 'orderby', 'parallelperiod', 'partitionby', 'path', + 'pathcontains', 'pathitem', 'pathitemreverse', 'pathlength', + 'pduration', 'percentile.exc', 'percentile.inc', 'percentilex.exc', + 'percentilex.inc', 'permut', 'pi', 'pmt', 'poisson.dist', 'power', + 'ppmt', 'previousday', 'previousmonth', 'previousquarter', + 'previousyear', 'price', 'pricedisc', 'pricemat', 'product', + 'productx', 'pv', 'quarter', 'quotient', 'radians', 'rand', + 'randbetween', 'rank.eq', 'rankx', 'rate', 'received', 'related', + 'relatedtable', 'removefilters', 'replace', 'rept', 'right', + 'rollup', 'rollupaddissubtotal', 'rollupgroup', 'rollupissubtotal', + 'round', 'rounddown', 'roundup', 'row', 'rri', 'sameperiodlastyear', + 'sample', 'sampleaxiswithlocalminmax', 'search', 'second', + 'selectcolumns', 'selectedmeasure', 'selectedmeasureformatstring', + 'selectedmeasurename', 'selectedvalue', 'sign', 'sin', 'sinh', 'sln', + 'sqrt', 'sqrtpi', 'startofmonth', 'startofquarter', 'startofyear', + 'stdev.p', 'stdev.s', 'stdevx.p', 'stdevx.s', 'substitute', + 'substitutewithindex', 'sum', 'summarize', 'summarizecolumns', 'sumx', + 'switch', 'syd', 't.dist', 't.dist.2t', 't.dist.rt', 't.inv', + 't.inv.2t', 'tan', 'tanh', 'tbilleq', 'tbillprice', 'tbillyield', + 'time', 'timevalue', 'tocsv', 'today', 'tojson', 'topn', + 'topnperlevel', 'topnskip', 'totalmtd', 'totalqtd', 'totalytd', + 'treatas', 'trim', 'true', 'trunc', 'unichar', 'unicode', 'union', + 'upper', 'userculture', 'userelationship', 'username', 'userobjectid', + 'userprincipalname', 'utcnow', 'utctoday', 'value', 'values', 'var.p', + 'var.s', 'varx.p', 'varx.s', 'vdb', 'weekday', 'weeknum', 'window', + 'xirr', 'xnpv', 'year', 'yearfrac', 'yield', 'yielddisc', 'yieldmat'), + prefix=r'(?i)', suffix=r'\b'), Name.Function), #Functions + + (words(('at','asc','boolean','both','by','create','currency', + 'datetime','day','define','desc','double', + 'evaluate','false','integer','measure', + 'month','none','order','return','single','start','string', + 'table','true','var','year'), + prefix=r'(?i)', suffix=r'\b'), Name.Builtin), # Keyword + + (r':=|[-+*\/=^]', Operator), + (r'\b(IN|NOT)\b', Operator.Word), + (r'"', String, 'string'), #StringLiteral + (r"'(?:[^']|'')*'(?!')(?:\[[ \w]+\])?|\w+\[[ \w]+\]", + Name.Attribute), # Column reference + (r"\[[ \w]+\]", Name.Attribute), #Measure reference + (r'(?]+', Name.Variable), + (r'[^.,+\-<>\[\]]+', Comment), + ], + 'root': [ + (r'\[', Keyword, 'loop'), + (r'\]', Error), + include('common'), + ], + 'loop': [ + (r'\[', Keyword, '#push'), + (r'\]', Keyword, '#pop'), + include('common'), + ] + } + + def analyse_text(text): + """It's safe to assume that a program which mostly consists of + - + and < > is brainfuck.""" + plus_minus_count = 0 + greater_less_count = 0 + + range_to_check = max(256, len(text)) + + for c in text[:range_to_check]: + if c == '+' or c == '-': + plus_minus_count += 1 + if c == '<' or c == '>': + greater_less_count += 1 + + if plus_minus_count > (0.25 * range_to_check): + return 1.0 + if greater_less_count > (0.25 * range_to_check): + return 1.0 + + result = 0 + if '[-]' in text: + result += 0.5 + + return result + + +class BefungeLexer(RegexLexer): + """ + Lexer for the esoteric Befunge language. + """ + name = 'Befunge' + url = 'http://en.wikipedia.org/wiki/Befunge' + aliases = ['befunge'] + filenames = ['*.befunge'] + mimetypes = ['application/x-befunge'] + version_added = '0.7' + + tokens = { + 'root': [ + (r'[0-9a-f]', Number), + (r'[+*/%!`-]', Operator), # Traditional math + (r'[<>^v?\[\]rxjk]', Name.Variable), # Move, imperatives + (r'[:\\$.,n]', Name.Builtin), # Stack ops, imperatives + (r'[|_mw]', Keyword), + (r'[{}]', Name.Tag), # Befunge-98 stack ops + (r'".*?"', String.Double), # Strings don't appear to allow escapes + (r'\'.', String.Single), # Single character + (r'[#;]', Comment), # Trampoline... depends on direction hit + (r'[pg&~=@iotsy]', Keyword), # Misc + (r'[()A-Z]', Comment), # Fingerprints + (r'\s+', Whitespace), # Whitespace doesn't matter + ], + } + + +class CAmkESLexer(RegexLexer): + """ + Basic lexer for the input language for the CAmkES component platform. + """ + name = 'CAmkES' + url = 'https://sel4.systems/CAmkES/' + aliases = ['camkes', 'idl4'] + filenames = ['*.camkes', '*.idl4'] + version_added = '2.1' + + tokens = { + 'root': [ + # C pre-processor directive + (r'^(\s*)(#.*)(\n)', bygroups(Whitespace, Comment.Preproc, + Whitespace)), + + # Whitespace, comments + (r'\s+', Whitespace), + (r'/\*(.|\n)*?\*/', Comment), + (r'//.*$', Comment), + + (r'[\[(){},.;\]]', Punctuation), + (r'[~!%^&*+=|?:<>/-]', Operator), + + (words(('assembly', 'attribute', 'component', 'composition', + 'configuration', 'connection', 'connector', 'consumes', + 'control', 'dataport', 'Dataport', 'Dataports', 'emits', + 'event', 'Event', 'Events', 'export', 'from', 'group', + 'hardware', 'has', 'interface', 'Interface', 'maybe', + 'procedure', 'Procedure', 'Procedures', 'provides', + 'template', 'thread', 'threads', 'to', 'uses', 'with'), + suffix=r'\b'), Keyword), + + (words(('bool', 'boolean', 'Buf', 'char', 'character', 'double', + 'float', 'in', 'inout', 'int', 'int16_6', 'int32_t', + 'int64_t', 'int8_t', 'integer', 'mutex', 'out', 'real', + 'refin', 'semaphore', 'signed', 'string', 'struct', + 'uint16_t', 'uint32_t', 'uint64_t', 'uint8_t', 'uintptr_t', + 'unsigned', 'void'), + suffix=r'\b'), Keyword.Type), + + # Recognised attributes + (r'[a-zA-Z_]\w*_(priority|domain|buffer)', Keyword.Reserved), + (words(('dma_pool', 'from_access', 'to_access'), suffix=r'\b'), + Keyword.Reserved), + + # CAmkES-level include + (r'(import)(\s+)((?:<[^>]*>|"[^"]*");)', + bygroups(Comment.Preproc, Whitespace, Comment.Preproc)), + + # C-level include + (r'(include)(\s+)((?:<[^>]*>|"[^"]*");)', + bygroups(Comment.Preproc, Whitespace, Comment.Preproc)), + + # Literals + (r'0[xX][\da-fA-F]+', Number.Hex), + (r'-?[\d]+', Number), + (r'-?[\d]+\.[\d]+', Number.Float), + (r'"[^"]*"', String), + (r'[Tt]rue|[Ff]alse', Name.Builtin), + + # Identifiers + (r'[a-zA-Z_]\w*', Name), + ], + } + + +class CapDLLexer(RegexLexer): + """ + Basic lexer for CapDL. + + The source of the primary tool that reads such specifications is available + at https://github.com/seL4/capdl/tree/master/capDL-tool. Note that this + lexer only supports a subset of the grammar. For example, identifiers can + shadow type names, but these instances are currently incorrectly + highlighted as types. Supporting this would need a stateful lexer that is + considered unnecessarily complex for now. + """ + name = 'CapDL' + url = 'https://ssrg.nicta.com.au/publications/nictaabstracts/Kuz_KLW_10.abstract.pml' + aliases = ['capdl'] + filenames = ['*.cdl'] + version_added = '2.2' + + tokens = { + 'root': [ + # C pre-processor directive + (r'^(\s*)(#.*)(\n)', + bygroups(Whitespace, Comment.Preproc, Whitespace)), + + # Whitespace, comments + (r'\s+', Whitespace), + (r'/\*(.|\n)*?\*/', Comment), + (r'(//|--).*$', Comment), + + (r'[<>\[(){},:;=\]]', Punctuation), + (r'\.\.', Punctuation), + + (words(('arch', 'arm11', 'caps', 'child_of', 'ia32', 'irq', 'maps', + 'objects'), suffix=r'\b'), Keyword), + + (words(('aep', 'asid_pool', 'cnode', 'ep', 'frame', 'io_device', + 'io_ports', 'io_pt', 'notification', 'pd', 'pt', 'tcb', + 'ut', 'vcpu'), suffix=r'\b'), Keyword.Type), + + # Properties + (words(('asid', 'addr', 'badge', 'cached', 'dom', 'domainID', 'elf', + 'fault_ep', 'G', 'guard', 'guard_size', 'init', 'ip', + 'prio', 'sp', 'R', 'RG', 'RX', 'RW', 'RWG', 'RWX', 'W', + 'WG', 'WX', 'level', 'masked', 'master_reply', 'paddr', + 'ports', 'reply', 'uncached'), suffix=r'\b'), + Keyword.Reserved), + + # Literals + (r'0[xX][\da-fA-F]+', Number.Hex), + (r'\d+(\.\d+)?(k|M)?', Number), + (words(('bits',), suffix=r'\b'), Number), + (words(('cspace', 'vspace', 'reply_slot', 'caller_slot', + 'ipc_buffer_slot'), suffix=r'\b'), Number), + + # Identifiers + (r'[a-zA-Z_][-@\.\w]*', Name), + ], + } + + +class RedcodeLexer(RegexLexer): + """ + A simple Redcode lexer based on ICWS'94. + Contributed by Adam Blinkinsop . + """ + name = 'Redcode' + aliases = ['redcode'] + filenames = ['*.cw'] + url = 'https://en.wikipedia.org/wiki/Core_War' + version_added = '0.8' + + opcodes = ('DAT', 'MOV', 'ADD', 'SUB', 'MUL', 'DIV', 'MOD', + 'JMP', 'JMZ', 'JMN', 'DJN', 'CMP', 'SLT', 'SPL', + 'ORG', 'EQU', 'END') + modifiers = ('A', 'B', 'AB', 'BA', 'F', 'X', 'I') + + tokens = { + 'root': [ + # Whitespace: + (r'\s+', Whitespace), + (r';.*$', Comment.Single), + # Lexemes: + # Identifiers + (r'\b({})\b'.format('|'.join(opcodes)), Name.Function), + (r'\b({})\b'.format('|'.join(modifiers)), Name.Decorator), + (r'[A-Za-z_]\w+', Name), + # Operators + (r'[-+*/%]', Operator), + (r'[#$@<>]', Operator), # mode + (r'[.,]', Punctuation), # mode + # Numbers + (r'[-+]?\d+', Number.Integer), + ], + } + + +class AheuiLexer(RegexLexer): + """ + Aheui is esoteric language based on Korean alphabets. + """ + + name = 'Aheui' + url = 'http://aheui.github.io/' + aliases = ['aheui'] + filenames = ['*.aheui'] + version_added = '' + + tokens = { + 'root': [ + ('[' + '나-낳냐-냫너-넣녀-녛노-놓뇨-눟뉴-닇' + '다-닿댜-댷더-덯뎌-뎧도-돟됴-둫듀-딓' + '따-땋땨-떃떠-떻뗘-뗳또-똫뚀-뚷뜌-띟' + '라-랗랴-럏러-렇려-렿로-롷료-뤃류-릫' + '마-맣먀-먛머-멓며-몋모-뫃묘-뭏뮤-믷' + '바-밯뱌-뱧버-벟벼-볗보-봏뵤-붛뷰-빃' + '빠-빻뺘-뺳뻐-뻫뼈-뼣뽀-뽛뾰-뿧쀼-삏' + '사-샇샤-샿서-섷셔-셯소-솧쇼-숳슈-싛' + '싸-쌓쌰-썋써-쎃쎠-쎻쏘-쏳쑈-쑿쓔-씧' + '자-잫쟈-쟣저-젛져-졓조-좋죠-줗쥬-즿' + '차-챃챠-챻처-첳쳐-쳫초-촣쵸-춯츄-칗' + '카-캏캬-컇커-컿켜-켷코-콯쿄-쿻큐-킣' + '타-탛탸-턓터-텋텨-톃토-톻툐-퉇튜-틯' + '파-팧퍄-퍟퍼-펗펴-폏포-퐇표-풓퓨-픻' + '하-핳햐-햫허-헣혀-혛호-홓효-훟휴-힇' + ']', Operator), + ('.', Comment), + ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/ezhil.py b/lib/python3.12/site-packages/pygments/lexers/ezhil.py new file mode 100644 index 0000000000000000000000000000000000000000..aeb71ab0ce793656d0e56d72d72af50b0265d4f5 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/ezhil.py @@ -0,0 +1,76 @@ +""" + pygments.lexers.ezhil + ~~~~~~~~~~~~~~~~~~~~~ + + Pygments lexers for Ezhil language. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, include, words +from pygments.token import Keyword, Comment, Name, String, Number, \ + Punctuation, Operator, Whitespace + +__all__ = ['EzhilLexer'] + + +class EzhilLexer(RegexLexer): + """ + Lexer for Ezhil, a Tamil script-based programming language. + """ + name = 'Ezhil' + url = 'http://ezhillang.org' + aliases = ['ezhil'] + filenames = ['*.n'] + mimetypes = ['text/x-ezhil'] + version_added = '2.1' + # Refer to tamil.utf8.tamil_letters from open-tamil for a stricter version of this. + # This much simpler version is close enough, and includes combining marks. + _TALETTERS = '[a-zA-Z_]|[\u0b80-\u0bff]' + tokens = { + 'root': [ + include('keywords'), + (r'#.*$', Comment.Single), + (r'[@+/*,^\-%]|[!<>=]=?|&&?|\|\|?', Operator), + ('இல்', Operator.Word), + (words(('assert', 'max', 'min', + 'நீளம்', 'சரம்_இடமாற்று', 'சரம்_கண்டுபிடி', + 'பட்டியல்', 'பின்இணை', 'வரிசைப்படுத்து', + 'எடு', 'தலைகீழ்', 'நீட்டிக்க', 'நுழைக்க', 'வை', + 'கோப்பை_திற', 'கோப்பை_எழுது', 'கோப்பை_மூடு', + 'pi', 'sin', 'cos', 'tan', 'sqrt', 'hypot', 'pow', + 'exp', 'log', 'log10', 'exit', + ), suffix=r'\b'), Name.Builtin), + (r'(True|False)\b', Keyword.Constant), + (r'[^\S\n]+', Whitespace), + include('identifier'), + include('literal'), + (r'[(){}\[\]:;.]', Punctuation), + ], + 'keywords': [ + ('பதிப்பி|தேர்ந்தெடு|தேர்வு|ஏதேனில்|ஆனால்|இல்லைஆனால்|இல்லை|ஆக|ஒவ்வொன்றாக|இல்|வரை|செய்|முடியேனில்|பின்கொடு|முடி|நிரல்பாகம்|தொடர்|நிறுத்து|நிரல்பாகம்', Keyword), + ], + 'identifier': [ + ('(?:'+_TALETTERS+')(?:[0-9]|'+_TALETTERS+')*', Name), + ], + 'literal': [ + (r'".*?"', String), + (r'\d+((\.\d*)?[eE][+-]?\d+|\.\d*)', Number.Float), + (r'\d+', Number.Integer), + ] + } + + def analyse_text(text): + """This language uses Tamil-script. We'll assume that if there's a + decent amount of Tamil-characters, it's this language. This assumption + is obviously horribly off if someone uses string literals in tamil + in another language.""" + if len(re.findall(r'[\u0b80-\u0bff]', text)) > 10: + return 0.25 + + def __init__(self, **options): + super().__init__(**options) + self.encoding = options.get('encoding', 'utf-8') diff --git a/lib/python3.12/site-packages/pygments/lexers/fantom.py b/lib/python3.12/site-packages/pygments/lexers/fantom.py new file mode 100644 index 0000000000000000000000000000000000000000..7228554ba9b42b0d8667e8eefe16b622253082d0 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/fantom.py @@ -0,0 +1,251 @@ +""" + pygments.lexers.fantom + ~~~~~~~~~~~~~~~~~~~~~~ + + Lexer for the Fantom language. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from string import Template + +from pygments.lexer import RegexLexer, include, bygroups, using, \ + this, default, words +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Literal, Whitespace + +__all__ = ['FantomLexer'] + + +class FantomLexer(RegexLexer): + """ + For Fantom source code. + """ + name = 'Fantom' + aliases = ['fan'] + filenames = ['*.fan'] + mimetypes = ['application/x-fantom'] + url = 'https://www.fantom.org' + version_added = '1.5' + + # often used regexes + def s(str): + return Template(str).substitute( + dict( + pod=r'[\"\w\.]+', + eos=r'\n|;', + id=r'[a-zA-Z_]\w*', + # all chars which can be part of type definition. Starts with + # either letter, or [ (maps), or | (funcs) + type=r'(?:\[|[a-zA-Z_]|\|)[:\w\[\]|\->?]*?', + ) + ) + + tokens = { + 'comments': [ + (r'(?s)/\*.*?\*/', Comment.Multiline), # Multiline + (r'//.*?$', Comment.Single), # Single line + # TODO: highlight references in fandocs + (r'\*\*.*?$', Comment.Special), # Fandoc + (r'#.*$', Comment.Single) # Shell-style + ], + 'literals': [ + (r'\b-?[\d_]+(ns|ms|sec|min|hr|day)', Number), # Duration + (r'\b-?[\d_]*\.[\d_]+(ns|ms|sec|min|hr|day)', Number), # Duration with dot + (r'\b-?(\d+)?\.\d+(f|F|d|D)?', Number.Float), # Float/Decimal + (r'\b-?0x[0-9a-fA-F_]+', Number.Hex), # Hex + (r'\b-?[\d_]+', Number.Integer), # Int + (r"'\\.'|'[^\\]'|'\\u[0-9a-f]{4}'", String.Char), # Char + (r'"', Punctuation, 'insideStr'), # Opening quote + (r'`', Punctuation, 'insideUri'), # Opening accent + (r'\b(true|false|null)\b', Keyword.Constant), # Bool & null + (r'(?:(\w+)(::))?(\w+)(<\|)(.*?)(\|>)', # DSL + bygroups(Name.Namespace, Punctuation, Name.Class, + Punctuation, String, Punctuation)), + (r'(?:(\w+)(::))?(\w+)?(#)(\w+)?', # Type/slot literal + bygroups(Name.Namespace, Punctuation, Name.Class, + Punctuation, Name.Function)), + (r'\[,\]', Literal), # Empty list + (s(r'($type)(\[,\])'), # Typed empty list + bygroups(using(this, state='inType'), Literal)), + (r'\[:\]', Literal), # Empty Map + (s(r'($type)(\[:\])'), + bygroups(using(this, state='inType'), Literal)), + ], + 'insideStr': [ + (r'\\\\', String.Escape), # Escaped backslash + (r'\\"', String.Escape), # Escaped " + (r'\\`', String.Escape), # Escaped ` + (r'\$\w+', String.Interpol), # Subst var + (r'\$\{.*?\}', String.Interpol), # Subst expr + (r'"', Punctuation, '#pop'), # Closing quot + (r'.', String) # String content + ], + 'insideUri': [ # TODO: remove copy/paste str/uri + (r'\\\\', String.Escape), # Escaped backslash + (r'\\"', String.Escape), # Escaped " + (r'\\`', String.Escape), # Escaped ` + (r'\$\w+', String.Interpol), # Subst var + (r'\$\{.*?\}', String.Interpol), # Subst expr + (r'`', Punctuation, '#pop'), # Closing tick + (r'.', String.Backtick) # URI content + ], + 'protectionKeywords': [ + (r'\b(public|protected|private|internal)\b', Keyword), + ], + 'typeKeywords': [ + (r'\b(abstract|final|const|native|facet|enum)\b', Keyword), + ], + 'methodKeywords': [ + (r'\b(abstract|native|once|override|static|virtual|final)\b', + Keyword), + ], + 'fieldKeywords': [ + (r'\b(abstract|const|final|native|override|static|virtual|' + r'readonly)\b', Keyword) + ], + 'otherKeywords': [ + (words(( + 'try', 'catch', 'throw', 'finally', 'for', 'if', 'else', 'while', + 'as', 'is', 'isnot', 'switch', 'case', 'default', 'continue', + 'break', 'do', 'return', 'get', 'set'), prefix=r'\b', suffix=r'\b'), + Keyword), + (r'\b(it|this|super)\b', Name.Builtin.Pseudo), + ], + 'operators': [ + (r'\+\+|\-\-|\+|\-|\*|/|\|\||&&|<=>|<=|<|>=|>|=|!|\[|\]', Operator) + ], + 'inType': [ + (r'[\[\]|\->:?]', Punctuation), + (s(r'$id'), Name.Class), + default('#pop'), + + ], + 'root': [ + include('comments'), + include('protectionKeywords'), + include('typeKeywords'), + include('methodKeywords'), + include('fieldKeywords'), + include('literals'), + include('otherKeywords'), + include('operators'), + (r'using\b', Keyword.Namespace, 'using'), # Using stmt + (r'@\w+', Name.Decorator, 'facet'), # Symbol + (r'(class|mixin)(\s+)(\w+)', bygroups(Keyword, Whitespace, Name.Class), + 'inheritance'), # Inheritance list + + # Type var := val + (s(r'($type)([ \t]+)($id)(\s*)(:=)'), + bygroups(using(this, state='inType'), Whitespace, + Name.Variable, Whitespace, Operator)), + + # var := val + (s(r'($id)(\s*)(:=)'), + bygroups(Name.Variable, Whitespace, Operator)), + + # .someId( or ->someId( ### + (s(r'(\.|(?:\->))($id)(\s*)(\()'), + bygroups(Operator, Name.Function, Whitespace, Punctuation), + 'insideParen'), + + # .someId or ->someId + (s(r'(\.|(?:\->))($id)'), + bygroups(Operator, Name.Function)), + + # new makeXXX ( + (r'(new)(\s+)(make\w*)(\s*)(\()', + bygroups(Keyword, Whitespace, Name.Function, Whitespace, Punctuation), + 'insideMethodDeclArgs'), + + # Type name ( + (s(r'($type)([ \t]+)' # Return type and whitespace + r'($id)(\s*)(\()'), # method name + open brace + bygroups(using(this, state='inType'), Whitespace, + Name.Function, Whitespace, Punctuation), + 'insideMethodDeclArgs'), + + # ArgType argName, + (s(r'($type)(\s+)($id)(\s*)(,)'), + bygroups(using(this, state='inType'), Whitespace, Name.Variable, + Whitespace, Punctuation)), + + # ArgType argName) + # Covered in 'insideParen' state + + # ArgType argName -> ArgType| + (s(r'($type)(\s+)($id)(\s*)(\->)(\s*)($type)(\|)'), + bygroups(using(this, state='inType'), Whitespace, Name.Variable, + Whitespace, Punctuation, Whitespace, using(this, state='inType'), + Punctuation)), + + # ArgType argName| + (s(r'($type)(\s+)($id)(\s*)(\|)'), + bygroups(using(this, state='inType'), Whitespace, Name.Variable, + Whitespace, Punctuation)), + + # Type var + (s(r'($type)([ \t]+)($id)'), + bygroups(using(this, state='inType'), Whitespace, + Name.Variable)), + + (r'\(', Punctuation, 'insideParen'), + (r'\{', Punctuation, 'insideBrace'), + (r'\s+', Whitespace), + (r'.', Text) + ], + 'insideParen': [ + (r'\)', Punctuation, '#pop'), + include('root'), + ], + 'insideMethodDeclArgs': [ + (r'\)', Punctuation, '#pop'), + (s(r'($type)(\s+)($id)(\s*)(\))'), + bygroups(using(this, state='inType'), Whitespace, Name.Variable, + Whitespace, Punctuation), '#pop'), + include('root'), + ], + 'insideBrace': [ + (r'\}', Punctuation, '#pop'), + include('root'), + ], + 'inheritance': [ + (r'\s+', Whitespace), # Whitespace + (r':|,', Punctuation), + (r'(?:(\w+)(::))?(\w+)', + bygroups(Name.Namespace, Punctuation, Name.Class)), + (r'\{', Punctuation, '#pop') + ], + 'using': [ + (r'[ \t]+', Whitespace), # consume whitespaces + (r'(\[)(\w+)(\])', + bygroups(Punctuation, Comment.Special, Punctuation)), # ffi + (r'(\")?([\w.]+)(\")?', + bygroups(Punctuation, Name.Namespace, Punctuation)), # podname + (r'::', Punctuation, 'usingClass'), + default('#pop') + ], + 'usingClass': [ + (r'[ \t]+', Whitespace), # consume whitespaces + (r'(as)(\s+)(\w+)', + bygroups(Keyword.Declaration, Whitespace, Name.Class), '#pop:2'), + (r'[\w$]+', Name.Class), + default('#pop:2') # jump out to root state + ], + 'facet': [ + (r'\s+', Whitespace), + (r'\{', Punctuation, 'facetFields'), + default('#pop') + ], + 'facetFields': [ + include('comments'), + include('literals'), + include('operators'), + (r'\s+', Whitespace), + (r'(\s*)(\w+)(\s*)(=)', bygroups(Whitespace, Name, Whitespace, Operator)), + (r'\}', Punctuation, '#pop'), + (r'\s+', Whitespace), + (r'.', Text) + ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/fift.py b/lib/python3.12/site-packages/pygments/lexers/fift.py new file mode 100644 index 0000000000000000000000000000000000000000..1263236c9c83b557f486b4bd4cef9ec3f894df58 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/fift.py @@ -0,0 +1,68 @@ +""" + pygments.lexers.fift + ~~~~~~~~~~~~~~~~~~~~ + + Lexers for fift. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, include +from pygments.token import Literal, Comment, Name, String, Number, Whitespace + +__all__ = ['FiftLexer'] + + +class FiftLexer(RegexLexer): + """ + For Fift source code. + """ + + name = 'Fift' + aliases = ['fift', 'fif'] + filenames = ['*.fif'] + url = 'https://ton-blockchain.github.io/docs/fiftbase.pdf' + version_added = '' + + tokens = { + 'root': [ + (r'\s+', Whitespace), + + include('comments'), + + (r'[\.+]?\"', String, 'string'), + + # numbers + (r'0x[0-9a-fA-F]+', Number.Hex), + (r'0b[01]+', Number.Bin), + (r'-?[0-9]+("/"-?[0-9]+)?', Number.Decimal), + + # slices + (r'b\{[01]+\}', Literal), + (r'x\{[0-9a-fA-F_]+\}', Literal), + + # byte literal + (r'B\{[0-9a-fA-F_]+\}', Literal), + + # treat anything as word + (r'\S+', Name) + ], + + 'string': [ + (r'\\.', String.Escape), + (r'\"', String, '#pop'), + (r'[^\"\r\n\\]+', String) + ], + + 'comments': [ + (r'//.*', Comment.Singleline), + (r'/\*', Comment.Multiline, 'comment'), + ], + 'comment': [ + (r'[^/*]+', Comment.Multiline), + (r'/\*', Comment.Multiline, '#push'), + (r'\*/', Comment.Multiline, '#pop'), + (r'[*/]', Comment.Multiline), + ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/freefem.py b/lib/python3.12/site-packages/pygments/lexers/freefem.py new file mode 100644 index 0000000000000000000000000000000000000000..87b066b1a0dadf89194162427c61706187a33248 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/freefem.py @@ -0,0 +1,893 @@ +""" + pygments.lexers.freefem + ~~~~~~~~~~~~~~~~~~~~~~~ + + Lexer for FreeFem++ language. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.token import Comment, Operator, Keyword, Name + +from pygments.lexers.c_cpp import CppLexer + +__all__ = ['FreeFemLexer'] + + +class FreeFemLexer(CppLexer): + """ + For FreeFem++ source. + + This is an extension of the CppLexer, as the FreeFem Language is a superset + of C++. + """ + + name = 'Freefem' + url = 'https://freefem.org/' + aliases = ['freefem'] + filenames = ['*.edp'] + mimetypes = ['text/x-freefem'] + version_added = '2.4' + + # Language operators + operators = {'+', '-', '*', '.*', '/', './', '%', '^', '^-1', ':', '\''} + + # types + types = {'bool', 'border', 'complex', 'dmatrix', 'fespace', 'func', 'gslspline', + 'ifstream', 'int', 'macro', 'matrix', 'mesh', 'mesh3', 'mpiComm', + 'mpiGroup', 'mpiRequest', 'NewMacro', 'EndMacro', 'ofstream', 'Pmmap', + 'problem', 'Psemaphore', 'real', 'solve', 'string', 'varf'} + + # finite element spaces + fespaces = {'BDM1', 'BDM1Ortho', 'Edge03d', 'Edge13d', 'Edge23d', 'FEQF', 'HCT', + 'P0', 'P03d', 'P0Edge', 'P1', 'P13d', 'P1b', 'P1b3d', 'P1bl', 'P1bl3d', + 'P1dc', 'P1Edge', 'P1nc', 'P2', 'P23d', 'P2b', 'P2BR', 'P2dc', 'P2Edge', + 'P2h', 'P2Morley', 'P2pnc', 'P3', 'P3dc', 'P3Edge', 'P4', 'P4dc', + 'P4Edge', 'P5Edge', 'RT0', 'RT03d', 'RT0Ortho', 'RT1', 'RT1Ortho', + 'RT2', 'RT2Ortho'} + + # preprocessor + preprocessor = {'ENDIFMACRO', 'include', 'IFMACRO', 'load'} + + # Language keywords + keywords = { + 'adj', + 'append', + 'area', + 'ARGV', + 'be', + 'binary', + 'BoundaryEdge', + 'bordermeasure', + 'CG', + 'Cholesky', + 'cin', + 'cout', + 'Crout', + 'default', + 'diag', + 'edgeOrientation', + 'endl', + 'false', + 'ffind', + 'FILE', + 'find', + 'fixed', + 'flush', + 'GMRES', + 'good', + 'hTriangle', + 'im', + 'imax', + 'imin', + 'InternalEdge', + 'l1', + 'l2', + 'label', + 'lenEdge', + 'length', + 'LINE', + 'linfty', + 'LU', + 'm', + 'max', + 'measure', + 'min', + 'mpiAnySource', + 'mpiBAND', + 'mpiBXOR', + 'mpiCommWorld', + 'mpiLAND', + 'mpiLOR', + 'mpiLXOR', + 'mpiMAX', + 'mpiMIN', + 'mpiPROD', + 'mpirank', + 'mpisize', + 'mpiSUM', + 'mpiUndefined', + 'n', + 'N', + 'nbe', + 'ndof', + 'ndofK', + 'noshowbase', + 'noshowpos', + 'notaregion', + 'nt', + 'nTonEdge', + 'nuEdge', + 'nuTriangle', + 'nv', + 'P', + 'pi', + 'precision', + 'qf1pE', + 'qf1pElump', + 'qf1pT', + 'qf1pTlump', + 'qfV1', + 'qfV1lump', + 'qf2pE', + 'qf2pT', + 'qf2pT4P1', + 'qfV2', + 'qf3pE', + 'qf4pE', + 'qf5pE', + 'qf5pT', + 'qfV5', + 'qf7pT', + 'qf9pT', + 'qfnbpE', + 'quantile', + 're', + 'region', + 'rfind', + 'scientific', + 'searchMethod', + 'setw', + 'showbase', + 'showpos', + 'sparsesolver', + 'sum', + 'tellp', + 'true', + 'UMFPACK', + 'unused', + 'whoinElement', + 'verbosity', + 'version', + 'volume', + 'x', + 'y', + 'z' + } + + # Language shipped functions and class ( ) + functions = { + 'abs', + 'acos', + 'acosh', + 'adaptmesh', + 'adj', + 'AffineCG', + 'AffineGMRES', + 'arg', + 'asin', + 'asinh', + 'assert', + 'atan', + 'atan2', + 'atanh', + 'atof', + 'atoi', + 'BFGS', + 'broadcast', + 'buildlayers', + 'buildmesh', + 'ceil', + 'chi', + 'complexEigenValue', + 'copysign', + 'change', + 'checkmovemesh', + 'clock', + 'cmaes', + 'conj', + 'convect', + 'cos', + 'cosh', + 'cube', + 'd', + 'dd', + 'dfft', + 'diffnp', + 'diffpos', + 'dimKrylov', + 'dist', + 'dumptable', + 'dx', + 'dxx', + 'dxy', + 'dxz', + 'dy', + 'dyx', + 'dyy', + 'dyz', + 'dz', + 'dzx', + 'dzy', + 'dzz', + 'EigenValue', + 'emptymesh', + 'erf', + 'erfc', + 'exec', + 'exit', + 'exp', + 'fdim', + 'floor', + 'fmax', + 'fmin', + 'fmod', + 'freeyams', + 'getARGV', + 'getline', + 'gmshload', + 'gmshload3', + 'gslcdfugaussianP', + 'gslcdfugaussianQ', + 'gslcdfugaussianPinv', + 'gslcdfugaussianQinv', + 'gslcdfgaussianP', + 'gslcdfgaussianQ', + 'gslcdfgaussianPinv', + 'gslcdfgaussianQinv', + 'gslcdfgammaP', + 'gslcdfgammaQ', + 'gslcdfgammaPinv', + 'gslcdfgammaQinv', + 'gslcdfcauchyP', + 'gslcdfcauchyQ', + 'gslcdfcauchyPinv', + 'gslcdfcauchyQinv', + 'gslcdflaplaceP', + 'gslcdflaplaceQ', + 'gslcdflaplacePinv', + 'gslcdflaplaceQinv', + 'gslcdfrayleighP', + 'gslcdfrayleighQ', + 'gslcdfrayleighPinv', + 'gslcdfrayleighQinv', + 'gslcdfchisqP', + 'gslcdfchisqQ', + 'gslcdfchisqPinv', + 'gslcdfchisqQinv', + 'gslcdfexponentialP', + 'gslcdfexponentialQ', + 'gslcdfexponentialPinv', + 'gslcdfexponentialQinv', + 'gslcdfexppowP', + 'gslcdfexppowQ', + 'gslcdftdistP', + 'gslcdftdistQ', + 'gslcdftdistPinv', + 'gslcdftdistQinv', + 'gslcdffdistP', + 'gslcdffdistQ', + 'gslcdffdistPinv', + 'gslcdffdistQinv', + 'gslcdfbetaP', + 'gslcdfbetaQ', + 'gslcdfbetaPinv', + 'gslcdfbetaQinv', + 'gslcdfflatP', + 'gslcdfflatQ', + 'gslcdfflatPinv', + 'gslcdfflatQinv', + 'gslcdflognormalP', + 'gslcdflognormalQ', + 'gslcdflognormalPinv', + 'gslcdflognormalQinv', + 'gslcdfgumbel1P', + 'gslcdfgumbel1Q', + 'gslcdfgumbel1Pinv', + 'gslcdfgumbel1Qinv', + 'gslcdfgumbel2P', + 'gslcdfgumbel2Q', + 'gslcdfgumbel2Pinv', + 'gslcdfgumbel2Qinv', + 'gslcdfweibullP', + 'gslcdfweibullQ', + 'gslcdfweibullPinv', + 'gslcdfweibullQinv', + 'gslcdfparetoP', + 'gslcdfparetoQ', + 'gslcdfparetoPinv', + 'gslcdfparetoQinv', + 'gslcdflogisticP', + 'gslcdflogisticQ', + 'gslcdflogisticPinv', + 'gslcdflogisticQinv', + 'gslcdfbinomialP', + 'gslcdfbinomialQ', + 'gslcdfpoissonP', + 'gslcdfpoissonQ', + 'gslcdfgeometricP', + 'gslcdfgeometricQ', + 'gslcdfnegativebinomialP', + 'gslcdfnegativebinomialQ', + 'gslcdfpascalP', + 'gslcdfpascalQ', + 'gslinterpakima', + 'gslinterpakimaperiodic', + 'gslinterpcsplineperiodic', + 'gslinterpcspline', + 'gslinterpsteffen', + 'gslinterplinear', + 'gslinterppolynomial', + 'gslranbernoullipdf', + 'gslranbeta', + 'gslranbetapdf', + 'gslranbinomialpdf', + 'gslranexponential', + 'gslranexponentialpdf', + 'gslranexppow', + 'gslranexppowpdf', + 'gslrancauchy', + 'gslrancauchypdf', + 'gslranchisq', + 'gslranchisqpdf', + 'gslranerlang', + 'gslranerlangpdf', + 'gslranfdist', + 'gslranfdistpdf', + 'gslranflat', + 'gslranflatpdf', + 'gslrangamma', + 'gslrangammaint', + 'gslrangammapdf', + 'gslrangammamt', + 'gslrangammaknuth', + 'gslrangaussian', + 'gslrangaussianratiomethod', + 'gslrangaussianziggurat', + 'gslrangaussianpdf', + 'gslranugaussian', + 'gslranugaussianratiomethod', + 'gslranugaussianpdf', + 'gslrangaussiantail', + 'gslrangaussiantailpdf', + 'gslranugaussiantail', + 'gslranugaussiantailpdf', + 'gslranlandau', + 'gslranlandaupdf', + 'gslrangeometricpdf', + 'gslrangumbel1', + 'gslrangumbel1pdf', + 'gslrangumbel2', + 'gslrangumbel2pdf', + 'gslranlogistic', + 'gslranlogisticpdf', + 'gslranlognormal', + 'gslranlognormalpdf', + 'gslranlogarithmicpdf', + 'gslrannegativebinomialpdf', + 'gslranpascalpdf', + 'gslranpareto', + 'gslranparetopdf', + 'gslranpoissonpdf', + 'gslranrayleigh', + 'gslranrayleighpdf', + 'gslranrayleightail', + 'gslranrayleightailpdf', + 'gslrantdist', + 'gslrantdistpdf', + 'gslranlaplace', + 'gslranlaplacepdf', + 'gslranlevy', + 'gslranweibull', + 'gslranweibullpdf', + 'gslsfairyAi', + 'gslsfairyBi', + 'gslsfairyAiscaled', + 'gslsfairyBiscaled', + 'gslsfairyAideriv', + 'gslsfairyBideriv', + 'gslsfairyAiderivscaled', + 'gslsfairyBiderivscaled', + 'gslsfairyzeroAi', + 'gslsfairyzeroBi', + 'gslsfairyzeroAideriv', + 'gslsfairyzeroBideriv', + 'gslsfbesselJ0', + 'gslsfbesselJ1', + 'gslsfbesselJn', + 'gslsfbesselY0', + 'gslsfbesselY1', + 'gslsfbesselYn', + 'gslsfbesselI0', + 'gslsfbesselI1', + 'gslsfbesselIn', + 'gslsfbesselI0scaled', + 'gslsfbesselI1scaled', + 'gslsfbesselInscaled', + 'gslsfbesselK0', + 'gslsfbesselK1', + 'gslsfbesselKn', + 'gslsfbesselK0scaled', + 'gslsfbesselK1scaled', + 'gslsfbesselKnscaled', + 'gslsfbesselj0', + 'gslsfbesselj1', + 'gslsfbesselj2', + 'gslsfbesseljl', + 'gslsfbessely0', + 'gslsfbessely1', + 'gslsfbessely2', + 'gslsfbesselyl', + 'gslsfbesseli0scaled', + 'gslsfbesseli1scaled', + 'gslsfbesseli2scaled', + 'gslsfbesselilscaled', + 'gslsfbesselk0scaled', + 'gslsfbesselk1scaled', + 'gslsfbesselk2scaled', + 'gslsfbesselklscaled', + 'gslsfbesselJnu', + 'gslsfbesselYnu', + 'gslsfbesselInuscaled', + 'gslsfbesselInu', + 'gslsfbesselKnuscaled', + 'gslsfbesselKnu', + 'gslsfbessellnKnu', + 'gslsfbesselzeroJ0', + 'gslsfbesselzeroJ1', + 'gslsfbesselzeroJnu', + 'gslsfclausen', + 'gslsfhydrogenicR1', + 'gslsfdawson', + 'gslsfdebye1', + 'gslsfdebye2', + 'gslsfdebye3', + 'gslsfdebye4', + 'gslsfdebye5', + 'gslsfdebye6', + 'gslsfdilog', + 'gslsfmultiply', + 'gslsfellintKcomp', + 'gslsfellintEcomp', + 'gslsfellintPcomp', + 'gslsfellintDcomp', + 'gslsfellintF', + 'gslsfellintE', + 'gslsfellintRC', + 'gslsferfc', + 'gslsflogerfc', + 'gslsferf', + 'gslsferfZ', + 'gslsferfQ', + 'gslsfhazard', + 'gslsfexp', + 'gslsfexpmult', + 'gslsfexpm1', + 'gslsfexprel', + 'gslsfexprel2', + 'gslsfexpreln', + 'gslsfexpintE1', + 'gslsfexpintE2', + 'gslsfexpintEn', + 'gslsfexpintE1scaled', + 'gslsfexpintE2scaled', + 'gslsfexpintEnscaled', + 'gslsfexpintEi', + 'gslsfexpintEiscaled', + 'gslsfShi', + 'gslsfChi', + 'gslsfexpint3', + 'gslsfSi', + 'gslsfCi', + 'gslsfatanint', + 'gslsffermidiracm1', + 'gslsffermidirac0', + 'gslsffermidirac1', + 'gslsffermidirac2', + 'gslsffermidiracint', + 'gslsffermidiracmhalf', + 'gslsffermidirachalf', + 'gslsffermidirac3half', + 'gslsffermidiracinc0', + 'gslsflngamma', + 'gslsfgamma', + 'gslsfgammastar', + 'gslsfgammainv', + 'gslsftaylorcoeff', + 'gslsffact', + 'gslsfdoublefact', + 'gslsflnfact', + 'gslsflndoublefact', + 'gslsflnchoose', + 'gslsfchoose', + 'gslsflnpoch', + 'gslsfpoch', + 'gslsfpochrel', + 'gslsfgammaincQ', + 'gslsfgammaincP', + 'gslsfgammainc', + 'gslsflnbeta', + 'gslsfbeta', + 'gslsfbetainc', + 'gslsfgegenpoly1', + 'gslsfgegenpoly2', + 'gslsfgegenpoly3', + 'gslsfgegenpolyn', + 'gslsfhyperg0F1', + 'gslsfhyperg1F1int', + 'gslsfhyperg1F1', + 'gslsfhypergUint', + 'gslsfhypergU', + 'gslsfhyperg2F0', + 'gslsflaguerre1', + 'gslsflaguerre2', + 'gslsflaguerre3', + 'gslsflaguerren', + 'gslsflambertW0', + 'gslsflambertWm1', + 'gslsflegendrePl', + 'gslsflegendreP1', + 'gslsflegendreP2', + 'gslsflegendreP3', + 'gslsflegendreQ0', + 'gslsflegendreQ1', + 'gslsflegendreQl', + 'gslsflegendrePlm', + 'gslsflegendresphPlm', + 'gslsflegendrearraysize', + 'gslsfconicalPhalf', + 'gslsfconicalPmhalf', + 'gslsfconicalP0', + 'gslsfconicalP1', + 'gslsfconicalPsphreg', + 'gslsfconicalPcylreg', + 'gslsflegendreH3d0', + 'gslsflegendreH3d1', + 'gslsflegendreH3d', + 'gslsflog', + 'gslsflogabs', + 'gslsflog1plusx', + 'gslsflog1plusxmx', + 'gslsfpowint', + 'gslsfpsiint', + 'gslsfpsi', + 'gslsfpsi1piy', + 'gslsfpsi1int', + 'gslsfpsi1', + 'gslsfpsin', + 'gslsfsynchrotron1', + 'gslsfsynchrotron2', + 'gslsftransport2', + 'gslsftransport3', + 'gslsftransport4', + 'gslsftransport5', + 'gslsfsin', + 'gslsfcos', + 'gslsfhypot', + 'gslsfsinc', + 'gslsflnsinh', + 'gslsflncosh', + 'gslsfanglerestrictsymm', + 'gslsfanglerestrictpos', + 'gslsfzetaint', + 'gslsfzeta', + 'gslsfzetam1', + 'gslsfzetam1int', + 'gslsfhzeta', + 'gslsfetaint', + 'gslsfeta', + 'imag', + 'int1d', + 'int2d', + 'int3d', + 'intalledges', + 'intallfaces', + 'interpolate', + 'invdiff', + 'invdiffnp', + 'invdiffpos', + 'Isend', + 'isInf', + 'isNaN', + 'isoline', + 'Irecv', + 'j0', + 'j1', + 'jn', + 'jump', + 'lgamma', + 'LinearCG', + 'LinearGMRES', + 'log', + 'log10', + 'lrint', + 'lround', + 'max', + 'mean', + 'medit', + 'min', + 'mmg3d', + 'movemesh', + 'movemesh23', + 'mpiAlltoall', + 'mpiAlltoallv', + 'mpiAllgather', + 'mpiAllgatherv', + 'mpiAllReduce', + 'mpiBarrier', + 'mpiGather', + 'mpiGatherv', + 'mpiRank', + 'mpiReduce', + 'mpiScatter', + 'mpiScatterv', + 'mpiSize', + 'mpiWait', + 'mpiWaitAny', + 'mpiWtick', + 'mpiWtime', + 'mshmet', + 'NaN', + 'NLCG', + 'on', + 'plot', + 'polar', + 'Post', + 'pow', + 'processor', + 'processorblock', + 'projection', + 'randinit', + 'randint31', + 'randint32', + 'random', + 'randreal1', + 'randreal2', + 'randreal3', + 'randres53', + 'Read', + 'readmesh', + 'readmesh3', + 'Recv', + 'rint', + 'round', + 'savemesh', + 'savesol', + 'savevtk', + 'seekg', + 'Sent', + 'set', + 'sign', + 'signbit', + 'sin', + 'sinh', + 'sort', + 'splitComm', + 'splitmesh', + 'sqrt', + 'square', + 'srandom', + 'srandomdev', + 'Stringification', + 'swap', + 'system', + 'tan', + 'tanh', + 'tellg', + 'tetg', + 'tetgconvexhull', + 'tetgreconstruction', + 'tetgtransfo', + 'tgamma', + 'triangulate', + 'trunc', + 'Wait', + 'Write', + 'y0', + 'y1', + 'yn' + } + + # function parameters + parameters = { + 'A', + 'A1', + 'abserror', + 'absolute', + 'aniso', + 'aspectratio', + 'B', + 'B1', + 'bb', + 'beginend', + 'bin', + 'boundary', + 'bw', + 'close', + 'cmm', + 'coef', + 'composante', + 'cutoff', + 'datafilename', + 'dataname', + 'dim', + 'distmax', + 'displacement', + 'doptions', + 'dparams', + 'eps', + 'err', + 'errg', + 'facemerge', + 'facetcl', + 'factorize', + 'file', + 'fill', + 'fixedborder', + 'flabel', + 'flags', + 'floatmesh', + 'floatsol', + 'fregion', + 'gradation', + 'grey', + 'hmax', + 'hmin', + 'holelist', + 'hsv', + 'init', + 'inquire', + 'inside', + 'IsMetric', + 'iso', + 'ivalue', + 'keepbackvertices', + 'label', + 'labeldown', + 'labelmid', + 'labelup', + 'levelset', + 'loptions', + 'lparams', + 'maxit', + 'maxsubdiv', + 'meditff', + 'mem', + 'memory', + 'metric', + 'mode', + 'nbarrow', + 'nbiso', + 'nbiter', + 'nbjacoby', + 'nboffacetcl', + 'nbofholes', + 'nbofregions', + 'nbregul', + 'nbsmooth', + 'nbvx', + 'ncv', + 'nev', + 'nomeshgeneration', + 'normalization', + 'omega', + 'op', + 'optimize', + 'option', + 'options', + 'order', + 'orientation', + 'periodic', + 'power', + 'precon', + 'prev', + 'ps', + 'ptmerge', + 'qfe', + 'qforder', + 'qft', + 'qfV', + 'ratio', + 'rawvector', + 'reffacelow', + 'reffacemid', + 'reffaceup', + 'refnum', + 'reftet', + 'reftri', + 'region', + 'regionlist', + 'renumv', + 'rescaling', + 'ridgeangle', + 'save', + 'sigma', + 'sizeofvolume', + 'smoothing', + 'solver', + 'sparams', + 'split', + 'splitin2', + 'splitpbedge', + 'stop', + 'strategy', + 'swap', + 'switch', + 'sym', + 't', + 'tgv', + 'thetamax', + 'tol', + 'tolpivot', + 'tolpivotsym', + 'transfo', + 'U2Vc', + 'value', + 'varrow', + 'vector', + 'veps', + 'viso', + 'wait', + 'width', + 'withsurfacemesh', + 'WindowIndex', + 'which', + 'zbound' + } + + # deprecated + deprecated = {'fixeborder'} + + # do not highlight + suppress_highlight = { + 'alignof', + 'asm', + 'constexpr', + 'decltype', + 'div', + 'double', + 'grad', + 'mutable', + 'namespace', + 'noexcept', + 'restrict', + 'static_assert', + 'template', + 'this', + 'thread_local', + 'typeid', + 'typename', + 'using' + } + + def get_tokens_unprocessed(self, text, stack=('root',)): + for index, token, value in CppLexer.get_tokens_unprocessed(self, text, stack): + if value in self.operators: + yield index, Operator, value + elif value in self.types: + yield index, Keyword.Type, value + elif value in self.fespaces: + yield index, Name.Class, value + elif value in self.preprocessor: + yield index, Comment.Preproc, value + elif value in self.keywords: + yield index, Keyword.Reserved, value + elif value in self.functions: + yield index, Name.Function, value + elif value in self.parameters: + yield index, Keyword.Pseudo, value + elif value in self.suppress_highlight: + yield index, Name, value + else: + yield index, token, value diff --git a/lib/python3.12/site-packages/pygments/lexers/functional.py b/lib/python3.12/site-packages/pygments/lexers/functional.py new file mode 100644 index 0000000000000000000000000000000000000000..6a051d8fd3a6d26817dbaf7f254803ad5599a10f --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/functional.py @@ -0,0 +1,21 @@ +""" + pygments.lexers.functional + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Just export lexer classes previously contained in this module. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +# ruff: noqa: F401 +from pygments.lexers.lisp import SchemeLexer, CommonLispLexer, RacketLexer, \ + NewLispLexer, ShenLexer +from pygments.lexers.haskell import HaskellLexer, LiterateHaskellLexer, \ + KokaLexer +from pygments.lexers.theorem import CoqLexer +from pygments.lexers.erlang import ErlangLexer, ErlangShellLexer, \ + ElixirConsoleLexer, ElixirLexer +from pygments.lexers.ml import SMLLexer, OcamlLexer, OpaLexer + +__all__ = [] diff --git a/lib/python3.12/site-packages/pygments/lexers/futhark.py b/lib/python3.12/site-packages/pygments/lexers/futhark.py new file mode 100644 index 0000000000000000000000000000000000000000..dd2efe83e709f962a9b8580d5f7324a75083b005 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/futhark.py @@ -0,0 +1,105 @@ +""" + pygments.lexers.futhark + ~~~~~~~~~~~~~~~~~~~~~~~ + + Lexer for the Futhark language + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, bygroups +from pygments.token import Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Whitespace +from pygments import unistring as uni + +__all__ = ['FutharkLexer'] + + +class FutharkLexer(RegexLexer): + """ + A Futhark lexer + """ + name = 'Futhark' + url = 'https://futhark-lang.org/' + aliases = ['futhark'] + filenames = ['*.fut'] + mimetypes = ['text/x-futhark'] + version_added = '2.8' + + num_types = ('i8', 'i16', 'i32', 'i64', 'u8', 'u16', 'u32', 'u64', 'f32', 'f64') + + other_types = ('bool', ) + + reserved = ('if', 'then', 'else', 'def', 'let', 'loop', 'in', 'with', + 'type', 'type~', 'type^', + 'val', 'entry', 'for', 'while', 'do', 'case', 'match', + 'include', 'import', 'module', 'open', 'local', 'assert', '_') + + ascii = ('NUL', 'SOH', '[SE]TX', 'EOT', 'ENQ', 'ACK', + 'BEL', 'BS', 'HT', 'LF', 'VT', 'FF', 'CR', 'S[OI]', 'DLE', + 'DC[1-4]', 'NAK', 'SYN', 'ETB', 'CAN', + 'EM', 'SUB', 'ESC', '[FGRU]S', 'SP', 'DEL') + + num_postfix = r'({})?'.format('|'.join(num_types)) + + identifier_re = '[a-zA-Z_][a-zA-Z_0-9\']*' + + # opstart_re = '+\-\*/%=\!><\|&\^' + + tokens = { + 'root': [ + (r'--(.*?)$', Comment.Single), + (r'\s+', Whitespace), + (r'\(\)', Punctuation), + (r'\b({})(?!\')\b'.format('|'.join(reserved)), Keyword.Reserved), + (r'\b({})(?!\')\b'.format('|'.join(num_types + other_types)), Keyword.Type), + + # Identifiers + (r'#\[([a-zA-Z_\(\) ]*)\]', Comment.Preproc), + (rf'[#!]?({identifier_re}\.)*{identifier_re}', Name), + + (r'\\', Operator), + (r'[-+/%=!><|&*^][-+/%=!><|&*^.]*', Operator), + (r'[][(),:;`{}?.\'~^]', Punctuation), + + # Numbers + (r'0[xX]_*[\da-fA-F](_*[\da-fA-F])*_*[pP][+-]?\d(_*\d)*' + num_postfix, + Number.Float), + (r'0[xX]_*[\da-fA-F](_*[\da-fA-F])*\.[\da-fA-F](_*[\da-fA-F])*' + r'(_*[pP][+-]?\d(_*\d)*)?' + num_postfix, Number.Float), + (r'\d(_*\d)*_*[eE][+-]?\d(_*\d)*' + num_postfix, Number.Float), + (r'\d(_*\d)*\.\d(_*\d)*(_*[eE][+-]?\d(_*\d)*)?' + num_postfix, Number.Float), + (r'0[bB]_*[01](_*[01])*' + num_postfix, Number.Bin), + (r'0[xX]_*[\da-fA-F](_*[\da-fA-F])*' + num_postfix, Number.Hex), + (r'\d(_*\d)*' + num_postfix, Number.Integer), + + # Character/String Literals + (r"'", String.Char, 'character'), + (r'"', String, 'string'), + # Special + (r'\[[a-zA-Z_\d]*\]', Keyword.Type), + (r'\(\)', Name.Builtin), + ], + 'character': [ + # Allows multi-chars, incorrectly. + (r"[^\\']'", String.Char, '#pop'), + (r"\\", String.Escape, 'escape'), + ("'", String.Char, '#pop'), + ], + 'string': [ + (r'[^\\"]+', String), + (r"\\", String.Escape, 'escape'), + ('"', String, '#pop'), + ], + + 'escape': [ + (r'[abfnrtv"\'&\\]', String.Escape, '#pop'), + (r'\^[][' + uni.Lu + r'@^_]', String.Escape, '#pop'), + ('|'.join(ascii), String.Escape, '#pop'), + (r'o[0-7]+', String.Escape, '#pop'), + (r'x[\da-fA-F]+', String.Escape, '#pop'), + (r'\d+', String.Escape, '#pop'), + (r'(\s+)(\\)', bygroups(Whitespace, String.Escape), '#pop'), + ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/gcodelexer.py b/lib/python3.12/site-packages/pygments/lexers/gcodelexer.py new file mode 100644 index 0000000000000000000000000000000000000000..9e968bd6b67e17fe28175e002037cbf50846088c --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/gcodelexer.py @@ -0,0 +1,35 @@ +""" + pygments.lexers.gcodelexer + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for the G Code Language. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, bygroups +from pygments.token import Comment, Name, Text, Keyword, Number + +__all__ = ['GcodeLexer'] + + +class GcodeLexer(RegexLexer): + """ + For gcode source code. + """ + name = 'g-code' + aliases = ['gcode'] + filenames = ['*.gcode'] + url = 'https://en.wikipedia.org/wiki/G-code' + version_added = '2.9' + + tokens = { + 'root': [ + (r';.*\n', Comment), + (r'^[gmGM]\d{1,4}\s', Name.Builtin), # M or G commands + (r'([^gGmM])([+-]?\d*[.]?\d+)', bygroups(Keyword, Number)), + (r'\s', Text.Whitespace), + (r'.*\n', Text), + ] + } diff --git a/lib/python3.12/site-packages/pygments/lexers/graphics.py b/lib/python3.12/site-packages/pygments/lexers/graphics.py new file mode 100644 index 0000000000000000000000000000000000000000..400be4fd8950b130454b9b43c039415fdc166309 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/graphics.py @@ -0,0 +1,794 @@ +""" + pygments.lexers.graphics + ~~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for computer graphics and plotting related languages. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, words, include, bygroups, using, \ + this, default +from pygments.token import Text, Comment, Operator, Keyword, Name, \ + Number, Punctuation, String, Whitespace + +__all__ = ['GLShaderLexer', 'PostScriptLexer', 'AsymptoteLexer', 'GnuplotLexer', + 'PovrayLexer', 'HLSLShaderLexer'] + + +class GLShaderLexer(RegexLexer): + """ + GLSL (OpenGL Shader) lexer. + """ + name = 'GLSL' + aliases = ['glsl'] + filenames = ['*.vert', '*.frag', '*.geo'] + mimetypes = ['text/x-glslsrc'] + url = 'https://www.khronos.org/api/opengl' + version_added = '1.1' + + tokens = { + 'root': [ + (r'#(?:.*\\\n)*.*$', Comment.Preproc), + (r'//.*$', Comment.Single), + (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline), + (r'\+|-|~|!=?|\*|/|%|<<|>>|<=?|>=?|==?|&&?|\^|\|\|?', + Operator), + (r'[?:]', Operator), # quick hack for ternary + (r'\bdefined\b', Operator), + (r'[;{}(),\[\]]', Punctuation), + # FIXME when e is present, no decimal point needed + (r'[+-]?\d*\.\d+([eE][-+]?\d+)?', Number.Float), + (r'[+-]?\d+\.\d*([eE][-+]?\d+)?', Number.Float), + (r'0[xX][0-9a-fA-F]*', Number.Hex), + (r'0[0-7]*', Number.Oct), + (r'[1-9][0-9]*', Number.Integer), + (words(( + # Storage qualifiers + 'attribute', 'const', 'uniform', 'varying', + 'buffer', 'shared', 'in', 'out', + # Layout qualifiers + 'layout', + # Interpolation qualifiers + 'flat', 'smooth', 'noperspective', + # Auxiliary qualifiers + 'centroid', 'sample', 'patch', + # Parameter qualifiers. Some double as Storage qualifiers + 'inout', + # Precision qualifiers + 'lowp', 'mediump', 'highp', 'precision', + # Invariance qualifiers + 'invariant', + # Precise qualifiers + 'precise', + # Memory qualifiers + 'coherent', 'volatile', 'restrict', 'readonly', 'writeonly', + # Statements + 'break', 'continue', 'do', 'for', 'while', 'switch', + 'case', 'default', 'if', 'else', 'subroutine', + 'discard', 'return', 'struct'), + prefix=r'\b', suffix=r'\b'), + Keyword), + (words(( + # Boolean values + 'true', 'false'), + prefix=r'\b', suffix=r'\b'), + Keyword.Constant), + (words(( + # Miscellaneous types + 'void', 'atomic_uint', + # Floating-point scalars and vectors + 'float', 'vec2', 'vec3', 'vec4', + 'double', 'dvec2', 'dvec3', 'dvec4', + # Integer scalars and vectors + 'int', 'ivec2', 'ivec3', 'ivec4', + 'uint', 'uvec2', 'uvec3', 'uvec4', + # Boolean scalars and vectors + 'bool', 'bvec2', 'bvec3', 'bvec4', + # Matrices + 'mat2', 'mat3', 'mat4', 'dmat2', 'dmat3', 'dmat4', + 'mat2x2', 'mat2x3', 'mat2x4', 'dmat2x2', 'dmat2x3', 'dmat2x4', + 'mat3x2', 'mat3x3', 'mat3x4', 'dmat3x2', 'dmat3x3', + 'dmat3x4', 'mat4x2', 'mat4x3', 'mat4x4', 'dmat4x2', 'dmat4x3', 'dmat4x4', + # Floating-point samplers + 'sampler1D', 'sampler2D', 'sampler3D', 'samplerCube', + 'sampler1DArray', 'sampler2DArray', 'samplerCubeArray', + 'sampler2DRect', 'samplerBuffer', + 'sampler2DMS', 'sampler2DMSArray', + # Shadow samplers + 'sampler1DShadow', 'sampler2DShadow', 'samplerCubeShadow', + 'sampler1DArrayShadow', 'sampler2DArrayShadow', + 'samplerCubeArrayShadow', 'sampler2DRectShadow', + # Signed integer samplers + 'isampler1D', 'isampler2D', 'isampler3D', 'isamplerCube', + 'isampler1DArray', 'isampler2DArray', 'isamplerCubeArray', + 'isampler2DRect', 'isamplerBuffer', + 'isampler2DMS', 'isampler2DMSArray', + # Unsigned integer samplers + 'usampler1D', 'usampler2D', 'usampler3D', 'usamplerCube', + 'usampler1DArray', 'usampler2DArray', 'usamplerCubeArray', + 'usampler2DRect', 'usamplerBuffer', + 'usampler2DMS', 'usampler2DMSArray', + # Floating-point image types + 'image1D', 'image2D', 'image3D', 'imageCube', + 'image1DArray', 'image2DArray', 'imageCubeArray', + 'image2DRect', 'imageBuffer', + 'image2DMS', 'image2DMSArray', + # Signed integer image types + 'iimage1D', 'iimage2D', 'iimage3D', 'iimageCube', + 'iimage1DArray', 'iimage2DArray', 'iimageCubeArray', + 'iimage2DRect', 'iimageBuffer', + 'iimage2DMS', 'iimage2DMSArray', + # Unsigned integer image types + 'uimage1D', 'uimage2D', 'uimage3D', 'uimageCube', + 'uimage1DArray', 'uimage2DArray', 'uimageCubeArray', + 'uimage2DRect', 'uimageBuffer', + 'uimage2DMS', 'uimage2DMSArray'), + prefix=r'\b', suffix=r'\b'), + Keyword.Type), + (words(( + # Reserved for future use. + 'common', 'partition', 'active', 'asm', 'class', + 'union', 'enum', 'typedef', 'template', 'this', + 'resource', 'goto', 'inline', 'noinline', 'public', + 'static', 'extern', 'external', 'interface', 'long', + 'short', 'half', 'fixed', 'unsigned', 'superp', 'input', + 'output', 'hvec2', 'hvec3', 'hvec4', 'fvec2', 'fvec3', + 'fvec4', 'sampler3DRect', 'filter', 'sizeof', 'cast', + 'namespace', 'using'), + prefix=r'\b', suffix=r'\b'), + Keyword.Reserved), + # All names beginning with "gl_" are reserved. + (r'gl_\w*', Name.Builtin), + (r'[a-zA-Z_]\w*', Name), + (r'\.', Punctuation), + (r'\s+', Whitespace), + ], + } + + +class HLSLShaderLexer(RegexLexer): + """ + HLSL (Microsoft Direct3D Shader) lexer. + """ + name = 'HLSL' + aliases = ['hlsl'] + filenames = ['*.hlsl', '*.hlsli'] + mimetypes = ['text/x-hlsl'] + url = 'https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl' + version_added = '2.3' + + tokens = { + 'root': [ + (r'#(?:.*\\\n)*.*$', Comment.Preproc), + (r'//.*$', Comment.Single), + (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline), + (r'\+|-|~|!=?|\*|/|%|<<|>>|<=?|>=?|==?|&&?|\^|\|\|?', + Operator), + (r'[?:]', Operator), # quick hack for ternary + (r'\bdefined\b', Operator), + (r'[;{}(),.\[\]]', Punctuation), + # FIXME when e is present, no decimal point needed + (r'[+-]?\d*\.\d+([eE][-+]?\d+)?f?', Number.Float), + (r'[+-]?\d+\.\d*([eE][-+]?\d+)?f?', Number.Float), + (r'0[xX][0-9a-fA-F]*', Number.Hex), + (r'0[0-7]*', Number.Oct), + (r'[1-9][0-9]*', Number.Integer), + (r'"', String, 'string'), + (words(( + 'asm','asm_fragment','break','case','cbuffer','centroid','class', + 'column_major','compile','compile_fragment','const','continue', + 'default','discard','do','else','export','extern','for','fxgroup', + 'globallycoherent','groupshared','if','in','inline','inout', + 'interface','line','lineadj','linear','namespace','nointerpolation', + 'noperspective','NULL','out','packoffset','pass','pixelfragment', + 'point','precise','return','register','row_major','sample', + 'sampler','shared','stateblock','stateblock_state','static', + 'struct','switch','tbuffer','technique','technique10', + 'technique11','texture','typedef','triangle','triangleadj', + 'uniform','vertexfragment','volatile','while'), + prefix=r'\b', suffix=r'\b'), + Keyword), + (words(('true','false'), prefix=r'\b', suffix=r'\b'), + Keyword.Constant), + (words(( + 'auto','catch','char','const_cast','delete','dynamic_cast','enum', + 'explicit','friend','goto','long','mutable','new','operator', + 'private','protected','public','reinterpret_cast','short','signed', + 'sizeof','static_cast','template','this','throw','try','typename', + 'union','unsigned','using','virtual'), + prefix=r'\b', suffix=r'\b'), + Keyword.Reserved), + (words(( + 'dword','matrix','snorm','string','unorm','unsigned','void','vector', + 'BlendState','Buffer','ByteAddressBuffer','ComputeShader', + 'DepthStencilState','DepthStencilView','DomainShader', + 'GeometryShader','HullShader','InputPatch','LineStream', + 'OutputPatch','PixelShader','PointStream','RasterizerState', + 'RenderTargetView','RasterizerOrderedBuffer', + 'RasterizerOrderedByteAddressBuffer', + 'RasterizerOrderedStructuredBuffer','RasterizerOrderedTexture1D', + 'RasterizerOrderedTexture1DArray','RasterizerOrderedTexture2D', + 'RasterizerOrderedTexture2DArray','RasterizerOrderedTexture3D', + 'RWBuffer','RWByteAddressBuffer','RWStructuredBuffer', + 'RWTexture1D','RWTexture1DArray','RWTexture2D','RWTexture2DArray', + 'RWTexture3D','SamplerState','SamplerComparisonState', + 'StructuredBuffer','Texture1D','Texture1DArray','Texture2D', + 'Texture2DArray','Texture2DMS','Texture2DMSArray','Texture3D', + 'TextureCube','TextureCubeArray','TriangleStream','VertexShader'), + prefix=r'\b', suffix=r'\b'), + Keyword.Type), + (words(( + 'bool','double','float','int','half','min16float','min10float', + 'min16int','min12int','min16uint','uint'), + prefix=r'\b', suffix=r'([1-4](x[1-4])?)?\b'), + Keyword.Type), # vector and matrix types + (words(( + 'abort','abs','acos','all','AllMemoryBarrier', + 'AllMemoryBarrierWithGroupSync','any','AppendStructuredBuffer', + 'asdouble','asfloat','asin','asint','asuint','asuint','atan', + 'atan2','ceil','CheckAccessFullyMapped','clamp','clip', + 'CompileShader','ConsumeStructuredBuffer','cos','cosh','countbits', + 'cross','D3DCOLORtoUBYTE4','ddx','ddx_coarse','ddx_fine','ddy', + 'ddy_coarse','ddy_fine','degrees','determinant', + 'DeviceMemoryBarrier','DeviceMemoryBarrierWithGroupSync','distance', + 'dot','dst','errorf','EvaluateAttributeAtCentroid', + 'EvaluateAttributeAtSample','EvaluateAttributeSnapped','exp', + 'exp2','f16tof32','f32tof16','faceforward','firstbithigh', + 'firstbitlow','floor','fma','fmod','frac','frexp','fwidth', + 'GetRenderTargetSampleCount','GetRenderTargetSamplePosition', + 'GlobalOrderedCountIncrement','GroupMemoryBarrier', + 'GroupMemoryBarrierWithGroupSync','InterlockedAdd','InterlockedAnd', + 'InterlockedCompareExchange','InterlockedCompareStore', + 'InterlockedExchange','InterlockedMax','InterlockedMin', + 'InterlockedOr','InterlockedXor','isfinite','isinf','isnan', + 'ldexp','length','lerp','lit','log','log10','log2','mad','max', + 'min','modf','msad4','mul','noise','normalize','pow','printf', + 'Process2DQuadTessFactorsAvg','Process2DQuadTessFactorsMax', + 'Process2DQuadTessFactorsMin','ProcessIsolineTessFactors', + 'ProcessQuadTessFactorsAvg','ProcessQuadTessFactorsMax', + 'ProcessQuadTessFactorsMin','ProcessTriTessFactorsAvg', + 'ProcessTriTessFactorsMax','ProcessTriTessFactorsMin', + 'QuadReadLaneAt','QuadSwapX','QuadSwapY','radians','rcp', + 'reflect','refract','reversebits','round','rsqrt','saturate', + 'sign','sin','sincos','sinh','smoothstep','sqrt','step','tan', + 'tanh','tex1D','tex1D','tex1Dbias','tex1Dgrad','tex1Dlod', + 'tex1Dproj','tex2D','tex2D','tex2Dbias','tex2Dgrad','tex2Dlod', + 'tex2Dproj','tex3D','tex3D','tex3Dbias','tex3Dgrad','tex3Dlod', + 'tex3Dproj','texCUBE','texCUBE','texCUBEbias','texCUBEgrad', + 'texCUBElod','texCUBEproj','transpose','trunc','WaveAllBitAnd', + 'WaveAllMax','WaveAllMin','WaveAllBitOr','WaveAllBitXor', + 'WaveAllEqual','WaveAllProduct','WaveAllSum','WaveAllTrue', + 'WaveAnyTrue','WaveBallot','WaveGetLaneCount','WaveGetLaneIndex', + 'WaveGetOrderedIndex','WaveIsHelperLane','WaveOnce', + 'WavePrefixProduct','WavePrefixSum','WaveReadFirstLane', + 'WaveReadLaneAt'), + prefix=r'\b', suffix=r'\b'), + Name.Builtin), # built-in functions + (words(( + 'SV_ClipDistance','SV_ClipDistance0','SV_ClipDistance1', + 'SV_Culldistance','SV_CullDistance0','SV_CullDistance1', + 'SV_Coverage','SV_Depth','SV_DepthGreaterEqual', + 'SV_DepthLessEqual','SV_DispatchThreadID','SV_DomainLocation', + 'SV_GroupID','SV_GroupIndex','SV_GroupThreadID','SV_GSInstanceID', + 'SV_InnerCoverage','SV_InsideTessFactor','SV_InstanceID', + 'SV_IsFrontFace','SV_OutputControlPointID','SV_Position', + 'SV_PrimitiveID','SV_RenderTargetArrayIndex','SV_SampleIndex', + 'SV_StencilRef','SV_TessFactor','SV_VertexID', + 'SV_ViewportArrayIndex'), + prefix=r'\b', suffix=r'\b'), + Name.Decorator), # system-value semantics + (r'\bSV_Target[0-7]?\b', Name.Decorator), + (words(( + 'allow_uav_condition','branch','call','domain','earlydepthstencil', + 'fastopt','flatten','forcecase','instance','loop','maxtessfactor', + 'numthreads','outputcontrolpoints','outputtopology','partitioning', + 'patchconstantfunc','unroll'), + prefix=r'\b', suffix=r'\b'), + Name.Decorator), # attributes + (r'[a-zA-Z_]\w*', Name), + (r'\\$', Comment.Preproc), # backslash at end of line -- usually macro continuation + (r'\s+', Whitespace), + ], + 'string': [ + (r'"', String, '#pop'), + (r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|' + r'u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|[0-7]{1,3})', String.Escape), + (r'[^\\"\n]+', String), # all other characters + (r'\\\n', String), # line continuation + (r'\\', String), # stray backslash + ], + } + + +class PostScriptLexer(RegexLexer): + """ + Lexer for PostScript files. + """ + name = 'PostScript' + url = 'https://en.wikipedia.org/wiki/PostScript' + aliases = ['postscript', 'postscr'] + filenames = ['*.ps', '*.eps'] + mimetypes = ['application/postscript'] + version_added = '1.4' + + delimiter = r'()<>\[\]{}/%\s' + delimiter_end = rf'(?=[{delimiter}])' + + valid_name_chars = rf'[^{delimiter}]' + valid_name = rf"{valid_name_chars}+{delimiter_end}" + + tokens = { + 'root': [ + # All comment types + (r'^%!.+$', Comment.Preproc), + (r'%%.*$', Comment.Special), + (r'(^%.*\n){2,}', Comment.Multiline), + (r'%.*$', Comment.Single), + + # String literals are awkward; enter separate state. + (r'\(', String, 'stringliteral'), + + (r'[{}<>\[\]]', Punctuation), + + # Numbers + (r'<[0-9A-Fa-f]+>' + delimiter_end, Number.Hex), + # Slight abuse: use Oct to signify any explicit base system + (r'[0-9]+\#(\-|\+)?([0-9]+\.?|[0-9]*\.[0-9]+|[0-9]+\.[0-9]*)' + r'((e|E)[0-9]+)?' + delimiter_end, Number.Oct), + (r'(\-|\+)?([0-9]+\.?|[0-9]*\.[0-9]+|[0-9]+\.[0-9]*)((e|E)[0-9]+)?' + + delimiter_end, Number.Float), + (r'(\-|\+)?[0-9]+' + delimiter_end, Number.Integer), + + # References + (rf'\/{valid_name}', Name.Variable), + + # Names + (valid_name, Name.Function), # Anything else is executed + + # These keywords taken from + # + # Is there an authoritative list anywhere that doesn't involve + # trawling documentation? + + (r'(false|true)' + delimiter_end, Keyword.Constant), + + # Conditionals / flow control + (r'(eq|ne|g[et]|l[et]|and|or|not|if(?:else)?|for(?:all)?)' + + delimiter_end, Keyword.Reserved), + + (words(( + 'abs', 'add', 'aload', 'arc', 'arcn', 'array', 'atan', 'begin', + 'bind', 'ceiling', 'charpath', 'clip', 'closepath', 'concat', + 'concatmatrix', 'copy', 'cos', 'currentlinewidth', 'currentmatrix', + 'currentpoint', 'curveto', 'cvi', 'cvs', 'def', 'defaultmatrix', + 'dict', 'dictstackoverflow', 'div', 'dtransform', 'dup', 'end', + 'exch', 'exec', 'exit', 'exp', 'fill', 'findfont', 'floor', 'get', + 'getinterval', 'grestore', 'gsave', 'gt', 'identmatrix', 'idiv', + 'idtransform', 'index', 'invertmatrix', 'itransform', 'length', + 'lineto', 'ln', 'load', 'log', 'loop', 'matrix', 'mod', 'moveto', + 'mul', 'neg', 'newpath', 'pathforall', 'pathbbox', 'pop', 'print', + 'pstack', 'put', 'quit', 'rand', 'rangecheck', 'rcurveto', 'repeat', + 'restore', 'rlineto', 'rmoveto', 'roll', 'rotate', 'round', 'run', + 'save', 'scale', 'scalefont', 'setdash', 'setfont', 'setgray', + 'setlinecap', 'setlinejoin', 'setlinewidth', 'setmatrix', + 'setrgbcolor', 'shfill', 'show', 'showpage', 'sin', 'sqrt', + 'stack', 'stringwidth', 'stroke', 'strokepath', 'sub', 'syntaxerror', + 'transform', 'translate', 'truncate', 'typecheck', 'undefined', + 'undefinedfilename', 'undefinedresult'), suffix=delimiter_end), + Name.Builtin), + + (r'\s+', Whitespace), + ], + + 'stringliteral': [ + (r'[^()\\]+', String), + (r'\\', String.Escape, 'escape'), + (r'\(', String, '#push'), + (r'\)', String, '#pop'), + ], + + 'escape': [ + (r'[0-8]{3}|n|r|t|b|f|\\|\(|\)', String.Escape, '#pop'), + default('#pop'), + ], + } + + +class AsymptoteLexer(RegexLexer): + """ + For Asymptote source code. + """ + name = 'Asymptote' + url = 'http://asymptote.sf.net/' + aliases = ['asymptote', 'asy'] + filenames = ['*.asy'] + mimetypes = ['text/x-asymptote'] + version_added = '1.2' + + #: optional Comment or Whitespace + _ws = r'(?:\s|//.*?\n|/\*.*?\*/)+' + + tokens = { + 'whitespace': [ + (r'\n', Whitespace), + (r'\s+', Whitespace), + (r'(\\)(\n)', bygroups(Text, Whitespace)), # line continuation + (r'//(\n|(.|\n)*?[^\\]\n)', Comment), + (r'/(\\\n)?\*(.|\n)*?\*(\\\n)?/', Comment), + ], + 'statements': [ + # simple string (TeX friendly) + (r'"(\\\\|\\[^\\]|[^"\\])*"', String), + # C style string (with character escapes) + (r"'", String, 'string'), + (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[lL]?', Number.Float), + (r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float), + (r'0x[0-9a-fA-F]+[Ll]?', Number.Hex), + (r'0[0-7]+[Ll]?', Number.Oct), + (r'\d+[Ll]?', Number.Integer), + (r'[~!%^&*+=|?:<>/-]', Operator), + (r'[()\[\],.]', Punctuation), + (r'\b(case)(.+?)(:)', bygroups(Keyword, using(this), Text)), + (r'(and|controls|tension|atleast|curl|if|else|while|for|do|' + r'return|break|continue|struct|typedef|new|access|import|' + r'unravel|from|include|quote|static|public|private|restricted|' + r'this|explicit|true|false|null|cycle|newframe|operator)\b', Keyword), + # Since an asy-type-name can be also an asy-function-name, + # in the following we test if the string " [a-zA-Z]" follows + # the Keyword.Type. + # Of course it is not perfect ! + (r'(Braid|FitResult|Label|Legend|TreeNode|abscissa|arc|arrowhead|' + r'binarytree|binarytreeNode|block|bool|bool3|bounds|bqe|circle|' + r'conic|coord|coordsys|cputime|ellipse|file|filltype|frame|grid3|' + r'guide|horner|hsv|hyperbola|indexedTransform|int|inversion|key|' + r'light|line|linefit|marginT|marker|mass|object|pair|parabola|path|' + r'path3|pen|picture|point|position|projection|real|revolution|' + r'scaleT|scientific|segment|side|slice|splitface|string|surface|' + r'tensionSpecifier|ticklocate|ticksgridT|tickvalues|transform|' + r'transformation|tree|triangle|trilinear|triple|vector|' + r'vertex|void)(?=\s+[a-zA-Z])', Keyword.Type), + # Now the asy-type-name which are not asy-function-name + # except yours ! + # Perhaps useless + (r'(Braid|FitResult|TreeNode|abscissa|arrowhead|block|bool|bool3|' + r'bounds|coord|frame|guide|horner|int|linefit|marginT|pair|pen|' + r'picture|position|real|revolution|slice|splitface|ticksgridT|' + r'tickvalues|tree|triple|vertex|void)\b', Keyword.Type), + (r'[a-zA-Z_]\w*:(?!:)', Name.Label), + (r'[a-zA-Z_]\w*', Name), + ], + 'root': [ + include('whitespace'), + # functions + (r'((?:[\w*\s])+?(?:\s|\*))' # return arguments + r'([a-zA-Z_]\w*)' # method name + r'(\s*\([^;]*?\))' # signature + r'(' + _ws + r')(\{)', + bygroups(using(this), Name.Function, using(this), using(this), + Punctuation), + 'function'), + # function declarations + (r'((?:[\w*\s])+?(?:\s|\*))' # return arguments + r'([a-zA-Z_]\w*)' # method name + r'(\s*\([^;]*?\))' # signature + r'(' + _ws + r')(;)', + bygroups(using(this), Name.Function, using(this), using(this), + Punctuation)), + default('statement'), + ], + 'statement': [ + include('whitespace'), + include('statements'), + ('[{}]', Punctuation), + (';', Punctuation, '#pop'), + ], + 'function': [ + include('whitespace'), + include('statements'), + (';', Punctuation), + (r'\{', Punctuation, '#push'), + (r'\}', Punctuation, '#pop'), + ], + 'string': [ + (r"'", String, '#pop'), + (r'\\([\\abfnrtv"\'?]|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape), + (r'\n', String), + (r"[^\\'\n]+", String), # all other characters + (r'\\\n', String), + (r'\\n', String), # line continuation + (r'\\', String), # stray backslash + ], + } + + def get_tokens_unprocessed(self, text): + from pygments.lexers._asy_builtins import ASYFUNCNAME, ASYVARNAME + for index, token, value in \ + RegexLexer.get_tokens_unprocessed(self, text): + if token is Name and value in ASYFUNCNAME: + token = Name.Function + elif token is Name and value in ASYVARNAME: + token = Name.Variable + yield index, token, value + + +def _shortened(word): + dpos = word.find('$') + return '|'.join(word[:dpos] + word[dpos+1:i] + r'\b' + for i in range(len(word), dpos, -1)) + + +def _shortened_many(*words): + return '|'.join(map(_shortened, words)) + + +class GnuplotLexer(RegexLexer): + """ + For Gnuplot plotting scripts. + """ + + name = 'Gnuplot' + url = 'http://gnuplot.info/' + aliases = ['gnuplot'] + filenames = ['*.plot', '*.plt'] + mimetypes = ['text/x-gnuplot'] + version_added = '0.11' + + tokens = { + 'root': [ + include('whitespace'), + (_shortened('bi$nd'), Keyword, 'bind'), + (_shortened_many('ex$it', 'q$uit'), Keyword, 'quit'), + (_shortened('f$it'), Keyword, 'fit'), + (r'(if)(\s*)(\()', bygroups(Keyword, Text, Punctuation), 'if'), + (r'else\b', Keyword), + (_shortened('pa$use'), Keyword, 'pause'), + (_shortened_many('p$lot', 'rep$lot', 'sp$lot'), Keyword, 'plot'), + (_shortened('sa$ve'), Keyword, 'save'), + (_shortened('se$t'), Keyword, ('genericargs', 'optionarg')), + (_shortened_many('sh$ow', 'uns$et'), + Keyword, ('noargs', 'optionarg')), + (_shortened_many('low$er', 'ra$ise', 'ca$ll', 'cd$', 'cl$ear', + 'h$elp', '\\?$', 'hi$story', 'l$oad', 'pr$int', + 'pwd$', 're$read', 'res$et', 'scr$eendump', + 'she$ll', 'sy$stem', 'up$date'), + Keyword, 'genericargs'), + (_shortened_many('pwd$', 're$read', 'res$et', 'scr$eendump', + 'she$ll', 'test$'), + Keyword, 'noargs'), + (r'([a-zA-Z_]\w*)(\s*)(=)', + bygroups(Name.Variable, Whitespace, Operator), 'genericargs'), + (r'([a-zA-Z_]\w*)(\s*)(\()(.*?)(\))(\s*)(=)', + bygroups(Name.Function, Whitespace, Punctuation, + Text, Punctuation, Whitespace, Operator), 'genericargs'), + (r'@[a-zA-Z_]\w*', Name.Constant), # macros + (r';', Keyword), + ], + 'comment': [ + (r'[^\\\n]+', Comment), + (r'\\\n', Comment), + (r'\\', Comment), + # don't add the newline to the Comment token + default('#pop'), + ], + 'whitespace': [ + ('#', Comment, 'comment'), + (r'[ \t\v\f]+', Whitespace), + ], + 'noargs': [ + include('whitespace'), + # semicolon and newline end the argument list + (r';', Punctuation, '#pop'), + (r'\n', Whitespace, '#pop'), + ], + 'dqstring': [ + (r'"', String, '#pop'), + (r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape), + (r'[^\\"\n]+', String), # all other characters + (r'\\\n', String), # line continuation + (r'\\', String), # stray backslash + (r'\n', Whitespace, '#pop'), # newline ends the string too + ], + 'sqstring': [ + (r"''", String), # escaped single quote + (r"'", String, '#pop'), + (r"[^\\'\n]+", String), # all other characters + (r'\\\n', String), # line continuation + (r'\\', String), # normal backslash + (r'\n', Whitespace, '#pop'), # newline ends the string too + ], + 'genericargs': [ + include('noargs'), + (r'"', String, 'dqstring'), + (r"'", String, 'sqstring'), + (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+', Number.Float), + (r'(\d+\.\d*|\.\d+)', Number.Float), + (r'-?\d+', Number.Integer), + ('[,.~!%^&*+=|?:<>/-]', Operator), + (r'[{}()\[\]]', Punctuation), + (r'(eq|ne)\b', Operator.Word), + (r'([a-zA-Z_]\w*)(\s*)(\()', + bygroups(Name.Function, Text, Punctuation)), + (r'[a-zA-Z_]\w*', Name), + (r'@[a-zA-Z_]\w*', Name.Constant), # macros + (r'(\\)(\n)', bygroups(Text, Whitespace)), + ], + 'optionarg': [ + include('whitespace'), + (_shortened_many( + "a$ll", "an$gles", "ar$row", "au$toscale", "b$ars", "bor$der", + "box$width", "cl$abel", "c$lip", "cn$trparam", "co$ntour", "da$ta", + "data$file", "dg$rid3d", "du$mmy", "enc$oding", "dec$imalsign", + "fit$", "font$path", "fo$rmat", "fu$nction", "fu$nctions", "g$rid", + "hid$den3d", "his$torysize", "is$osamples", "k$ey", "keyt$itle", + "la$bel", "li$nestyle", "ls$", "loa$dpath", "loc$ale", "log$scale", + "mac$ros", "map$ping", "map$ping3d", "mar$gin", "lmar$gin", + "rmar$gin", "tmar$gin", "bmar$gin", "mo$use", "multi$plot", + "mxt$ics", "nomxt$ics", "mx2t$ics", "nomx2t$ics", "myt$ics", + "nomyt$ics", "my2t$ics", "nomy2t$ics", "mzt$ics", "nomzt$ics", + "mcbt$ics", "nomcbt$ics", "of$fsets", "or$igin", "o$utput", + "pa$rametric", "pm$3d", "pal$ette", "colorb$ox", "p$lot", + "poi$ntsize", "pol$ar", "pr$int", "obj$ect", "sa$mples", "si$ze", + "st$yle", "su$rface", "table$", "t$erminal", "termo$ptions", "ti$cs", + "ticsc$ale", "ticsl$evel", "timef$mt", "tim$estamp", "tit$le", + "v$ariables", "ve$rsion", "vi$ew", "xyp$lane", "xda$ta", "x2da$ta", + "yda$ta", "y2da$ta", "zda$ta", "cbda$ta", "xl$abel", "x2l$abel", + "yl$abel", "y2l$abel", "zl$abel", "cbl$abel", "xti$cs", "noxti$cs", + "x2ti$cs", "nox2ti$cs", "yti$cs", "noyti$cs", "y2ti$cs", "noy2ti$cs", + "zti$cs", "nozti$cs", "cbti$cs", "nocbti$cs", "xdti$cs", "noxdti$cs", + "x2dti$cs", "nox2dti$cs", "ydti$cs", "noydti$cs", "y2dti$cs", + "noy2dti$cs", "zdti$cs", "nozdti$cs", "cbdti$cs", "nocbdti$cs", + "xmti$cs", "noxmti$cs", "x2mti$cs", "nox2mti$cs", "ymti$cs", + "noymti$cs", "y2mti$cs", "noy2mti$cs", "zmti$cs", "nozmti$cs", + "cbmti$cs", "nocbmti$cs", "xr$ange", "x2r$ange", "yr$ange", + "y2r$ange", "zr$ange", "cbr$ange", "rr$ange", "tr$ange", "ur$ange", + "vr$ange", "xzeroa$xis", "x2zeroa$xis", "yzeroa$xis", "y2zeroa$xis", + "zzeroa$xis", "zeroa$xis", "z$ero"), Name.Builtin, '#pop'), + ], + 'bind': [ + ('!', Keyword, '#pop'), + (_shortened('all$windows'), Name.Builtin), + include('genericargs'), + ], + 'quit': [ + (r'gnuplot\b', Keyword), + include('noargs'), + ], + 'fit': [ + (r'via\b', Name.Builtin), + include('plot'), + ], + 'if': [ + (r'\)', Punctuation, '#pop'), + include('genericargs'), + ], + 'pause': [ + (r'(mouse|any|button1|button2|button3)\b', Name.Builtin), + (_shortened('key$press'), Name.Builtin), + include('genericargs'), + ], + 'plot': [ + (_shortened_many('ax$es', 'axi$s', 'bin$ary', 'ev$ery', 'i$ndex', + 'mat$rix', 's$mooth', 'thru$', 't$itle', + 'not$itle', 'u$sing', 'w$ith'), + Name.Builtin), + include('genericargs'), + ], + 'save': [ + (_shortened_many('f$unctions', 's$et', 't$erminal', 'v$ariables'), + Name.Builtin), + include('genericargs'), + ], + } + + +class PovrayLexer(RegexLexer): + """ + For Persistence of Vision Raytracer files. + """ + name = 'POVRay' + url = 'http://www.povray.org/' + aliases = ['pov'] + filenames = ['*.pov', '*.inc'] + mimetypes = ['text/x-povray'] + version_added = '0.11' + + tokens = { + 'root': [ + (r'/\*[\w\W]*?\*/', Comment.Multiline), + (r'//.*$', Comment.Single), + (r'(?s)"(?:\\.|[^"\\])+"', String.Double), + (words(( + 'break', 'case', 'debug', 'declare', 'default', 'define', 'else', + 'elseif', 'end', 'error', 'fclose', 'fopen', 'for', 'if', 'ifdef', + 'ifndef', 'include', 'local', 'macro', 'range', 'read', 'render', + 'statistics', 'switch', 'undef', 'version', 'warning', 'while', + 'write'), prefix=r'#', suffix=r'\b'), + Comment.Preproc), + (words(( + 'aa_level', 'aa_threshold', 'abs', 'acos', 'acosh', 'adaptive', 'adc_bailout', + 'agate', 'agate_turb', 'all', 'alpha', 'ambient', 'ambient_light', 'angle', + 'aperture', 'arc_angle', 'area_light', 'asc', 'asin', 'asinh', 'assumed_gamma', + 'atan', 'atan2', 'atanh', 'atmosphere', 'atmospheric_attenuation', + 'attenuating', 'average', 'background', 'black_hole', 'blue', 'blur_samples', + 'bounded_by', 'box_mapping', 'bozo', 'break', 'brick', 'brick_size', + 'brightness', 'brilliance', 'bumps', 'bumpy1', 'bumpy2', 'bumpy3', 'bump_map', + 'bump_size', 'case', 'caustics', 'ceil', 'checker', 'chr', 'clipped_by', 'clock', + 'color', 'color_map', 'colour', 'colour_map', 'component', 'composite', 'concat', + 'confidence', 'conic_sweep', 'constant', 'control0', 'control1', 'cos', 'cosh', + 'count', 'crackle', 'crand', 'cube', 'cubic_spline', 'cylindrical_mapping', + 'debug', 'declare', 'default', 'degrees', 'dents', 'diffuse', 'direction', + 'distance', 'distance_maximum', 'div', 'dust', 'dust_type', 'eccentricity', + 'else', 'emitting', 'end', 'error', 'error_bound', 'exp', 'exponent', + 'fade_distance', 'fade_power', 'falloff', 'falloff_angle', 'false', + 'file_exists', 'filter', 'finish', 'fisheye', 'flatness', 'flip', 'floor', + 'focal_point', 'fog', 'fog_alt', 'fog_offset', 'fog_type', 'frequency', 'gif', + 'global_settings', 'glowing', 'gradient', 'granite', 'gray_threshold', + 'green', 'halo', 'hexagon', 'hf_gray_16', 'hierarchy', 'hollow', 'hypercomplex', + 'if', 'ifdef', 'iff', 'image_map', 'incidence', 'include', 'int', 'interpolate', + 'inverse', 'ior', 'irid', 'irid_wavelength', 'jitter', 'lambda', 'leopard', + 'linear', 'linear_spline', 'linear_sweep', 'location', 'log', 'looks_like', + 'look_at', 'low_error_factor', 'mandel', 'map_type', 'marble', 'material_map', + 'matrix', 'max', 'max_intersections', 'max_iteration', 'max_trace_level', + 'max_value', 'metallic', 'min', 'minimum_reuse', 'mod', 'mortar', + 'nearest_count', 'no', 'normal', 'normal_map', 'no_shadow', 'number_of_waves', + 'octaves', 'off', 'offset', 'omega', 'omnimax', 'on', 'once', 'onion', 'open', + 'orthographic', 'panoramic', 'pattern1', 'pattern2', 'pattern3', + 'perspective', 'pgm', 'phase', 'phong', 'phong_size', 'pi', 'pigment', + 'pigment_map', 'planar_mapping', 'png', 'point_at', 'pot', 'pow', 'ppm', + 'precision', 'pwr', 'quadratic_spline', 'quaternion', 'quick_color', + 'quick_colour', 'quilted', 'radial', 'radians', 'radiosity', 'radius', 'rainbow', + 'ramp_wave', 'rand', 'range', 'reciprocal', 'recursion_limit', 'red', + 'reflection', 'refraction', 'render', 'repeat', 'rgb', 'rgbf', 'rgbft', 'rgbt', + 'right', 'ripples', 'rotate', 'roughness', 'samples', 'scale', 'scallop_wave', + 'scattering', 'seed', 'shadowless', 'sin', 'sine_wave', 'sinh', 'sky', 'sky_sphere', + 'slice', 'slope_map', 'smooth', 'specular', 'spherical_mapping', 'spiral', + 'spiral1', 'spiral2', 'spotlight', 'spotted', 'sqr', 'sqrt', 'statistics', 'str', + 'strcmp', 'strength', 'strlen', 'strlwr', 'strupr', 'sturm', 'substr', 'switch', 'sys', + 't', 'tan', 'tanh', 'test_camera_1', 'test_camera_2', 'test_camera_3', + 'test_camera_4', 'texture', 'texture_map', 'tga', 'thickness', 'threshold', + 'tightness', 'tile2', 'tiles', 'track', 'transform', 'translate', 'transmit', + 'triangle_wave', 'true', 'ttf', 'turbulence', 'turb_depth', 'type', + 'ultra_wide_angle', 'up', 'use_color', 'use_colour', 'use_index', 'u_steps', + 'val', 'variance', 'vaxis_rotate', 'vcross', 'vdot', 'version', 'vlength', + 'vnormalize', 'volume_object', 'volume_rendered', 'vol_with_light', + 'vrotate', 'v_steps', 'warning', 'warp', 'water_level', 'waves', 'while', 'width', + 'wood', 'wrinkles', 'yes'), prefix=r'\b', suffix=r'\b'), + Keyword), + (words(( + 'bicubic_patch', 'blob', 'box', 'camera', 'cone', 'cubic', 'cylinder', 'difference', + 'disc', 'height_field', 'intersection', 'julia_fractal', 'lathe', + 'light_source', 'merge', 'mesh', 'object', 'plane', 'poly', 'polygon', 'prism', + 'quadric', 'quartic', 'smooth_triangle', 'sor', 'sphere', 'superellipsoid', + 'text', 'torus', 'triangle', 'union'), suffix=r'\b'), + Name.Builtin), + (r'\b(x|y|z|u|v)\b', Name.Builtin.Pseudo), + (r'[a-zA-Z_]\w*', Name), + (r'[0-9]*\.[0-9]+', Number.Float), + (r'[0-9]+', Number.Integer), + (r'[\[\](){}<>;,]', Punctuation), + (r'[-+*/=.|&]|<=|>=|!=', Operator), + (r'"(\\\\|\\[^\\]|[^"\\])*"', String), + (r'\s+', Whitespace), + ] + } + + def analyse_text(text): + """POVRAY is similar to JSON/C, but the combination of camera and + light_source is probably not very likely elsewhere. HLSL or GLSL + are similar (GLSL even has #version), but they miss #declare, and + light_source/camera are not keywords anywhere else -- it's fair + to assume though that any POVRAY scene must have a camera and + lightsource.""" + result = 0 + if '#version' in text: + result += 0.05 + if '#declare' in text: + result += 0.05 + if 'camera' in text: + result += 0.05 + if 'light_source' in text: + result += 0.1 + + return result diff --git a/lib/python3.12/site-packages/pygments/lexers/hare.py b/lib/python3.12/site-packages/pygments/lexers/hare.py new file mode 100644 index 0000000000000000000000000000000000000000..56548d5e59f3ca0968d79f7e76cb67dc4ac817fd --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/hare.py @@ -0,0 +1,73 @@ +""" + pygments.lexers.hare + ~~~~~~~~~~~~~~~~~~~~ + + Lexers for the Hare language. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, include, words +from pygments.token import Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Whitespace + +__all__ = ['HareLexer'] + +class HareLexer(RegexLexer): + """ + Lexer for the Hare programming language. + """ + name = 'Hare' + url = 'https://harelang.org/' + aliases = ['hare'] + filenames = ['*.ha'] + mimetypes = ['text/x-hare'] + version_added = '2.19' + + _ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+' + _ws1 = r'\s*(?:/[*].*?[*]/\s*)?' + + tokens = { + 'whitespace': [ + (r'^use.*;', Comment.Preproc), + (r'@[a-z]+', Comment.Preproc), + (r'\n', Whitespace), + (r'\s+', Whitespace), + (r'//.*?$', Comment.Single), + ], + 'statements': [ + (r'"', String, 'string'), + (r'`[^`]*`', String), + (r"'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'", String.Char), + (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*', Number.Float), + (r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float), + (r'0x[0-9a-fA-F]+[LlUu]*', Number.Hex), + (r'0o[0-7]+[LlUu]*', Number.Oct), + (r'\d+[zui]?(\d+)?', Number.Integer), + (r'[~!%^&*+=|?:<>/-]', Operator), + (words(('as', 'is', '=>', '..', '...')), Operator), + (r'[()\[\],.{};]+', Punctuation), + (words(('abort', 'align', 'alloc', 'append', 'assert', 'case', + 'const', 'def', 'defer', 'delete', 'else', 'enum', 'export', + 'fn', 'for', 'free', 'if', 'let', 'len', 'match', 'offset', + 'return', 'static', 'struct', 'switch', 'type', 'union', + 'yield', 'vastart', 'vaarg', 'vaend'), + suffix=r'\b'), Keyword), + (r'(bool|int|uint|uintptr|u8|u16|u32|u64|i8|i16|i32|i64|f32|f64|null|done|never|void|nullable|rune|size|valist)\b', + Keyword.Type), + (r'(true|false|null)\b', Name.Builtin), + (r'[a-zA-Z_]\w*', Name), + ], + 'string': [ + (r'"', String, '#pop'), + (r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|' + r'u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|[0-7]{1,3})', String.Escape), + (r'[^\\"\n]+', String), # all other characters + (r'\\', String), # stray backslash + ], + 'root': [ + include('whitespace'), + include('statements'), + ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/hexdump.py b/lib/python3.12/site-packages/pygments/lexers/hexdump.py new file mode 100644 index 0000000000000000000000000000000000000000..4da4edb6af7bbb2855a923b0fdc618a9054e988c --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/hexdump.py @@ -0,0 +1,102 @@ +""" + pygments.lexers.hexdump + ~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for hexadecimal dumps. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, bygroups, include +from pygments.token import Name, Number, String, Punctuation, Whitespace + +__all__ = ['HexdumpLexer'] + + +class HexdumpLexer(RegexLexer): + """ + For typical hex dump output formats by the UNIX and GNU/Linux tools ``hexdump``, + ``hd``, ``hexcat``, ``od`` and ``xxd``, and the DOS tool ``DEBUG``. For example: + + .. sourcecode:: hexdump + + 00000000 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 |.ELF............| + 00000010 02 00 3e 00 01 00 00 00 c5 48 40 00 00 00 00 00 |..>......H@.....| + + The specific supported formats are the outputs of: + + * ``hexdump FILE`` + * ``hexdump -C FILE`` -- the `canonical` format used in the example. + * ``hd FILE`` -- same as ``hexdump -C FILE``. + * ``hexcat FILE`` + * ``od -t x1z FILE`` + * ``xxd FILE`` + * ``DEBUG.EXE FILE.COM`` and entering ``d`` to the prompt. + """ + name = 'Hexdump' + aliases = ['hexdump'] + url = 'https://en.wikipedia.org/wiki/Hex_dump' + version_added = '2.1' + + hd = r'[0-9A-Ha-h]' + + tokens = { + 'root': [ + (r'\n', Whitespace), + include('offset'), + (r'('+hd+r'{2})(\-)('+hd+r'{2})', + bygroups(Number.Hex, Punctuation, Number.Hex)), + (hd+r'{2}', Number.Hex), + (r'(\s{2,3})(\>)(.{16})(\<)$', + bygroups(Whitespace, Punctuation, String, Punctuation), 'bracket-strings'), + (r'(\s{2,3})(\|)(.{16})(\|)$', + bygroups(Whitespace, Punctuation, String, Punctuation), 'piped-strings'), + (r'(\s{2,3})(\>)(.{1,15})(\<)$', + bygroups(Whitespace, Punctuation, String, Punctuation)), + (r'(\s{2,3})(\|)(.{1,15})(\|)$', + bygroups(Whitespace, Punctuation, String, Punctuation)), + (r'(\s{2,3})(.{1,15})$', bygroups(Whitespace, String)), + (r'(\s{2,3})(.{16}|.{20})$', bygroups(Whitespace, String), 'nonpiped-strings'), + (r'\s', Whitespace), + (r'^\*', Punctuation), + ], + 'offset': [ + (r'^('+hd+'+)(:)', bygroups(Name.Label, Punctuation), 'offset-mode'), + (r'^'+hd+'+', Name.Label), + ], + 'offset-mode': [ + (r'\s', Whitespace, '#pop'), + (hd+'+', Name.Label), + (r':', Punctuation) + ], + 'piped-strings': [ + (r'\n', Whitespace), + include('offset'), + (hd+r'{2}', Number.Hex), + (r'(\s{2,3})(\|)(.{1,16})(\|)$', + bygroups(Whitespace, Punctuation, String, Punctuation)), + (r'\s', Whitespace), + (r'^\*', Punctuation), + ], + 'bracket-strings': [ + (r'\n', Whitespace), + include('offset'), + (hd+r'{2}', Number.Hex), + (r'(\s{2,3})(\>)(.{1,16})(\<)$', + bygroups(Whitespace, Punctuation, String, Punctuation)), + (r'\s', Whitespace), + (r'^\*', Punctuation), + ], + 'nonpiped-strings': [ + (r'\n', Whitespace), + include('offset'), + (r'('+hd+r'{2})(\-)('+hd+r'{2})', + bygroups(Number.Hex, Punctuation, Number.Hex)), + (hd+r'{2}', Number.Hex), + (r'(\s{19,})(.{1,20}?)$', bygroups(Whitespace, String)), + (r'(\s{2,3})(.{1,20})$', bygroups(Whitespace, String)), + (r'\s', Whitespace), + (r'^\*', Punctuation), + ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/installers.py b/lib/python3.12/site-packages/pygments/lexers/installers.py new file mode 100644 index 0000000000000000000000000000000000000000..3f12a25b2ce4d64b9e9af1950b35cbd5cbcfee47 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/installers.py @@ -0,0 +1,352 @@ +""" + pygments.lexers.installers + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for installer/packager DSLs and formats. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, include, bygroups, using, this, default +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Punctuation, Generic, Number, Whitespace + +__all__ = ['NSISLexer', 'RPMSpecLexer', + 'DebianSourcesLexer', 'SourcesListLexer', + 'DebianControlLexer'] + + +class NSISLexer(RegexLexer): + """ + For NSIS scripts. + """ + name = 'NSIS' + url = 'http://nsis.sourceforge.net/' + aliases = ['nsis', 'nsi', 'nsh'] + filenames = ['*.nsi', '*.nsh'] + mimetypes = ['text/x-nsis'] + version_added = '1.6' + + flags = re.IGNORECASE + + tokens = { + 'root': [ + (r'([;#].*)(\n)', bygroups(Comment, Whitespace)), + (r"'.*?'", String.Single), + (r'"', String.Double, 'str_double'), + (r'`', String.Backtick, 'str_backtick'), + include('macro'), + include('interpol'), + include('basic'), + (r'\$\{[a-z_|][\w|]*\}', Keyword.Pseudo), + (r'/[a-z_]\w*', Name.Attribute), + (r'\s+', Whitespace), + (r'[\w.]+', Text), + ], + 'basic': [ + (r'(\n)(Function)(\s+)([._a-z][.\w]*)\b', + bygroups(Whitespace, Keyword, Whitespace, Name.Function)), + (r'\b([_a-z]\w*)(::)([a-z][a-z0-9]*)\b', + bygroups(Keyword.Namespace, Punctuation, Name.Function)), + (r'\b([_a-z]\w*)(:)', bygroups(Name.Label, Punctuation)), + (r'(\b[ULS]|\B)([!<>=]?=|\<\>?|\>)\B', Operator), + (r'[|+-]', Operator), + (r'\\', Punctuation), + (r'\b(Abort|Add(?:BrandingImage|Size)|' + r'Allow(?:RootDirInstall|SkipFiles)|AutoCloseWindow|' + r'BG(?:Font|Gradient)|BrandingText|BringToFront|Call(?:InstDLL)?|' + r'(?:Sub)?Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|' + r'ComponentText|CopyFiles|CRCCheck|' + r'Create(?:Directory|Font|Shortcut)|Delete(?:INI(?:Sec|Str)|' + r'Reg(?:Key|Value))?|DetailPrint|DetailsButtonText|' + r'Dir(?:Show|Text|Var|Verify)|(?:Disabled|Enabled)Bitmap|' + r'EnableWindow|EnumReg(?:Key|Value)|Exch|Exec(?:Shell|Wait)?|' + r'ExpandEnvStrings|File(?:BufSize|Close|ErrorText|Open|' + r'Read(?:Byte)?|Seek|Write(?:Byte)?)?|' + r'Find(?:Close|First|Next|Window)|FlushINI|Function(?:End)?|' + r'Get(?:CurInstType|CurrentAddress|DlgItem|DLLVersion(?:Local)?|' + r'ErrorLevel|FileTime(?:Local)?|FullPathName|FunctionAddress|' + r'InstDirError|LabelAddress|TempFileName)|' + r'Goto|HideWindow|Icon|' + r'If(?:Abort|Errors|FileExists|RebootFlag|Silent)|' + r'InitPluginsDir|Install(?:ButtonText|Colors|Dir(?:RegKey)?)|' + r'Inst(?:ProgressFlags|Type(?:[GS]etText)?)|Int(?:CmpU?|Fmt|Op)|' + r'IsWindow|LangString(?:UP)?|' + r'License(?:BkColor|Data|ForceSelection|LangString|Text)|' + r'LoadLanguageFile|LockWindow|Log(?:Set|Text)|MessageBox|' + r'MiscButtonText|Name|Nop|OutFile|(?:Uninst)?Page(?:Ex(?:End)?)?|' + r'PluginDir|Pop|Push|Quit|Read(?:(?:Env|INI|Reg)Str|RegDWORD)|' + r'Reboot|(?:Un)?RegDLL|Rename|RequestExecutionLevel|ReserveFile|' + r'Return|RMDir|SearchPath|Section(?:Divider|End|' + r'(?:(?:Get|Set)(?:Flags|InstTypes|Size|Text))|Group(?:End)?|In)?|' + r'SendMessage|Set(?:AutoClose|BrandingImage|Compress(?:ionLevel|' + r'or(?:DictSize)?)?|CtlColors|CurInstType|DatablockOptimize|' + r'DateSave|Details(?:Print|View)|Error(?:s|Level)|FileAttributes|' + r'Font|OutPath|Overwrite|PluginUnload|RebootFlag|ShellVarContext|' + r'Silent|StaticBkColor)|' + r'Show(?:(?:I|Uni)nstDetails|Window)|Silent(?:Un)?Install|Sleep|' + r'SpaceTexts|Str(?:CmpS?|Cpy|Len)|SubSection(?:End)?|' + r'Uninstall(?:ButtonText|(?:Sub)?Caption|EXEName|Icon|Text)|' + r'UninstPage|Var|VI(?:AddVersionKey|ProductVersion)|WindowIcon|' + r'Write(?:INIStr|Reg(:?Bin|DWORD|(?:Expand)?Str)|Uninstaller)|' + r'XPStyle)\b', Keyword), + (r'\b(CUR|END|(?:FILE_ATTRIBUTE_)?' + r'(?:ARCHIVE|HIDDEN|NORMAL|OFFLINE|READONLY|SYSTEM|TEMPORARY)|' + r'HK(CC|CR|CU|DD|LM|PD|U)|' + r'HKEY_(?:CLASSES_ROOT|CURRENT_(?:CONFIG|USER)|DYN_DATA|' + r'LOCAL_MACHINE|PERFORMANCE_DATA|USERS)|' + r'ID(?:ABORT|CANCEL|IGNORE|NO|OK|RETRY|YES)|' + r'MB_(?:ABORTRETRYIGNORE|DEFBUTTON[1-4]|' + r'ICON(?:EXCLAMATION|INFORMATION|QUESTION|STOP)|' + r'OK(?:CANCEL)?|RETRYCANCEL|RIGHT|SETFOREGROUND|TOPMOST|USERICON|' + r'YESNO(?:CANCEL)?)|SET|SHCTX|' + r'SW_(?:HIDE|SHOW(?:MAXIMIZED|MINIMIZED|NORMAL))|' + r'admin|all|auto|both|bottom|bzip2|checkbox|colored|current|false|' + r'force|hide|highest|if(?:diff|newer)|lastused|leave|left|' + r'listonly|lzma|nevershow|none|normal|off|on|pop|push|' + r'radiobuttons|right|show|silent|silentlog|smooth|textonly|top|' + r'true|try|user|zlib)\b', Name.Constant), + ], + 'macro': [ + (r'\!(addincludedir(?:dir)?|addplugindir|appendfile|cd|define|' + r'delfilefile|echo(?:message)?|else|endif|error|execute|' + r'if(?:macro)?n?(?:def)?|include|insertmacro|macro(?:end)?|packhdr|' + r'search(?:parse|replace)|system|tempfilesymbol|undef|verbose|' + r'warning)\b', Comment.Preproc), + ], + 'interpol': [ + (r'\$(R?[0-9])', Name.Builtin.Pseudo), # registers + (r'\$(ADMINTOOLS|APPDATA|CDBURN_AREA|COOKIES|COMMONFILES(?:32|64)|' + r'DESKTOP|DOCUMENTS|EXE(?:DIR|FILE|PATH)|FAVORITES|FONTS|HISTORY|' + r'HWNDPARENT|INTERNET_CACHE|LOCALAPPDATA|MUSIC|NETHOOD|PICTURES|' + r'PLUGINSDIR|PRINTHOOD|PROFILE|PROGRAMFILES(?:32|64)|QUICKLAUNCH|' + r'RECENT|RESOURCES(?:_LOCALIZED)?|SENDTO|SM(?:PROGRAMS|STARTUP)|' + r'STARTMENU|SYSDIR|TEMP(?:LATES)?|VIDEOS|WINDIR|\{NSISDIR\})', + Name.Builtin), + (r'\$(CMDLINE|INSTDIR|OUTDIR|LANGUAGE)', Name.Variable.Global), + (r'\$[a-z_]\w*', Name.Variable), + ], + 'str_double': [ + (r'"', String.Double, '#pop'), + (r'\$(\\[nrt"]|\$)', String.Escape), + include('interpol'), + (r'[^"]+', String.Double), + ], + 'str_backtick': [ + (r'`', String.Double, '#pop'), + (r'\$(\\[nrt"]|\$)', String.Escape), + include('interpol'), + (r'[^`]+', String.Double), + ], + } + + +class RPMSpecLexer(RegexLexer): + """ + For RPM ``.spec`` files. + """ + + name = 'RPMSpec' + aliases = ['spec'] + filenames = ['*.spec'] + mimetypes = ['text/x-rpm-spec'] + url = 'https://rpm-software-management.github.io/rpm/manual/spec.html' + version_added = '1.6' + + _directives = ('(?:package|prep|build|install|clean|check|pre[a-z]*|' + 'post[a-z]*|trigger[a-z]*|files)') + + tokens = { + 'root': [ + (r'#.*$', Comment), + include('basic'), + ], + 'description': [ + (r'^(%' + _directives + ')(.*)$', + bygroups(Name.Decorator, Text), '#pop'), + (r'\s+', Whitespace), + (r'.', Text), + ], + 'changelog': [ + (r'\*.*$', Generic.Subheading), + (r'^(%' + _directives + ')(.*)$', + bygroups(Name.Decorator, Text), '#pop'), + (r'\s+', Whitespace), + (r'.', Text), + ], + 'string': [ + (r'"', String.Double, '#pop'), + (r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape), + include('interpol'), + (r'.', String.Double), + ], + 'basic': [ + include('macro'), + (r'(?i)^(Name|Version|Release|Epoch|Summary|Group|License|Packager|' + r'Vendor|Icon|URL|Distribution|Prefix|Patch[0-9]*|Source[0-9]*|' + r'Requires\(?[a-z]*\)?|[a-z]+Req|Obsoletes|Suggests|Provides|Conflicts|' + r'Build[a-z]+|[a-z]+Arch|Auto[a-z]+)(:)(.*)$', + bygroups(Generic.Heading, Punctuation, using(this))), + (r'^%description', Name.Decorator, 'description'), + (r'^%changelog', Name.Decorator, 'changelog'), + (r'^(%' + _directives + ')(.*)$', bygroups(Name.Decorator, Text)), + (r'%(attr|defattr|dir|doc(?:dir)?|setup|config(?:ure)?|' + r'make(?:install)|ghost|patch[0-9]+|find_lang|exclude|verify)', + Keyword), + include('interpol'), + (r"'.*?'", String.Single), + (r'"', String.Double, 'string'), + (r'\s+', Whitespace), + (r'.', Text), + ], + 'macro': [ + (r'%define.*$', Comment.Preproc), + (r'%\{\!\?.*%define.*\}', Comment.Preproc), + (r'(%(?:if(?:n?arch)?|else(?:if)?|endif))(.*)$', + bygroups(Comment.Preproc, Text)), + ], + 'interpol': [ + (r'%\{?__[a-z_]+\}?', Name.Function), + (r'%\{?_([a-z_]+dir|[a-z_]+path|prefix)\}?', Keyword.Pseudo), + (r'%\{\?\w+\}', Name.Variable), + (r'\$\{?RPM_[A-Z0-9_]+\}?', Name.Variable.Global), + (r'%\{[a-zA-Z]\w+\}', Keyword.Constant), + ] + } + + +class DebianSourcesLexer(RegexLexer): + """ + Lexer that highlights debian.sources files. + """ + + name = 'Debian Sources file' + aliases = ['debian.sources'] + filenames = ['*.sources'] + version_added = '2.19' + url = 'https://manpages.debian.org/bookworm/apt/sources.list.5.en.html#THE_DEB_AND_DEB-SRC_TYPES:_GENERAL_FORMAT' + + tokens = { + 'root': [ + (r'^(Signed-By)(:)(\s*)', bygroups(Keyword, Punctuation, Whitespace), 'signed-by'), + (r'^([a-zA-Z\-0-9\.]*?)(:)(\s*)(.*?)$', + bygroups(Keyword, Punctuation, Whitespace, String)), + ], + 'signed-by': [ + (r' -----END PGP PUBLIC KEY BLOCK-----\n', Text, '#pop'), + (r'.+\n', Text), + ], + } + + +class SourcesListLexer(RegexLexer): + """ + Lexer that highlights debian sources.list files. + """ + + name = 'Debian Sourcelist' + aliases = ['debsources', 'sourceslist', 'sources.list'] + filenames = ['sources.list'] + version_added = '0.7' + mimetype = ['application/x-debian-sourceslist'] + url = 'https://wiki.debian.org/SourcesList' + + tokens = { + 'root': [ + (r'\s+', Whitespace), + (r'#.*?$', Comment), + (r'^(deb(?:-src)?)(\s+)', + bygroups(Keyword, Whitespace), 'distribution') + ], + 'distribution': [ + (r'#.*?$', Comment, '#pop'), + (r'\$\(ARCH\)', Name.Variable), + (r'[^\s$[]+', String), + (r'\[', String.Other, 'escaped-distribution'), + (r'\$', String), + (r'\s+', Whitespace, 'components') + ], + 'escaped-distribution': [ + (r'\]', String.Other, '#pop'), + (r'\$\(ARCH\)', Name.Variable), + (r'[^\]$]+', String.Other), + (r'\$', String.Other) + ], + 'components': [ + (r'#.*?$', Comment, '#pop:2'), + (r'$', Text, '#pop:2'), + (r'\s+', Whitespace), + (r'\S+', Keyword.Pseudo), + ] + } + + def analyse_text(text): + for line in text.splitlines(): + line = line.strip() + if line.startswith('deb ') or line.startswith('deb-src '): + return True + + +class DebianControlLexer(RegexLexer): + """ + Lexer for Debian ``control`` files and ``apt-cache show `` outputs. + """ + name = 'Debian Control file' + url = 'https://www.debian.org/doc/debian-policy/ch-controlfields.html' + aliases = ['debcontrol', 'control'] + filenames = ['control'] + version_added = '0.9' + + tokens = { + 'root': [ + (r'^(Description)', Keyword, 'description'), + (r'^(Maintainer|Uploaders|Changed-By)(:)(\s*)', + bygroups(Keyword, Punctuation, Whitespace), + 'maintainer'), + (r'^((?:Build-|Pre-)?Depends(?:-Indep|-Arch)?)(:)(\s*)', + bygroups(Keyword, Punctuation, Whitespace), 'package_list'), + (r'^(Recommends|Suggests|Enhances|Breaks|Replaces|Provides|Conflicts)(:)(\s*)', + bygroups(Keyword, Punctuation, Whitespace), 'package_list'), + (r'^((?:Python-)?Version)(:)(\s*)(\S+)$', + bygroups(Keyword, Punctuation, Whitespace, Number)), + (r'^((?:Installed-)?Size)(:)(\s*)(\S+)$', + bygroups(Keyword, Punctuation, Whitespace, Number)), + (r'^(MD5Sum|SHA1|SHA256)(:)(\s*)(\S+)$', + bygroups(Keyword, Punctuation, Whitespace, Number)), + (r'^([a-zA-Z\-0-9\.]*?)(:)(\s*)(.*?)$', + bygroups(Keyword, Punctuation, Whitespace, String)), + ], + 'maintainer': [ + (r'<[^>]+>$', Generic.Strong, '#pop'), + (r'<[^>]+>', Generic.Strong), + (r',\n?', Whitespace), + (r'[^,<]+$', Text, '#pop'), + (r'[^,<]+', Text), + ], + 'description': [ + (r'(.*)(Homepage)(: )(\S+)', + bygroups(Text, String, Name, Name.Class)), + (r':.*\n', Generic.Strong), + (r' .*\n', Text), + default('#pop'), + ], + 'package_list': [ + (r'(\$)(\{)(\w+)(\s*)(:)(\s*)(\w+)(\})', + bygroups(Operator, Punctuation, Name.Entity, Whitespace, + Punctuation, Whitespace, Text, Punctuation)), + (r'\(', Punctuation, 'package_list_vers'), + (r'\|', Operator), + (r'\n\s', Whitespace), + (r'\n', Whitespace, '#pop'), + (r'[,\s]', Text), + (r'[+.a-zA-Z0-9-]+', Name.Function), + (r'\[.*?\]', Name.Entity), + ], + 'package_list_vers': [ + (r'\)', Punctuation, '#pop'), + (r'([><=]+)(\s*)([^)]+)', bygroups(Operator, Whitespace, Number)), + ] + } diff --git a/lib/python3.12/site-packages/pygments/lexers/iolang.py b/lib/python3.12/site-packages/pygments/lexers/iolang.py new file mode 100644 index 0000000000000000000000000000000000000000..0269384fac1ac51eb6c0fff6c0d2a380a7b3b887 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/iolang.py @@ -0,0 +1,61 @@ +""" + pygments.lexers.iolang + ~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for the Io language. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer +from pygments.token import Comment, Operator, Keyword, Name, String, Number, \ + Whitespace + +__all__ = ['IoLexer'] + + +class IoLexer(RegexLexer): + """ + For Io (a small, prototype-based programming language) source. + """ + name = 'Io' + url = 'http://iolanguage.com/' + filenames = ['*.io'] + aliases = ['io'] + mimetypes = ['text/x-iosrc'] + version_added = '0.10' + tokens = { + 'root': [ + (r'\n', Whitespace), + (r'\s+', Whitespace), + # Comments + (r'//(.*?)$', Comment.Single), + (r'#(.*?)$', Comment.Single), + (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline), + (r'/\+', Comment.Multiline, 'nestedcomment'), + # DoubleQuotedString + (r'"(\\\\|\\[^\\]|[^"\\])*"', String), + # Operators + (r'::=|:=|=|\(|\)|;|,|\*|-|\+|>|<|@|!|/|\||\^|\.|%|&|\[|\]|\{|\}', + Operator), + # keywords + (r'(clone|do|doFile|doString|method|for|if|else|elseif|then)\b', + Keyword), + # constants + (r'(nil|false|true)\b', Name.Constant), + # names + (r'(Object|list|List|Map|args|Sequence|Coroutine|File)\b', + Name.Builtin), + (r'[a-zA-Z_]\w*', Name), + # numbers + (r'(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float), + (r'\d+', Number.Integer) + ], + 'nestedcomment': [ + (r'[^+/]+', Comment.Multiline), + (r'/\+', Comment.Multiline, '#push'), + (r'\+/', Comment.Multiline, '#pop'), + (r'[+/]', Comment.Multiline), + ] + } diff --git a/lib/python3.12/site-packages/pygments/lexers/jsonnet.py b/lib/python3.12/site-packages/pygments/lexers/jsonnet.py new file mode 100644 index 0000000000000000000000000000000000000000..f9aa5953f0ed95a3f8ff214e054ff30dff9285e3 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/jsonnet.py @@ -0,0 +1,169 @@ +""" + pygments.lexers.jsonnet + ~~~~~~~~~~~~~~~~~~~~~~~ + + Lexer for Jsonnet data templating language. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import include, RegexLexer, words +from pygments.token import Comment, Keyword, Name, Number, Operator, \ + Punctuation, String, Text, Whitespace + +__all__ = ['JsonnetLexer'] + +jsonnet_token = r'[^\W\d]\w*' +jsonnet_function_token = jsonnet_token + r'(?=\()' + + +def string_rules(quote_mark): + return [ + (rf"[^{quote_mark}\\]", String), + (r"\\.", String.Escape), + (quote_mark, String, '#pop'), + ] + + +def quoted_field_name(quote_mark): + return [ + (rf'([^{quote_mark}\\]|\\.)*{quote_mark}', + Name.Variable, 'field_separator') + ] + + +class JsonnetLexer(RegexLexer): + """Lexer for Jsonnet source code.""" + + name = 'Jsonnet' + aliases = ['jsonnet'] + filenames = ['*.jsonnet', '*.libsonnet'] + url = "https://jsonnet.org" + version_added = '' + tokens = { + # Not used by itself + '_comments': [ + (r'(//|#).*\n', Comment.Single), + (r'/\*\*([^/]|/(?!\*))*\*/', String.Doc), + (r'/\*([^/]|/(?!\*))*\*/', Comment), + ], + 'root': [ + include('_comments'), + (r"@'.*'", String), + (r'@".*"', String), + (r"'", String, 'singlestring'), + (r'"', String, 'doublestring'), + (r'\|\|\|(.|\n)*\|\|\|', String), + # Jsonnet has no integers, only an IEEE754 64-bit float + (r'[+-]?[0-9]+(.[0-9])?', Number.Float), + # Omit : despite spec because it appears to be used as a field + # separator + (r'[!$~+\-&|^=<>*/%]', Operator), + (r'\{', Punctuation, 'object'), + (r'\[', Punctuation, 'array'), + (r'local\b', Keyword, ('local_name')), + (r'assert\b', Keyword, 'assert'), + (words([ + 'assert', 'else', 'error', 'false', 'for', 'if', 'import', + 'importstr', 'in', 'null', 'tailstrict', 'then', 'self', + 'super', 'true', + ], suffix=r'\b'), Keyword), + (r'\s+', Whitespace), + (r'function(?=\()', Keyword, 'function_params'), + (r'std\.' + jsonnet_function_token, Name.Builtin, 'function_args'), + (jsonnet_function_token, Name.Function, 'function_args'), + (jsonnet_token, Name.Variable), + (r'[\.()]', Punctuation), + ], + 'singlestring': string_rules("'"), + 'doublestring': string_rules('"'), + 'array': [ + (r',', Punctuation), + (r'\]', Punctuation, '#pop'), + include('root'), + ], + 'local_name': [ + (jsonnet_function_token, Name.Function, 'function_params'), + (jsonnet_token, Name.Variable), + (r'\s+', Whitespace), + ('(?==)', Whitespace, ('#pop', 'local_value')), + ], + 'local_value': [ + (r'=', Operator), + (r';', Punctuation, '#pop'), + include('root'), + ], + 'assert': [ + (r':', Punctuation), + (r';', Punctuation, '#pop'), + include('root'), + ], + 'function_params': [ + (jsonnet_token, Name.Variable), + (r'\(', Punctuation), + (r'\)', Punctuation, '#pop'), + (r',', Punctuation), + (r'\s+', Whitespace), + (r'=', Operator, 'function_param_default'), + ], + 'function_args': [ + (r'\(', Punctuation), + (r'\)', Punctuation, '#pop'), + (r',', Punctuation), + (r'\s+', Whitespace), + include('root'), + ], + 'object': [ + (r'\s+', Whitespace), + (r'local\b', Keyword, 'object_local_name'), + (r'assert\b', Keyword, 'object_assert'), + (r'\[', Operator, 'field_name_expr'), + (fr'(?={jsonnet_token})', Text, 'field_name'), + (r'\}', Punctuation, '#pop'), + (r'"', Name.Variable, 'double_field_name'), + (r"'", Name.Variable, 'single_field_name'), + include('_comments'), + ], + 'field_name': [ + (jsonnet_function_token, Name.Function, + ('field_separator', 'function_params') + ), + (jsonnet_token, Name.Variable, 'field_separator'), + ], + 'double_field_name': quoted_field_name('"'), + 'single_field_name': quoted_field_name("'"), + 'field_name_expr': [ + (r'\]', Operator, 'field_separator'), + include('root'), + ], + 'function_param_default': [ + (r'(?=[,\)])', Whitespace, '#pop'), + include('root'), + ], + 'field_separator': [ + (r'\s+', Whitespace), + (r'\+?::?:?', Punctuation, ('#pop', '#pop', 'field_value')), + include('_comments'), + ], + 'field_value': [ + (r',', Punctuation, '#pop'), + (r'\}', Punctuation, '#pop:2'), + include('root'), + ], + 'object_assert': [ + (r':', Punctuation), + (r',', Punctuation, '#pop'), + include('root'), + ], + 'object_local_name': [ + (jsonnet_token, Name.Variable, ('#pop', 'object_local_value')), + (r'\s+', Whitespace), + ], + 'object_local_value': [ + (r'=', Operator), + (r',', Punctuation, '#pop'), + (r'\}', Punctuation, '#pop:2'), + include('root'), + ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/jsx.py b/lib/python3.12/site-packages/pygments/lexers/jsx.py new file mode 100644 index 0000000000000000000000000000000000000000..6124d8c00ec6313a08c511aa60f636e502e0774d --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/jsx.py @@ -0,0 +1,100 @@ +""" + pygments.lexers.jsx + ~~~~~~~~~~~~~~~~~~~ + + Lexers for JSX (React) and TSX (TypeScript flavor). + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import bygroups, default, include, inherit +from pygments.lexers.javascript import JavascriptLexer, TypeScriptLexer +from pygments.token import Name, Operator, Punctuation, String, Text, \ + Whitespace + +__all__ = ['JsxLexer', 'TsxLexer'] + +_JSX_RULES = { + "jsx": [ + (r"", Punctuation), # JSXFragment <>| + (r"(<)(\w+)(\.?)", bygroups(Punctuation, Name.Tag, Punctuation), "tag"), + ( + r"()", + bygroups(Punctuation, Name.Tag, Punctuation), + ), + ( + r"()", bygroups(Punctuation, Text, Punctuation), "#pop"), + ], + "fragment": [ + (r"(.)(\w+)", bygroups(Punctuation, Name.Attribute)), + (r"(>)", bygroups(Punctuation), "#pop"), + ], + "attr": [ + (r"\{", Punctuation, "expression"), + (r'".*?"', String, "#pop"), + (r"'.*?'", String, "#pop"), + default("#pop"), + ], + "expression": [ + (r"\{", Punctuation, "#push"), + (r"\}", Punctuation, "#pop"), + include("root"), + ], +} + + +class JsxLexer(JavascriptLexer): + """For JavaScript Syntax Extension (JSX). + """ + + name = "JSX" + aliases = ["jsx", "react"] + filenames = ["*.jsx", "*.react"] + mimetypes = ["text/jsx", "text/typescript-jsx"] + url = "https://facebook.github.io/jsx/" + version_added = '2.17' + + flags = re.MULTILINE | re.DOTALL + + # Use same tokens as `JavascriptLexer`, but with tags and attributes support + tokens = { + "root": [ + include("jsx"), + inherit, + ], + **_JSX_RULES} + + +class TsxLexer(TypeScriptLexer): + """For TypeScript with embedded JSX + """ + + name = "TSX" + aliases = ["tsx"] + filenames = ["*.tsx"] + mimetypes = ["text/typescript-tsx"] + url = "https://www.typescriptlang.org/docs/handbook/jsx.html" + version_added = '2.19' + + flags = re.MULTILINE | re.DOTALL + + # Use same tokens as `TypescriptLexer`, but with tags and attributes support + tokens = { + "root": [ + include("jsx"), + inherit, + ], + **_JSX_RULES} diff --git a/lib/python3.12/site-packages/pygments/lexers/julia.py b/lib/python3.12/site-packages/pygments/lexers/julia.py new file mode 100644 index 0000000000000000000000000000000000000000..77d8bafcdb250c630f8223ffbbdf46fbdef8ac38 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/julia.py @@ -0,0 +1,294 @@ +""" + pygments.lexers.julia + ~~~~~~~~~~~~~~~~~~~~~ + + Lexers for the Julia language. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import Lexer, RegexLexer, bygroups, do_insertions, \ + words, include +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Generic, Whitespace +from pygments.util import shebang_matches +from pygments.lexers._julia_builtins import OPERATORS_LIST, DOTTED_OPERATORS_LIST, \ + KEYWORD_LIST, BUILTIN_LIST, LITERAL_LIST + +__all__ = ['JuliaLexer', 'JuliaConsoleLexer'] + +# see https://docs.julialang.org/en/v1/manual/variables/#Allowed-Variable-Names +allowed_variable = \ + '(?:[a-zA-Z_\u00A1-\U0010ffff][a-zA-Z_0-9!\u00A1-\U0010ffff]*)' +# see https://github.com/JuliaLang/julia/blob/master/src/flisp/julia_opsuffs.h +operator_suffixes = r'[²³¹ʰʲʳʷʸˡˢˣᴬᴮᴰᴱᴳᴴᴵᴶᴷᴸᴹᴺᴼᴾᴿᵀᵁᵂᵃᵇᵈᵉᵍᵏᵐᵒᵖᵗᵘᵛᵝᵞᵟᵠᵡᵢᵣᵤᵥᵦᵧᵨᵩᵪᶜᶠᶥᶦᶫᶰᶸᶻᶿ′″‴‵‶‷⁗⁰ⁱ⁴⁵⁶⁷⁸⁹⁺⁻⁼⁽⁾ⁿ₀₁₂₃₄₅₆₇₈₉₊₋₌₍₎ₐₑₒₓₕₖₗₘₙₚₛₜⱼⱽ]*' + +class JuliaLexer(RegexLexer): + """ + For Julia source code. + """ + + name = 'Julia' + url = 'https://julialang.org/' + aliases = ['julia', 'jl'] + filenames = ['*.jl'] + mimetypes = ['text/x-julia', 'application/x-julia'] + version_added = '1.6' + + tokens = { + 'root': [ + (r'\n', Whitespace), + (r'[^\S\n]+', Whitespace), + (r'#=', Comment.Multiline, "blockcomment"), + (r'#.*$', Comment), + (r'[\[\](),;]', Punctuation), + + # symbols + # intercept range expressions first + (r'(' + allowed_variable + r')(\s*)(:)(' + allowed_variable + ')', + bygroups(Name, Whitespace, Operator, Name)), + # then match :name which does not follow closing brackets, digits, or the + # ::, <:, and :> operators + (r'(?\d.])(:' + allowed_variable + ')', String.Symbol), + + # type assertions - excludes expressions like ::typeof(sin) and ::avec[1] + (r'(?<=::)(\s*)(' + allowed_variable + r')\b(?![(\[])', + bygroups(Whitespace, Keyword.Type)), + # type comparisons + # - MyType <: A or MyType >: A + ('(' + allowed_variable + r')(\s*)([<>]:)(\s*)(' + allowed_variable + r')\b(?![(\[])', + bygroups(Keyword.Type, Whitespace, Operator, Whitespace, Keyword.Type)), + # - <: B or >: B + (r'([<>]:)(\s*)(' + allowed_variable + r')\b(?![(\[])', + bygroups(Operator, Whitespace, Keyword.Type)), + # - A <: or A >: + (r'\b(' + allowed_variable + r')(\s*)([<>]:)', + bygroups(Keyword.Type, Whitespace, Operator)), + + # operators + # Suffixes aren't actually allowed on all operators, but we'll ignore that + # since those cases are invalid Julia code. + (words([*OPERATORS_LIST, *DOTTED_OPERATORS_LIST], + suffix=operator_suffixes), Operator), + (words(['.' + o for o in DOTTED_OPERATORS_LIST], + suffix=operator_suffixes), Operator), + (words(['...', '..']), Operator), + + # NOTE + # Patterns below work only for definition sites and thus hardly reliable. + # + # functions + # (r'(function)(\s+)(' + allowed_variable + ')', + # bygroups(Keyword, Text, Name.Function)), + + # chars + (r"'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,3}|\\u[a-fA-F0-9]{1,4}|" + r"\\U[a-fA-F0-9]{1,6}|[^\\\'\n])'", String.Char), + + # try to match trailing transpose + (r'(?<=[.\w)\]])(\'' + operator_suffixes + ')+', Operator), + + # raw strings + (r'(raw)(""")', bygroups(String.Affix, String), 'tqrawstring'), + (r'(raw)(")', bygroups(String.Affix, String), 'rawstring'), + # regular expressions + (r'(r)(""")', bygroups(String.Affix, String.Regex), 'tqregex'), + (r'(r)(")', bygroups(String.Affix, String.Regex), 'regex'), + # other strings + (r'(' + allowed_variable + ')?(""")', + bygroups(String.Affix, String), 'tqstring'), + (r'(' + allowed_variable + ')?(")', + bygroups(String.Affix, String), 'string'), + + # backticks + (r'(' + allowed_variable + ')?(```)', + bygroups(String.Affix, String.Backtick), 'tqcommand'), + (r'(' + allowed_variable + ')?(`)', + bygroups(String.Affix, String.Backtick), 'command'), + + # type names + # - names that begin a curly expression + ('(' + allowed_variable + r')(\{)', + bygroups(Keyword.Type, Punctuation), 'curly'), + # - names as part of bare 'where' + (r'(where)(\s+)(' + allowed_variable + ')', + bygroups(Keyword, Whitespace, Keyword.Type)), + # - curly expressions in general + (r'(\{)', Punctuation, 'curly'), + # - names as part of type declaration + (r'(abstract|primitive)([ \t]+)(type\b)([\s()]+)(' + + allowed_variable + r')', + bygroups(Keyword, Whitespace, Keyword, Text, Keyword.Type)), + (r'(mutable(?=[ \t]))?([ \t]+)?(struct\b)([\s()]+)(' + + allowed_variable + r')', + bygroups(Keyword, Whitespace, Keyword, Text, Keyword.Type)), + + # macros + (r'@' + allowed_variable, Name.Decorator), + (words([*OPERATORS_LIST, '..', '.', *DOTTED_OPERATORS_LIST], + prefix='@', suffix=operator_suffixes), Name.Decorator), + + # keywords + (words(KEYWORD_LIST, suffix=r'\b'), Keyword), + # builtin types + (words(BUILTIN_LIST, suffix=r'\b'), Keyword.Type), + # builtin literals + (words(LITERAL_LIST, suffix=r'\b'), Name.Builtin), + + # names + (allowed_variable, Name), + + # numbers + (r'(\d+((_\d+)+)?\.(?!\.)(\d+((_\d+)+)?)?|\.\d+((_\d+)+)?)([eEf][+-]?[0-9]+)?', Number.Float), + (r'\d+((_\d+)+)?[eEf][+-]?[0-9]+', Number.Float), + (r'0x[a-fA-F0-9]+((_[a-fA-F0-9]+)+)?(\.([a-fA-F0-9]+((_[a-fA-F0-9]+)+)?)?)?p[+-]?\d+', Number.Float), + (r'0b[01]+((_[01]+)+)?', Number.Bin), + (r'0o[0-7]+((_[0-7]+)+)?', Number.Oct), + (r'0x[a-fA-F0-9]+((_[a-fA-F0-9]+)+)?', Number.Hex), + (r'\d+((_\d+)+)?', Number.Integer), + + # single dot operator matched last to permit e.g. ".1" as a float + (words(['.']), Operator), + ], + + "blockcomment": [ + (r'[^=#]', Comment.Multiline), + (r'#=', Comment.Multiline, '#push'), + (r'=#', Comment.Multiline, '#pop'), + (r'[=#]', Comment.Multiline), + ], + + 'curly': [ + (r'\{', Punctuation, '#push'), + (r'\}', Punctuation, '#pop'), + (allowed_variable, Keyword.Type), + include('root'), + ], + + 'tqrawstring': [ + (r'"""', String, '#pop'), + (r'([^"]|"[^"][^"])+', String), + ], + 'rawstring': [ + (r'"', String, '#pop'), + (r'\\"', String.Escape), + (r'([^"\\]|\\[^"])+', String), + ], + + # Interpolation is defined as "$" followed by the shortest full + # expression, which is something we can't parse. Include the most + # common cases here: $word, and $(paren'd expr). + 'interp': [ + (r'\$' + allowed_variable, String.Interpol), + (r'(\$)(\()', bygroups(String.Interpol, Punctuation), 'in-intp'), + ], + 'in-intp': [ + (r'\(', Punctuation, '#push'), + (r'\)', Punctuation, '#pop'), + include('root'), + ], + + 'string': [ + (r'(")(' + allowed_variable + r'|\d+)?', + bygroups(String, String.Affix), '#pop'), + # FIXME: This escape pattern is not perfect. + (r'\\([\\"\'$nrbtfav]|(x|u|U)[a-fA-F0-9]+|\d+)', String.Escape), + include('interp'), + # @printf and @sprintf formats + (r'%[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?[hlL]?[E-GXc-giorsux%]', + String.Interpol), + (r'[^"$%\\]+', String), + (r'.', String), + ], + 'tqstring': [ + (r'(""")(' + allowed_variable + r'|\d+)?', + bygroups(String, String.Affix), '#pop'), + (r'\\([\\"\'$nrbtfav]|(x|u|U)[a-fA-F0-9]+|\d+)', String.Escape), + include('interp'), + (r'[^"$%\\]+', String), + (r'.', String), + ], + + 'regex': [ + (r'(")([imsxa]*)?', bygroups(String.Regex, String.Affix), '#pop'), + (r'\\"', String.Regex), + (r'[^\\"]+', String.Regex), + ], + + 'tqregex': [ + (r'(""")([imsxa]*)?', bygroups(String.Regex, String.Affix), '#pop'), + (r'[^"]+', String.Regex), + ], + + 'command': [ + (r'(`)(' + allowed_variable + r'|\d+)?', + bygroups(String.Backtick, String.Affix), '#pop'), + (r'\\[`$]', String.Escape), + include('interp'), + (r'[^\\`$]+', String.Backtick), + (r'.', String.Backtick), + ], + 'tqcommand': [ + (r'(```)(' + allowed_variable + r'|\d+)?', + bygroups(String.Backtick, String.Affix), '#pop'), + (r'\\\$', String.Escape), + include('interp'), + (r'[^\\`$]+', String.Backtick), + (r'.', String.Backtick), + ], + } + + def analyse_text(text): + return shebang_matches(text, r'julia') + + +class JuliaConsoleLexer(Lexer): + """ + For Julia console sessions. Modeled after MatlabSessionLexer. + """ + name = 'Julia console' + aliases = ['jlcon', 'julia-repl'] + url = 'https://julialang.org/' + version_added = '1.6' + _example = "jlcon/console" + + def get_tokens_unprocessed(self, text): + jllexer = JuliaLexer(**self.options) + start = 0 + curcode = '' + insertions = [] + output = False + error = False + + for line in text.splitlines(keepends=True): + if line.startswith('julia>'): + insertions.append((len(curcode), [(0, Generic.Prompt, line[:6])])) + curcode += line[6:] + output = False + error = False + elif line.startswith('help?>') or line.startswith('shell>'): + yield start, Generic.Prompt, line[:6] + yield start + 6, Text, line[6:] + output = False + error = False + elif line.startswith(' ') and not output: + insertions.append((len(curcode), [(0, Whitespace, line[:6])])) + curcode += line[6:] + else: + if curcode: + yield from do_insertions( + insertions, jllexer.get_tokens_unprocessed(curcode)) + curcode = '' + insertions = [] + if line.startswith('ERROR: ') or error: + yield start, Generic.Error, line + error = True + else: + yield start, Generic.Output, line + output = True + start += len(line) + + if curcode: + yield from do_insertions( + insertions, jllexer.get_tokens_unprocessed(curcode)) diff --git a/lib/python3.12/site-packages/pygments/lexers/lean.py b/lib/python3.12/site-packages/pygments/lexers/lean.py new file mode 100644 index 0000000000000000000000000000000000000000..76af11fe909f47e276b52da90983f02f62d3c4ac --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/lean.py @@ -0,0 +1,241 @@ +""" + pygments.lexers.lean + ~~~~~~~~~~~~~~~~~~~~ + + Lexers for the Lean theorem prover. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, words, include +from pygments.token import Comment, Operator, Keyword, Name, String, \ + Number, Generic, Whitespace + +__all__ = ['Lean3Lexer', 'Lean4Lexer'] + +class Lean3Lexer(RegexLexer): + """ + For the Lean 3 theorem prover. + """ + name = 'Lean' + url = 'https://leanprover-community.github.io/lean3' + aliases = ['lean', 'lean3'] + filenames = ['*.lean'] + mimetypes = ['text/x-lean', 'text/x-lean3'] + version_added = '2.0' + + # from https://github.com/leanprover/vscode-lean/blob/1589ca3a65e394b3789409707febbd2d166c9344/syntaxes/lean.json#L186C20-L186C217 + _name_segment = ( + "(?![λΠΣ])[_a-zA-Zα-ωΑ-Ωϊ-ϻἀ-῾℀-⅏𝒜-𝖟]" + "(?:(?![λΠΣ])[_a-zA-Zα-ωΑ-Ωϊ-ϻἀ-῾℀-⅏𝒜-𝖟0-9'ⁿ-₉ₐ-ₜᵢ-ᵪ])*") + _name = _name_segment + r"(\." + _name_segment + r")*" + + tokens = { + 'expression': [ + (r'\s+', Whitespace), + (r'/--', String.Doc, 'docstring'), + (r'/-', Comment, 'comment'), + (r'--.*?$', Comment.Single), + (words(( + 'forall', 'fun', 'Pi', 'from', 'have', 'show', 'assume', 'suffices', + 'let', 'if', 'else', 'then', 'in', 'with', 'calc', 'match', + 'do' + ), prefix=r'\b', suffix=r'\b'), Keyword), + (words(('sorry', 'admit'), prefix=r'\b', suffix=r'\b'), Generic.Error), + (words(('Sort', 'Prop', 'Type'), prefix=r'\b', suffix=r'\b'), Keyword.Type), + (words(( + '(', ')', ':', '{', '}', '[', ']', '⟨', '⟩', '‹', '›', '⦃', '⦄', ':=', ',', + )), Operator), + (_name, Name), + (r'``?' + _name, String.Symbol), + (r'0x[A-Za-z0-9]+', Number.Integer), + (r'0b[01]+', Number.Integer), + (r'\d+', Number.Integer), + (r'"', String.Double, 'string'), + (r"'(?:(\\[\\\"'nt])|(\\x[0-9a-fA-F]{2})|(\\u[0-9a-fA-F]{4})|.)'", String.Char), + (r'[~?][a-z][\w\']*:', Name.Variable), + (r'\S', Name.Builtin.Pseudo), + ], + 'root': [ + (words(( + 'import', 'renaming', 'hiding', + 'namespace', + 'local', + 'private', 'protected', 'section', + 'include', 'omit', 'section', + 'protected', 'export', + 'open', + 'attribute', + ), prefix=r'\b', suffix=r'\b'), Keyword.Namespace), + (words(( + 'lemma', 'theorem', 'def', 'definition', 'example', + 'axiom', 'axioms', 'constant', 'constants', + 'universe', 'universes', + 'inductive', 'coinductive', 'structure', 'extends', + 'class', 'instance', + 'abbreviation', + + 'noncomputable theory', + + 'noncomputable', 'mutual', 'meta', + + 'attribute', + + 'parameter', 'parameters', + 'variable', 'variables', + + 'reserve', 'precedence', + 'postfix', 'prefix', 'notation', 'infix', 'infixl', 'infixr', + + 'begin', 'by', 'end', + + 'set_option', + 'run_cmd', + ), prefix=r'\b', suffix=r'\b'), Keyword.Declaration), + (r'@\[', Keyword.Declaration, 'attribute'), + (words(( + '#eval', '#check', '#reduce', '#exit', + '#print', '#help', + ), suffix=r'\b'), Keyword), + include('expression') + ], + 'attribute': [ + (r'\]', Keyword.Declaration, '#pop'), + include('expression'), + ], + 'comment': [ + (r'[^/-]+', Comment.Multiline), + (r'/-', Comment.Multiline, '#push'), + (r'-/', Comment.Multiline, '#pop'), + (r'[/-]', Comment.Multiline) + ], + 'docstring': [ + (r'[^/-]+', String.Doc), + (r'-/', String.Doc, '#pop'), + (r'[/-]', String.Doc) + ], + 'string': [ + (r'[^\\"]+', String.Double), + (r"(?:(\\[\\\"'nt])|(\\x[0-9a-fA-F]{2})|(\\u[0-9a-fA-F]{4}))", String.Escape), + ('"', String.Double, '#pop'), + ], + } + + def analyse_text(text): + if re.search(r'^import [a-z]', text, re.MULTILINE): + return 0.1 + + +LeanLexer = Lean3Lexer + + +class Lean4Lexer(RegexLexer): + """ + For the Lean 4 theorem prover. + """ + + name = 'Lean4' + url = 'https://github.com/leanprover/lean4' + aliases = ['lean4'] + filenames = ['*.lean'] + mimetypes = ['text/x-lean4'] + version_added = '2.18' + + # same as Lean3Lexer, with `!` and `?` allowed + _name_segment = ( + "(?![λΠΣ])[_a-zA-Zα-ωΑ-Ωϊ-ϻἀ-῾℀-⅏𝒜-𝖟]" + "(?:(?![λΠΣ])[_a-zA-Zα-ωΑ-Ωϊ-ϻἀ-῾℀-⅏𝒜-𝖟0-9'ⁿ-₉ₐ-ₜᵢ-ᵪ!?])*") + _name = _name_segment + r"(\." + _name_segment + r")*" + + keywords1 = ( + 'import', 'unif_hint', + 'renaming', 'inline', 'hiding', 'lemma', 'variable', + 'theorem', 'axiom', 'inductive', 'structure', 'universe', 'alias', + '#help', 'precedence', 'postfix', 'prefix', + 'infix', 'infixl', 'infixr', 'notation', '#eval', + '#check', '#reduce', '#exit', 'end', 'private', 'using', 'namespace', + 'instance', 'section', 'protected', + 'export', 'set_option', 'extends', 'open', 'example', + '#print', 'opaque', + 'def', 'macro', 'elab', 'syntax', 'macro_rules', '#reduce', 'where', + 'abbrev', 'noncomputable', 'class', 'attribute', '#synth', 'mutual', + 'scoped', 'local', + ) + + keywords2 = ( + 'forall', 'fun', 'obtain', 'from', 'have', 'show', 'assume', + 'let', 'if', 'else', 'then', 'by', 'in', 'with', + 'calc', 'match', 'nomatch', 'do', 'at', + ) + + keywords3 = ( + # Sorts + 'Type', 'Prop', 'Sort', + ) + + operators = ( + '!=', '#', '&', '&&', '*', '+', '-', '/', '@', '!', + '-.', '->', '.', '..', '...', '::', ':>', ';', ';;', '<', + '<-', '=', '==', '>', '_', '|', '||', '~', '=>', '<=', '>=', + '/\\', '\\/', '∀', 'Π', 'λ', '↔', '∧', '∨', '≠', '≤', '≥', + '¬', '⁻¹', '⬝', '▸', '→', '∃', '≈', '×', '⌞', + '⌟', '≡', '⟨', '⟩', "↦", + ) + + punctuation = ('(', ')', ':', '{', '}', '[', ']', '⦃', '⦄', + ':=', ',') + + tokens = { + 'expression': [ + (r'\s+', Whitespace), + (r'/--', String.Doc, 'docstring'), + (r'/-', Comment, 'comment'), + (r'--.*$', Comment.Single), + (words(keywords3, prefix=r'\b', suffix=r'\b'), Keyword.Type), + (words(('sorry', 'admit'), prefix=r'\b', suffix=r'\b'), Generic.Error), + (words(operators), Name.Builtin.Pseudo), + (words(punctuation), Operator), + (_name_segment, Name), + (r'``?' + _name, String.Symbol), + (r'(?<=\.)\d+', Number), + (r'(\d+\.\d*)([eE][+-]?[0-9]+)?', Number.Float), + (r'\d+', Number.Integer), + (r'"', String.Double, 'string'), + (r'[~?][a-z][\w\']*:', Name.Variable), + (r'\S', Name.Builtin.Pseudo), + ], + 'root': [ + (words(keywords1, prefix=r'\b', suffix=r'\b'), Keyword.Namespace), + (words(keywords2, prefix=r'\b', suffix=r'\b'), Keyword), + (r'@\[', Keyword.Declaration, 'attribute'), + include('expression') + ], + 'attribute': [ + (r'\]', Keyword.Declaration, '#pop'), + include('expression'), + ], + 'comment': [ + # Multiline Comments + (r'[^/-]+', Comment.Multiline), + (r'/-', Comment.Multiline, '#push'), + (r'-/', Comment.Multiline, '#pop'), + (r'[/-]', Comment.Multiline) + ], + 'docstring': [ + (r'[^/-]+', String.Doc), + (r'-/', String.Doc, '#pop'), + (r'[/-]', String.Doc) + ], + 'string': [ + (r'[^\\"]+', String.Double), + (r'\\[n"\\\n]', String.Escape), + ('"', String.Double, '#pop'), + ], + } + + def analyse_text(text): + if re.search(r'^import [A-Z]', text, re.MULTILINE): + return 0.1 diff --git a/lib/python3.12/site-packages/pygments/lexers/lisp.py b/lib/python3.12/site-packages/pygments/lexers/lisp.py new file mode 100644 index 0000000000000000000000000000000000000000..2c970d9395b0591a6f31cd2c082c14b15cb408f6 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/lisp.py @@ -0,0 +1,3146 @@ +""" + pygments.lexers.lisp + ~~~~~~~~~~~~~~~~~~~~ + + Lexers for Lispy languages. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, include, bygroups, words, default +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Literal, Error, Whitespace + +from pygments.lexers.python import PythonLexer + +from pygments.lexers._scheme_builtins import scheme_keywords, scheme_builtins + +__all__ = ['SchemeLexer', 'CommonLispLexer', 'HyLexer', 'RacketLexer', + 'NewLispLexer', 'EmacsLispLexer', 'ShenLexer', 'CPSALexer', + 'XtlangLexer', 'FennelLexer', 'JanetLexer'] + + +class SchemeLexer(RegexLexer): + """ + A Scheme lexer. + + This parser is checked with pastes from the LISP pastebin + at http://paste.lisp.org/ to cover as much syntax as possible. + + It supports the full Scheme syntax as defined in R5RS. + """ + name = 'Scheme' + url = 'http://www.scheme-reports.org/' + aliases = ['scheme', 'scm'] + filenames = ['*.scm', '*.ss'] + mimetypes = ['text/x-scheme', 'application/x-scheme'] + version_added = '0.6' + + flags = re.DOTALL | re.MULTILINE + + # valid names for identifiers + # well, names can only not consist fully of numbers + # but this should be good enough for now + valid_name = r'[\w!$%&*+,/:<=>?@^~|-]+' + + # Use within verbose regexes + token_end = r''' + (?= + \s # whitespace + | ; # comment + | \#[;|!] # fancy comments + | [)\]] # end delimiters + | $ # end of file + ) + ''' + + # Recognizing builtins. + def get_tokens_unprocessed(self, text): + for index, token, value in super().get_tokens_unprocessed(text): + if token is Name.Function or token is Name.Variable: + if value in scheme_keywords: + yield index, Keyword, value + elif value in scheme_builtins: + yield index, Name.Builtin, value + else: + yield index, token, value + else: + yield index, token, value + + # Scheme has funky syntactic rules for numbers. These are all + # valid number literals: 5.0e55|14, 14/13, -1+5j, +1@5, #b110, + # #o#Iinf.0-nan.0i. This is adapted from the formal grammar given + # in http://www.r6rs.org/final/r6rs.pdf, section 4.2.1. Take a + # deep breath ... + + # It would be simpler if we could just not bother about invalid + # numbers like #b35. But we cannot parse 'abcdef' without #x as a + # number. + + number_rules = {} + for base in (2, 8, 10, 16): + if base == 2: + digit = r'[01]' + radix = r'( \#[bB] )' + elif base == 8: + digit = r'[0-7]' + radix = r'( \#[oO] )' + elif base == 10: + digit = r'[0-9]' + radix = r'( (\#[dD])? )' + elif base == 16: + digit = r'[0-9a-fA-F]' + radix = r'( \#[xX] )' + + # Radix, optional exactness indicator. + prefix = rf''' + ( + {radix} (\#[iIeE])? + | \#[iIeE] {radix} + ) + ''' + + # Simple unsigned number or fraction. + ureal = rf''' + ( + {digit}+ + ( / {digit}+ )? + ) + ''' + + # Add decimal numbers. + if base == 10: + decimal = r''' + ( + # Decimal part + ( + [0-9]+ ([.][0-9]*)? + | [.][0-9]+ + ) + + # Optional exponent + ( + [eEsSfFdDlL] [+-]? [0-9]+ + )? + + # Optional mantissa width + ( + \|[0-9]+ + )? + ) + ''' + ureal = rf''' + ( + {decimal} (?!/) + | {ureal} + ) + ''' + + naninf = r'(nan.0|inf.0)' + + real = rf''' + ( + [+-] {naninf} # Sign mandatory + | [+-]? {ureal} # Sign optional + ) + ''' + + complex_ = rf''' + ( + {real}? [+-] ({naninf}|{ureal})? i + | {real} (@ {real})? + + ) + ''' + + num = rf'''(?x) + ( + {prefix} + {complex_} + ) + # Need to ensure we have a full token. 1+ is not a + # number followed by something else, but a function + # name. + {token_end} + ''' + + number_rules[base] = num + + # If you have a headache now, say thanks to RnRS editors. + + # Doing it this way is simpler than splitting the number(10) + # regex in a floating-point and a no-floating-point version. + def decimal_cb(self, match): + if '.' in match.group(): + token_type = Number.Float # includes [+-](inf|nan).0 + else: + token_type = Number.Integer + yield match.start(), token_type, match.group() + + # -- + + # The 'scheme-root' state parses as many expressions as needed, always + # delegating to the 'scheme-value' state. The latter parses one complete + # expression and immediately pops back. This is needed for the LilyPondLexer. + # When LilyPond encounters a #, it starts parsing embedded Scheme code, and + # returns to normal syntax after one expression. We implement this + # by letting the LilyPondLexer subclass the SchemeLexer. When it finds + # the #, the LilyPondLexer goes to the 'value' state, which then pops back + # to LilyPondLexer. The 'root' state of the SchemeLexer merely delegates the + # work to 'scheme-root'; this is so that LilyPondLexer can inherit + # 'scheme-root' and redefine 'root'. + + tokens = { + 'root': [ + default('scheme-root'), + ], + 'scheme-root': [ + default('value'), + ], + 'value': [ + # the comments + # and going to the end of the line + (r';.*?$', Comment.Single), + # multi-line comment + (r'#\|', Comment.Multiline, 'multiline-comment'), + # commented form (entire sexpr following) + (r'#;[([]', Comment, 'commented-form'), + # commented datum + (r'#;', Comment, 'commented-datum'), + # signifies that the program text that follows is written with the + # lexical and datum syntax described in r6rs + (r'#!r6rs', Comment), + + # whitespaces - usually not relevant + (r'\s+', Whitespace), + + # numbers + (number_rules[2], Number.Bin, '#pop'), + (number_rules[8], Number.Oct, '#pop'), + (number_rules[10], decimal_cb, '#pop'), + (number_rules[16], Number.Hex, '#pop'), + + # strings, symbols, keywords and characters + (r'"', String, 'string'), + (r"'" + valid_name, String.Symbol, "#pop"), + (r'#:' + valid_name, Keyword.Declaration, '#pop'), + (r"#\\([()/'\"._!§$%& ?=+-]|[a-zA-Z0-9]+)", String.Char, "#pop"), + + # constants + (r'(#t|#f)', Name.Constant, '#pop'), + + # special operators + (r"('|#|`|,@|,|\.)", Operator), + + # first variable in a quoted string like + # '(this is syntactic sugar) + (r"(?<='\()" + valid_name, Name.Variable, '#pop'), + (r"(?<=#\()" + valid_name, Name.Variable, '#pop'), + + # Functions -- note that this also catches variables + # defined in let/let*, but there is little that can + # be done about it. + (r'(?<=\()' + valid_name, Name.Function, '#pop'), + + # find the remaining variables + (valid_name, Name.Variable, '#pop'), + + # the famous parentheses! + + # Push scheme-root to enter a state that will parse as many things + # as needed in the parentheses. + (r'[([]', Punctuation, 'scheme-root'), + # Pop one 'value', one 'scheme-root', and yet another 'value', so + # we get back to a state parsing expressions as needed in the + # enclosing context. + (r'[)\]]', Punctuation, '#pop:3'), + ], + 'multiline-comment': [ + (r'#\|', Comment.Multiline, '#push'), + (r'\|#', Comment.Multiline, '#pop'), + (r'[^|#]+', Comment.Multiline), + (r'[|#]', Comment.Multiline), + ], + 'commented-form': [ + (r'[([]', Comment, '#push'), + (r'[)\]]', Comment, '#pop'), + (r'[^()[\]]+', Comment), + ], + 'commented-datum': [ + (rf'(?x).*?{token_end}', Comment, '#pop'), + ], + 'string': [ + # Pops back from 'string', and pops 'value' as well. + ('"', String, '#pop:2'), + # Hex escape sequences, R6RS-style. + (r'\\x[0-9a-fA-F]+;', String.Escape), + # We try R6RS style first, but fall back to Guile-style. + (r'\\x[0-9a-fA-F]{2}', String.Escape), + # Other special escape sequences implemented by Guile. + (r'\\u[0-9a-fA-F]{4}', String.Escape), + (r'\\U[0-9a-fA-F]{6}', String.Escape), + # Escape sequences are not overly standardized. Recognizing + # a single character after the backslash should be good enough. + # NB: we have DOTALL. + (r'\\.', String.Escape), + # The rest + (r'[^\\"]+', String), + ] + } + + +class CommonLispLexer(RegexLexer): + """ + A Common Lisp lexer. + """ + name = 'Common Lisp' + url = 'https://lisp-lang.org/' + aliases = ['common-lisp', 'cl', 'lisp'] + filenames = ['*.cl', '*.lisp'] + mimetypes = ['text/x-common-lisp'] + version_added = '0.9' + + flags = re.IGNORECASE | re.MULTILINE + + # couple of useful regexes + + # characters that are not macro-characters and can be used to begin a symbol + nonmacro = r'\\.|[\w!$%&*+-/<=>?@\[\]^{}~]' + constituent = nonmacro + '|[#.:]' + terminated = r'(?=[ "()\'\n,;`])' # whitespace or terminating macro characters + + # symbol token, reverse-engineered from hyperspec + # Take a deep breath... + symbol = rf'(\|[^|]+\||(?:{nonmacro})(?:{constituent})*)' + + def __init__(self, **options): + from pygments.lexers._cl_builtins import BUILTIN_FUNCTIONS, \ + SPECIAL_FORMS, MACROS, LAMBDA_LIST_KEYWORDS, DECLARATIONS, \ + BUILTIN_TYPES, BUILTIN_CLASSES + self.builtin_function = BUILTIN_FUNCTIONS + self.special_forms = SPECIAL_FORMS + self.macros = MACROS + self.lambda_list_keywords = LAMBDA_LIST_KEYWORDS + self.declarations = DECLARATIONS + self.builtin_types = BUILTIN_TYPES + self.builtin_classes = BUILTIN_CLASSES + RegexLexer.__init__(self, **options) + + def get_tokens_unprocessed(self, text): + stack = ['root'] + for index, token, value in RegexLexer.get_tokens_unprocessed(self, text, stack): + if token is Name.Variable: + if value in self.builtin_function: + yield index, Name.Builtin, value + continue + if value in self.special_forms: + yield index, Keyword, value + continue + if value in self.macros: + yield index, Name.Builtin, value + continue + if value in self.lambda_list_keywords: + yield index, Keyword, value + continue + if value in self.declarations: + yield index, Keyword, value + continue + if value in self.builtin_types: + yield index, Keyword.Type, value + continue + if value in self.builtin_classes: + yield index, Name.Class, value + continue + yield index, token, value + + tokens = { + 'root': [ + default('body'), + ], + 'multiline-comment': [ + (r'#\|', Comment.Multiline, '#push'), # (cf. Hyperspec 2.4.8.19) + (r'\|#', Comment.Multiline, '#pop'), + (r'[^|#]+', Comment.Multiline), + (r'[|#]', Comment.Multiline), + ], + 'commented-form': [ + (r'\(', Comment.Preproc, '#push'), + (r'\)', Comment.Preproc, '#pop'), + (r'[^()]+', Comment.Preproc), + ], + 'body': [ + # whitespace + (r'\s+', Whitespace), + + # single-line comment + (r';.*$', Comment.Single), + + # multi-line comment + (r'#\|', Comment.Multiline, 'multiline-comment'), + + # encoding comment (?) + (r'#\d*Y.*$', Comment.Special), + + # strings and characters + (r'"(\\.|\\\n|[^"\\])*"', String), + # quoting + (r":" + symbol, String.Symbol), + (r"::" + symbol, String.Symbol), + (r":#" + symbol, String.Symbol), + (r"'" + symbol, String.Symbol), + (r"'", Operator), + (r"`", Operator), + + # decimal numbers + (r'[-+]?\d+\.?' + terminated, Number.Integer), + (r'[-+]?\d+/\d+' + terminated, Number), + (r'[-+]?(\d*\.\d+([defls][-+]?\d+)?|\d+(\.\d*)?[defls][-+]?\d+)' + + terminated, Number.Float), + + # sharpsign strings and characters + (r"#\\." + terminated, String.Char), + (r"#\\" + symbol, String.Char), + + # vector + (r'#\(', Operator, 'body'), + + # bitstring + (r'#\d*\*[01]*', Literal.Other), + + # uninterned symbol + (r'#:' + symbol, String.Symbol), + + # read-time and load-time evaluation + (r'#[.,]', Operator), + + # function shorthand + (r'#\'', Name.Function), + + # binary rational + (r'#b[+-]?[01]+(/[01]+)?', Number.Bin), + + # octal rational + (r'#o[+-]?[0-7]+(/[0-7]+)?', Number.Oct), + + # hex rational + (r'#x[+-]?[0-9a-f]+(/[0-9a-f]+)?', Number.Hex), + + # radix rational + (r'#\d+r[+-]?[0-9a-z]+(/[0-9a-z]+)?', Number), + + # complex + (r'(#c)(\()', bygroups(Number, Punctuation), 'body'), + + # array + (r'(#\d+a)(\()', bygroups(Literal.Other, Punctuation), 'body'), + + # structure + (r'(#s)(\()', bygroups(Literal.Other, Punctuation), 'body'), + + # path + (r'#p?"(\\.|[^"])*"', Literal.Other), + + # reference + (r'#\d+=', Operator), + (r'#\d+#', Operator), + + # read-time comment + (r'#+nil' + terminated + r'\s*\(', Comment.Preproc, 'commented-form'), + + # read-time conditional + (r'#[+-]', Operator), + + # special operators that should have been parsed already + (r'(,@|,|\.)', Operator), + + # special constants + (r'(t|nil)' + terminated, Name.Constant), + + # functions and variables + (r'\*' + symbol + r'\*', Name.Variable.Global), + (symbol, Name.Variable), + + # parentheses + (r'\(', Punctuation, 'body'), + (r'\)', Punctuation, '#pop'), + ], + } + + def analyse_text(text): + """Competes with Visual Prolog on *.cl""" + # This is a *really* good indicator (and not conflicting with Visual Prolog) + # '(defun ' first on a line + # section keyword alone on line e.g. 'clauses' + if re.search(r'^\s*\(defun\s', text): + return 0.8 + else: + return 0 + + +class HyLexer(RegexLexer): + """ + Lexer for Hy source code. + """ + name = 'Hy' + url = 'http://hylang.org/' + aliases = ['hylang', 'hy'] + filenames = ['*.hy'] + mimetypes = ['text/x-hy', 'application/x-hy'] + version_added = '2.0' + + special_forms = ( + 'cond', 'for', '->', '->>', 'car', + 'cdr', 'first', 'rest', 'let', 'when', 'unless', + 'import', 'do', 'progn', 'get', 'slice', 'assoc', 'with-decorator', + ',', 'list_comp', 'kwapply', '~', 'is', 'in', 'is-not', 'not-in', + 'quasiquote', 'unquote', 'unquote-splice', 'quote', '|', '<<=', '>>=', + 'foreach', 'while', + 'eval-and-compile', 'eval-when-compile' + ) + + declarations = ( + 'def', 'defn', 'defun', 'defmacro', 'defclass', 'lambda', 'fn', 'setv' + ) + + hy_builtins = () + + hy_core = ( + 'cycle', 'dec', 'distinct', 'drop', 'even?', 'filter', 'inc', + 'instance?', 'iterable?', 'iterate', 'iterator?', 'neg?', + 'none?', 'nth', 'numeric?', 'odd?', 'pos?', 'remove', 'repeat', + 'repeatedly', 'take', 'take_nth', 'take_while', 'zero?' + ) + + builtins = hy_builtins + hy_core + + # valid names for identifiers + # well, names can only not consist fully of numbers + # but this should be good enough for now + valid_name = r"[^ \t\n\r\f\v()[\]{};\"'`~]+" + + def _multi_escape(entries): + return words(entries, suffix=' ') + + tokens = { + 'root': [ + # the comments - always starting with semicolon + # and going to the end of the line + (r';.*$', Comment.Single), + + # whitespaces - usually not relevant + (r'[ \t\n\r\f\v]+', Whitespace), + + # numbers + (r'-?\d+\.\d+', Number.Float), + (r'-?\d+', Number.Integer), + (r'0[0-7]+j?', Number.Oct), + (r'0[xX][a-fA-F0-9]+', Number.Hex), + + # strings, symbols and characters + (r'"(\\\\|\\[^\\]|[^"\\])*"', String), + (r"'" + valid_name, String.Symbol), + (r"\\(.|[a-z]+)", String.Char), + (r'^(\s*)([rRuU]{,2}"""(?:.|\n)*?""")', bygroups(Text, String.Doc)), + (r"^(\s*)([rRuU]{,2}'''(?:.|\n)*?''')", bygroups(Text, String.Doc)), + + # keywords + (r'::?' + valid_name, String.Symbol), + + # special operators + (r'~@|[`\'#^~&@]', Operator), + + include('py-keywords'), + include('py-builtins'), + + # highlight the special forms + (_multi_escape(special_forms), Keyword), + + # Technically, only the special forms are 'keywords'. The problem + # is that only treating them as keywords means that things like + # 'defn' and 'ns' need to be highlighted as builtins. This is ugly + # and weird for most styles. So, as a compromise we're going to + # highlight them as Keyword.Declarations. + (_multi_escape(declarations), Keyword.Declaration), + + # highlight the builtins + (_multi_escape(builtins), Name.Builtin), + + # the remaining functions + (r'(?<=\()' + valid_name, Name.Function), + + # find the remaining variables + (valid_name, Name.Variable), + + # Hy accepts vector notation + (r'(\[|\])', Punctuation), + + # Hy accepts map notation + (r'(\{|\})', Punctuation), + + # the famous parentheses! + (r'(\(|\))', Punctuation), + + ], + 'py-keywords': PythonLexer.tokens['keywords'], + 'py-builtins': PythonLexer.tokens['builtins'], + } + + def analyse_text(text): + if '(import ' in text or '(defn ' in text: + return 0.9 + + +class RacketLexer(RegexLexer): + """ + Lexer for Racket source code (formerly + known as PLT Scheme). + """ + + name = 'Racket' + url = 'http://racket-lang.org/' + aliases = ['racket', 'rkt'] + filenames = ['*.rkt', '*.rktd', '*.rktl'] + mimetypes = ['text/x-racket', 'application/x-racket'] + version_added = '1.6' + + # Generated by example.rkt + _keywords = ( + '#%app', '#%datum', '#%declare', '#%expression', '#%module-begin', + '#%plain-app', '#%plain-lambda', '#%plain-module-begin', + '#%printing-module-begin', '#%provide', '#%require', + '#%stratified-body', '#%top', '#%top-interaction', + '#%variable-reference', '->', '->*', '->*m', '->d', '->dm', '->i', + '->m', '...', ':do-in', '==', '=>', '_', 'absent', 'abstract', + 'all-defined-out', 'all-from-out', 'and', 'any', 'augment', 'augment*', + 'augment-final', 'augment-final*', 'augride', 'augride*', 'begin', + 'begin-for-syntax', 'begin0', 'case', 'case->', 'case->m', + 'case-lambda', 'class', 'class*', 'class-field-accessor', + 'class-field-mutator', 'class/c', 'class/derived', 'combine-in', + 'combine-out', 'command-line', 'compound-unit', 'compound-unit/infer', + 'cond', 'cons/dc', 'contract', 'contract-out', 'contract-struct', + 'contracted', 'define', 'define-compound-unit', + 'define-compound-unit/infer', 'define-contract-struct', + 'define-custom-hash-types', 'define-custom-set-types', + 'define-for-syntax', 'define-local-member-name', 'define-logger', + 'define-match-expander', 'define-member-name', + 'define-module-boundary-contract', 'define-namespace-anchor', + 'define-opt/c', 'define-sequence-syntax', 'define-serializable-class', + 'define-serializable-class*', 'define-signature', + 'define-signature-form', 'define-struct', 'define-struct/contract', + 'define-struct/derived', 'define-syntax', 'define-syntax-rule', + 'define-syntaxes', 'define-unit', 'define-unit-binding', + 'define-unit-from-context', 'define-unit/contract', + 'define-unit/new-import-export', 'define-unit/s', 'define-values', + 'define-values-for-export', 'define-values-for-syntax', + 'define-values/invoke-unit', 'define-values/invoke-unit/infer', + 'define/augment', 'define/augment-final', 'define/augride', + 'define/contract', 'define/final-prop', 'define/match', + 'define/overment', 'define/override', 'define/override-final', + 'define/private', 'define/public', 'define/public-final', + 'define/pubment', 'define/subexpression-pos-prop', + 'define/subexpression-pos-prop/name', 'delay', 'delay/idle', + 'delay/name', 'delay/strict', 'delay/sync', 'delay/thread', 'do', + 'else', 'except', 'except-in', 'except-out', 'export', 'extends', + 'failure-cont', 'false', 'false/c', 'field', 'field-bound?', 'file', + 'flat-murec-contract', 'flat-rec-contract', 'for', 'for*', 'for*/and', + 'for*/async', 'for*/first', 'for*/fold', 'for*/fold/derived', + 'for*/hash', 'for*/hasheq', 'for*/hasheqv', 'for*/last', 'for*/list', + 'for*/lists', 'for*/mutable-set', 'for*/mutable-seteq', + 'for*/mutable-seteqv', 'for*/or', 'for*/product', 'for*/set', + 'for*/seteq', 'for*/seteqv', 'for*/stream', 'for*/sum', 'for*/vector', + 'for*/weak-set', 'for*/weak-seteq', 'for*/weak-seteqv', 'for-label', + 'for-meta', 'for-syntax', 'for-template', 'for/and', 'for/async', + 'for/first', 'for/fold', 'for/fold/derived', 'for/hash', 'for/hasheq', + 'for/hasheqv', 'for/last', 'for/list', 'for/lists', 'for/mutable-set', + 'for/mutable-seteq', 'for/mutable-seteqv', 'for/or', 'for/product', + 'for/set', 'for/seteq', 'for/seteqv', 'for/stream', 'for/sum', + 'for/vector', 'for/weak-set', 'for/weak-seteq', 'for/weak-seteqv', + 'gen:custom-write', 'gen:dict', 'gen:equal+hash', 'gen:set', + 'gen:stream', 'generic', 'get-field', 'hash/dc', 'if', 'implies', + 'import', 'include', 'include-at/relative-to', + 'include-at/relative-to/reader', 'include/reader', 'inherit', + 'inherit-field', 'inherit/inner', 'inherit/super', 'init', + 'init-depend', 'init-field', 'init-rest', 'inner', 'inspect', + 'instantiate', 'interface', 'interface*', 'invariant-assertion', + 'invoke-unit', 'invoke-unit/infer', 'lambda', 'lazy', 'let', 'let*', + 'let*-values', 'let-syntax', 'let-syntaxes', 'let-values', 'let/cc', + 'let/ec', 'letrec', 'letrec-syntax', 'letrec-syntaxes', + 'letrec-syntaxes+values', 'letrec-values', 'lib', 'link', 'local', + 'local-require', 'log-debug', 'log-error', 'log-fatal', 'log-info', + 'log-warning', 'match', 'match*', 'match*/derived', 'match-define', + 'match-define-values', 'match-lambda', 'match-lambda*', + 'match-lambda**', 'match-let', 'match-let*', 'match-let*-values', + 'match-let-values', 'match-letrec', 'match-letrec-values', + 'match/derived', 'match/values', 'member-name-key', 'mixin', 'module', + 'module*', 'module+', 'nand', 'new', 'nor', 'object-contract', + 'object/c', 'only', 'only-in', 'only-meta-in', 'open', 'opt/c', 'or', + 'overment', 'overment*', 'override', 'override*', 'override-final', + 'override-final*', 'parameterize', 'parameterize*', + 'parameterize-break', 'parametric->/c', 'place', 'place*', + 'place/context', 'planet', 'prefix', 'prefix-in', 'prefix-out', + 'private', 'private*', 'prompt-tag/c', 'protect-out', 'provide', + 'provide-signature-elements', 'provide/contract', 'public', 'public*', + 'public-final', 'public-final*', 'pubment', 'pubment*', 'quasiquote', + 'quasisyntax', 'quasisyntax/loc', 'quote', 'quote-syntax', + 'quote-syntax/prune', 'recontract-out', 'recursive-contract', + 'relative-in', 'rename', 'rename-in', 'rename-inner', 'rename-out', + 'rename-super', 'require', 'send', 'send*', 'send+', 'send-generic', + 'send/apply', 'send/keyword-apply', 'set!', 'set!-values', + 'set-field!', 'shared', 'stream', 'stream*', 'stream-cons', 'struct', + 'struct*', 'struct-copy', 'struct-field-index', 'struct-out', + 'struct/c', 'struct/ctc', 'struct/dc', 'submod', 'super', + 'super-instantiate', 'super-make-object', 'super-new', 'syntax', + 'syntax-case', 'syntax-case*', 'syntax-id-rules', 'syntax-rules', + 'syntax/loc', 'tag', 'this', 'this%', 'thunk', 'thunk*', 'time', + 'unconstrained-domain->', 'unit', 'unit-from-context', 'unit/c', + 'unit/new-import-export', 'unit/s', 'unless', 'unquote', + 'unquote-splicing', 'unsyntax', 'unsyntax-splicing', 'values/drop', + 'when', 'with-continuation-mark', 'with-contract', + 'with-contract-continuation-mark', 'with-handlers', 'with-handlers*', + 'with-method', 'with-syntax', 'λ' + ) + + # Generated by example.rkt + _builtins = ( + '*', '*list/c', '+', '-', '/', '<', '', '>/c', '>=', '>=/c', 'abort-current-continuation', 'abs', + 'absolute-path?', 'acos', 'add-between', 'add1', 'alarm-evt', + 'always-evt', 'and/c', 'andmap', 'angle', 'any/c', 'append', 'append*', + 'append-map', 'apply', 'argmax', 'argmin', 'arithmetic-shift', + 'arity-at-least', 'arity-at-least-value', 'arity-at-least?', + 'arity-checking-wrapper', 'arity-includes?', 'arity=?', + 'arrow-contract-info', 'arrow-contract-info-accepts-arglist', + 'arrow-contract-info-chaperone-procedure', + 'arrow-contract-info-check-first-order', 'arrow-contract-info?', + 'asin', 'assf', 'assoc', 'assq', 'assv', 'atan', + 'bad-number-of-results', 'banner', 'base->-doms/c', 'base->-rngs/c', + 'base->?', 'between/c', 'bitwise-and', 'bitwise-bit-field', + 'bitwise-bit-set?', 'bitwise-ior', 'bitwise-not', 'bitwise-xor', + 'blame-add-car-context', 'blame-add-cdr-context', 'blame-add-context', + 'blame-add-missing-party', 'blame-add-nth-arg-context', + 'blame-add-range-context', 'blame-add-unknown-context', + 'blame-context', 'blame-contract', 'blame-fmt->-string', + 'blame-missing-party?', 'blame-negative', 'blame-original?', + 'blame-positive', 'blame-replace-negative', 'blame-source', + 'blame-swap', 'blame-swapped?', 'blame-update', 'blame-value', + 'blame?', 'boolean=?', 'boolean?', 'bound-identifier=?', 'box', + 'box-cas!', 'box-immutable', 'box-immutable/c', 'box/c', 'box?', + 'break-enabled', 'break-parameterization?', 'break-thread', + 'build-chaperone-contract-property', 'build-compound-type-name', + 'build-contract-property', 'build-flat-contract-property', + 'build-list', 'build-path', 'build-path/convention-type', + 'build-string', 'build-vector', 'byte-pregexp', 'byte-pregexp?', + 'byte-ready?', 'byte-regexp', 'byte-regexp?', 'byte?', 'bytes', + 'bytes->immutable-bytes', 'bytes->list', 'bytes->path', + 'bytes->path-element', 'bytes->string/latin-1', 'bytes->string/locale', + 'bytes->string/utf-8', 'bytes-append', 'bytes-append*', + 'bytes-close-converter', 'bytes-convert', 'bytes-convert-end', + 'bytes-converter?', 'bytes-copy', 'bytes-copy!', + 'bytes-environment-variable-name?', 'bytes-fill!', 'bytes-join', + 'bytes-length', 'bytes-no-nuls?', 'bytes-open-converter', 'bytes-ref', + 'bytes-set!', 'bytes-utf-8-index', 'bytes-utf-8-length', + 'bytes-utf-8-ref', 'bytes?', 'bytes?', 'caaaar', + 'caaadr', 'caaar', 'caadar', 'caaddr', 'caadr', 'caar', 'cadaar', + 'cadadr', 'cadar', 'caddar', 'cadddr', 'caddr', 'cadr', + 'call-in-nested-thread', 'call-with-atomic-output-file', + 'call-with-break-parameterization', + 'call-with-composable-continuation', 'call-with-continuation-barrier', + 'call-with-continuation-prompt', 'call-with-current-continuation', + 'call-with-default-reading-parameterization', + 'call-with-escape-continuation', 'call-with-exception-handler', + 'call-with-file-lock/timeout', 'call-with-immediate-continuation-mark', + 'call-with-input-bytes', 'call-with-input-file', + 'call-with-input-file*', 'call-with-input-string', + 'call-with-output-bytes', 'call-with-output-file', + 'call-with-output-file*', 'call-with-output-string', + 'call-with-parameterization', 'call-with-semaphore', + 'call-with-semaphore/enable-break', 'call-with-values', 'call/cc', + 'call/ec', 'car', 'cartesian-product', 'cdaaar', 'cdaadr', 'cdaar', + 'cdadar', 'cdaddr', 'cdadr', 'cdar', 'cddaar', 'cddadr', 'cddar', + 'cdddar', 'cddddr', 'cdddr', 'cddr', 'cdr', 'ceiling', 'channel-get', + 'channel-put', 'channel-put-evt', 'channel-put-evt?', + 'channel-try-get', 'channel/c', 'channel?', 'chaperone-box', + 'chaperone-channel', 'chaperone-continuation-mark-key', + 'chaperone-contract-property?', 'chaperone-contract?', 'chaperone-evt', + 'chaperone-hash', 'chaperone-hash-set', 'chaperone-of?', + 'chaperone-procedure', 'chaperone-procedure*', 'chaperone-prompt-tag', + 'chaperone-struct', 'chaperone-struct-type', 'chaperone-vector', + 'chaperone?', 'char->integer', 'char-alphabetic?', 'char-blank?', + 'char-ci<=?', 'char-ci=?', 'char-ci>?', + 'char-downcase', 'char-foldcase', 'char-general-category', + 'char-graphic?', 'char-in', 'char-in/c', 'char-iso-control?', + 'char-lower-case?', 'char-numeric?', 'char-punctuation?', + 'char-ready?', 'char-symbolic?', 'char-title-case?', 'char-titlecase', + 'char-upcase', 'char-upper-case?', 'char-utf-8-length', + 'char-whitespace?', 'char<=?', 'char=?', 'char>?', + 'char?', 'check-duplicate-identifier', 'check-duplicates', + 'checked-procedure-check-and-extract', 'choice-evt', + 'class->interface', 'class-info', 'class-seal', 'class-unseal', + 'class?', 'cleanse-path', 'close-input-port', 'close-output-port', + 'coerce-chaperone-contract', 'coerce-chaperone-contracts', + 'coerce-contract', 'coerce-contract/f', 'coerce-contracts', + 'coerce-flat-contract', 'coerce-flat-contracts', 'collect-garbage', + 'collection-file-path', 'collection-path', 'combinations', 'compile', + 'compile-allow-set!-undefined', 'compile-context-preservation-enabled', + 'compile-enforce-module-constants', 'compile-syntax', + 'compiled-expression-recompile', 'compiled-expression?', + 'compiled-module-expression?', 'complete-path?', 'complex?', 'compose', + 'compose1', 'conjoin', 'conjugate', 'cons', 'cons/c', 'cons?', 'const', + 'continuation-mark-key/c', 'continuation-mark-key?', + 'continuation-mark-set->context', 'continuation-mark-set->list', + 'continuation-mark-set->list*', 'continuation-mark-set-first', + 'continuation-mark-set?', 'continuation-marks', + 'continuation-prompt-available?', 'continuation-prompt-tag?', + 'continuation?', 'contract-continuation-mark-key', + 'contract-custom-write-property-proc', 'contract-exercise', + 'contract-first-order', 'contract-first-order-passes?', + 'contract-late-neg-projection', 'contract-name', 'contract-proc', + 'contract-projection', 'contract-property?', + 'contract-random-generate', 'contract-random-generate-fail', + 'contract-random-generate-fail?', + 'contract-random-generate-get-current-environment', + 'contract-random-generate-stash', 'contract-random-generate/choose', + 'contract-stronger?', 'contract-struct-exercise', + 'contract-struct-generate', 'contract-struct-late-neg-projection', + 'contract-struct-list-contract?', 'contract-val-first-projection', + 'contract?', 'convert-stream', 'copy-directory/files', 'copy-file', + 'copy-port', 'cos', 'cosh', 'count', 'current-blame-format', + 'current-break-parameterization', 'current-code-inspector', + 'current-command-line-arguments', 'current-compile', + 'current-compiled-file-roots', 'current-continuation-marks', + 'current-contract-region', 'current-custodian', 'current-directory', + 'current-directory-for-user', 'current-drive', + 'current-environment-variables', 'current-error-port', 'current-eval', + 'current-evt-pseudo-random-generator', + 'current-force-delete-permissions', 'current-future', + 'current-gc-milliseconds', 'current-get-interaction-input-port', + 'current-inexact-milliseconds', 'current-input-port', + 'current-inspector', 'current-library-collection-links', + 'current-library-collection-paths', 'current-load', + 'current-load-extension', 'current-load-relative-directory', + 'current-load/use-compiled', 'current-locale', 'current-logger', + 'current-memory-use', 'current-milliseconds', + 'current-module-declare-name', 'current-module-declare-source', + 'current-module-name-resolver', 'current-module-path-for-load', + 'current-namespace', 'current-output-port', 'current-parameterization', + 'current-plumber', 'current-preserved-thread-cell-values', + 'current-print', 'current-process-milliseconds', 'current-prompt-read', + 'current-pseudo-random-generator', 'current-read-interaction', + 'current-reader-guard', 'current-readtable', 'current-seconds', + 'current-security-guard', 'current-subprocess-custodian-mode', + 'current-thread', 'current-thread-group', + 'current-thread-initial-stack-size', + 'current-write-relative-directory', 'curry', 'curryr', + 'custodian-box-value', 'custodian-box?', 'custodian-limit-memory', + 'custodian-managed-list', 'custodian-memory-accounting-available?', + 'custodian-require-memory', 'custodian-shutdown-all', 'custodian?', + 'custom-print-quotable-accessor', 'custom-print-quotable?', + 'custom-write-accessor', 'custom-write-property-proc', 'custom-write?', + 'date', 'date*', 'date*-nanosecond', 'date*-time-zone-name', 'date*?', + 'date-day', 'date-dst?', 'date-hour', 'date-minute', 'date-month', + 'date-second', 'date-time-zone-offset', 'date-week-day', 'date-year', + 'date-year-day', 'date?', 'datum->syntax', 'datum-intern-literal', + 'default-continuation-prompt-tag', 'degrees->radians', + 'delete-directory', 'delete-directory/files', 'delete-file', + 'denominator', 'dict->list', 'dict-can-functional-set?', + 'dict-can-remove-keys?', 'dict-clear', 'dict-clear!', 'dict-copy', + 'dict-count', 'dict-empty?', 'dict-for-each', 'dict-has-key?', + 'dict-implements/c', 'dict-implements?', 'dict-iter-contract', + 'dict-iterate-first', 'dict-iterate-key', 'dict-iterate-next', + 'dict-iterate-value', 'dict-key-contract', 'dict-keys', 'dict-map', + 'dict-mutable?', 'dict-ref', 'dict-ref!', 'dict-remove', + 'dict-remove!', 'dict-set', 'dict-set!', 'dict-set*', 'dict-set*!', + 'dict-update', 'dict-update!', 'dict-value-contract', 'dict-values', + 'dict?', 'directory-exists?', 'directory-list', 'disjoin', 'display', + 'display-lines', 'display-lines-to-file', 'display-to-file', + 'displayln', 'double-flonum?', 'drop', 'drop-common-prefix', + 'drop-right', 'dropf', 'dropf-right', 'dump-memory-stats', + 'dup-input-port', 'dup-output-port', 'dynamic->*', 'dynamic-get-field', + 'dynamic-object/c', 'dynamic-place', 'dynamic-place*', + 'dynamic-require', 'dynamic-require-for-syntax', 'dynamic-send', + 'dynamic-set-field!', 'dynamic-wind', 'eighth', 'empty', + 'empty-sequence', 'empty-stream', 'empty?', + 'environment-variables-copy', 'environment-variables-names', + 'environment-variables-ref', 'environment-variables-set!', + 'environment-variables?', 'eof', 'eof-evt', 'eof-object?', + 'ephemeron-value', 'ephemeron?', 'eprintf', 'eq-contract-val', + 'eq-contract?', 'eq-hash-code', 'eq?', 'equal-contract-val', + 'equal-contract?', 'equal-hash-code', 'equal-secondary-hash-code', + 'equal<%>', 'equal?', 'equal?/recur', 'eqv-hash-code', 'eqv?', 'error', + 'error-display-handler', 'error-escape-handler', + 'error-print-context-length', 'error-print-source-location', + 'error-print-width', 'error-value->string-handler', 'eval', + 'eval-jit-enabled', 'eval-syntax', 'even?', 'evt/c', 'evt?', + 'exact->inexact', 'exact-ceiling', 'exact-floor', 'exact-integer?', + 'exact-nonnegative-integer?', 'exact-positive-integer?', 'exact-round', + 'exact-truncate', 'exact?', 'executable-yield-handler', 'exit', + 'exit-handler', 'exn', 'exn-continuation-marks', 'exn-message', + 'exn:break', 'exn:break-continuation', 'exn:break:hang-up', + 'exn:break:hang-up?', 'exn:break:terminate', 'exn:break:terminate?', + 'exn:break?', 'exn:fail', 'exn:fail:contract', + 'exn:fail:contract:arity', 'exn:fail:contract:arity?', + 'exn:fail:contract:blame', 'exn:fail:contract:blame-object', + 'exn:fail:contract:blame?', 'exn:fail:contract:continuation', + 'exn:fail:contract:continuation?', 'exn:fail:contract:divide-by-zero', + 'exn:fail:contract:divide-by-zero?', + 'exn:fail:contract:non-fixnum-result', + 'exn:fail:contract:non-fixnum-result?', 'exn:fail:contract:variable', + 'exn:fail:contract:variable-id', 'exn:fail:contract:variable?', + 'exn:fail:contract?', 'exn:fail:filesystem', + 'exn:fail:filesystem:errno', 'exn:fail:filesystem:errno-errno', + 'exn:fail:filesystem:errno?', 'exn:fail:filesystem:exists', + 'exn:fail:filesystem:exists?', 'exn:fail:filesystem:missing-module', + 'exn:fail:filesystem:missing-module-path', + 'exn:fail:filesystem:missing-module?', 'exn:fail:filesystem:version', + 'exn:fail:filesystem:version?', 'exn:fail:filesystem?', + 'exn:fail:network', 'exn:fail:network:errno', + 'exn:fail:network:errno-errno', 'exn:fail:network:errno?', + 'exn:fail:network?', 'exn:fail:object', 'exn:fail:object?', + 'exn:fail:out-of-memory', 'exn:fail:out-of-memory?', 'exn:fail:read', + 'exn:fail:read-srclocs', 'exn:fail:read:eof', 'exn:fail:read:eof?', + 'exn:fail:read:non-char', 'exn:fail:read:non-char?', 'exn:fail:read?', + 'exn:fail:syntax', 'exn:fail:syntax-exprs', + 'exn:fail:syntax:missing-module', + 'exn:fail:syntax:missing-module-path', + 'exn:fail:syntax:missing-module?', 'exn:fail:syntax:unbound', + 'exn:fail:syntax:unbound?', 'exn:fail:syntax?', 'exn:fail:unsupported', + 'exn:fail:unsupported?', 'exn:fail:user', 'exn:fail:user?', + 'exn:fail?', 'exn:misc:match?', 'exn:missing-module-accessor', + 'exn:missing-module?', 'exn:srclocs-accessor', 'exn:srclocs?', 'exn?', + 'exp', 'expand', 'expand-once', 'expand-syntax', 'expand-syntax-once', + 'expand-syntax-to-top-form', 'expand-to-top-form', 'expand-user-path', + 'explode-path', 'expt', 'externalizable<%>', 'failure-result/c', + 'false?', 'field-names', 'fifth', 'file->bytes', 'file->bytes-lines', + 'file->lines', 'file->list', 'file->string', 'file->value', + 'file-exists?', 'file-name-from-path', 'file-or-directory-identity', + 'file-or-directory-modify-seconds', 'file-or-directory-permissions', + 'file-position', 'file-position*', 'file-size', + 'file-stream-buffer-mode', 'file-stream-port?', 'file-truncate', + 'filename-extension', 'filesystem-change-evt', + 'filesystem-change-evt-cancel', 'filesystem-change-evt?', + 'filesystem-root-list', 'filter', 'filter-map', 'filter-not', + 'filter-read-input-port', 'find-executable-path', 'find-files', + 'find-library-collection-links', 'find-library-collection-paths', + 'find-relative-path', 'find-system-path', 'findf', 'first', + 'first-or/c', 'fixnum?', 'flat-contract', 'flat-contract-predicate', + 'flat-contract-property?', 'flat-contract?', 'flat-named-contract', + 'flatten', 'floating-point-bytes->real', 'flonum?', 'floor', + 'flush-output', 'fold-files', 'foldl', 'foldr', 'for-each', 'force', + 'format', 'fourth', 'fprintf', 'free-identifier=?', + 'free-label-identifier=?', 'free-template-identifier=?', + 'free-transformer-identifier=?', 'fsemaphore-count', 'fsemaphore-post', + 'fsemaphore-try-wait?', 'fsemaphore-wait', 'fsemaphore?', 'future', + 'future?', 'futures-enabled?', 'gcd', 'generate-member-key', + 'generate-temporaries', 'generic-set?', 'generic?', 'gensym', + 'get-output-bytes', 'get-output-string', 'get-preference', + 'get/build-late-neg-projection', 'get/build-val-first-projection', + 'getenv', 'global-port-print-handler', 'group-by', 'group-execute-bit', + 'group-read-bit', 'group-write-bit', 'guard-evt', 'handle-evt', + 'handle-evt?', 'has-blame?', 'has-contract?', 'hash', 'hash->list', + 'hash-clear', 'hash-clear!', 'hash-copy', 'hash-copy-clear', + 'hash-count', 'hash-empty?', 'hash-eq?', 'hash-equal?', 'hash-eqv?', + 'hash-for-each', 'hash-has-key?', 'hash-iterate-first', + 'hash-iterate-key', 'hash-iterate-key+value', 'hash-iterate-next', + 'hash-iterate-pair', 'hash-iterate-value', 'hash-keys', 'hash-map', + 'hash-placeholder?', 'hash-ref', 'hash-ref!', 'hash-remove', + 'hash-remove!', 'hash-set', 'hash-set!', 'hash-set*', 'hash-set*!', + 'hash-update', 'hash-update!', 'hash-values', 'hash-weak?', 'hash/c', + 'hash?', 'hasheq', 'hasheqv', 'identifier-binding', + 'identifier-binding-symbol', 'identifier-label-binding', + 'identifier-prune-lexical-context', + 'identifier-prune-to-source-module', + 'identifier-remove-from-definition-context', + 'identifier-template-binding', 'identifier-transformer-binding', + 'identifier?', 'identity', 'if/c', 'imag-part', 'immutable?', + 'impersonate-box', 'impersonate-channel', + 'impersonate-continuation-mark-key', 'impersonate-hash', + 'impersonate-hash-set', 'impersonate-procedure', + 'impersonate-procedure*', 'impersonate-prompt-tag', + 'impersonate-struct', 'impersonate-vector', 'impersonator-contract?', + 'impersonator-ephemeron', 'impersonator-of?', + 'impersonator-prop:application-mark', 'impersonator-prop:blame', + 'impersonator-prop:contracted', + 'impersonator-property-accessor-procedure?', 'impersonator-property?', + 'impersonator?', 'implementation?', 'implementation?/c', 'in-bytes', + 'in-bytes-lines', 'in-combinations', 'in-cycle', 'in-dict', + 'in-dict-keys', 'in-dict-pairs', 'in-dict-values', 'in-directory', + 'in-hash', 'in-hash-keys', 'in-hash-pairs', 'in-hash-values', + 'in-immutable-hash', 'in-immutable-hash-keys', + 'in-immutable-hash-pairs', 'in-immutable-hash-values', + 'in-immutable-set', 'in-indexed', 'in-input-port-bytes', + 'in-input-port-chars', 'in-lines', 'in-list', 'in-mlist', + 'in-mutable-hash', 'in-mutable-hash-keys', 'in-mutable-hash-pairs', + 'in-mutable-hash-values', 'in-mutable-set', 'in-naturals', + 'in-parallel', 'in-permutations', 'in-port', 'in-producer', 'in-range', + 'in-sequences', 'in-set', 'in-slice', 'in-stream', 'in-string', + 'in-syntax', 'in-value', 'in-values*-sequence', 'in-values-sequence', + 'in-vector', 'in-weak-hash', 'in-weak-hash-keys', 'in-weak-hash-pairs', + 'in-weak-hash-values', 'in-weak-set', 'inexact->exact', + 'inexact-real?', 'inexact?', 'infinite?', 'input-port-append', + 'input-port?', 'inspector?', 'instanceof/c', 'integer->char', + 'integer->integer-bytes', 'integer-bytes->integer', 'integer-in', + 'integer-length', 'integer-sqrt', 'integer-sqrt/remainder', 'integer?', + 'interface->method-names', 'interface-extension?', 'interface?', + 'internal-definition-context-binding-identifiers', + 'internal-definition-context-introduce', + 'internal-definition-context-seal', 'internal-definition-context?', + 'is-a?', 'is-a?/c', 'keyword->string', 'keyword-apply', 'keywordbytes', 'list->mutable-set', + 'list->mutable-seteq', 'list->mutable-seteqv', 'list->set', + 'list->seteq', 'list->seteqv', 'list->string', 'list->vector', + 'list->weak-set', 'list->weak-seteq', 'list->weak-seteqv', + 'list-contract?', 'list-prefix?', 'list-ref', 'list-set', 'list-tail', + 'list-update', 'list/c', 'list?', 'listen-port-number?', 'listof', + 'load', 'load-extension', 'load-on-demand-enabled', 'load-relative', + 'load-relative-extension', 'load/cd', 'load/use-compiled', + 'local-expand', 'local-expand/capture-lifts', + 'local-transformer-expand', 'local-transformer-expand/capture-lifts', + 'locale-string-encoding', 'log', 'log-all-levels', 'log-level-evt', + 'log-level?', 'log-max-level', 'log-message', 'log-receiver?', + 'logger-name', 'logger?', 'magnitude', 'make-arity-at-least', + 'make-base-empty-namespace', 'make-base-namespace', 'make-bytes', + 'make-channel', 'make-chaperone-contract', + 'make-continuation-mark-key', 'make-continuation-prompt-tag', + 'make-contract', 'make-custodian', 'make-custodian-box', + 'make-custom-hash', 'make-custom-hash-types', 'make-custom-set', + 'make-custom-set-types', 'make-date', 'make-date*', + 'make-derived-parameter', 'make-directory', 'make-directory*', + 'make-do-sequence', 'make-empty-namespace', + 'make-environment-variables', 'make-ephemeron', 'make-exn', + 'make-exn:break', 'make-exn:break:hang-up', 'make-exn:break:terminate', + 'make-exn:fail', 'make-exn:fail:contract', + 'make-exn:fail:contract:arity', 'make-exn:fail:contract:blame', + 'make-exn:fail:contract:continuation', + 'make-exn:fail:contract:divide-by-zero', + 'make-exn:fail:contract:non-fixnum-result', + 'make-exn:fail:contract:variable', 'make-exn:fail:filesystem', + 'make-exn:fail:filesystem:errno', 'make-exn:fail:filesystem:exists', + 'make-exn:fail:filesystem:missing-module', + 'make-exn:fail:filesystem:version', 'make-exn:fail:network', + 'make-exn:fail:network:errno', 'make-exn:fail:object', + 'make-exn:fail:out-of-memory', 'make-exn:fail:read', + 'make-exn:fail:read:eof', 'make-exn:fail:read:non-char', + 'make-exn:fail:syntax', 'make-exn:fail:syntax:missing-module', + 'make-exn:fail:syntax:unbound', 'make-exn:fail:unsupported', + 'make-exn:fail:user', 'make-file-or-directory-link', + 'make-flat-contract', 'make-fsemaphore', 'make-generic', + 'make-handle-get-preference-locked', 'make-hash', + 'make-hash-placeholder', 'make-hasheq', 'make-hasheq-placeholder', + 'make-hasheqv', 'make-hasheqv-placeholder', + 'make-immutable-custom-hash', 'make-immutable-hash', + 'make-immutable-hasheq', 'make-immutable-hasheqv', + 'make-impersonator-property', 'make-input-port', + 'make-input-port/read-to-peek', 'make-inspector', + 'make-keyword-procedure', 'make-known-char-range-list', + 'make-limited-input-port', 'make-list', 'make-lock-file-name', + 'make-log-receiver', 'make-logger', 'make-mixin-contract', + 'make-mutable-custom-set', 'make-none/c', 'make-object', + 'make-output-port', 'make-parameter', 'make-parent-directory*', + 'make-phantom-bytes', 'make-pipe', 'make-pipe-with-specials', + 'make-placeholder', 'make-plumber', 'make-polar', 'make-prefab-struct', + 'make-primitive-class', 'make-proj-contract', + 'make-pseudo-random-generator', 'make-reader-graph', 'make-readtable', + 'make-rectangular', 'make-rename-transformer', + 'make-resolved-module-path', 'make-security-guard', 'make-semaphore', + 'make-set!-transformer', 'make-shared-bytes', 'make-sibling-inspector', + 'make-special-comment', 'make-srcloc', 'make-string', + 'make-struct-field-accessor', 'make-struct-field-mutator', + 'make-struct-type', 'make-struct-type-property', + 'make-syntax-delta-introducer', 'make-syntax-introducer', + 'make-temporary-file', 'make-tentative-pretty-print-output-port', + 'make-thread-cell', 'make-thread-group', 'make-vector', + 'make-weak-box', 'make-weak-custom-hash', 'make-weak-custom-set', + 'make-weak-hash', 'make-weak-hasheq', 'make-weak-hasheqv', + 'make-will-executor', 'map', 'match-equality-test', + 'matches-arity-exactly?', 'max', 'mcar', 'mcdr', 'mcons', 'member', + 'member-name-key-hash-code', 'member-name-key=?', 'member-name-key?', + 'memf', 'memq', 'memv', 'merge-input', 'method-in-interface?', 'min', + 'mixin-contract', 'module->exports', 'module->imports', + 'module->language-info', 'module->namespace', + 'module-compiled-cross-phase-persistent?', 'module-compiled-exports', + 'module-compiled-imports', 'module-compiled-language-info', + 'module-compiled-name', 'module-compiled-submodules', + 'module-declared?', 'module-path-index-join', + 'module-path-index-resolve', 'module-path-index-split', + 'module-path-index-submodule', 'module-path-index?', 'module-path?', + 'module-predefined?', 'module-provide-protected?', 'modulo', 'mpair?', + 'mutable-set', 'mutable-seteq', 'mutable-seteqv', 'n->th', + 'nack-guard-evt', 'namespace-anchor->empty-namespace', + 'namespace-anchor->namespace', 'namespace-anchor?', + 'namespace-attach-module', 'namespace-attach-module-declaration', + 'namespace-base-phase', 'namespace-mapped-symbols', + 'namespace-module-identifier', 'namespace-module-registry', + 'namespace-require', 'namespace-require/constant', + 'namespace-require/copy', 'namespace-require/expansion-time', + 'namespace-set-variable-value!', 'namespace-symbol->identifier', + 'namespace-syntax-introduce', 'namespace-undefine-variable!', + 'namespace-unprotect-module', 'namespace-variable-value', 'namespace?', + 'nan?', 'natural-number/c', 'negate', 'negative?', 'never-evt', + 'new-∀/c', 'new-∃/c', 'newline', 'ninth', 'non-empty-listof', + 'non-empty-string?', 'none/c', 'normal-case-path', 'normalize-arity', + 'normalize-path', 'normalized-arity?', 'not', 'not/c', 'null', 'null?', + 'number->string', 'number?', 'numerator', 'object%', 'object->vector', + 'object-info', 'object-interface', 'object-method-arity-includes?', + 'object-name', 'object-or-false=?', 'object=?', 'object?', 'odd?', + 'one-of/c', 'open-input-bytes', 'open-input-file', + 'open-input-output-file', 'open-input-string', 'open-output-bytes', + 'open-output-file', 'open-output-nowhere', 'open-output-string', + 'or/c', 'order-of-magnitude', 'ormap', 'other-execute-bit', + 'other-read-bit', 'other-write-bit', 'output-port?', 'pair?', + 'parameter-procedure=?', 'parameter/c', 'parameter?', + 'parameterization?', 'parse-command-line', 'partition', 'path->bytes', + 'path->complete-path', 'path->directory-path', 'path->string', + 'path-add-suffix', 'path-convention-type', 'path-element->bytes', + 'path-element->string', 'path-element?', 'path-for-some-system?', + 'path-list-string->path-list', 'path-only', 'path-replace-suffix', + 'path-string?', 'pathbytes', 'port->bytes-lines', 'port->lines', + 'port->list', 'port->string', 'port-closed-evt', 'port-closed?', + 'port-commit-peeked', 'port-count-lines!', 'port-count-lines-enabled', + 'port-counts-lines?', 'port-display-handler', 'port-file-identity', + 'port-file-unlock', 'port-next-location', 'port-number?', + 'port-print-handler', 'port-progress-evt', + 'port-provides-progress-evts?', 'port-read-handler', + 'port-try-file-lock?', 'port-write-handler', 'port-writes-atomic?', + 'port-writes-special?', 'port?', 'positive?', 'predicate/c', + 'prefab-key->struct-type', 'prefab-key?', 'prefab-struct-key', + 'preferences-lock-file-mode', 'pregexp', 'pregexp?', 'pretty-display', + 'pretty-format', 'pretty-print', 'pretty-print-.-symbol-without-bars', + 'pretty-print-abbreviate-read-macros', 'pretty-print-columns', + 'pretty-print-current-style-table', 'pretty-print-depth', + 'pretty-print-exact-as-decimal', 'pretty-print-extend-style-table', + 'pretty-print-handler', 'pretty-print-newline', + 'pretty-print-post-print-hook', 'pretty-print-pre-print-hook', + 'pretty-print-print-hook', 'pretty-print-print-line', + 'pretty-print-remap-stylable', 'pretty-print-show-inexactness', + 'pretty-print-size-hook', 'pretty-print-style-table?', + 'pretty-printing', 'pretty-write', 'primitive-closure?', + 'primitive-result-arity', 'primitive?', 'print', 'print-as-expression', + 'print-boolean-long-form', 'print-box', 'print-graph', + 'print-hash-table', 'print-mpair-curly-braces', + 'print-pair-curly-braces', 'print-reader-abbreviations', + 'print-struct', 'print-syntax-width', 'print-unreadable', + 'print-vector-length', 'printable/c', 'printable<%>', 'printf', + 'println', 'procedure->method', 'procedure-arity', + 'procedure-arity-includes/c', 'procedure-arity-includes?', + 'procedure-arity?', 'procedure-closure-contents-eq?', + 'procedure-extract-target', 'procedure-keywords', + 'procedure-reduce-arity', 'procedure-reduce-keyword-arity', + 'procedure-rename', 'procedure-result-arity', 'procedure-specialize', + 'procedure-struct-type?', 'procedure?', 'process', 'process*', + 'process*/ports', 'process/ports', 'processor-count', 'progress-evt?', + 'promise-forced?', 'promise-running?', 'promise/c', 'promise/name?', + 'promise?', 'prop:arity-string', 'prop:arrow-contract', + 'prop:arrow-contract-get-info', 'prop:arrow-contract?', 'prop:blame', + 'prop:chaperone-contract', 'prop:checked-procedure', 'prop:contract', + 'prop:contracted', 'prop:custom-print-quotable', 'prop:custom-write', + 'prop:dict', 'prop:dict/contract', 'prop:equal+hash', 'prop:evt', + 'prop:exn:missing-module', 'prop:exn:srclocs', + 'prop:expansion-contexts', 'prop:flat-contract', + 'prop:impersonator-of', 'prop:input-port', + 'prop:liberal-define-context', 'prop:object-name', + 'prop:opt-chaperone-contract', 'prop:opt-chaperone-contract-get-test', + 'prop:opt-chaperone-contract?', 'prop:orc-contract', + 'prop:orc-contract-get-subcontracts', 'prop:orc-contract?', + 'prop:output-port', 'prop:place-location', 'prop:procedure', + 'prop:recursive-contract', 'prop:recursive-contract-unroll', + 'prop:recursive-contract?', 'prop:rename-transformer', 'prop:sequence', + 'prop:set!-transformer', 'prop:stream', 'proper-subset?', + 'pseudo-random-generator->vector', 'pseudo-random-generator-vector?', + 'pseudo-random-generator?', 'put-preferences', 'putenv', 'quotient', + 'quotient/remainder', 'radians->degrees', 'raise', + 'raise-argument-error', 'raise-arguments-error', 'raise-arity-error', + 'raise-blame-error', 'raise-contract-error', 'raise-mismatch-error', + 'raise-not-cons-blame-error', 'raise-range-error', + 'raise-result-error', 'raise-syntax-error', 'raise-type-error', + 'raise-user-error', 'random', 'random-seed', 'range', 'rational?', + 'rationalize', 'read', 'read-accept-bar-quote', 'read-accept-box', + 'read-accept-compiled', 'read-accept-dot', 'read-accept-graph', + 'read-accept-infix-dot', 'read-accept-lang', 'read-accept-quasiquote', + 'read-accept-reader', 'read-byte', 'read-byte-or-special', + 'read-bytes', 'read-bytes!', 'read-bytes!-evt', 'read-bytes-avail!', + 'read-bytes-avail!*', 'read-bytes-avail!-evt', + 'read-bytes-avail!/enable-break', 'read-bytes-evt', 'read-bytes-line', + 'read-bytes-line-evt', 'read-case-sensitive', 'read-cdot', 'read-char', + 'read-char-or-special', 'read-curly-brace-as-paren', + 'read-curly-brace-with-tag', 'read-decimal-as-inexact', + 'read-eval-print-loop', 'read-language', 'read-line', 'read-line-evt', + 'read-on-demand-source', 'read-square-bracket-as-paren', + 'read-square-bracket-with-tag', 'read-string', 'read-string!', + 'read-string!-evt', 'read-string-evt', 'read-syntax', + 'read-syntax/recursive', 'read/recursive', 'readtable-mapping', + 'readtable?', 'real->decimal-string', 'real->double-flonum', + 'real->floating-point-bytes', 'real->single-flonum', 'real-in', + 'real-part', 'real?', 'reencode-input-port', 'reencode-output-port', + 'regexp', 'regexp-match', 'regexp-match*', 'regexp-match-evt', + 'regexp-match-exact?', 'regexp-match-peek', + 'regexp-match-peek-immediate', 'regexp-match-peek-positions', + 'regexp-match-peek-positions*', + 'regexp-match-peek-positions-immediate', + 'regexp-match-peek-positions-immediate/end', + 'regexp-match-peek-positions/end', 'regexp-match-positions', + 'regexp-match-positions*', 'regexp-match-positions/end', + 'regexp-match/end', 'regexp-match?', 'regexp-max-lookbehind', + 'regexp-quote', 'regexp-replace', 'regexp-replace*', + 'regexp-replace-quote', 'regexp-replaces', 'regexp-split', + 'regexp-try-match', 'regexp?', 'relative-path?', 'relocate-input-port', + 'relocate-output-port', 'remainder', 'remf', 'remf*', 'remove', + 'remove*', 'remove-duplicates', 'remq', 'remq*', 'remv', 'remv*', + 'rename-contract', 'rename-file-or-directory', + 'rename-transformer-target', 'rename-transformer?', 'replace-evt', + 'reroot-path', 'resolve-path', 'resolved-module-path-name', + 'resolved-module-path?', 'rest', 'reverse', 'round', 'second', + 'seconds->date', 'security-guard?', 'semaphore-peek-evt', + 'semaphore-peek-evt?', 'semaphore-post', 'semaphore-try-wait?', + 'semaphore-wait', 'semaphore-wait/enable-break', 'semaphore?', + 'sequence->list', 'sequence->stream', 'sequence-add-between', + 'sequence-andmap', 'sequence-append', 'sequence-count', + 'sequence-filter', 'sequence-fold', 'sequence-for-each', + 'sequence-generate', 'sequence-generate*', 'sequence-length', + 'sequence-map', 'sequence-ormap', 'sequence-ref', 'sequence-tail', + 'sequence/c', 'sequence?', 'set', 'set!-transformer-procedure', + 'set!-transformer?', 'set->list', 'set->stream', 'set-add', 'set-add!', + 'set-box!', 'set-clear', 'set-clear!', 'set-copy', 'set-copy-clear', + 'set-count', 'set-empty?', 'set-eq?', 'set-equal?', 'set-eqv?', + 'set-first', 'set-for-each', 'set-implements/c', 'set-implements?', + 'set-intersect', 'set-intersect!', 'set-map', 'set-mcar!', 'set-mcdr!', + 'set-member?', 'set-mutable?', 'set-phantom-bytes!', + 'set-port-next-location!', 'set-remove', 'set-remove!', 'set-rest', + 'set-some-basic-contracts!', 'set-subtract', 'set-subtract!', + 'set-symmetric-difference', 'set-symmetric-difference!', 'set-union', + 'set-union!', 'set-weak?', 'set/c', 'set=?', 'set?', 'seteq', 'seteqv', + 'seventh', 'sgn', 'shared-bytes', 'shell-execute', 'shrink-path-wrt', + 'shuffle', 'simple-form-path', 'simplify-path', 'sin', + 'single-flonum?', 'sinh', 'sixth', 'skip-projection-wrapper?', 'sleep', + 'some-system-path->string', 'sort', 'special-comment-value', + 'special-comment?', 'special-filter-input-port', 'split-at', + 'split-at-right', 'split-common-prefix', 'split-path', 'splitf-at', + 'splitf-at-right', 'sqr', 'sqrt', 'srcloc', 'srcloc->string', + 'srcloc-column', 'srcloc-line', 'srcloc-position', 'srcloc-source', + 'srcloc-span', 'srcloc?', 'stop-after', 'stop-before', 'stream->list', + 'stream-add-between', 'stream-andmap', 'stream-append', 'stream-count', + 'stream-empty?', 'stream-filter', 'stream-first', 'stream-fold', + 'stream-for-each', 'stream-length', 'stream-map', 'stream-ormap', + 'stream-ref', 'stream-rest', 'stream-tail', 'stream/c', 'stream?', + 'string', 'string->bytes/latin-1', 'string->bytes/locale', + 'string->bytes/utf-8', 'string->immutable-string', 'string->keyword', + 'string->list', 'string->number', 'string->path', + 'string->path-element', 'string->some-system-path', 'string->symbol', + 'string->uninterned-symbol', 'string->unreadable-symbol', + 'string-append', 'string-append*', 'string-ci<=?', 'string-ci=?', 'string-ci>?', 'string-contains?', + 'string-copy', 'string-copy!', 'string-downcase', + 'string-environment-variable-name?', 'string-fill!', 'string-foldcase', + 'string-join', 'string-len/c', 'string-length', 'string-locale-ci?', 'string-locale-downcase', + 'string-locale-upcase', 'string-locale?', 'string-no-nuls?', 'string-normalize-nfc', + 'string-normalize-nfd', 'string-normalize-nfkc', + 'string-normalize-nfkd', 'string-normalize-spaces', 'string-port?', + 'string-prefix?', 'string-ref', 'string-replace', 'string-set!', + 'string-split', 'string-suffix?', 'string-titlecase', 'string-trim', + 'string-upcase', 'string-utf-8-length', 'string<=?', 'string=?', 'string>?', 'string?', 'struct->vector', + 'struct-accessor-procedure?', 'struct-constructor-procedure?', + 'struct-info', 'struct-mutator-procedure?', + 'struct-predicate-procedure?', 'struct-type-info', + 'struct-type-make-constructor', 'struct-type-make-predicate', + 'struct-type-property-accessor-procedure?', 'struct-type-property/c', + 'struct-type-property?', 'struct-type?', 'struct:arity-at-least', + 'struct:arrow-contract-info', 'struct:date', 'struct:date*', + 'struct:exn', 'struct:exn:break', 'struct:exn:break:hang-up', + 'struct:exn:break:terminate', 'struct:exn:fail', + 'struct:exn:fail:contract', 'struct:exn:fail:contract:arity', + 'struct:exn:fail:contract:blame', + 'struct:exn:fail:contract:continuation', + 'struct:exn:fail:contract:divide-by-zero', + 'struct:exn:fail:contract:non-fixnum-result', + 'struct:exn:fail:contract:variable', 'struct:exn:fail:filesystem', + 'struct:exn:fail:filesystem:errno', + 'struct:exn:fail:filesystem:exists', + 'struct:exn:fail:filesystem:missing-module', + 'struct:exn:fail:filesystem:version', 'struct:exn:fail:network', + 'struct:exn:fail:network:errno', 'struct:exn:fail:object', + 'struct:exn:fail:out-of-memory', 'struct:exn:fail:read', + 'struct:exn:fail:read:eof', 'struct:exn:fail:read:non-char', + 'struct:exn:fail:syntax', 'struct:exn:fail:syntax:missing-module', + 'struct:exn:fail:syntax:unbound', 'struct:exn:fail:unsupported', + 'struct:exn:fail:user', 'struct:srcloc', + 'struct:wrapped-extra-arg-arrow', 'struct?', 'sub1', 'subbytes', + 'subclass?', 'subclass?/c', 'subprocess', 'subprocess-group-enabled', + 'subprocess-kill', 'subprocess-pid', 'subprocess-status', + 'subprocess-wait', 'subprocess?', 'subset?', 'substring', 'suggest/c', + 'symbol->string', 'symbol-interned?', 'symbol-unreadable?', 'symboldatum', + 'syntax->list', 'syntax-arm', 'syntax-column', 'syntax-debug-info', + 'syntax-disarm', 'syntax-e', 'syntax-line', + 'syntax-local-bind-syntaxes', 'syntax-local-certifier', + 'syntax-local-context', 'syntax-local-expand-expression', + 'syntax-local-get-shadower', 'syntax-local-identifier-as-binding', + 'syntax-local-introduce', 'syntax-local-lift-context', + 'syntax-local-lift-expression', 'syntax-local-lift-module', + 'syntax-local-lift-module-end-declaration', + 'syntax-local-lift-provide', 'syntax-local-lift-require', + 'syntax-local-lift-values-expression', + 'syntax-local-make-definition-context', + 'syntax-local-make-delta-introducer', + 'syntax-local-module-defined-identifiers', + 'syntax-local-module-exports', + 'syntax-local-module-required-identifiers', 'syntax-local-name', + 'syntax-local-phase-level', 'syntax-local-submodules', + 'syntax-local-transforming-module-provides?', 'syntax-local-value', + 'syntax-local-value/immediate', 'syntax-original?', 'syntax-position', + 'syntax-property', 'syntax-property-preserved?', + 'syntax-property-symbol-keys', 'syntax-protect', 'syntax-rearm', + 'syntax-recertify', 'syntax-shift-phase-level', 'syntax-source', + 'syntax-source-module', 'syntax-span', 'syntax-taint', + 'syntax-tainted?', 'syntax-track-origin', + 'syntax-transforming-module-expression?', + 'syntax-transforming-with-lifts?', 'syntax-transforming?', 'syntax/c', + 'syntax?', 'system', 'system*', 'system*/exit-code', + 'system-big-endian?', 'system-idle-evt', 'system-language+country', + 'system-library-subpath', 'system-path-convention-type', 'system-type', + 'system/exit-code', 'tail-marks-match?', 'take', 'take-common-prefix', + 'take-right', 'takef', 'takef-right', 'tan', 'tanh', + 'tcp-abandon-port', 'tcp-accept', 'tcp-accept-evt', + 'tcp-accept-ready?', 'tcp-accept/enable-break', 'tcp-addresses', + 'tcp-close', 'tcp-connect', 'tcp-connect/enable-break', 'tcp-listen', + 'tcp-listener?', 'tcp-port?', 'tentative-pretty-print-port-cancel', + 'tentative-pretty-print-port-transfer', 'tenth', 'terminal-port?', + 'the-unsupplied-arg', 'third', 'thread', 'thread-cell-ref', + 'thread-cell-set!', 'thread-cell-values?', 'thread-cell?', + 'thread-dead-evt', 'thread-dead?', 'thread-group?', 'thread-receive', + 'thread-receive-evt', 'thread-resume', 'thread-resume-evt', + 'thread-rewind-receive', 'thread-running?', 'thread-send', + 'thread-suspend', 'thread-suspend-evt', 'thread-try-receive', + 'thread-wait', 'thread/suspend-to-kill', 'thread?', 'time-apply', + 'touch', 'transplant-input-port', 'transplant-output-port', 'true', + 'truncate', 'udp-addresses', 'udp-bind!', 'udp-bound?', 'udp-close', + 'udp-connect!', 'udp-connected?', 'udp-multicast-interface', + 'udp-multicast-join-group!', 'udp-multicast-leave-group!', + 'udp-multicast-loopback?', 'udp-multicast-set-interface!', + 'udp-multicast-set-loopback!', 'udp-multicast-set-ttl!', + 'udp-multicast-ttl', 'udp-open-socket', 'udp-receive!', + 'udp-receive!*', 'udp-receive!-evt', 'udp-receive!/enable-break', + 'udp-receive-ready-evt', 'udp-send', 'udp-send*', 'udp-send-evt', + 'udp-send-ready-evt', 'udp-send-to', 'udp-send-to*', 'udp-send-to-evt', + 'udp-send-to/enable-break', 'udp-send/enable-break', 'udp?', 'unbox', + 'uncaught-exception-handler', 'unit?', 'unspecified-dom', + 'unsupplied-arg?', 'use-collection-link-paths', + 'use-compiled-file-paths', 'use-user-specific-search-paths', + 'user-execute-bit', 'user-read-bit', 'user-write-bit', 'value-blame', + 'value-contract', 'values', 'variable-reference->empty-namespace', + 'variable-reference->module-base-phase', + 'variable-reference->module-declaration-inspector', + 'variable-reference->module-path-index', + 'variable-reference->module-source', 'variable-reference->namespace', + 'variable-reference->phase', + 'variable-reference->resolved-module-path', + 'variable-reference-constant?', 'variable-reference?', 'vector', + 'vector->immutable-vector', 'vector->list', + 'vector->pseudo-random-generator', 'vector->pseudo-random-generator!', + 'vector->values', 'vector-append', 'vector-argmax', 'vector-argmin', + 'vector-copy', 'vector-copy!', 'vector-count', 'vector-drop', + 'vector-drop-right', 'vector-fill!', 'vector-filter', + 'vector-filter-not', 'vector-immutable', 'vector-immutable/c', + 'vector-immutableof', 'vector-length', 'vector-map', 'vector-map!', + 'vector-member', 'vector-memq', 'vector-memv', 'vector-ref', + 'vector-set!', 'vector-set*!', 'vector-set-performance-stats!', + 'vector-split-at', 'vector-split-at-right', 'vector-take', + 'vector-take-right', 'vector/c', 'vector?', 'vectorof', 'version', + 'void', 'void?', 'weak-box-value', 'weak-box?', 'weak-set', + 'weak-seteq', 'weak-seteqv', 'will-execute', 'will-executor?', + 'will-register', 'will-try-execute', 'with-input-from-bytes', + 'with-input-from-file', 'with-input-from-string', + 'with-output-to-bytes', 'with-output-to-file', 'with-output-to-string', + 'would-be-future', 'wrap-evt', 'wrapped-extra-arg-arrow', + 'wrapped-extra-arg-arrow-extra-neg-party-argument', + 'wrapped-extra-arg-arrow-real-func', 'wrapped-extra-arg-arrow?', + 'writable<%>', 'write', 'write-byte', 'write-bytes', + 'write-bytes-avail', 'write-bytes-avail*', 'write-bytes-avail-evt', + 'write-bytes-avail/enable-break', 'write-char', 'write-special', + 'write-special-avail*', 'write-special-evt', 'write-string', + 'write-to-file', 'writeln', 'xor', 'zero?', '~.a', '~.s', '~.v', '~a', + '~e', '~r', '~s', '~v' + ) + + _opening_parenthesis = r'[([{]' + _closing_parenthesis = r'[)\]}]' + _delimiters = r'()[\]{}",\'`;\s' + _symbol = rf'(?:\|[^|]*\||\\[\w\W]|[^|\\{_delimiters}]+)+' + _exact_decimal_prefix = r'(?:#e)?(?:#d)?(?:#e)?' + _exponent = r'(?:[defls][-+]?\d+)' + _inexact_simple_no_hashes = r'(?:\d+(?:/\d+|\.\d*)?|\.\d+)' + _inexact_simple = (rf'(?:{_inexact_simple_no_hashes}|(?:\d+#+(?:\.#*|/\d+#*)?|\.\d+#+|' + r'\d+(?:\.\d*#+|/\d+#+)))') + _inexact_normal_no_hashes = rf'(?:{_inexact_simple_no_hashes}{_exponent}?)' + _inexact_normal = rf'(?:{_inexact_simple}{_exponent}?)' + _inexact_special = r'(?:(?:inf|nan)\.[0f])' + _inexact_real = rf'(?:[-+]?{_inexact_normal}|[-+]{_inexact_special})' + _inexact_unsigned = rf'(?:{_inexact_normal}|{_inexact_special})' + + tokens = { + 'root': [ + (_closing_parenthesis, Error), + (r'(?!\Z)', Text, 'unquoted-datum') + ], + 'datum': [ + (r'(?s)#;|#![ /]([^\\\n]|\\.)*', Comment), + (r';[^\n\r\x85\u2028\u2029]*', Comment.Single), + (r'#\|', Comment.Multiline, 'block-comment'), + + # Whitespaces + (r'(?u)\s+', Whitespace), + + # Numbers: Keep in mind Racket reader hash prefixes, which + # can denote the base or the type. These don't map neatly + # onto Pygments token types; some judgment calls here. + + # #d or no prefix + (rf'(?i){_exact_decimal_prefix}[-+]?\d+(?=[{_delimiters}])', + Number.Integer, '#pop'), + (rf'(?i){_exact_decimal_prefix}[-+]?(\d+(\.\d*)?|\.\d+)([deflst][-+]?\d+)?(?=[{_delimiters}])', Number.Float, '#pop'), + (rf'(?i){_exact_decimal_prefix}[-+]?({_inexact_normal_no_hashes}([-+]{_inexact_normal_no_hashes}?i)?|[-+]{_inexact_normal_no_hashes}?i)(?=[{_delimiters}])', Number, '#pop'), + + # Inexact without explicit #i + (rf'(?i)(#d)?({_inexact_real}([-+]{_inexact_unsigned}?i)?|[-+]{_inexact_unsigned}?i|{_inexact_real}@{_inexact_real})(?=[{_delimiters}])', Number.Float, + '#pop'), + + # The remaining extflonums + (rf'(?i)(([-+]?{_inexact_simple}t[-+]?\d+)|[-+](inf|nan)\.t)(?=[{_delimiters}])', Number.Float, '#pop'), + + # #b + (rf'(?iu)(#[ei])?#b{_symbol}', Number.Bin, '#pop'), + + # #o + (rf'(?iu)(#[ei])?#o{_symbol}', Number.Oct, '#pop'), + + # #x + (rf'(?iu)(#[ei])?#x{_symbol}', Number.Hex, '#pop'), + + # #i is always inexact, i.e. float + (rf'(?iu)(#d)?#i{_symbol}', Number.Float, '#pop'), + + # Strings and characters + (r'#?"', String.Double, ('#pop', 'string')), + (r'#<<(.+)\n(^(?!\1$).*$\n)*^\1$', String.Heredoc, '#pop'), + (r'#\\(u[\da-fA-F]{1,4}|U[\da-fA-F]{1,8})', String.Char, '#pop'), + (r'(?is)#\\([0-7]{3}|[a-z]+|.)', String.Char, '#pop'), + (r'(?s)#[pr]x#?"(\\?.)*?"', String.Regex, '#pop'), + + # Constants + (r'#(true|false|[tTfF])', Name.Constant, '#pop'), + + # Keyword argument names (e.g. #:keyword) + (rf'#:{_symbol}', Keyword.Declaration, '#pop'), + + # Reader extensions + (r'(#lang |#!)(\S+)', + bygroups(Keyword.Namespace, Name.Namespace)), + (r'#reader', Keyword.Namespace, 'quoted-datum'), + + # Other syntax + (rf"(?i)\.(?=[{_delimiters}])|#c[is]|#['`]|#,@?", Operator), + (rf"'|#[s&]|#hash(eqv?)?|#\d*(?={_opening_parenthesis})", + Operator, ('#pop', 'quoted-datum')) + ], + 'datum*': [ + (r'`|,@?', Operator), + (_symbol, String.Symbol, '#pop'), + (r'[|\\]', Error), + default('#pop') + ], + 'list': [ + (_closing_parenthesis, Punctuation, '#pop') + ], + 'unquoted-datum': [ + include('datum'), + (rf'quote(?=[{_delimiters}])', Keyword, + ('#pop', 'quoted-datum')), + (r'`', Operator, ('#pop', 'quasiquoted-datum')), + (rf'quasiquote(?=[{_delimiters}])', Keyword, + ('#pop', 'quasiquoted-datum')), + (_opening_parenthesis, Punctuation, ('#pop', 'unquoted-list')), + (words(_keywords, suffix=f'(?=[{_delimiters}])'), + Keyword, '#pop'), + (words(_builtins, suffix=f'(?=[{_delimiters}])'), + Name.Builtin, '#pop'), + (_symbol, Name, '#pop'), + include('datum*') + ], + 'unquoted-list': [ + include('list'), + (r'(?!\Z)', Text, 'unquoted-datum') + ], + 'quasiquoted-datum': [ + include('datum'), + (r',@?', Operator, ('#pop', 'unquoted-datum')), + (rf'unquote(-splicing)?(?=[{_delimiters}])', Keyword, + ('#pop', 'unquoted-datum')), + (_opening_parenthesis, Punctuation, ('#pop', 'quasiquoted-list')), + include('datum*') + ], + 'quasiquoted-list': [ + include('list'), + (r'(?!\Z)', Text, 'quasiquoted-datum') + ], + 'quoted-datum': [ + include('datum'), + (_opening_parenthesis, Punctuation, ('#pop', 'quoted-list')), + include('datum*') + ], + 'quoted-list': [ + include('list'), + (r'(?!\Z)', Text, 'quoted-datum') + ], + 'block-comment': [ + (r'#\|', Comment.Multiline, '#push'), + (r'\|#', Comment.Multiline, '#pop'), + (r'[^#|]+|.', Comment.Multiline) + ], + 'string': [ + (r'"', String.Double, '#pop'), + (r'(?s)\\([0-7]{1,3}|x[\da-fA-F]{1,2}|u[\da-fA-F]{1,4}|' + r'U[\da-fA-F]{1,8}|.)', String.Escape), + (r'[^\\"]+', String.Double) + ] + } + + +class NewLispLexer(RegexLexer): + """ + For newLISP source code (version 10.3.0). + """ + + name = 'NewLisp' + url = 'http://www.newlisp.org/' + aliases = ['newlisp'] + filenames = ['*.lsp', '*.nl', '*.kif'] + mimetypes = ['text/x-newlisp', 'application/x-newlisp'] + version_added = '1.5' + + flags = re.IGNORECASE | re.MULTILINE + + # list of built-in functions for newLISP version 10.3 + builtins = ( + '^', '--', '-', ':', '!', '!=', '?', '@', '*', '/', '&', '%', '+', '++', + '<', '<<', '<=', '=', '>', '>=', '>>', '|', '~', '$', '$0', '$1', '$10', + '$11', '$12', '$13', '$14', '$15', '$2', '$3', '$4', '$5', '$6', '$7', + '$8', '$9', '$args', '$idx', '$it', '$main-args', 'abort', 'abs', + 'acos', 'acosh', 'add', 'address', 'amb', 'and', 'append-file', + 'append', 'apply', 'args', 'array-list', 'array?', 'array', 'asin', + 'asinh', 'assoc', 'atan', 'atan2', 'atanh', 'atom?', 'base64-dec', + 'base64-enc', 'bayes-query', 'bayes-train', 'begin', + 'beta', 'betai', 'bind', 'binomial', 'bits', 'callback', + 'case', 'catch', 'ceil', 'change-dir', 'char', 'chop', 'Class', 'clean', + 'close', 'command-event', 'cond', 'cons', 'constant', + 'context?', 'context', 'copy-file', 'copy', 'cos', 'cosh', 'count', + 'cpymem', 'crc32', 'crit-chi2', 'crit-z', 'current-line', 'curry', + 'date-list', 'date-parse', 'date-value', 'date', 'debug', 'dec', + 'def-new', 'default', 'define-macro', 'define', + 'delete-file', 'delete-url', 'delete', 'destroy', 'det', 'device', + 'difference', 'directory?', 'directory', 'div', 'do-until', 'do-while', + 'doargs', 'dolist', 'dostring', 'dotimes', 'dotree', 'dump', 'dup', + 'empty?', 'encrypt', 'ends-with', 'env', 'erf', 'error-event', + 'eval-string', 'eval', 'exec', 'exists', 'exit', 'exp', 'expand', + 'explode', 'extend', 'factor', 'fft', 'file-info', 'file?', 'filter', + 'find-all', 'find', 'first', 'flat', 'float?', 'float', 'floor', 'flt', + 'fn', 'for-all', 'for', 'fork', 'format', 'fv', 'gammai', 'gammaln', + 'gcd', 'get-char', 'get-float', 'get-int', 'get-long', 'get-string', + 'get-url', 'global?', 'global', 'if-not', 'if', 'ifft', 'import', 'inc', + 'index', 'inf?', 'int', 'integer?', 'integer', 'intersect', 'invert', + 'irr', 'join', 'lambda-macro', 'lambda?', 'lambda', 'last-error', + 'last', 'legal?', 'length', 'let', 'letex', 'letn', + 'list?', 'list', 'load', 'local', 'log', 'lookup', + 'lower-case', 'macro?', 'main-args', 'MAIN', 'make-dir', 'map', 'mat', + 'match', 'max', 'member', 'min', 'mod', 'module', 'mul', 'multiply', + 'NaN?', 'net-accept', 'net-close', 'net-connect', 'net-error', + 'net-eval', 'net-interface', 'net-ipv', 'net-listen', 'net-local', + 'net-lookup', 'net-packet', 'net-peek', 'net-peer', 'net-ping', + 'net-receive-from', 'net-receive-udp', 'net-receive', 'net-select', + 'net-send-to', 'net-send-udp', 'net-send', 'net-service', + 'net-sessions', 'new', 'nil?', 'nil', 'normal', 'not', 'now', 'nper', + 'npv', 'nth', 'null?', 'number?', 'open', 'or', 'ostype', 'pack', + 'parse-date', 'parse', 'peek', 'pipe', 'pmt', 'pop-assoc', 'pop', + 'post-url', 'pow', 'prefix', 'pretty-print', 'primitive?', 'print', + 'println', 'prob-chi2', 'prob-z', 'process', 'prompt-event', + 'protected?', 'push', 'put-url', 'pv', 'quote?', 'quote', 'rand', + 'random', 'randomize', 'read', 'read-char', 'read-expr', 'read-file', + 'read-key', 'read-line', 'read-utf8', 'reader-event', + 'real-path', 'receive', 'ref-all', 'ref', 'regex-comp', 'regex', + 'remove-dir', 'rename-file', 'replace', 'reset', 'rest', 'reverse', + 'rotate', 'round', 'save', 'search', 'seed', 'seek', 'select', 'self', + 'semaphore', 'send', 'sequence', 'series', 'set-locale', 'set-ref-all', + 'set-ref', 'set', 'setf', 'setq', 'sgn', 'share', 'signal', 'silent', + 'sin', 'sinh', 'sleep', 'slice', 'sort', 'source', 'spawn', 'sqrt', + 'starts-with', 'string?', 'string', 'sub', 'swap', 'sym', 'symbol?', + 'symbols', 'sync', 'sys-error', 'sys-info', 'tan', 'tanh', 'term', + 'throw-error', 'throw', 'time-of-day', 'time', 'timer', 'title-case', + 'trace-highlight', 'trace', 'transpose', 'Tree', 'trim', 'true?', + 'true', 'unicode', 'unify', 'unique', 'unless', 'unpack', 'until', + 'upper-case', 'utf8', 'utf8len', 'uuid', 'wait-pid', 'when', 'while', + 'write', 'write-char', 'write-file', 'write-line', + 'xfer-event', 'xml-error', 'xml-parse', 'xml-type-tags', 'zero?', + ) + + # valid names + valid_name = r'([\w!$%&*+.,/<=>?@^~|-])+|(\[.*?\])+' + + tokens = { + 'root': [ + # shebang + (r'#!(.*?)$', Comment.Preproc), + # comments starting with semicolon + (r';.*$', Comment.Single), + # comments starting with # + (r'#.*$', Comment.Single), + + # whitespace + (r'\s+', Whitespace), + + # strings, symbols and characters + (r'"(\\\\|\\[^\\]|[^"\\])*"', String), + + # braces + (r'\{', String, "bracestring"), + + # [text] ... [/text] delimited strings + (r'\[text\]*', String, "tagstring"), + + # 'special' operators... + (r"('|:)", Operator), + + # highlight the builtins + (words(builtins, suffix=r'\b'), + Keyword), + + # the remaining functions + (r'(?<=\()' + valid_name, Name.Variable), + + # the remaining variables + (valid_name, String.Symbol), + + # parentheses + (r'(\(|\))', Punctuation), + ], + + # braced strings... + 'bracestring': [ + (r'\{', String, "#push"), + (r'\}', String, "#pop"), + ('[^{}]+', String), + ], + + # tagged [text]...[/text] delimited strings... + 'tagstring': [ + (r'(?s)(.*?)(\[/text\])', String, '#pop'), + ], + } + + +class EmacsLispLexer(RegexLexer): + """ + An ELisp lexer, parsing a stream and outputting the tokens + needed to highlight elisp code. + """ + name = 'EmacsLisp' + aliases = ['emacs-lisp', 'elisp', 'emacs'] + filenames = ['*.el'] + mimetypes = ['text/x-elisp', 'application/x-elisp'] + url = 'https://www.gnu.org/software/emacs' + version_added = '2.1' + + flags = re.MULTILINE + + # couple of useful regexes + + # characters that are not macro-characters and can be used to begin a symbol + nonmacro = r'\\.|[\w!$%&*+-/<=>?@^{}~|]' + constituent = nonmacro + '|[#.:]' + terminated = r'(?=[ "()\]\'\n,;`])' # whitespace or terminating macro characters + + # symbol token, reverse-engineered from hyperspec + # Take a deep breath... + symbol = rf'((?:{nonmacro})(?:{constituent})*)' + + macros = { + 'atomic-change-group', 'case', 'block', 'cl-block', 'cl-callf', 'cl-callf2', + 'cl-case', 'cl-decf', 'cl-declaim', 'cl-declare', + 'cl-define-compiler-macro', 'cl-defmacro', 'cl-defstruct', + 'cl-defsubst', 'cl-deftype', 'cl-defun', 'cl-destructuring-bind', + 'cl-do', 'cl-do*', 'cl-do-all-symbols', 'cl-do-symbols', 'cl-dolist', + 'cl-dotimes', 'cl-ecase', 'cl-etypecase', 'eval-when', 'cl-eval-when', 'cl-flet', + 'cl-flet*', 'cl-function', 'cl-incf', 'cl-labels', 'cl-letf', + 'cl-letf*', 'cl-load-time-value', 'cl-locally', 'cl-loop', + 'cl-macrolet', 'cl-multiple-value-bind', 'cl-multiple-value-setq', + 'cl-progv', 'cl-psetf', 'cl-psetq', 'cl-pushnew', 'cl-remf', + 'cl-return', 'cl-return-from', 'cl-rotatef', 'cl-shiftf', + 'cl-symbol-macrolet', 'cl-tagbody', 'cl-the', 'cl-typecase', + 'combine-after-change-calls', 'condition-case-unless-debug', 'decf', + 'declaim', 'declare', 'declare-function', 'def-edebug-spec', + 'defadvice', 'defclass', 'defcustom', 'defface', 'defgeneric', + 'defgroup', 'define-advice', 'define-alternatives', + 'define-compiler-macro', 'define-derived-mode', 'define-generic-mode', + 'define-global-minor-mode', 'define-globalized-minor-mode', + 'define-minor-mode', 'define-modify-macro', + 'define-obsolete-face-alias', 'define-obsolete-function-alias', + 'define-obsolete-variable-alias', 'define-setf-expander', + 'define-skeleton', 'defmacro', 'defmethod', 'defsetf', 'defstruct', + 'defsubst', 'deftheme', 'deftype', 'defun', 'defvar-local', + 'delay-mode-hooks', 'destructuring-bind', 'do', 'do*', + 'do-all-symbols', 'do-symbols', 'dolist', 'dont-compile', 'dotimes', + 'dotimes-with-progress-reporter', 'ecase', 'ert-deftest', 'etypecase', + 'eval-and-compile', 'eval-when-compile', 'flet', 'ignore-errors', + 'incf', 'labels', 'lambda', 'letrec', 'lexical-let', 'lexical-let*', + 'loop', 'multiple-value-bind', 'multiple-value-setq', 'noreturn', + 'oref', 'oref-default', 'oset', 'oset-default', 'pcase', + 'pcase-defmacro', 'pcase-dolist', 'pcase-exhaustive', 'pcase-let', + 'pcase-let*', 'pop', 'psetf', 'psetq', 'push', 'pushnew', 'remf', + 'return', 'rotatef', 'rx', 'save-match-data', 'save-selected-window', + 'save-window-excursion', 'setf', 'setq-local', 'shiftf', + 'track-mouse', 'typecase', 'unless', 'use-package', 'when', + 'while-no-input', 'with-case-table', 'with-category-table', + 'with-coding-priority', 'with-current-buffer', 'with-demoted-errors', + 'with-eval-after-load', 'with-file-modes', 'with-local-quit', + 'with-output-to-string', 'with-output-to-temp-buffer', + 'with-parsed-tramp-file-name', 'with-selected-frame', + 'with-selected-window', 'with-silent-modifications', 'with-slots', + 'with-syntax-table', 'with-temp-buffer', 'with-temp-file', + 'with-temp-message', 'with-timeout', 'with-tramp-connection-property', + 'with-tramp-file-property', 'with-tramp-progress-reporter', + 'with-wrapper-hook', 'load-time-value', 'locally', 'macrolet', 'progv', + 'return-from', + } + + special_forms = { + 'and', 'catch', 'cond', 'condition-case', 'defconst', 'defvar', + 'function', 'if', 'interactive', 'let', 'let*', 'or', 'prog1', + 'prog2', 'progn', 'quote', 'save-current-buffer', 'save-excursion', + 'save-restriction', 'setq', 'setq-default', 'subr-arity', + 'unwind-protect', 'while', + } + + builtin_function = { + '%', '*', '+', '-', '/', '/=', '1+', '1-', '<', '<=', '=', '>', '>=', + 'Snarf-documentation', 'abort-recursive-edit', 'abs', + 'accept-process-output', 'access-file', 'accessible-keymaps', 'acos', + 'active-minibuffer-window', 'add-face-text-property', + 'add-name-to-file', 'add-text-properties', 'all-completions', + 'append', 'apply', 'apropos-internal', 'aref', 'arrayp', 'aset', + 'ash', 'asin', 'assoc', 'assoc-string', 'assq', 'atan', 'atom', + 'autoload', 'autoload-do-load', 'backtrace', 'backtrace--locals', + 'backtrace-debug', 'backtrace-eval', 'backtrace-frame', + 'backward-char', 'backward-prefix-chars', 'barf-if-buffer-read-only', + 'base64-decode-region', 'base64-decode-string', + 'base64-encode-region', 'base64-encode-string', 'beginning-of-line', + 'bidi-find-overridden-directionality', 'bidi-resolved-levels', + 'bitmap-spec-p', 'bobp', 'bolp', 'bool-vector', + 'bool-vector-count-consecutive', 'bool-vector-count-population', + 'bool-vector-exclusive-or', 'bool-vector-intersection', + 'bool-vector-not', 'bool-vector-p', 'bool-vector-set-difference', + 'bool-vector-subsetp', 'bool-vector-union', 'boundp', + 'buffer-base-buffer', 'buffer-chars-modified-tick', + 'buffer-enable-undo', 'buffer-file-name', 'buffer-has-markers-at', + 'buffer-list', 'buffer-live-p', 'buffer-local-value', + 'buffer-local-variables', 'buffer-modified-p', 'buffer-modified-tick', + 'buffer-name', 'buffer-size', 'buffer-string', 'buffer-substring', + 'buffer-substring-no-properties', 'buffer-swap-text', 'bufferp', + 'bury-buffer-internal', 'byte-code', 'byte-code-function-p', + 'byte-to-position', 'byte-to-string', 'byteorder', + 'call-interactively', 'call-last-kbd-macro', 'call-process', + 'call-process-region', 'cancel-kbd-macro-events', 'capitalize', + 'capitalize-region', 'capitalize-word', 'car', 'car-less-than-car', + 'car-safe', 'case-table-p', 'category-docstring', + 'category-set-mnemonics', 'category-table', 'category-table-p', + 'ccl-execute', 'ccl-execute-on-string', 'ccl-program-p', 'cdr', + 'cdr-safe', 'ceiling', 'char-after', 'char-before', + 'char-category-set', 'char-charset', 'char-equal', 'char-or-string-p', + 'char-resolve-modifiers', 'char-syntax', 'char-table-extra-slot', + 'char-table-p', 'char-table-parent', 'char-table-range', + 'char-table-subtype', 'char-to-string', 'char-width', 'characterp', + 'charset-after', 'charset-id-internal', 'charset-plist', + 'charset-priority-list', 'charsetp', 'check-coding-system', + 'check-coding-systems-region', 'clear-buffer-auto-save-failure', + 'clear-charset-maps', 'clear-face-cache', 'clear-font-cache', + 'clear-image-cache', 'clear-string', 'clear-this-command-keys', + 'close-font', 'clrhash', 'coding-system-aliases', + 'coding-system-base', 'coding-system-eol-type', 'coding-system-p', + 'coding-system-plist', 'coding-system-priority-list', + 'coding-system-put', 'color-distance', 'color-gray-p', + 'color-supported-p', 'combine-after-change-execute', + 'command-error-default-function', 'command-remapping', 'commandp', + 'compare-buffer-substrings', 'compare-strings', + 'compare-window-configurations', 'completing-read', + 'compose-region-internal', 'compose-string-internal', + 'composition-get-gstring', 'compute-motion', 'concat', 'cons', + 'consp', 'constrain-to-field', 'continue-process', + 'controlling-tty-p', 'coordinates-in-window-p', 'copy-alist', + 'copy-category-table', 'copy-file', 'copy-hash-table', 'copy-keymap', + 'copy-marker', 'copy-sequence', 'copy-syntax-table', 'copysign', + 'cos', 'current-active-maps', 'current-bidi-paragraph-direction', + 'current-buffer', 'current-case-table', 'current-column', + 'current-global-map', 'current-idle-time', 'current-indentation', + 'current-input-mode', 'current-local-map', 'current-message', + 'current-minor-mode-maps', 'current-time', 'current-time-string', + 'current-time-zone', 'current-window-configuration', + 'cygwin-convert-file-name-from-windows', + 'cygwin-convert-file-name-to-windows', 'daemon-initialized', + 'daemonp', 'dbus--init-bus', 'dbus-get-unique-name', + 'dbus-message-internal', 'debug-timer-check', 'declare-equiv-charset', + 'decode-big5-char', 'decode-char', 'decode-coding-region', + 'decode-coding-string', 'decode-sjis-char', 'decode-time', + 'default-boundp', 'default-file-modes', 'default-printer-name', + 'default-toplevel-value', 'default-value', 'define-category', + 'define-charset-alias', 'define-charset-internal', + 'define-coding-system-alias', 'define-coding-system-internal', + 'define-fringe-bitmap', 'define-hash-table-test', 'define-key', + 'define-prefix-command', 'delete', + 'delete-all-overlays', 'delete-and-extract-region', 'delete-char', + 'delete-directory-internal', 'delete-field', 'delete-file', + 'delete-frame', 'delete-other-windows-internal', 'delete-overlay', + 'delete-process', 'delete-region', 'delete-terminal', + 'delete-window-internal', 'delq', 'describe-buffer-bindings', + 'describe-vector', 'destroy-fringe-bitmap', 'detect-coding-region', + 'detect-coding-string', 'ding', 'directory-file-name', + 'directory-files', 'directory-files-and-attributes', 'discard-input', + 'display-supports-face-attributes-p', 'do-auto-save', 'documentation', + 'documentation-property', 'downcase', 'downcase-region', + 'downcase-word', 'draw-string', 'dump-colors', 'dump-emacs', + 'dump-face', 'dump-frame-glyph-matrix', 'dump-glyph-matrix', + 'dump-glyph-row', 'dump-redisplay-history', 'dump-tool-bar-row', + 'elt', 'emacs-pid', 'encode-big5-char', 'encode-char', + 'encode-coding-region', 'encode-coding-string', 'encode-sjis-char', + 'encode-time', 'end-kbd-macro', 'end-of-line', 'eobp', 'eolp', 'eq', + 'eql', 'equal', 'equal-including-properties', 'erase-buffer', + 'error-message-string', 'eval', 'eval-buffer', 'eval-region', + 'event-convert-list', 'execute-kbd-macro', 'exit-recursive-edit', + 'exp', 'expand-file-name', 'expt', 'external-debugging-output', + 'face-attribute-relative-p', 'face-attributes-as-vector', 'face-font', + 'fboundp', 'fceiling', 'fetch-bytecode', 'ffloor', + 'field-beginning', 'field-end', 'field-string', + 'field-string-no-properties', 'file-accessible-directory-p', + 'file-acl', 'file-attributes', 'file-attributes-lessp', + 'file-directory-p', 'file-executable-p', 'file-exists-p', + 'file-locked-p', 'file-modes', 'file-name-absolute-p', + 'file-name-all-completions', 'file-name-as-directory', + 'file-name-completion', 'file-name-directory', + 'file-name-nondirectory', 'file-newer-than-file-p', 'file-readable-p', + 'file-regular-p', 'file-selinux-context', 'file-symlink-p', + 'file-system-info', 'file-system-info', 'file-writable-p', + 'fillarray', 'find-charset-region', 'find-charset-string', + 'find-coding-systems-region-internal', 'find-composition-internal', + 'find-file-name-handler', 'find-font', 'find-operation-coding-system', + 'float', 'float-time', 'floatp', 'floor', 'fmakunbound', + 'following-char', 'font-at', 'font-drive-otf', 'font-face-attributes', + 'font-family-list', 'font-get', 'font-get-glyphs', + 'font-get-system-font', 'font-get-system-normal-font', 'font-info', + 'font-match-p', 'font-otf-alternates', 'font-put', + 'font-shape-gstring', 'font-spec', 'font-variation-glyphs', + 'font-xlfd-name', 'fontp', 'fontset-font', 'fontset-info', + 'fontset-list', 'fontset-list-all', 'force-mode-line-update', + 'force-window-update', 'format', 'format-mode-line', + 'format-network-address', 'format-time-string', 'forward-char', + 'forward-comment', 'forward-line', 'forward-word', + 'frame-border-width', 'frame-bottom-divider-width', + 'frame-can-run-window-configuration-change-hook', 'frame-char-height', + 'frame-char-width', 'frame-face-alist', 'frame-first-window', + 'frame-focus', 'frame-font-cache', 'frame-fringe-width', 'frame-list', + 'frame-live-p', 'frame-or-buffer-changed-p', 'frame-parameter', + 'frame-parameters', 'frame-pixel-height', 'frame-pixel-width', + 'frame-pointer-visible-p', 'frame-right-divider-width', + 'frame-root-window', 'frame-scroll-bar-height', + 'frame-scroll-bar-width', 'frame-selected-window', 'frame-terminal', + 'frame-text-cols', 'frame-text-height', 'frame-text-lines', + 'frame-text-width', 'frame-total-cols', 'frame-total-lines', + 'frame-visible-p', 'framep', 'frexp', 'fringe-bitmaps-at-pos', + 'fround', 'fset', 'ftruncate', 'funcall', 'funcall-interactively', + 'function-equal', 'functionp', 'gap-position', 'gap-size', + 'garbage-collect', 'gc-status', 'generate-new-buffer-name', 'get', + 'get-buffer', 'get-buffer-create', 'get-buffer-process', + 'get-buffer-window', 'get-byte', 'get-char-property', + 'get-char-property-and-overlay', 'get-file-buffer', 'get-file-char', + 'get-internal-run-time', 'get-load-suffixes', 'get-pos-property', + 'get-process', 'get-screen-color', 'get-text-property', + 'get-unicode-property-internal', 'get-unused-category', + 'get-unused-iso-final-char', 'getenv-internal', 'gethash', + 'gfile-add-watch', 'gfile-rm-watch', 'global-key-binding', + 'gnutls-available-p', 'gnutls-boot', 'gnutls-bye', 'gnutls-deinit', + 'gnutls-error-fatalp', 'gnutls-error-string', 'gnutls-errorp', + 'gnutls-get-initstage', 'gnutls-peer-status', + 'gnutls-peer-status-warning-describe', 'goto-char', 'gpm-mouse-start', + 'gpm-mouse-stop', 'group-gid', 'group-real-gid', + 'handle-save-session', 'handle-switch-frame', 'hash-table-count', + 'hash-table-p', 'hash-table-rehash-size', + 'hash-table-rehash-threshold', 'hash-table-size', 'hash-table-test', + 'hash-table-weakness', 'iconify-frame', 'identity', 'image-flush', + 'image-mask-p', 'image-metadata', 'image-size', 'imagemagick-types', + 'imagep', 'indent-to', 'indirect-function', 'indirect-variable', + 'init-image-library', 'inotify-add-watch', 'inotify-rm-watch', + 'input-pending-p', 'insert', 'insert-and-inherit', + 'insert-before-markers', 'insert-before-markers-and-inherit', + 'insert-buffer-substring', 'insert-byte', 'insert-char', + 'insert-file-contents', 'insert-startup-screen', 'int86', + 'integer-or-marker-p', 'integerp', 'interactive-form', 'intern', + 'intern-soft', 'internal--track-mouse', 'internal-char-font', + 'internal-complete-buffer', 'internal-copy-lisp-face', + 'internal-default-process-filter', + 'internal-default-process-sentinel', 'internal-describe-syntax-value', + 'internal-event-symbol-parse-modifiers', + 'internal-face-x-get-resource', 'internal-get-lisp-face-attribute', + 'internal-lisp-face-attribute-values', 'internal-lisp-face-empty-p', + 'internal-lisp-face-equal-p', 'internal-lisp-face-p', + 'internal-make-lisp-face', 'internal-make-var-non-special', + 'internal-merge-in-global-face', + 'internal-set-alternative-font-family-alist', + 'internal-set-alternative-font-registry-alist', + 'internal-set-font-selection-order', + 'internal-set-lisp-face-attribute', + 'internal-set-lisp-face-attribute-from-resource', + 'internal-show-cursor', 'internal-show-cursor-p', 'interrupt-process', + 'invisible-p', 'invocation-directory', 'invocation-name', 'isnan', + 'iso-charset', 'key-binding', 'key-description', + 'keyboard-coding-system', 'keymap-parent', 'keymap-prompt', 'keymapp', + 'keywordp', 'kill-all-local-variables', 'kill-buffer', 'kill-emacs', + 'kill-local-variable', 'kill-process', 'last-nonminibuffer-frame', + 'lax-plist-get', 'lax-plist-put', 'ldexp', 'length', + 'libxml-parse-html-region', 'libxml-parse-xml-region', + 'line-beginning-position', 'line-end-position', 'line-pixel-height', + 'list', 'list-fonts', 'list-system-processes', 'listp', 'load', + 'load-average', 'local-key-binding', 'local-variable-if-set-p', + 'local-variable-p', 'locale-info', 'locate-file-internal', + 'lock-buffer', 'log', 'logand', 'logb', 'logior', 'lognot', 'logxor', + 'looking-at', 'lookup-image', 'lookup-image-map', 'lookup-key', + 'lower-frame', 'lsh', 'macroexpand', 'make-bool-vector', + 'make-byte-code', 'make-category-set', 'make-category-table', + 'make-char', 'make-char-table', 'make-directory-internal', + 'make-frame-invisible', 'make-frame-visible', 'make-hash-table', + 'make-indirect-buffer', 'make-keymap', 'make-list', + 'make-local-variable', 'make-marker', 'make-network-process', + 'make-overlay', 'make-serial-process', 'make-sparse-keymap', + 'make-string', 'make-symbol', 'make-symbolic-link', 'make-temp-name', + 'make-terminal-frame', 'make-variable-buffer-local', + 'make-variable-frame-local', 'make-vector', 'makunbound', + 'map-char-table', 'map-charset-chars', 'map-keymap', + 'map-keymap-internal', 'mapatoms', 'mapc', 'mapcar', 'mapconcat', + 'maphash', 'mark-marker', 'marker-buffer', 'marker-insertion-type', + 'marker-position', 'markerp', 'match-beginning', 'match-data', + 'match-end', 'matching-paren', 'max', 'max-char', 'md5', 'member', + 'memory-info', 'memory-limit', 'memory-use-counts', 'memq', 'memql', + 'menu-bar-menu-at-x-y', 'menu-or-popup-active-p', + 'menu-or-popup-active-p', 'merge-face-attribute', 'message', + 'message-box', 'message-or-box', 'min', + 'minibuffer-completion-contents', 'minibuffer-contents', + 'minibuffer-contents-no-properties', 'minibuffer-depth', + 'minibuffer-prompt', 'minibuffer-prompt-end', + 'minibuffer-selected-window', 'minibuffer-window', 'minibufferp', + 'minor-mode-key-binding', 'mod', 'modify-category-entry', + 'modify-frame-parameters', 'modify-syntax-entry', + 'mouse-pixel-position', 'mouse-position', 'move-overlay', + 'move-point-visually', 'move-to-column', 'move-to-window-line', + 'msdos-downcase-filename', 'msdos-long-file-names', 'msdos-memget', + 'msdos-memput', 'msdos-mouse-disable', 'msdos-mouse-enable', + 'msdos-mouse-init', 'msdos-mouse-p', 'msdos-remember-default-colors', + 'msdos-set-keyboard', 'msdos-set-mouse-buttons', + 'multibyte-char-to-unibyte', 'multibyte-string-p', 'narrow-to-region', + 'natnump', 'nconc', 'network-interface-info', + 'network-interface-list', 'new-fontset', 'newline-cache-check', + 'next-char-property-change', 'next-frame', 'next-overlay-change', + 'next-property-change', 'next-read-file-uses-dialog-p', + 'next-single-char-property-change', 'next-single-property-change', + 'next-window', 'nlistp', 'nreverse', 'nth', 'nthcdr', 'null', + 'number-or-marker-p', 'number-to-string', 'numberp', + 'open-dribble-file', 'open-font', 'open-termscript', + 'optimize-char-table', 'other-buffer', 'other-window-for-scrolling', + 'overlay-buffer', 'overlay-end', 'overlay-get', 'overlay-lists', + 'overlay-properties', 'overlay-put', 'overlay-recenter', + 'overlay-start', 'overlayp', 'overlays-at', 'overlays-in', + 'parse-partial-sexp', 'play-sound-internal', 'plist-get', + 'plist-member', 'plist-put', 'point', 'point-marker', 'point-max', + 'point-max-marker', 'point-min', 'point-min-marker', + 'pos-visible-in-window-p', 'position-bytes', 'posix-looking-at', + 'posix-search-backward', 'posix-search-forward', 'posix-string-match', + 'posn-at-point', 'posn-at-x-y', 'preceding-char', + 'prefix-numeric-value', 'previous-char-property-change', + 'previous-frame', 'previous-overlay-change', + 'previous-property-change', 'previous-single-char-property-change', + 'previous-single-property-change', 'previous-window', 'prin1', + 'prin1-to-string', 'princ', 'print', 'process-attributes', + 'process-buffer', 'process-coding-system', 'process-command', + 'process-connection', 'process-contact', 'process-datagram-address', + 'process-exit-status', 'process-filter', 'process-filter-multibyte-p', + 'process-id', 'process-inherit-coding-system-flag', 'process-list', + 'process-mark', 'process-name', 'process-plist', + 'process-query-on-exit-flag', 'process-running-child-p', + 'process-send-eof', 'process-send-region', 'process-send-string', + 'process-sentinel', 'process-status', 'process-tty-name', + 'process-type', 'processp', 'profiler-cpu-log', + 'profiler-cpu-running-p', 'profiler-cpu-start', 'profiler-cpu-stop', + 'profiler-memory-log', 'profiler-memory-running-p', + 'profiler-memory-start', 'profiler-memory-stop', 'propertize', + 'purecopy', 'put', 'put-text-property', + 'put-unicode-property-internal', 'puthash', 'query-font', + 'query-fontset', 'quit-process', 'raise-frame', 'random', 'rassoc', + 'rassq', 're-search-backward', 're-search-forward', 'read', + 'read-buffer', 'read-char', 'read-char-exclusive', + 'read-coding-system', 'read-command', 'read-event', + 'read-from-minibuffer', 'read-from-string', 'read-function', + 'read-key-sequence', 'read-key-sequence-vector', + 'read-no-blanks-input', 'read-non-nil-coding-system', 'read-string', + 'read-variable', 'recent-auto-save-p', 'recent-doskeys', + 'recent-keys', 'recenter', 'recursion-depth', 'recursive-edit', + 'redirect-debugging-output', 'redirect-frame-focus', 'redisplay', + 'redraw-display', 'redraw-frame', 'regexp-quote', 'region-beginning', + 'region-end', 'register-ccl-program', 'register-code-conversion-map', + 'remhash', 'remove-list-of-text-properties', 'remove-text-properties', + 'rename-buffer', 'rename-file', 'replace-match', + 'reset-this-command-lengths', 'resize-mini-window-internal', + 'restore-buffer-modified-p', 'resume-tty', 'reverse', 'round', + 'run-hook-with-args', 'run-hook-with-args-until-failure', + 'run-hook-with-args-until-success', 'run-hook-wrapped', 'run-hooks', + 'run-window-configuration-change-hook', 'run-window-scroll-functions', + 'safe-length', 'scan-lists', 'scan-sexps', 'scroll-down', + 'scroll-left', 'scroll-other-window', 'scroll-right', 'scroll-up', + 'search-backward', 'search-forward', 'secure-hash', 'select-frame', + 'select-window', 'selected-frame', 'selected-window', + 'self-insert-command', 'send-string-to-terminal', 'sequencep', + 'serial-process-configure', 'set', 'set-buffer', + 'set-buffer-auto-saved', 'set-buffer-major-mode', + 'set-buffer-modified-p', 'set-buffer-multibyte', 'set-case-table', + 'set-category-table', 'set-char-table-extra-slot', + 'set-char-table-parent', 'set-char-table-range', 'set-charset-plist', + 'set-charset-priority', 'set-coding-system-priority', + 'set-cursor-size', 'set-default', 'set-default-file-modes', + 'set-default-toplevel-value', 'set-file-acl', 'set-file-modes', + 'set-file-selinux-context', 'set-file-times', 'set-fontset-font', + 'set-frame-height', 'set-frame-position', 'set-frame-selected-window', + 'set-frame-size', 'set-frame-width', 'set-fringe-bitmap-face', + 'set-input-interrupt-mode', 'set-input-meta-mode', 'set-input-mode', + 'set-keyboard-coding-system-internal', 'set-keymap-parent', + 'set-marker', 'set-marker-insertion-type', 'set-match-data', + 'set-message-beep', 'set-minibuffer-window', + 'set-mouse-pixel-position', 'set-mouse-position', + 'set-network-process-option', 'set-output-flow-control', + 'set-process-buffer', 'set-process-coding-system', + 'set-process-datagram-address', 'set-process-filter', + 'set-process-filter-multibyte', + 'set-process-inherit-coding-system-flag', 'set-process-plist', + 'set-process-query-on-exit-flag', 'set-process-sentinel', + 'set-process-window-size', 'set-quit-char', + 'set-safe-terminal-coding-system-internal', 'set-screen-color', + 'set-standard-case-table', 'set-syntax-table', + 'set-terminal-coding-system-internal', 'set-terminal-local-value', + 'set-terminal-parameter', 'set-text-properties', 'set-time-zone-rule', + 'set-visited-file-modtime', 'set-window-buffer', + 'set-window-combination-limit', 'set-window-configuration', + 'set-window-dedicated-p', 'set-window-display-table', + 'set-window-fringes', 'set-window-hscroll', 'set-window-margins', + 'set-window-new-normal', 'set-window-new-pixel', + 'set-window-new-total', 'set-window-next-buffers', + 'set-window-parameter', 'set-window-point', 'set-window-prev-buffers', + 'set-window-redisplay-end-trigger', 'set-window-scroll-bars', + 'set-window-start', 'set-window-vscroll', 'setcar', 'setcdr', + 'setplist', 'show-face-resources', 'signal', 'signal-process', 'sin', + 'single-key-description', 'skip-chars-backward', 'skip-chars-forward', + 'skip-syntax-backward', 'skip-syntax-forward', 'sleep-for', 'sort', + 'sort-charsets', 'special-variable-p', 'split-char', + 'split-window-internal', 'sqrt', 'standard-case-table', + 'standard-category-table', 'standard-syntax-table', 'start-kbd-macro', + 'start-process', 'stop-process', 'store-kbd-macro-event', 'string', + 'string=', 'string<', 'string>', 'string-as-multibyte', + 'string-as-unibyte', 'string-bytes', 'string-collate-equalp', + 'string-collate-lessp', 'string-equal', 'string-greaterp', + 'string-lessp', 'string-make-multibyte', 'string-make-unibyte', + 'string-match', 'string-to-char', 'string-to-multibyte', + 'string-to-number', 'string-to-syntax', 'string-to-unibyte', + 'string-width', 'stringp', 'subr-name', 'subrp', + 'subst-char-in-region', 'substitute-command-keys', + 'substitute-in-file-name', 'substring', 'substring-no-properties', + 'suspend-emacs', 'suspend-tty', 'suspicious-object', 'sxhash', + 'symbol-function', 'symbol-name', 'symbol-plist', 'symbol-value', + 'symbolp', 'syntax-table', 'syntax-table-p', 'system-groups', + 'system-move-file-to-trash', 'system-name', 'system-users', 'tan', + 'terminal-coding-system', 'terminal-list', 'terminal-live-p', + 'terminal-local-value', 'terminal-name', 'terminal-parameter', + 'terminal-parameters', 'terpri', 'test-completion', + 'text-char-description', 'text-properties-at', 'text-property-any', + 'text-property-not-all', 'this-command-keys', + 'this-command-keys-vector', 'this-single-command-keys', + 'this-single-command-raw-keys', 'time-add', 'time-less-p', + 'time-subtract', 'tool-bar-get-system-style', 'tool-bar-height', + 'tool-bar-pixel-width', 'top-level', 'trace-redisplay', + 'trace-to-stderr', 'translate-region-internal', 'transpose-regions', + 'truncate', 'try-completion', 'tty-display-color-cells', + 'tty-display-color-p', 'tty-no-underline', + 'tty-suppress-bold-inverse-default-colors', 'tty-top-frame', + 'tty-type', 'type-of', 'undo-boundary', 'unencodable-char-position', + 'unhandled-file-name-directory', 'unibyte-char-to-multibyte', + 'unibyte-string', 'unicode-property-table-internal', 'unify-charset', + 'unintern', 'unix-sync', 'unlock-buffer', 'upcase', 'upcase-initials', + 'upcase-initials-region', 'upcase-region', 'upcase-word', + 'use-global-map', 'use-local-map', 'user-full-name', + 'user-login-name', 'user-real-login-name', 'user-real-uid', + 'user-uid', 'variable-binding-locus', 'vconcat', 'vector', + 'vector-or-char-table-p', 'vectorp', 'verify-visited-file-modtime', + 'vertical-motion', 'visible-frame-list', 'visited-file-modtime', + 'w16-get-clipboard-data', 'w16-selection-exists-p', + 'w16-set-clipboard-data', 'w32-battery-status', + 'w32-default-color-map', 'w32-define-rgb-color', + 'w32-display-monitor-attributes-list', 'w32-frame-menu-bar-size', + 'w32-frame-rect', 'w32-get-clipboard-data', + 'w32-get-codepage-charset', 'w32-get-console-codepage', + 'w32-get-console-output-codepage', 'w32-get-current-locale-id', + 'w32-get-default-locale-id', 'w32-get-keyboard-layout', + 'w32-get-locale-info', 'w32-get-valid-codepages', + 'w32-get-valid-keyboard-layouts', 'w32-get-valid-locale-ids', + 'w32-has-winsock', 'w32-long-file-name', 'w32-reconstruct-hot-key', + 'w32-register-hot-key', 'w32-registered-hot-keys', + 'w32-selection-exists-p', 'w32-send-sys-command', + 'w32-set-clipboard-data', 'w32-set-console-codepage', + 'w32-set-console-output-codepage', 'w32-set-current-locale', + 'w32-set-keyboard-layout', 'w32-set-process-priority', + 'w32-shell-execute', 'w32-short-file-name', 'w32-toggle-lock-key', + 'w32-unload-winsock', 'w32-unregister-hot-key', 'w32-window-exists-p', + 'w32notify-add-watch', 'w32notify-rm-watch', + 'waiting-for-user-input-p', 'where-is-internal', 'widen', + 'widget-apply', 'widget-get', 'widget-put', + 'window-absolute-pixel-edges', 'window-at', 'window-body-height', + 'window-body-width', 'window-bottom-divider-width', 'window-buffer', + 'window-combination-limit', 'window-configuration-frame', + 'window-configuration-p', 'window-dedicated-p', + 'window-display-table', 'window-edges', 'window-end', 'window-frame', + 'window-fringes', 'window-header-line-height', 'window-hscroll', + 'window-inside-absolute-pixel-edges', 'window-inside-edges', + 'window-inside-pixel-edges', 'window-left-child', + 'window-left-column', 'window-line-height', 'window-list', + 'window-list-1', 'window-live-p', 'window-margins', + 'window-minibuffer-p', 'window-mode-line-height', 'window-new-normal', + 'window-new-pixel', 'window-new-total', 'window-next-buffers', + 'window-next-sibling', 'window-normal-size', 'window-old-point', + 'window-parameter', 'window-parameters', 'window-parent', + 'window-pixel-edges', 'window-pixel-height', 'window-pixel-left', + 'window-pixel-top', 'window-pixel-width', 'window-point', + 'window-prev-buffers', 'window-prev-sibling', + 'window-redisplay-end-trigger', 'window-resize-apply', + 'window-resize-apply-total', 'window-right-divider-width', + 'window-scroll-bar-height', 'window-scroll-bar-width', + 'window-scroll-bars', 'window-start', 'window-system', + 'window-text-height', 'window-text-pixel-size', 'window-text-width', + 'window-top-child', 'window-top-line', 'window-total-height', + 'window-total-width', 'window-use-time', 'window-valid-p', + 'window-vscroll', 'windowp', 'write-char', 'write-region', + 'x-backspace-delete-keys-p', 'x-change-window-property', + 'x-change-window-property', 'x-close-connection', + 'x-close-connection', 'x-create-frame', 'x-create-frame', + 'x-delete-window-property', 'x-delete-window-property', + 'x-disown-selection-internal', 'x-display-backing-store', + 'x-display-backing-store', 'x-display-color-cells', + 'x-display-color-cells', 'x-display-grayscale-p', + 'x-display-grayscale-p', 'x-display-list', 'x-display-list', + 'x-display-mm-height', 'x-display-mm-height', 'x-display-mm-width', + 'x-display-mm-width', 'x-display-monitor-attributes-list', + 'x-display-pixel-height', 'x-display-pixel-height', + 'x-display-pixel-width', 'x-display-pixel-width', 'x-display-planes', + 'x-display-planes', 'x-display-save-under', 'x-display-save-under', + 'x-display-screens', 'x-display-screens', 'x-display-visual-class', + 'x-display-visual-class', 'x-family-fonts', 'x-file-dialog', + 'x-file-dialog', 'x-file-dialog', 'x-focus-frame', 'x-frame-geometry', + 'x-frame-geometry', 'x-get-atom-name', 'x-get-resource', + 'x-get-selection-internal', 'x-hide-tip', 'x-hide-tip', + 'x-list-fonts', 'x-load-color-file', 'x-menu-bar-open-internal', + 'x-menu-bar-open-internal', 'x-open-connection', 'x-open-connection', + 'x-own-selection-internal', 'x-parse-geometry', 'x-popup-dialog', + 'x-popup-menu', 'x-register-dnd-atom', 'x-select-font', + 'x-select-font', 'x-selection-exists-p', 'x-selection-owner-p', + 'x-send-client-message', 'x-server-max-request-size', + 'x-server-max-request-size', 'x-server-vendor', 'x-server-vendor', + 'x-server-version', 'x-server-version', 'x-show-tip', 'x-show-tip', + 'x-synchronize', 'x-synchronize', 'x-uses-old-gtk-dialog', + 'x-window-property', 'x-window-property', 'x-wm-set-size-hint', + 'xw-color-defined-p', 'xw-color-defined-p', 'xw-color-values', + 'xw-color-values', 'xw-display-color-p', 'xw-display-color-p', + 'yes-or-no-p', 'zlib-available-p', 'zlib-decompress-region', + 'forward-point', + } + + builtin_function_highlighted = { + 'defvaralias', 'provide', 'require', + 'with-no-warnings', 'define-widget', 'with-electric-help', + 'throw', 'defalias', 'featurep' + } + + lambda_list_keywords = { + '&allow-other-keys', '&aux', '&body', '&environment', '&key', '&optional', + '&rest', '&whole', + } + + error_keywords = { + 'cl-assert', 'cl-check-type', 'error', 'signal', + 'user-error', 'warn', + } + + def get_tokens_unprocessed(self, text): + stack = ['root'] + for index, token, value in RegexLexer.get_tokens_unprocessed(self, text, stack): + if token is Name.Variable: + if value in EmacsLispLexer.builtin_function: + yield index, Name.Function, value + continue + if value in EmacsLispLexer.special_forms: + yield index, Keyword, value + continue + if value in EmacsLispLexer.error_keywords: + yield index, Name.Exception, value + continue + if value in EmacsLispLexer.builtin_function_highlighted: + yield index, Name.Builtin, value + continue + if value in EmacsLispLexer.macros: + yield index, Name.Builtin, value + continue + if value in EmacsLispLexer.lambda_list_keywords: + yield index, Keyword.Pseudo, value + continue + yield index, token, value + + tokens = { + 'root': [ + default('body'), + ], + 'body': [ + # whitespace + (r'\s+', Whitespace), + + # single-line comment + (r';.*$', Comment.Single), + + # strings and characters + (r'"', String, 'string'), + (r'\?([^\\]|\\.)', String.Char), + # quoting + (r":" + symbol, Name.Builtin), + (r"::" + symbol, String.Symbol), + (r"'" + symbol, String.Symbol), + (r"'", Operator), + (r"`", Operator), + + # decimal numbers + (r'[-+]?\d+\.?' + terminated, Number.Integer), + (r'[-+]?\d+/\d+' + terminated, Number), + (r'[-+]?(\d*\.\d+([defls][-+]?\d+)?|\d+(\.\d*)?[defls][-+]?\d+)' + + terminated, Number.Float), + + # vectors + (r'\[|\]', Punctuation), + + # uninterned symbol + (r'#:' + symbol, String.Symbol), + + # read syntax for char tables + (r'#\^\^?', Operator), + + # function shorthand + (r'#\'', Name.Function), + + # binary rational + (r'#[bB][+-]?[01]+(/[01]+)?', Number.Bin), + + # octal rational + (r'#[oO][+-]?[0-7]+(/[0-7]+)?', Number.Oct), + + # hex rational + (r'#[xX][+-]?[0-9a-fA-F]+(/[0-9a-fA-F]+)?', Number.Hex), + + # radix rational + (r'#\d+r[+-]?[0-9a-zA-Z]+(/[0-9a-zA-Z]+)?', Number), + + # reference + (r'#\d+=', Operator), + (r'#\d+#', Operator), + + # special operators that should have been parsed already + (r'(,@|,|\.|:)', Operator), + + # special constants + (r'(t|nil)' + terminated, Name.Constant), + + # functions and variables + (r'\*' + symbol + r'\*', Name.Variable.Global), + (symbol, Name.Variable), + + # parentheses + (r'#\(', Operator, 'body'), + (r'\(', Punctuation, 'body'), + (r'\)', Punctuation, '#pop'), + ], + 'string': [ + (r'[^"\\`]+', String), + (rf'`{symbol}\'', String.Symbol), + (r'`', String), + (r'\\.', String), + (r'\\\n', String), + (r'"', String, '#pop'), + ], + } + + +class ShenLexer(RegexLexer): + """ + Lexer for Shen source code. + """ + name = 'Shen' + url = 'http://shenlanguage.org/' + aliases = ['shen'] + filenames = ['*.shen'] + mimetypes = ['text/x-shen', 'application/x-shen'] + version_added = '2.1' + + DECLARATIONS = ( + 'datatype', 'define', 'defmacro', 'defprolog', 'defcc', + 'synonyms', 'declare', 'package', 'type', 'function', + ) + + SPECIAL_FORMS = ( + 'lambda', 'get', 'let', 'if', 'cases', 'cond', 'put', 'time', 'freeze', + 'value', 'load', '$', 'protect', 'or', 'and', 'not', 'do', 'output', + 'prolog?', 'trap-error', 'error', 'make-string', '/.', 'set', '@p', + '@s', '@v', + ) + + BUILTINS = ( + '==', '=', '*', '+', '-', '/', '<', '>', '>=', '<=', '<-address', + '<-vector', 'abort', 'absvector', 'absvector?', 'address->', 'adjoin', + 'append', 'arity', 'assoc', 'bind', 'boolean?', 'bound?', 'call', 'cd', + 'close', 'cn', 'compile', 'concat', 'cons', 'cons?', 'cut', 'destroy', + 'difference', 'element?', 'empty?', 'enable-type-theory', + 'error-to-string', 'eval', 'eval-kl', 'exception', 'explode', 'external', + 'fail', 'fail-if', 'file', 'findall', 'fix', 'fst', 'fwhen', 'gensym', + 'get-time', 'hash', 'hd', 'hdstr', 'hdv', 'head', 'identical', + 'implementation', 'in', 'include', 'include-all-but', 'inferences', + 'input', 'input+', 'integer?', 'intern', 'intersection', 'is', 'kill', + 'language', 'length', 'limit', 'lineread', 'loaded', 'macro', 'macroexpand', + 'map', 'mapcan', 'maxinferences', 'mode', 'n->string', 'nl', 'nth', 'null', + 'number?', 'occurrences', 'occurs-check', 'open', 'os', 'out', 'port', + 'porters', 'pos', 'pr', 'preclude', 'preclude-all-but', 'print', 'profile', + 'profile-results', 'ps', 'quit', 'read', 'read+', 'read-byte', 'read-file', + 'read-file-as-bytelist', 'read-file-as-string', 'read-from-string', + 'release', 'remove', 'return', 'reverse', 'run', 'save', 'set', + 'simple-error', 'snd', 'specialise', 'spy', 'step', 'stinput', 'stoutput', + 'str', 'string->n', 'string->symbol', 'string?', 'subst', 'symbol?', + 'systemf', 'tail', 'tc', 'tc?', 'thaw', 'tl', 'tlstr', 'tlv', 'track', + 'tuple?', 'undefmacro', 'unify', 'unify!', 'union', 'unprofile', + 'unspecialise', 'untrack', 'variable?', 'vector', 'vector->', 'vector?', + 'verified', 'version', 'warn', 'when', 'write-byte', 'write-to-file', + 'y-or-n?', + ) + + BUILTINS_ANYWHERE = ('where', 'skip', '>>', '_', '!', '', '') + + MAPPINGS = {s: Keyword for s in DECLARATIONS} + MAPPINGS.update((s, Name.Builtin) for s in BUILTINS) + MAPPINGS.update((s, Keyword) for s in SPECIAL_FORMS) + + valid_symbol_chars = r'[\w!$%*+,<=>?/.\'@&#:-]' + valid_name = f'{valid_symbol_chars}+' + symbol_name = rf'[a-z!$%*+,<=>?/.\'@&#_-]{valid_symbol_chars}*' + variable = rf'[A-Z]{valid_symbol_chars}*' + + tokens = { + 'string': [ + (r'"', String, '#pop'), + (r'c#\d{1,3};', String.Escape), + (r'~[ARS%]', String.Interpol), + (r'(?s).', String), + ], + + 'root': [ + (r'(?s)\\\*.*?\*\\', Comment.Multiline), # \* ... *\ + (r'\\\\.*', Comment.Single), # \\ ... + (r'\s+', Whitespace), + (r'_{5,}', Punctuation), + (r'={5,}', Punctuation), + (r'(;|:=|\||--?>|<--?)', Punctuation), + (r'(:-|:|\{|\})', Literal), + (r'[+-]*\d*\.\d+(e[+-]?\d+)?', Number.Float), + (r'[+-]*\d+', Number.Integer), + (r'"', String, 'string'), + (variable, Name.Variable), + (r'(true|false|<>|\[\])', Keyword.Pseudo), + (symbol_name, Literal), + (r'(\[|\]|\(|\))', Punctuation), + ], + } + + def get_tokens_unprocessed(self, text): + tokens = RegexLexer.get_tokens_unprocessed(self, text) + tokens = self._process_symbols(tokens) + tokens = self._process_declarations(tokens) + return tokens + + def _relevant(self, token): + return token not in (Text, Whitespace, Comment.Single, Comment.Multiline) + + def _process_declarations(self, tokens): + opening_paren = False + for index, token, value in tokens: + yield index, token, value + if self._relevant(token): + if opening_paren and token == Keyword and value in self.DECLARATIONS: + declaration = value + yield from self._process_declaration(declaration, tokens) + opening_paren = value == '(' and token == Punctuation + + def _process_symbols(self, tokens): + opening_paren = False + for index, token, value in tokens: + if opening_paren and token in (Literal, Name.Variable): + token = self.MAPPINGS.get(value, Name.Function) + elif token == Literal and value in self.BUILTINS_ANYWHERE: + token = Name.Builtin + opening_paren = value == '(' and token == Punctuation + yield index, token, value + + def _process_declaration(self, declaration, tokens): + for index, token, value in tokens: + if self._relevant(token): + break + yield index, token, value + + if declaration == 'datatype': + prev_was_colon = False + token = Keyword.Type if token == Literal else token + yield index, token, value + for index, token, value in tokens: + if prev_was_colon and token == Literal: + token = Keyword.Type + yield index, token, value + if self._relevant(token): + prev_was_colon = token == Literal and value == ':' + elif declaration == 'package': + token = Name.Namespace if token == Literal else token + yield index, token, value + elif declaration == 'define': + token = Name.Function if token == Literal else token + yield index, token, value + for index, token, value in tokens: + if self._relevant(token): + break + yield index, token, value + if value == '{' and token == Literal: + yield index, Punctuation, value + for index, token, value in self._process_signature(tokens): + yield index, token, value + else: + yield index, token, value + else: + token = Name.Function if token == Literal else token + yield index, token, value + + return + + def _process_signature(self, tokens): + for index, token, value in tokens: + if token == Literal and value == '}': + yield index, Punctuation, value + return + elif token in (Literal, Name.Function): + token = Name.Variable if value.istitle() else Keyword.Type + yield index, token, value + + +class CPSALexer(RegexLexer): + """ + A CPSA lexer based on the CPSA language as of version 2.2.12 + """ + name = 'CPSA' + aliases = ['cpsa'] + filenames = ['*.cpsa'] + mimetypes = [] + url = 'https://web.cs.wpi.edu/~guttman/cs564/cpsauser.html' + version_added = '2.1' + + # list of known keywords and builtins taken form vim 6.4 scheme.vim + # syntax file. + _keywords = ( + 'herald', 'vars', 'defmacro', 'include', 'defprotocol', 'defrole', + 'defskeleton', 'defstrand', 'deflistener', 'non-orig', 'uniq-orig', + 'pen-non-orig', 'precedes', 'trace', 'send', 'recv', 'name', 'text', + 'skey', 'akey', 'data', 'mesg', + ) + _builtins = ( + 'cat', 'enc', 'hash', 'privk', 'pubk', 'invk', 'ltk', 'gen', 'exp', + ) + + # valid names for identifiers + # well, names can only not consist fully of numbers + # but this should be good enough for now + valid_name = r'[\w!$%&*+,/:<=>?@^~|-]+' + + tokens = { + 'root': [ + # the comments - always starting with semicolon + # and going to the end of the line + (r';.*$', Comment.Single), + + # whitespaces - usually not relevant + (r'\s+', Whitespace), + + # numbers + (r'-?\d+\.\d+', Number.Float), + (r'-?\d+', Number.Integer), + # support for uncommon kinds of numbers - + # have to figure out what the characters mean + # (r'(#e|#i|#b|#o|#d|#x)[\d.]+', Number), + + # strings, symbols and characters + (r'"(\\\\|\\[^\\]|[^"\\])*"', String), + (r"'" + valid_name, String.Symbol), + (r"#\\([()/'\"._!§$%& ?=+-]|[a-zA-Z0-9]+)", String.Char), + + # constants + (r'(#t|#f)', Name.Constant), + + # special operators + (r"('|#|`|,@|,|\.)", Operator), + + # highlight the keywords + (words(_keywords, suffix=r'\b'), Keyword), + + # first variable in a quoted string like + # '(this is syntactic sugar) + (r"(?<='\()" + valid_name, Name.Variable), + (r"(?<=#\()" + valid_name, Name.Variable), + + # highlight the builtins + (words(_builtins, prefix=r'(?<=\()', suffix=r'\b'), Name.Builtin), + + # the remaining functions + (r'(?<=\()' + valid_name, Name.Function), + # find the remaining variables + (valid_name, Name.Variable), + + # the famous parentheses! + (r'(\(|\))', Punctuation), + (r'(\[|\])', Punctuation), + ], + } + + +class XtlangLexer(RegexLexer): + """An xtlang lexer for the Extempore programming environment. + + This is a mixture of Scheme and xtlang, really. Keyword lists are + taken from the Extempore Emacs mode + (https://github.com/extemporelang/extempore-emacs-mode) + """ + name = 'xtlang' + url = 'http://extempore.moso.com.au' + aliases = ['extempore'] + filenames = ['*.xtm'] + mimetypes = [] + version_added = '2.2' + + common_keywords = ( + 'lambda', 'define', 'if', 'else', 'cond', 'and', + 'or', 'let', 'begin', 'set!', 'map', 'for-each', + ) + scheme_keywords = ( + 'do', 'delay', 'quasiquote', 'unquote', 'unquote-splicing', 'eval', + 'case', 'let*', 'letrec', 'quote', + ) + xtlang_bind_keywords = ( + 'bind-func', 'bind-val', 'bind-lib', 'bind-type', 'bind-alias', + 'bind-poly', 'bind-dylib', 'bind-lib-func', 'bind-lib-val', + ) + xtlang_keywords = ( + 'letz', 'memzone', 'cast', 'convert', 'dotimes', 'doloop', + ) + common_functions = ( + '*', '+', '-', '/', '<', '<=', '=', '>', '>=', '%', 'abs', 'acos', + 'angle', 'append', 'apply', 'asin', 'assoc', 'assq', 'assv', + 'atan', 'boolean?', 'caaaar', 'caaadr', 'caaar', 'caadar', + 'caaddr', 'caadr', 'caar', 'cadaar', 'cadadr', 'cadar', + 'caddar', 'cadddr', 'caddr', 'cadr', 'car', 'cdaaar', + 'cdaadr', 'cdaar', 'cdadar', 'cdaddr', 'cdadr', 'cdar', + 'cddaar', 'cddadr', 'cddar', 'cdddar', 'cddddr', 'cdddr', + 'cddr', 'cdr', 'ceiling', 'cons', 'cos', 'floor', 'length', + 'list', 'log', 'max', 'member', 'min', 'modulo', 'not', + 'reverse', 'round', 'sin', 'sqrt', 'substring', 'tan', + 'println', 'random', 'null?', 'callback', 'now', + ) + scheme_functions = ( + 'call-with-current-continuation', 'call-with-input-file', + 'call-with-output-file', 'call-with-values', 'call/cc', + 'char->integer', 'char-alphabetic?', 'char-ci<=?', 'char-ci=?', 'char-ci>?', 'char-downcase', + 'char-lower-case?', 'char-numeric?', 'char-ready?', + 'char-upcase', 'char-upper-case?', 'char-whitespace?', + 'char<=?', 'char=?', 'char>?', 'char?', + 'close-input-port', 'close-output-port', 'complex?', + 'current-input-port', 'current-output-port', 'denominator', + 'display', 'dynamic-wind', 'eof-object?', 'eq?', 'equal?', + 'eqv?', 'even?', 'exact->inexact', 'exact?', 'exp', 'expt', + 'force', 'gcd', 'imag-part', 'inexact->exact', 'inexact?', + 'input-port?', 'integer->char', 'integer?', + 'interaction-environment', 'lcm', 'list->string', + 'list->vector', 'list-ref', 'list-tail', 'list?', 'load', + 'magnitude', 'make-polar', 'make-rectangular', 'make-string', + 'make-vector', 'memq', 'memv', 'negative?', 'newline', + 'null-environment', 'number->string', 'number?', + 'numerator', 'odd?', 'open-input-file', 'open-output-file', + 'output-port?', 'pair?', 'peek-char', 'port?', 'positive?', + 'procedure?', 'quotient', 'rational?', 'rationalize', 'read', + 'read-char', 'real-part', 'real?', + 'remainder', 'scheme-report-environment', 'set-car!', 'set-cdr!', + 'string', 'string->list', 'string->number', 'string->symbol', + 'string-append', 'string-ci<=?', 'string-ci=?', 'string-ci>?', 'string-copy', 'string-fill!', + 'string-length', 'string-ref', 'string-set!', 'string<=?', + 'string=?', 'string>?', 'string?', + 'symbol->string', 'symbol?', 'transcript-off', 'transcript-on', + 'truncate', 'values', 'vector', 'vector->list', 'vector-fill!', + 'vector-length', 'vector?', + 'with-input-from-file', 'with-output-to-file', 'write', + 'write-char', 'zero?', + ) + xtlang_functions = ( + 'toString', 'afill!', 'pfill!', 'tfill!', 'tbind', 'vfill!', + 'array-fill!', 'pointer-fill!', 'tuple-fill!', 'vector-fill!', 'free', + 'array', 'tuple', 'list', '~', 'cset!', 'cref', '&', 'bor', + 'ang-names', '<<', '>>', 'nil', 'printf', 'sprintf', 'null', 'now', + 'pset!', 'pref-ptr', 'vset!', 'vref', 'aset!', 'aref', 'aref-ptr', + 'tset!', 'tref', 'tref-ptr', 'salloc', 'halloc', 'zalloc', 'alloc', + 'schedule', 'exp', 'log', 'sin', 'cos', 'tan', 'asin', 'acos', 'atan', + 'sqrt', 'expt', 'floor', 'ceiling', 'truncate', 'round', + 'llvm_printf', 'push_zone', 'pop_zone', 'memzone', 'callback', + 'llvm_sprintf', 'make-array', 'array-set!', 'array-ref', + 'array-ref-ptr', 'pointer-set!', 'pointer-ref', 'pointer-ref-ptr', + 'stack-alloc', 'heap-alloc', 'zone-alloc', 'make-tuple', 'tuple-set!', + 'tuple-ref', 'tuple-ref-ptr', 'closure-set!', 'closure-ref', 'pref', + 'pdref', 'impc_null', 'bitcast', 'void', 'ifret', 'ret->', 'clrun->', + 'make-env-zone', 'make-env', '<>', 'dtof', 'ftod', 'i1tof', + 'i1tod', 'i1toi8', 'i1toi32', 'i1toi64', 'i8tof', 'i8tod', + 'i8toi1', 'i8toi32', 'i8toi64', 'i32tof', 'i32tod', 'i32toi1', + 'i32toi8', 'i32toi64', 'i64tof', 'i64tod', 'i64toi1', + 'i64toi8', 'i64toi32', + ) + + # valid names for Scheme identifiers (names cannot consist fully + # of numbers, but this should be good enough for now) + valid_scheme_name = r'[\w!$%&*+,/:<=>?@^~|-]+' + + # valid characters in xtlang names & types + valid_xtlang_name = r'[\w.!-]+' + valid_xtlang_type = r'[]{}[\w<>,*/|!-]+' + + tokens = { + # keep track of when we're exiting the xtlang form + 'xtlang': [ + (r'\(', Punctuation, '#push'), + (r'\)', Punctuation, '#pop'), + + (r'(?<=bind-func\s)' + valid_xtlang_name, Name.Function), + (r'(?<=bind-val\s)' + valid_xtlang_name, Name.Function), + (r'(?<=bind-type\s)' + valid_xtlang_name, Name.Function), + (r'(?<=bind-alias\s)' + valid_xtlang_name, Name.Function), + (r'(?<=bind-poly\s)' + valid_xtlang_name, Name.Function), + (r'(?<=bind-lib\s)' + valid_xtlang_name, Name.Function), + (r'(?<=bind-dylib\s)' + valid_xtlang_name, Name.Function), + (r'(?<=bind-lib-func\s)' + valid_xtlang_name, Name.Function), + (r'(?<=bind-lib-val\s)' + valid_xtlang_name, Name.Function), + + # type annotations + (r':' + valid_xtlang_type, Keyword.Type), + + # types + (r'(<' + valid_xtlang_type + r'>|\|' + valid_xtlang_type + r'\||/' + + valid_xtlang_type + r'/|' + valid_xtlang_type + r'\*)\**', + Keyword.Type), + + # keywords + (words(xtlang_keywords, prefix=r'(?<=\()'), Keyword), + + # builtins + (words(xtlang_functions, prefix=r'(?<=\()'), Name.Function), + + include('common'), + + # variables + (valid_xtlang_name, Name.Variable), + ], + 'scheme': [ + # quoted symbols + (r"'" + valid_scheme_name, String.Symbol), + + # char literals + (r"#\\([()/'\"._!§$%& ?=+-]|[a-zA-Z0-9]+)", String.Char), + + # special operators + (r"('|#|`|,@|,|\.)", Operator), + + # keywords + (words(scheme_keywords, prefix=r'(?<=\()'), Keyword), + + # builtins + (words(scheme_functions, prefix=r'(?<=\()'), Name.Function), + + include('common'), + + # variables + (valid_scheme_name, Name.Variable), + ], + # common to both xtlang and Scheme + 'common': [ + # comments + (r';.*$', Comment.Single), + + # whitespaces - usually not relevant + (r'\s+', Whitespace), + + # numbers + (r'-?\d+\.\d+', Number.Float), + (r'-?\d+', Number.Integer), + + # binary/oct/hex literals + (r'(#b|#o|#x)[\d.]+', Number), + + # strings + (r'"(\\\\|\\[^\\]|[^"\\])*"', String), + + # true/false constants + (r'(#t|#f)', Name.Constant), + + # keywords + (words(common_keywords, prefix=r'(?<=\()'), Keyword), + + # builtins + (words(common_functions, prefix=r'(?<=\()'), Name.Function), + + # the famous parentheses! + (r'(\(|\))', Punctuation), + ], + 'root': [ + # go into xtlang mode + (words(xtlang_bind_keywords, prefix=r'(?<=\()', suffix=r'\b'), + Keyword, 'xtlang'), + + include('scheme') + ], + } + + +class FennelLexer(RegexLexer): + """A lexer for the Fennel programming language. + + Fennel compiles to Lua, so all the Lua builtins are recognized as well + as the special forms that are particular to the Fennel compiler. + """ + name = 'Fennel' + url = 'https://fennel-lang.org' + aliases = ['fennel', 'fnl'] + filenames = ['*.fnl'] + version_added = '2.3' + + # this list is current as of Fennel version 0.10.0. + special_forms = ( + '#', '%', '*', '+', '-', '->', '->>', '-?>', '-?>>', '.', '..', + '/', '//', ':', '<', '<=', '=', '>', '>=', '?.', '^', 'accumulate', + 'and', 'band', 'bnot', 'bor', 'bxor', 'collect', 'comment', 'do', 'doc', + 'doto', 'each', 'eval-compiler', 'for', 'hashfn', 'icollect', 'if', + 'import-macros', 'include', 'length', 'let', 'lshift', 'lua', + 'macrodebug', 'match', 'not', 'not=', 'or', 'partial', 'pick-args', + 'pick-values', 'quote', 'require-macros', 'rshift', 'set', + 'set-forcibly!', 'tset', 'values', 'when', 'while', 'with-open', '~=' + ) + + declarations = ( + 'fn', 'global', 'lambda', 'local', 'macro', 'macros', 'var', 'λ' + ) + + builtins = ( + '_G', '_VERSION', 'arg', 'assert', 'bit32', 'collectgarbage', + 'coroutine', 'debug', 'dofile', 'error', 'getfenv', + 'getmetatable', 'io', 'ipairs', 'load', 'loadfile', 'loadstring', + 'math', 'next', 'os', 'package', 'pairs', 'pcall', 'print', + 'rawequal', 'rawget', 'rawlen', 'rawset', 'require', 'select', + 'setfenv', 'setmetatable', 'string', 'table', 'tonumber', + 'tostring', 'type', 'unpack', 'xpcall' + ) + + # based on the scheme definition, but disallowing leading digits and + # commas, and @ is not allowed. + valid_name = r'[a-zA-Z_!$%&*+/:<=>?^~|-][\w!$%&*+/:<=>?^~|\.-]*' + + tokens = { + 'root': [ + # the only comment form is a semicolon; goes to the end of the line + (r';.*$', Comment.Single), + + (r',+', Text), + (r'\s+', Whitespace), + (r'-?\d+\.\d+', Number.Float), + (r'-?\d+', Number.Integer), + + (r'"(\\\\|\\[^\\]|[^"\\])*"', String), + + (r'(true|false|nil)', Name.Constant), + + # these are technically strings, but it's worth visually + # distinguishing them because their intent is different + # from regular strings. + (r':' + valid_name, String.Symbol), + + # special forms are keywords + (words(special_forms, suffix=' '), Keyword), + # these are ... even more special! + (words(declarations, suffix=' '), Keyword.Declaration), + # lua standard library are builtins + (words(builtins, suffix=' '), Name.Builtin), + # special-case the vararg symbol + (r'\.\.\.', Name.Variable), + # regular identifiers + (valid_name, Name.Variable), + + # all your normal paired delimiters for your programming enjoyment + (r'(\(|\))', Punctuation), + (r'(\[|\])', Punctuation), + (r'(\{|\})', Punctuation), + + # the # symbol is shorthand for a lambda function + (r'#', Punctuation), + ] + } + + +class JanetLexer(RegexLexer): + """A lexer for the Janet programming language. + """ + name = 'Janet' + url = 'https://janet-lang.org/' + aliases = ['janet'] + filenames = ['*.janet', '*.jdn'] + mimetypes = ['text/x-janet', 'application/x-janet'] + version_added = '2.18' + + # XXX: gets too slow + #flags = re.MULTILINE | re.VERBOSE + + special_forms = ( + 'break', 'def', 'do', 'fn', 'if', 'quote', 'quasiquote', 'splice', + 'set', 'unquote', 'upscope', 'var', 'while' + ) + + builtin_macros = ( + '%=', '*=', '++', '+=', '--', '-=', '->', '->>', '-?>', + '-?>>', '/=', 'and', 'as->', 'as-macro', 'as?->', + 'assert', 'case', 'catseq', 'chr', 'comment', 'compif', + 'comptime', 'compwhen', 'cond', 'coro', 'def-', + 'default', 'defdyn', 'defer', 'defmacro', 'defmacro-', + 'defn', 'defn-', 'delay', 'doc', 'each', 'eachk', + 'eachp', 'edefer', 'ev/do-thread', 'ev/gather', + 'ev/spawn', 'ev/spawn-thread', 'ev/with-deadline', + 'ffi/defbind', 'fiber-fn', 'for', 'forever', 'forv', + 'generate', 'if-let', 'if-not', 'if-with', 'import', + 'juxt', 'label', 'let', 'loop', 'match', 'or', 'prompt', + 'protect', 'repeat', 'seq', 'short-fn', 'tabseq', + 'toggle', 'tracev', 'try', 'unless', 'use', 'var-', + 'varfn', 'when', 'when-let', 'when-with', 'with', + 'with-dyns', 'with-syms', 'with-vars', + # obsolete builtin macros + 'eachy' + ) + + builtin_functions = ( + '%', '*', '+', '-', '/', '<', '<=', '=', '>', '>=', + 'abstract?', 'accumulate', 'accumulate2', 'all', + 'all-bindings', 'all-dynamics', 'any?', 'apply', + 'array', 'array/clear', 'array/concat', 'array/ensure', + 'array/fill', 'array/insert', 'array/new', + 'array/new-filled', 'array/peek', 'array/pop', + 'array/push', 'array/remove', 'array/slice', + 'array/trim', 'array/weak', 'array?', 'asm', + 'bad-compile', 'bad-parse', 'band', 'blshift', 'bnot', + 'boolean?', 'bor', 'brshift', 'brushift', 'buffer', + 'buffer/bit', 'buffer/bit-clear', 'buffer/bit-set', + 'buffer/bit-toggle', 'buffer/blit', 'buffer/clear', + 'buffer/fill', 'buffer/format', 'buffer/from-bytes', + 'buffer/new', 'buffer/new-filled', 'buffer/popn', + 'buffer/push', 'buffer/push-at', 'buffer/push-byte', + 'buffer/push-string', 'buffer/push-word', + 'buffer/slice', 'buffer/trim', 'buffer?', 'bxor', + 'bytes?', 'cancel', 'cfunction?', 'cli-main', 'cmp', + 'comp', 'compare', 'compare<', 'compare<=', 'compare=', + 'compare>', 'compare>=', 'compile', 'complement', + 'count', 'curenv', 'debug', 'debug/arg-stack', + 'debug/break', 'debug/fbreak', 'debug/lineage', + 'debug/stack', 'debug/stacktrace', 'debug/step', + 'debug/unbreak', 'debug/unfbreak', 'debugger', + 'debugger-on-status', 'dec', 'deep-not=', 'deep=', + 'defglobal', 'describe', 'dictionary?', 'disasm', + 'distinct', 'div', 'doc*', 'doc-format', 'doc-of', + 'dofile', 'drop', 'drop-until', 'drop-while', 'dyn', + 'eflush', 'empty?', 'env-lookup', 'eprin', 'eprinf', + 'eprint', 'eprintf', 'error', 'errorf', + 'ev/acquire-lock', 'ev/acquire-rlock', + 'ev/acquire-wlock', 'ev/all-tasks', 'ev/call', + 'ev/cancel', 'ev/capacity', 'ev/chan', 'ev/chan-close', + 'ev/chunk', 'ev/close', 'ev/count', 'ev/deadline', + 'ev/full', 'ev/give', 'ev/give-supervisor', 'ev/go', + 'ev/lock', 'ev/read', 'ev/release-lock', + 'ev/release-rlock', 'ev/release-wlock', 'ev/rselect', + 'ev/rwlock', 'ev/select', 'ev/sleep', 'ev/take', + 'ev/thread', 'ev/thread-chan', 'ev/write', 'eval', + 'eval-string', 'even?', 'every?', 'extreme', 'false?', + 'ffi/align', 'ffi/call', 'ffi/calling-conventions', + 'ffi/close', 'ffi/context', 'ffi/free', 'ffi/jitfn', + 'ffi/lookup', 'ffi/malloc', 'ffi/native', + 'ffi/pointer-buffer', 'ffi/pointer-cfunction', + 'ffi/read', 'ffi/signature', 'ffi/size', 'ffi/struct', + 'ffi/trampoline', 'ffi/write', 'fiber/can-resume?', + 'fiber/current', 'fiber/getenv', 'fiber/last-value', + 'fiber/maxstack', 'fiber/new', 'fiber/root', + 'fiber/setenv', 'fiber/setmaxstack', 'fiber/status', + 'fiber?', 'file/close', 'file/flush', 'file/lines', + 'file/open', 'file/read', 'file/seek', 'file/tell', + 'file/temp', 'file/write', 'filter', 'find', + 'find-index', 'first', 'flatten', 'flatten-into', + 'flush', 'flycheck', 'freeze', 'frequencies', + 'from-pairs', 'function?', 'gccollect', 'gcinterval', + 'gcsetinterval', 'gensym', 'get', 'get-in', 'getline', + 'getproto', 'group-by', 'has-key?', 'has-value?', + 'hash', 'idempotent?', 'identity', 'import*', 'in', + 'inc', 'index-of', 'indexed?', 'int/s64', + 'int/to-bytes', 'int/to-number', 'int/u64', 'int?', + 'interleave', 'interpose', 'invert', 'juxt*', 'keep', + 'keep-syntax', 'keep-syntax!', 'keys', 'keyword', + 'keyword/slice', 'keyword?', 'kvs', 'last', 'length', + 'lengthable?', 'load-image', 'macex', 'macex1', + 'maclintf', 'make-env', 'make-image', 'map', 'mapcat', + 'marshal', 'math/abs', 'math/acos', 'math/acosh', + 'math/asin', 'math/asinh', 'math/atan', 'math/atan2', + 'math/atanh', 'math/cbrt', 'math/ceil', 'math/cos', + 'math/cosh', 'math/erf', 'math/erfc', 'math/exp', + 'math/exp2', 'math/expm1', 'math/floor', 'math/gamma', + 'math/gcd', 'math/hypot', 'math/lcm', 'math/log', + 'math/log-gamma', 'math/log10', 'math/log1p', + 'math/log2', 'math/next', 'math/pow', 'math/random', + 'math/rng', 'math/rng-buffer', 'math/rng-int', + 'math/rng-uniform', 'math/round', 'math/seedrandom', + 'math/sin', 'math/sinh', 'math/sqrt', 'math/tan', + 'math/tanh', 'math/trunc', 'max', 'max-of', 'mean', + 'memcmp', 'merge', 'merge-into', 'merge-module', 'min', + 'min-of', 'mod', 'module/add-paths', + 'module/expand-path', 'module/find', 'module/value', + 'nan?', 'nat?', 'native', 'neg?', 'net/accept', + 'net/accept-loop', 'net/address', 'net/address-unpack', + 'net/chunk', 'net/close', 'net/connect', 'net/flush', + 'net/listen', 'net/localname', 'net/peername', + 'net/read', 'net/recv-from', 'net/send-to', + 'net/server', 'net/setsockopt', 'net/shutdown', + 'net/write', 'next', 'nil?', 'not', 'not=', 'number?', + 'odd?', 'one?', 'os/arch', 'os/cd', 'os/chmod', + 'os/clock', 'os/compiler', 'os/cpu-count', + 'os/cryptorand', 'os/cwd', 'os/date', 'os/dir', + 'os/environ', 'os/execute', 'os/exit', 'os/getenv', + 'os/isatty', 'os/link', 'os/lstat', 'os/mkdir', + 'os/mktime', 'os/open', 'os/perm-int', 'os/perm-string', + 'os/pipe', 'os/posix-exec', 'os/posix-fork', + 'os/proc-close', 'os/proc-kill', 'os/proc-wait', + 'os/readlink', 'os/realpath', 'os/rename', 'os/rm', + 'os/rmdir', 'os/setenv', 'os/shell', 'os/sigaction', + 'os/sleep', 'os/spawn', 'os/stat', 'os/strftime', + 'os/symlink', 'os/time', 'os/touch', 'os/umask', + 'os/which', 'pairs', 'parse', 'parse-all', + 'parser/byte', 'parser/clone', 'parser/consume', + 'parser/eof', 'parser/error', 'parser/flush', + 'parser/has-more', 'parser/insert', 'parser/new', + 'parser/produce', 'parser/state', 'parser/status', + 'parser/where', 'partial', 'partition', 'partition-by', + 'peg/compile', 'peg/find', 'peg/find-all', 'peg/match', + 'peg/replace', 'peg/replace-all', 'pos?', 'postwalk', + 'pp', 'prewalk', 'prin', 'prinf', 'print', 'printf', + 'product', 'propagate', 'put', 'put-in', 'quit', + 'range', 'reduce', 'reduce2', 'repl', 'require', + 'resume', 'return', 'reverse', 'reverse!', + 'run-context', 'sandbox', 'scan-number', 'setdyn', + 'signal', 'slice', 'slurp', 'some', 'sort', 'sort-by', + 'sorted', 'sorted-by', 'spit', 'string', + 'string/ascii-lower', 'string/ascii-upper', + 'string/bytes', 'string/check-set', 'string/find', + 'string/find-all', 'string/format', 'string/from-bytes', + 'string/has-prefix?', 'string/has-suffix?', + 'string/join', 'string/repeat', 'string/replace', + 'string/replace-all', 'string/reverse', 'string/slice', + 'string/split', 'string/trim', 'string/triml', + 'string/trimr', 'string?', 'struct', 'struct/getproto', + 'struct/proto-flatten', 'struct/to-table', + 'struct/with-proto', 'struct?', 'sum', 'symbol', + 'symbol/slice', 'symbol?', 'table', 'table/clear', + 'table/clone', 'table/getproto', 'table/new', + 'table/proto-flatten', 'table/rawget', 'table/setproto', + 'table/to-struct', 'table/weak', 'table/weak-keys', + 'table/weak-values', 'table?', 'take', 'take-until', + 'take-while', 'thaw', 'trace', 'true?', 'truthy?', + 'tuple', 'tuple/brackets', 'tuple/setmap', + 'tuple/slice', 'tuple/sourcemap', 'tuple/type', + 'tuple?', 'type', 'unmarshal', 'untrace', 'update', + 'update-in', 'values', 'varglobal', 'walk', + 'warn-compile', 'xprin', 'xprinf', 'xprint', 'xprintf', + 'yield', 'zero?', 'zipcoll', + # obsolete builtin functions + 'tarray/buffer', 'tarray/copy-bytes', 'tarray/length', + 'tarray/new', 'tarray/properties', 'tarray/slice', + 'tarray/swap-bytes', 'thread/close', 'thread/current', + 'thread/exit', 'thread/new', 'thread/receive', + 'thread/send' + ) + + builtin_variables = ( + 'debugger-env', 'default-peg-grammar', 'janet/build', + 'janet/config-bits', 'janet/version', 'load-image-dict', + 'make-image-dict', 'math/-inf', 'math/e', 'math/inf', + 'math/int-max', 'math/int-min', 'math/int32-max', + 'math/int32-min', 'math/nan', 'math/pi', 'module/cache', + 'module/loaders', 'module/loading', 'module/paths', + 'root-env', 'stderr', 'stdin', 'stdout' + ) + + constants = ( + 'false', 'nil', 'true' + ) + + # XXX: this form not usable to pass to `suffix=` + #_token_end = r''' + # (?= # followed by one of: + # \s # whitespace + # | \# # comment + # | [)\]] # end delimiters + # | $ # end of file + # ) + #''' + + # ...so, express it like this + _token_end = r'(?=\s|#|[)\]]|$)' + + _first_char = r'[a-zA-Z!$%&*+\-./<=>?@^_]' + _rest_char = rf'([0-9:]|{_first_char})' + + valid_name = rf'{_first_char}({_rest_char})*' + + _radix_unit = r'[0-9a-zA-Z][0-9a-zA-Z_]*' + + # exponent marker, optional sign, one or more alphanumeric + _radix_exp = r'&[+-]?[0-9a-zA-Z]+' + + # 2af3__bee_ + _hex_unit = r'[0-9a-fA-F][0-9a-fA-F_]*' + + # 12_000__ + _dec_unit = r'[0-9][0-9_]*' + + # E-23 + # lower or uppercase e, optional sign, one or more digits + _dec_exp = r'[eE][+-]?[0-9]+' + + tokens = { + 'root': [ + (r'#.*$', Comment.Single), + + (r'\s+', Whitespace), + + # radix number + (rf'''(?x) + [+-]? [0-9]{{1,2}} r {_radix_unit} \. ({_radix_unit})? + ({_radix_exp})? + ''', + Number), + + (rf'''(?x) + [+-]? [0-9]{{1,2}} r (\.)? {_radix_unit} + ({_radix_exp})? + ''', + Number), + + # hex number + (rf'(?x) [+-]? 0x {_hex_unit} \. ({_hex_unit})?', + Number.Hex), + + (rf'(?x) [+-]? 0x (\.)? {_hex_unit}', + Number.Hex), + + # decimal number + (rf'(?x) [+-]? {_dec_unit} \. ({_dec_unit})? ({_dec_exp})?', + Number.Float), + + (rf'(?x) [+-]? (\.)? {_dec_unit} ({_dec_exp})?', + Number.Float), + + # strings and buffers + (r'@?"', String, 'string'), + + # long-strings and long-buffers + # + # non-empty content enclosed by a pair of n-backticks + # with optional leading @ + (r'@?(`+)(.|\n)+?\1', String), + + # things that hang out on front + # + # ' ~ , ; | + (r"['~,;|]", Operator), + + # collection delimiters + # + # @( ( ) + # @[ [ ] + # @{ { } + (r'@?[(\[{]|[)\]}]', Punctuation), + + # constants + (words(constants, suffix=_token_end), Keyword.Constants), + + # keywords + (rf'(:({_rest_char})+|:)', Name.Constant), + + # symbols + (words(builtin_variables, suffix=_token_end), + Name.Variable.Global), + + (words(special_forms, prefix=r'(?<=\()', suffix=_token_end), + Keyword.Reserved), + + (words(builtin_macros, prefix=r'(?<=\()', suffix=_token_end), + Name.Builtin), + + (words(builtin_functions, prefix=r'(?<=\()', suffix=_token_end), + Name.Function), + + # other symbols + (valid_name, Name.Variable), + ], + 'string': [ + (r'\\(u[0-9a-fA-F]{4}|U[0-9a-fA-F]{6})', String.Escape), + (r'\\x[0-9a-fA-F]{2}', String.Escape), + (r'\\.', String.Escape), + (r'"', String, '#pop'), + (r'[^\\"]+', String), + ] + } diff --git a/lib/python3.12/site-packages/pygments/lexers/matlab.py b/lib/python3.12/site-packages/pygments/lexers/matlab.py new file mode 100644 index 0000000000000000000000000000000000000000..8eeffc9d23a0ad2b5ec186a8e3da29a02340b95e --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/matlab.py @@ -0,0 +1,3307 @@ +""" + pygments.lexers.matlab + ~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for Matlab and related languages. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import Lexer, RegexLexer, bygroups, default, words, \ + do_insertions, include +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Generic, Whitespace + +from pygments.lexers import _scilab_builtins + +__all__ = ['MatlabLexer', 'MatlabSessionLexer', 'OctaveLexer', 'ScilabLexer'] + + +class MatlabLexer(RegexLexer): + """ + For Matlab source code. + """ + name = 'Matlab' + aliases = ['matlab'] + filenames = ['*.m'] + mimetypes = ['text/matlab'] + url = 'https://www.mathworks.com/products/matlab.html' + version_added = '0.10' + + _operators = r'-|==|~=|<=|>=|<|>|&&|&|~|\|\|?|\.\*|\*|\+|\.\^|\^|\.\\|\./|/|\\' + + tokens = { + 'expressions': [ + # operators: + (_operators, Operator), + + # numbers (must come before punctuation to handle `.5`; cannot use + # `\b` due to e.g. `5. + .5`). The negative lookahead on operators + # avoids including the dot in `1./x` (the dot is part of `./`). + (rf'(? and then + # (equal | open-parenthesis | | ). + (rf'(?:^|(?<=;))(\s*)(\w+)(\s+)(?!=|\(|{_operators}\s|\s)', + bygroups(Whitespace, Name, Whitespace), 'commandargs'), + + include('expressions') + ], + 'blockcomment': [ + (r'^\s*%\}', Comment.Multiline, '#pop'), + (r'^.*\n', Comment.Multiline), + (r'.', Comment.Multiline), + ], + 'deffunc': [ + (r'(\s*)(?:(\S+)(\s*)(=)(\s*))?(.+)(\()(.*)(\))(\s*)', + bygroups(Whitespace, Text, Whitespace, Punctuation, + Whitespace, Name.Function, Punctuation, Text, + Punctuation, Whitespace), '#pop'), + # function with no args + (r'(\s*)([a-zA-Z_]\w*)', + bygroups(Whitespace, Name.Function), '#pop'), + ], + 'propattrs': [ + (r'(\w+)(\s*)(=)(\s*)(\d+)', + bygroups(Name.Builtin, Whitespace, Punctuation, Whitespace, + Number)), + (r'(\w+)(\s*)(=)(\s*)([a-zA-Z]\w*)', + bygroups(Name.Builtin, Whitespace, Punctuation, Whitespace, + Keyword)), + (r',', Punctuation), + (r'\)', Punctuation, '#pop'), + (r'\s+', Whitespace), + (r'.', Text), + ], + 'defprops': [ + (r'%\{\s*\n', Comment.Multiline, 'blockcomment'), + (r'%.*$', Comment), + (r'(?. + """ + name = 'Matlab session' + aliases = ['matlabsession'] + url = 'https://www.mathworks.com/products/matlab.html' + version_added = '0.10' + _example = "matlabsession/matlabsession_sample.txt" + + def get_tokens_unprocessed(self, text): + mlexer = MatlabLexer(**self.options) + + curcode = '' + insertions = [] + continuation = False + + for match in line_re.finditer(text): + line = match.group() + + if line.startswith('>> '): + insertions.append((len(curcode), + [(0, Generic.Prompt, line[:3])])) + curcode += line[3:] + + elif line.startswith('>>'): + insertions.append((len(curcode), + [(0, Generic.Prompt, line[:2])])) + curcode += line[2:] + + elif line.startswith('???'): + + idx = len(curcode) + + # without is showing error on same line as before...? + # line = "\n" + line + token = (0, Generic.Traceback, line) + insertions.append((idx, [token])) + elif continuation and insertions: + # line_start is the length of the most recent prompt symbol + line_start = len(insertions[-1][-1][-1]) + # Set leading spaces with the length of the prompt to be a generic prompt + # This keeps code aligned when prompts are removed, say with some Javascript + if line.startswith(' '*line_start): + insertions.append( + (len(curcode), [(0, Generic.Prompt, line[:line_start])])) + curcode += line[line_start:] + else: + curcode += line + else: + if curcode: + yield from do_insertions( + insertions, mlexer.get_tokens_unprocessed(curcode)) + curcode = '' + insertions = [] + + yield match.start(), Generic.Output, line + + # Does not allow continuation if a comment is included after the ellipses. + # Continues any line that ends with ..., even comments (lines that start with %) + if line.strip().endswith('...'): + continuation = True + else: + continuation = False + + if curcode: # or item: + yield from do_insertions( + insertions, mlexer.get_tokens_unprocessed(curcode)) + + +class OctaveLexer(RegexLexer): + """ + For GNU Octave source code. + """ + name = 'Octave' + url = 'https://www.gnu.org/software/octave/index' + aliases = ['octave'] + filenames = ['*.m'] + mimetypes = ['text/octave'] + version_added = '1.5' + + # These lists are generated automatically. + # Run the following in bash shell: + # + # First dump all of the Octave manual into a plain text file: + # + # $ info octave --subnodes -o octave-manual + # + # Now grep through it: + + # for i in \ + # "Built-in Function" "Command" "Function File" \ + # "Loadable Function" "Mapping Function"; + # do + # perl -e '@name = qw('"$i"'); + # print lc($name[0]),"_kw = [\n"'; + # + # perl -n -e 'print "\"$1\",\n" if /-- '"$i"': .* (\w*) \(/;' \ + # octave-manual | sort | uniq ; + # echo "]" ; + # echo; + # done + + # taken from Octave Mercurial changeset 8cc154f45e37 (30-jan-2011) + + builtin_kw = ( + "addlistener", "addpath", "addproperty", "all", + "and", "any", "argnames", "argv", "assignin", + "atexit", "autoload", + "available_graphics_toolkits", "beep_on_error", + "bitand", "bitmax", "bitor", "bitshift", "bitxor", + "cat", "cell", "cellstr", "char", "class", "clc", + "columns", "command_line_path", + "completion_append_char", "completion_matches", + "complex", "confirm_recursive_rmdir", "cputime", + "crash_dumps_octave_core", "ctranspose", "cumprod", + "cumsum", "debug_on_error", "debug_on_interrupt", + "debug_on_warning", "default_save_options", + "dellistener", "diag", "diff", "disp", + "doc_cache_file", "do_string_escapes", "double", + "drawnow", "e", "echo_executing_commands", "eps", + "eq", "errno", "errno_list", "error", "eval", + "evalin", "exec", "exist", "exit", "eye", "false", + "fclear", "fclose", "fcntl", "fdisp", "feof", + "ferror", "feval", "fflush", "fgetl", "fgets", + "fieldnames", "file_in_loadpath", "file_in_path", + "filemarker", "filesep", "find_dir_in_path", + "fixed_point_format", "fnmatch", "fopen", "fork", + "formula", "fprintf", "fputs", "fread", "freport", + "frewind", "fscanf", "fseek", "fskipl", "ftell", + "functions", "fwrite", "ge", "genpath", "get", + "getegid", "getenv", "geteuid", "getgid", + "getpgrp", "getpid", "getppid", "getuid", "glob", + "gt", "gui_mode", "history_control", + "history_file", "history_size", + "history_timestamp_format_string", "home", + "horzcat", "hypot", "ifelse", + "ignore_function_time_stamp", "inferiorto", + "info_file", "info_program", "inline", "input", + "intmax", "intmin", "ipermute", + "is_absolute_filename", "isargout", "isbool", + "iscell", "iscellstr", "ischar", "iscomplex", + "isempty", "isfield", "isfloat", "isglobal", + "ishandle", "isieee", "isindex", "isinteger", + "islogical", "ismatrix", "ismethod", "isnull", + "isnumeric", "isobject", "isreal", + "is_rooted_relative_filename", "issorted", + "isstruct", "isvarname", "kbhit", "keyboard", + "kill", "lasterr", "lasterror", "lastwarn", + "ldivide", "le", "length", "link", "linspace", + "logical", "lstat", "lt", "make_absolute_filename", + "makeinfo_program", "max_recursion_depth", "merge", + "methods", "mfilename", "minus", "mislocked", + "mkdir", "mkfifo", "mkstemp", "mldivide", "mlock", + "mouse_wheel_zoom", "mpower", "mrdivide", "mtimes", + "munlock", "nargin", "nargout", + "native_float_format", "ndims", "ne", "nfields", + "nnz", "norm", "not", "numel", "nzmax", + "octave_config_info", "octave_core_file_limit", + "octave_core_file_name", + "octave_core_file_options", "ones", "or", + "output_max_field_width", "output_precision", + "page_output_immediately", "page_screen_output", + "path", "pathsep", "pause", "pclose", "permute", + "pi", "pipe", "plus", "popen", "power", + "print_empty_dimensions", "printf", + "print_struct_array_contents", "prod", + "program_invocation_name", "program_name", + "putenv", "puts", "pwd", "quit", "rats", "rdivide", + "readdir", "readlink", "read_readline_init_file", + "realmax", "realmin", "rehash", "rename", + "repelems", "re_read_readline_init_file", "reset", + "reshape", "resize", "restoredefaultpath", + "rethrow", "rmdir", "rmfield", "rmpath", "rows", + "save_header_format_string", "save_precision", + "saving_history", "scanf", "set", "setenv", + "shell_cmd", "sighup_dumps_octave_core", + "sigterm_dumps_octave_core", "silent_functions", + "single", "size", "size_equal", "sizemax", + "sizeof", "sleep", "source", "sparse_auto_mutate", + "split_long_rows", "sprintf", "squeeze", "sscanf", + "stat", "stderr", "stdin", "stdout", "strcmp", + "strcmpi", "string_fill_char", "strncmp", + "strncmpi", "struct", "struct_levels_to_print", + "strvcat", "subsasgn", "subsref", "sum", "sumsq", + "superiorto", "suppress_verbose_help_message", + "symlink", "system", "tic", "tilde_expand", + "times", "tmpfile", "tmpnam", "toc", "toupper", + "transpose", "true", "typeinfo", "umask", "uminus", + "uname", "undo_string_escapes", "unlink", "uplus", + "upper", "usage", "usleep", "vec", "vectorize", + "vertcat", "waitpid", "warning", "warranty", + "whos_line_format", "yes_or_no", "zeros", + "inf", "Inf", "nan", "NaN") + + command_kw = ("close", "load", "who", "whos") + + function_kw = ( + "accumarray", "accumdim", "acosd", "acotd", + "acscd", "addtodate", "allchild", "ancestor", + "anova", "arch_fit", "arch_rnd", "arch_test", + "area", "arma_rnd", "arrayfun", "ascii", "asctime", + "asecd", "asind", "assert", "atand", + "autoreg_matrix", "autumn", "axes", "axis", "bar", + "barh", "bartlett", "bartlett_test", "beep", + "betacdf", "betainv", "betapdf", "betarnd", + "bicgstab", "bicubic", "binary", "binocdf", + "binoinv", "binopdf", "binornd", "bitcmp", + "bitget", "bitset", "blackman", "blanks", + "blkdiag", "bone", "box", "brighten", "calendar", + "cast", "cauchy_cdf", "cauchy_inv", "cauchy_pdf", + "cauchy_rnd", "caxis", "celldisp", "center", "cgs", + "chisquare_test_homogeneity", + "chisquare_test_independence", "circshift", "cla", + "clabel", "clf", "clock", "cloglog", "closereq", + "colon", "colorbar", "colormap", "colperm", + "comet", "common_size", "commutation_matrix", + "compan", "compare_versions", "compass", + "computer", "cond", "condest", "contour", + "contourc", "contourf", "contrast", "conv", + "convhull", "cool", "copper", "copyfile", "cor", + "corrcoef", "cor_test", "cosd", "cotd", "cov", + "cplxpair", "cross", "cscd", "cstrcat", "csvread", + "csvwrite", "ctime", "cumtrapz", "curl", "cut", + "cylinder", "date", "datenum", "datestr", + "datetick", "datevec", "dblquad", "deal", + "deblank", "deconv", "delaunay", "delaunayn", + "delete", "demo", "detrend", "diffpara", "diffuse", + "dir", "discrete_cdf", "discrete_inv", + "discrete_pdf", "discrete_rnd", "display", + "divergence", "dlmwrite", "dos", "dsearch", + "dsearchn", "duplication_matrix", "durbinlevinson", + "ellipsoid", "empirical_cdf", "empirical_inv", + "empirical_pdf", "empirical_rnd", "eomday", + "errorbar", "etime", "etreeplot", "example", + "expcdf", "expinv", "expm", "exppdf", "exprnd", + "ezcontour", "ezcontourf", "ezmesh", "ezmeshc", + "ezplot", "ezpolar", "ezsurf", "ezsurfc", "factor", + "factorial", "fail", "fcdf", "feather", "fftconv", + "fftfilt", "fftshift", "figure", "fileattrib", + "fileparts", "fill", "findall", "findobj", + "findstr", "finv", "flag", "flipdim", "fliplr", + "flipud", "fpdf", "fplot", "fractdiff", "freqz", + "freqz_plot", "frnd", "fsolve", + "f_test_regression", "ftp", "fullfile", "fzero", + "gamcdf", "gaminv", "gampdf", "gamrnd", "gca", + "gcbf", "gcbo", "gcf", "genvarname", "geocdf", + "geoinv", "geopdf", "geornd", "getfield", "ginput", + "glpk", "gls", "gplot", "gradient", + "graphics_toolkit", "gray", "grid", "griddata", + "griddatan", "gtext", "gunzip", "gzip", "hadamard", + "hamming", "hankel", "hanning", "hggroup", + "hidden", "hilb", "hist", "histc", "hold", "hot", + "hotelling_test", "housh", "hsv", "hurst", + "hygecdf", "hygeinv", "hygepdf", "hygernd", + "idivide", "ifftshift", "image", "imagesc", + "imfinfo", "imread", "imshow", "imwrite", "index", + "info", "inpolygon", "inputname", "interpft", + "interpn", "intersect", "invhilb", "iqr", "isa", + "isdefinite", "isdir", "is_duplicate_entry", + "isequal", "isequalwithequalnans", "isfigure", + "ishermitian", "ishghandle", "is_leap_year", + "isletter", "ismac", "ismember", "ispc", "isprime", + "isprop", "isscalar", "issquare", "isstrprop", + "issymmetric", "isunix", "is_valid_file_id", + "isvector", "jet", "kendall", + "kolmogorov_smirnov_cdf", + "kolmogorov_smirnov_test", "kruskal_wallis_test", + "krylov", "kurtosis", "laplace_cdf", "laplace_inv", + "laplace_pdf", "laplace_rnd", "legend", "legendre", + "license", "line", "linkprop", "list_primes", + "loadaudio", "loadobj", "logistic_cdf", + "logistic_inv", "logistic_pdf", "logistic_rnd", + "logit", "loglog", "loglogerr", "logm", "logncdf", + "logninv", "lognpdf", "lognrnd", "logspace", + "lookfor", "ls_command", "lsqnonneg", "magic", + "mahalanobis", "manova", "matlabroot", + "mcnemar_test", "mean", "meansq", "median", "menu", + "mesh", "meshc", "meshgrid", "meshz", "mexext", + "mget", "mkpp", "mode", "moment", "movefile", + "mpoles", "mput", "namelengthmax", "nargchk", + "nargoutchk", "nbincdf", "nbininv", "nbinpdf", + "nbinrnd", "nchoosek", "ndgrid", "newplot", "news", + "nonzeros", "normcdf", "normest", "norminv", + "normpdf", "normrnd", "now", "nthroot", "null", + "ocean", "ols", "onenormest", "optimget", + "optimset", "orderfields", "orient", "orth", + "pack", "pareto", "parseparams", "pascal", "patch", + "pathdef", "pcg", "pchip", "pcolor", "pcr", + "peaks", "periodogram", "perl", "perms", "pie", + "pink", "planerot", "playaudio", "plot", + "plotmatrix", "plotyy", "poisscdf", "poissinv", + "poisspdf", "poissrnd", "polar", "poly", + "polyaffine", "polyarea", "polyderiv", "polyfit", + "polygcd", "polyint", "polyout", "polyreduce", + "polyval", "polyvalm", "postpad", "powerset", + "ppder", "ppint", "ppjumps", "ppplot", "ppval", + "pqpnonneg", "prepad", "primes", "print", + "print_usage", "prism", "probit", "qp", "qqplot", + "quadcc", "quadgk", "quadl", "quadv", "quiver", + "qzhess", "rainbow", "randi", "range", "rank", + "ranks", "rat", "reallog", "realpow", "realsqrt", + "record", "rectangle_lw", "rectangle_sw", + "rectint", "refresh", "refreshdata", + "regexptranslate", "repmat", "residue", "ribbon", + "rindex", "roots", "rose", "rosser", "rotdim", + "rref", "run", "run_count", "rundemos", "run_test", + "runtests", "saveas", "saveaudio", "saveobj", + "savepath", "scatter", "secd", "semilogx", + "semilogxerr", "semilogy", "semilogyerr", + "setaudio", "setdiff", "setfield", "setxor", + "shading", "shift", "shiftdim", "sign_test", + "sinc", "sind", "sinetone", "sinewave", "skewness", + "slice", "sombrero", "sortrows", "spaugment", + "spconvert", "spdiags", "spearman", "spectral_adf", + "spectral_xdf", "specular", "speed", "spencer", + "speye", "spfun", "sphere", "spinmap", "spline", + "spones", "sprand", "sprandn", "sprandsym", + "spring", "spstats", "spy", "sqp", "stairs", + "statistics", "std", "stdnormal_cdf", + "stdnormal_inv", "stdnormal_pdf", "stdnormal_rnd", + "stem", "stft", "strcat", "strchr", "strjust", + "strmatch", "strread", "strsplit", "strtok", + "strtrim", "strtrunc", "structfun", "studentize", + "subplot", "subsindex", "subspace", "substr", + "substruct", "summer", "surf", "surface", "surfc", + "surfl", "surfnorm", "svds", "swapbytes", + "sylvester_matrix", "symvar", "synthesis", "table", + "tand", "tar", "tcdf", "tempdir", "tempname", + "test", "text", "textread", "textscan", "tinv", + "title", "toeplitz", "tpdf", "trace", "trapz", + "treelayout", "treeplot", "triangle_lw", + "triangle_sw", "tril", "trimesh", "triplequad", + "triplot", "trisurf", "triu", "trnd", "tsearchn", + "t_test", "t_test_regression", "type", "unidcdf", + "unidinv", "unidpdf", "unidrnd", "unifcdf", + "unifinv", "unifpdf", "unifrnd", "union", "unique", + "unix", "unmkpp", "unpack", "untabify", "untar", + "unwrap", "unzip", "u_test", "validatestring", + "vander", "var", "var_test", "vech", "ver", + "version", "view", "voronoi", "voronoin", + "waitforbuttonpress", "wavread", "wavwrite", + "wblcdf", "wblinv", "wblpdf", "wblrnd", "weekday", + "welch_test", "what", "white", "whitebg", + "wienrnd", "wilcoxon_test", "wilkinson", "winter", + "xlabel", "xlim", "ylabel", "yulewalker", "zip", + "zlabel", "z_test") + + loadable_kw = ( + "airy", "amd", "balance", "besselh", "besseli", + "besselj", "besselk", "bessely", "bitpack", + "bsxfun", "builtin", "ccolamd", "cellfun", + "cellslices", "chol", "choldelete", "cholinsert", + "cholinv", "cholshift", "cholupdate", "colamd", + "colloc", "convhulln", "convn", "csymamd", + "cummax", "cummin", "daspk", "daspk_options", + "dasrt", "dasrt_options", "dassl", "dassl_options", + "dbclear", "dbdown", "dbstack", "dbstatus", + "dbstop", "dbtype", "dbup", "dbwhere", "det", + "dlmread", "dmperm", "dot", "eig", "eigs", + "endgrent", "endpwent", "etree", "fft", "fftn", + "fftw", "filter", "find", "full", "gcd", + "getgrent", "getgrgid", "getgrnam", "getpwent", + "getpwnam", "getpwuid", "getrusage", "givens", + "gmtime", "gnuplot_binary", "hess", "ifft", + "ifftn", "inv", "isdebugmode", "issparse", "kron", + "localtime", "lookup", "lsode", "lsode_options", + "lu", "luinc", "luupdate", "matrix_type", "max", + "min", "mktime", "pinv", "qr", "qrdelete", + "qrinsert", "qrshift", "qrupdate", "quad", + "quad_options", "qz", "rand", "rande", "randg", + "randn", "randp", "randperm", "rcond", "regexp", + "regexpi", "regexprep", "schur", "setgrent", + "setpwent", "sort", "spalloc", "sparse", "spparms", + "sprank", "sqrtm", "strfind", "strftime", + "strptime", "strrep", "svd", "svd_driver", "syl", + "symamd", "symbfact", "symrcm", "time", "tsearch", + "typecast", "urlread", "urlwrite") + + mapping_kw = ( + "abs", "acos", "acosh", "acot", "acoth", "acsc", + "acsch", "angle", "arg", "asec", "asech", "asin", + "asinh", "atan", "atanh", "beta", "betainc", + "betaln", "bincoeff", "cbrt", "ceil", "conj", "cos", + "cosh", "cot", "coth", "csc", "csch", "erf", "erfc", + "erfcx", "erfinv", "exp", "finite", "fix", "floor", + "fmod", "gamma", "gammainc", "gammaln", "imag", + "isalnum", "isalpha", "isascii", "iscntrl", + "isdigit", "isfinite", "isgraph", "isinf", + "islower", "isna", "isnan", "isprint", "ispunct", + "isspace", "isupper", "isxdigit", "lcm", "lgamma", + "log", "lower", "mod", "real", "rem", "round", + "roundb", "sec", "sech", "sign", "sin", "sinh", + "sqrt", "tan", "tanh", "toascii", "tolower", "xor") + + builtin_consts = ( + "EDITOR", "EXEC_PATH", "I", "IMAGE_PATH", "NA", + "OCTAVE_HOME", "OCTAVE_VERSION", "PAGER", + "PAGER_FLAGS", "SEEK_CUR", "SEEK_END", "SEEK_SET", + "SIG", "S_ISBLK", "S_ISCHR", "S_ISDIR", "S_ISFIFO", + "S_ISLNK", "S_ISREG", "S_ISSOCK", "WCONTINUE", + "WCOREDUMP", "WEXITSTATUS", "WIFCONTINUED", + "WIFEXITED", "WIFSIGNALED", "WIFSTOPPED", "WNOHANG", + "WSTOPSIG", "WTERMSIG", "WUNTRACED") + + tokens = { + 'root': [ + (r'%\{\s*\n', Comment.Multiline, 'percentblockcomment'), + (r'#\{\s*\n', Comment.Multiline, 'hashblockcomment'), + (r'[%#].*$', Comment), + (r'^\s*function\b', Keyword, 'deffunc'), + + # from 'iskeyword' on hg changeset 8cc154f45e37 + (words(( + '__FILE__', '__LINE__', 'break', 'case', 'catch', 'classdef', + 'continue', 'do', 'else', 'elseif', 'end', 'end_try_catch', + 'end_unwind_protect', 'endclassdef', 'endevents', 'endfor', + 'endfunction', 'endif', 'endmethods', 'endproperties', 'endswitch', + 'endwhile', 'events', 'for', 'function', 'get', 'global', 'if', + 'methods', 'otherwise', 'persistent', 'properties', 'return', + 'set', 'static', 'switch', 'try', 'until', 'unwind_protect', + 'unwind_protect_cleanup', 'while'), suffix=r'\b'), + Keyword), + + (words(builtin_kw + command_kw + function_kw + loadable_kw + mapping_kw, + suffix=r'\b'), Name.Builtin), + + (words(builtin_consts, suffix=r'\b'), Name.Constant), + + # operators in Octave but not Matlab: + (r'-=|!=|!|/=|--', Operator), + # operators: + (r'-|==|~=|<|>|<=|>=|&&|&|~|\|\|?', Operator), + # operators in Octave but not Matlab requiring escape for re: + (r'\*=|\+=|\^=|\/=|\\=|\*\*|\+\+|\.\*\*', Operator), + # operators requiring escape for re: + (r'\.\*|\*|\+|\.\^|\^|\.\\|\.\/|\/|\\', Operator), + + + # punctuation: + (r'[\[\](){}:@.,]', Punctuation), + (r'=|:|;', Punctuation), + + (r'"[^"]*"', String), + + (r'(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?', Number.Float), + (r'\d+[eEf][+-]?[0-9]+', Number.Float), + (r'\d+', Number.Integer), + + # quote can be transpose, instead of string: + # (not great, but handles common cases...) + (r'(?<=[\w)\].])\'+', Operator), + (r'(?|<=|>=|&&|&|~|\|\|?', Operator), + # operators requiring escape for re: + (r'\.\*|\*|\+|\.\^|\^|\.\\|\.\/|\/|\\', Operator), + + # punctuation: + (r'[\[\](){}@.,=:;]+', Punctuation), + + (r'"[^"]*"', String), + + # quote can be transpose, instead of string: + # (not great, but handles common cases...) + (r'(?<=[\w)\].])\'+', Operator), + (r'(?`_. + """ + + name = "MCFunction" + url = "https://minecraft.wiki/w/Commands" + aliases = ["mcfunction", "mcf"] + filenames = ["*.mcfunction"] + mimetypes = ["text/mcfunction"] + version_added = '2.12' + + # Used to denotate the start of a block comment, borrowed from Github's mcfunction + _block_comment_prefix = "[>!]" + + tokens = { + "root": [ + include("names"), + include("comments"), + include("literals"), + include("whitespace"), + include("property"), + include("operators"), + include("selectors"), + ], + + "names": [ + # The start of a command (either beginning of line OR after the run keyword) + # We don't encode a list of keywords since mods, plugins, or even pre-processors + # may add new commands, so we have a 'close-enough' regex which catches them. + (r"^(\s*)([a-z_]+)", bygroups(Whitespace, Name.Builtin)), + (r"(?<=run)\s+[a-z_]+", Name.Builtin), + + # UUID + (r"\b[0-9a-fA-F]+(?:-[0-9a-fA-F]+){4}\b", Name.Variable), + include("resource-name"), + # normal command names and scoreboards + # there's no way to know the differences unfortuntely + (r"[A-Za-z_][\w.#%$]+", Keyword.Constant), + (r"[#%$][\w.#%$]+", Name.Variable.Magic), + ], + + "resource-name": [ + # resource names have to be lowercase + (r"#?[a-z_][a-z_.-]*:[a-z0-9_./-]+", Name.Function), + # similar to above except optional `:`` + # a `/` must be present "somewhere" + (r"#?[a-z0-9_\.\-]+\/[a-z0-9_\.\-\/]+", Name.Function), + ], + + "whitespace": [ + (r"\s+", Whitespace), + ], + + "comments": [ + (rf"^\s*(#{_block_comment_prefix})", Comment.Multiline, + ("comments.block", "comments.block.emphasized")), + (r"#.*$", Comment.Single), + ], + "comments.block": [ + (rf"^\s*#{_block_comment_prefix}", Comment.Multiline, + "comments.block.emphasized"), + (r"^\s*#", Comment.Multiline, "comments.block.normal"), + default("#pop"), + ], + "comments.block.normal": [ + include("comments.block.special"), + (r"\S+", Comment.Multiline), + (r"\n", Text, "#pop"), + include("whitespace"), + ], + "comments.block.emphasized": [ + include("comments.block.special"), + (r"\S+", String.Doc), + (r"\n", Text, "#pop"), + include("whitespace"), + ], + "comments.block.special": [ + # Params + (r"@\S+", Name.Decorator), + + include("resource-name"), + + # Scoreboard player names + (r"[#%$][\w.#%$]+", Name.Variable.Magic), + ], + + "operators": [ + (r"[\-~%^?!+*<>\\/|&=.]", Operator), + ], + + "literals": [ + (r"\.\.", Literal), + (r"(true|false)", Keyword.Pseudo), + + # these are like unquoted strings and appear in many places + (r"[A-Za-z_]+", Name.Variable.Class), + + (r"[0-7]b", Number.Byte), + (r"[+-]?\d*\.?\d+([eE]?[+-]?\d+)?[df]?\b", Number.Float), + (r"[+-]?\d+\b", Number.Integer), + (r'"', String.Double, "literals.string-double"), + (r"'", String.Single, "literals.string-single"), + ], + "literals.string-double": [ + (r"\\.", String.Escape), + (r'[^\\"\n]+', String.Double), + (r'"', String.Double, "#pop"), + ], + "literals.string-single": [ + (r"\\.", String.Escape), + (r"[^\\'\n]+", String.Single), + (r"'", String.Single, "#pop"), + ], + + "selectors": [ + (r"@[a-z]", Name.Variable), + ], + + + ## Generic Property Container + # There are several, differing instances where the language accepts + # specific contained keys or contained key, value pairings. + # + # Property Maps: + # - Starts with either `[` or `{` + # - Key separated by `:` or `=` + # - Deliminated by `,` + # + # Property Lists: + # - Starts with `[` + # - Deliminated by `,` + # + # For simplicity, these patterns match a generic, nestable structure + # which follow a key, value pattern. For normal lists, there's only keys. + # This allow some "illegal" structures, but we'll accept those for + # sake of simplicity + # + # Examples: + # - `[facing=up, powered=true]` (blockstate) + # - `[name="hello world", nbt={key: 1b}]` (selector + nbt) + # - `[{"text": "value"}, "literal"]` (json) + ## + "property": [ + # This state gets included in root and also several substates + # We do this to shortcut the starting of new properties + # within other properties. Lists can have sublists and compounds + # and values can start a new property (see the `difficult_1.txt` + # snippet). + (r"\{", Punctuation, ("property.curly", "property.key")), + (r"\[", Punctuation, ("property.square", "property.key")), + ], + "property.curly": [ + include("whitespace"), + include("property"), + (r"\}", Punctuation, "#pop"), + ], + "property.square": [ + include("whitespace"), + include("property"), + (r"\]", Punctuation, "#pop"), + + # lists can have sequences of items + (r",", Punctuation), + ], + "property.key": [ + include("whitespace"), + + # resource names (for advancements) + # can omit `:` to default `minecraft:` + # must check if there is a future equals sign if `:` is in the name + (r"#?[a-z_][a-z_\.\-]*\:[a-z0-9_\.\-/]+(?=\s*\=)", Name.Attribute, "property.delimiter"), + (r"#?[a-z_][a-z0-9_\.\-/]+", Name.Attribute, "property.delimiter"), + + # unquoted NBT key + (r"[A-Za-z_\-\+]+", Name.Attribute, "property.delimiter"), + + # quoted JSON or NBT key + (r'"', Name.Attribute, "property.delimiter", "literals.string-double"), + (r"'", Name.Attribute, "property.delimiter", "literals.string-single"), + + # index for a list + (r"-?\d+", Number.Integer, "property.delimiter"), + + default("#pop"), + ], + "property.key.string-double": [ + (r"\\.", String.Escape), + (r'[^\\"\n]+', Name.Attribute), + (r'"', Name.Attribute, "#pop"), + ], + "property.key.string-single": [ + (r"\\.", String.Escape), + (r"[^\\'\n]+", Name.Attribute), + (r"'", Name.Attribute, "#pop"), + ], + "property.delimiter": [ + include("whitespace"), + + (r"[:=]!?", Punctuation, "property.value"), + (r",", Punctuation), + + default("#pop"), + ], + "property.value": [ + include("whitespace"), + + # unquoted resource names are valid literals here + (r"#?[a-z_][a-z_\.\-]*\:[a-z0-9_\.\-/]+", Name.Tag), + (r"#?[a-z_][a-z0-9_\.\-/]+", Name.Tag), + + include("literals"), + include("property"), + + default("#pop"), + ], + } + + +class MCSchemaLexer(RegexLexer): + """Lexer for Minecraft Add-ons data Schemas, an interface structure standard used in Minecraft + """ + + name = 'MCSchema' + url = 'https://learn.microsoft.com/en-us/minecraft/creator/reference/content/schemasreference/' + aliases = ['mcschema'] + filenames = ['*.mcschema'] + mimetypes = ['text/mcschema'] + version_added = '2.14' + + tokens = { + 'commentsandwhitespace': [ + (r'\s+', Whitespace), + (r'//.*?$', Comment.Single), + (r'/\*.*?\*/', Comment.Multiline) + ], + 'slashstartsregex': [ + include('commentsandwhitespace'), + (r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/' + r'([gimuysd]+\b|\B)', String.Regex, '#pop'), + (r'(?=/)', Text, ('#pop', 'badregex')), + default('#pop') + ], + 'badregex': [ + (r'\n', Whitespace, '#pop') + ], + 'singlestring': [ + (r'\\.', String.Escape), + (r"'", String.Single, '#pop'), + (r"[^\\']+", String.Single), + ], + 'doublestring': [ + (r'\\.', String.Escape), + (r'"', String.Double, '#pop'), + (r'[^\\"]+', String.Double), + ], + 'root': [ + (r'^(?=\s|/|', Comment, '#pop'), + (r'[^\-]+|-', Comment), + ], + } + + +class ReasonLexer(RegexLexer): + """ + For the ReasonML language. + """ + + name = 'ReasonML' + url = 'https://reasonml.github.io/' + aliases = ['reasonml', 'reason'] + filenames = ['*.re', '*.rei'] + mimetypes = ['text/x-reasonml'] + version_added = '2.6' + + keywords = ( + 'as', 'assert', 'begin', 'class', 'constraint', 'do', 'done', 'downto', + 'else', 'end', 'exception', 'external', 'false', 'for', 'fun', 'esfun', + 'function', 'functor', 'if', 'in', 'include', 'inherit', 'initializer', 'lazy', + 'let', 'switch', 'module', 'pub', 'mutable', 'new', 'nonrec', 'object', 'of', + 'open', 'pri', 'rec', 'sig', 'struct', 'then', 'to', 'true', 'try', + 'type', 'val', 'virtual', 'when', 'while', 'with', + ) + keyopts = ( + '!=', '#', '&', '&&', r'\(', r'\)', r'\*', r'\+', ',', '-', + r'-\.', '=>', r'\.', r'\.\.', r'\.\.\.', ':', '::', ':=', ':>', ';', ';;', '<', + '<-', '=', '>', '>]', r'>\}', r'\?', r'\?\?', r'\[', r'\[<', r'\[>', + r'\[\|', ']', '_', '`', r'\{', r'\{<', r'\|', r'\|\|', r'\|]', r'\}', '~' + ) + + operators = r'[!$%&*+\./:<=>?@^|~-]' + word_operators = ('and', 'asr', 'land', 'lor', 'lsl', 'lsr', 'lxor', 'mod', 'or') + prefix_syms = r'[!?~]' + infix_syms = r'[=<>@^|&+\*/$%-]' + primitives = ('unit', 'int', 'float', 'bool', 'string', 'char', 'list', 'array') + + tokens = { + 'escape-sequence': [ + (r'\\[\\"\'ntbr]', String.Escape), + (r'\\[0-9]{3}', String.Escape), + (r'\\x[0-9a-fA-F]{2}', String.Escape), + ], + 'root': [ + (r'\s+', Text), + (r'false|true|\(\)|\[\]', Name.Builtin.Pseudo), + (r'\b([A-Z][\w\']*)(?=\s*\.)', Name.Namespace, 'dotted'), + (r'\b([A-Z][\w\']*)', Name.Class), + (r'//.*?\n', Comment.Single), + (r'\/\*(?!/)', Comment.Multiline, 'comment'), + (r'\b({})\b'.format('|'.join(keywords)), Keyword), + (r'({})'.format('|'.join(keyopts[::-1])), Operator.Word), + (rf'({infix_syms}|{prefix_syms})?{operators}', Operator), + (r'\b({})\b'.format('|'.join(word_operators)), Operator.Word), + (r'\b({})\b'.format('|'.join(primitives)), Keyword.Type), + + (r"[^\W\d][\w']*", Name), + + (r'-?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)', Number.Float), + (r'0[xX][\da-fA-F][\da-fA-F_]*', Number.Hex), + (r'0[oO][0-7][0-7_]*', Number.Oct), + (r'0[bB][01][01_]*', Number.Bin), + (r'\d[\d_]*', Number.Integer), + + (r"'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'", + String.Char), + (r"'.'", String.Char), + (r"'", Keyword), + + (r'"', String.Double, 'string'), + + (r'[~?][a-z][\w\']*:', Name.Variable), + ], + 'comment': [ + (r'[^/*]+', Comment.Multiline), + (r'\/\*', Comment.Multiline, '#push'), + (r'\*\/', Comment.Multiline, '#pop'), + (r'\*', Comment.Multiline), + ], + 'string': [ + (r'[^\\"]+', String.Double), + include('escape-sequence'), + (r'\\\n', String.Double), + (r'"', String.Double, '#pop'), + ], + 'dotted': [ + (r'\s+', Text), + (r'\.', Punctuation), + (r'[A-Z][\w\']*(?=\s*\.)', Name.Namespace), + (r'[A-Z][\w\']*', Name.Class, '#pop'), + (r'[a-z_][\w\']*', Name, '#pop'), + default('#pop'), + ], + } + + +class FStarLexer(RegexLexer): + """ + For the F* language. + """ + + name = 'FStar' + url = 'https://www.fstar-lang.org/' + aliases = ['fstar'] + filenames = ['*.fst', '*.fsti'] + mimetypes = ['text/x-fstar'] + version_added = '2.7' + + keywords = ( + 'abstract', 'attributes', 'noeq', 'unopteq', 'and' + 'begin', 'by', 'default', 'effect', 'else', 'end', 'ensures', + 'exception', 'exists', 'false', 'forall', 'fun', 'function', 'if', + 'in', 'include', 'inline', 'inline_for_extraction', 'irreducible', + 'logic', 'match', 'module', 'mutable', 'new', 'new_effect', 'noextract', + 'of', 'open', 'opaque', 'private', 'range_of', 'reifiable', + 'reify', 'reflectable', 'requires', 'set_range_of', 'sub_effect', + 'synth', 'then', 'total', 'true', 'try', 'type', 'unfold', 'unfoldable', + 'val', 'when', 'with', 'not' + ) + decl_keywords = ('let', 'rec') + assume_keywords = ('assume', 'admit', 'assert', 'calc') + keyopts = ( + r'~', r'-', r'/\\', r'\\/', r'<:', r'<@', r'\(\|', r'\|\)', r'#', r'u#', + r'&', r'\(', r'\)', r'\(\)', r',', r'~>', r'->', r'<-', r'<--', r'<==>', + r'==>', r'\.', r'\?', r'\?\.', r'\.\[', r'\.\(', r'\.\(\|', r'\.\[\|', + r'\{:pattern', r':', r'::', r':=', r';', r';;', r'=', r'%\[', r'!\{', + r'\[', r'\[@', r'\[\|', r'\|>', r'\]', r'\|\]', r'\{', r'\|', r'\}', r'\$' + ) + + operators = r'[!$%&*+\./:<=>?@^|~-]' + prefix_syms = r'[!?~]' + infix_syms = r'[=<>@^|&+\*/$%-]' + primitives = ('unit', 'int', 'float', 'bool', 'string', 'char', 'list', 'array') + + tokens = { + 'escape-sequence': [ + (r'\\[\\"\'ntbr]', String.Escape), + (r'\\[0-9]{3}', String.Escape), + (r'\\x[0-9a-fA-F]{2}', String.Escape), + ], + 'root': [ + (r'\s+', Text), + (r'false|true|False|True|\(\)|\[\]', Name.Builtin.Pseudo), + (r'\b([A-Z][\w\']*)(?=\s*\.)', Name.Namespace, 'dotted'), + (r'\b([A-Z][\w\']*)', Name.Class), + (r'\(\*(?![)])', Comment, 'comment'), + (r'\/\/.+$', Comment), + (r'\b({})\b'.format('|'.join(keywords)), Keyword), + (r'\b({})\b'.format('|'.join(assume_keywords)), Name.Exception), + (r'\b({})\b'.format('|'.join(decl_keywords)), Keyword.Declaration), + (r'({})'.format('|'.join(keyopts[::-1])), Operator), + (rf'({infix_syms}|{prefix_syms})?{operators}', Operator), + (r'\b({})\b'.format('|'.join(primitives)), Keyword.Type), + + (r"[^\W\d][\w']*", Name), + + (r'-?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)', Number.Float), + (r'0[xX][\da-fA-F][\da-fA-F_]*', Number.Hex), + (r'0[oO][0-7][0-7_]*', Number.Oct), + (r'0[bB][01][01_]*', Number.Bin), + (r'\d[\d_]*', Number.Integer), + + (r"'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'", + String.Char), + (r"'.'", String.Char), + (r"'", Keyword), # a stray quote is another syntax element + (r"\`([\w\'.]+)\`", Operator.Word), # for infix applications + (r"\`", Keyword), # for quoting + (r'"', String.Double, 'string'), + + (r'[~?][a-z][\w\']*:', Name.Variable), + ], + 'comment': [ + (r'[^(*)]+', Comment), + (r'\(\*', Comment, '#push'), + (r'\*\)', Comment, '#pop'), + (r'[(*)]', Comment), + ], + 'string': [ + (r'[^\\"]+', String.Double), + include('escape-sequence'), + (r'\\\n', String.Double), + (r'"', String.Double, '#pop'), + ], + 'dotted': [ + (r'\s+', Text), + (r'\.', Punctuation), + (r'[A-Z][\w\']*(?=\s*\.)', Name.Namespace), + (r'[A-Z][\w\']*', Name.Class, '#pop'), + (r'[a-z_][\w\']*', Name, '#pop'), + default('#pop'), + ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/ncl.py b/lib/python3.12/site-packages/pygments/lexers/ncl.py new file mode 100644 index 0000000000000000000000000000000000000000..d2f476087bf6e6e92328542c52d0c609d1972845 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/ncl.py @@ -0,0 +1,894 @@ +""" + pygments.lexers.ncl + ~~~~~~~~~~~~~~~~~~~ + + Lexers for NCAR Command Language. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, include, words +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation + +__all__ = ['NCLLexer'] + + +class NCLLexer(RegexLexer): + """ + Lexer for NCL code. + """ + name = 'NCL' + aliases = ['ncl'] + filenames = ['*.ncl'] + mimetypes = ['text/ncl'] + url = 'https://www.ncl.ucar.edu' + version_added = '2.2' + + flags = re.MULTILINE + + tokens = { + 'root': [ + (r';.*\n', Comment), + include('strings'), + include('core'), + (r'[a-zA-Z_]\w*', Name), + include('nums'), + (r'[\s]+', Text), + ], + 'core': [ + # Statements + (words(( + 'begin', 'break', 'continue', 'create', 'defaultapp', 'do', + 'else', 'end', 'external', 'exit', 'True', 'False', 'file', 'function', + 'getvalues', 'graphic', 'group', 'if', 'list', 'load', 'local', + 'new', '_Missing', 'Missing', 'noparent', 'procedure', + 'quit', 'QUIT', 'Quit', 'record', 'return', 'setvalues', 'stop', + 'then', 'while'), prefix=r'\b', suffix=r'\s*\b'), + Keyword), + + # Data Types + (words(( + 'ubyte', 'uint', 'uint64', 'ulong', 'string', 'byte', + 'character', 'double', 'float', 'integer', 'int64', 'logical', + 'long', 'short', 'ushort', 'enumeric', 'numeric', 'snumeric'), + prefix=r'\b', suffix=r'\s*\b'), + Keyword.Type), + + # Operators + (r'[\%^*+\-/<>]', Operator), + + # punctuation: + (r'[\[\]():@$!&|.,\\{}]', Punctuation), + (r'[=:]', Punctuation), + + # Intrinsics + (words(( + 'abs', 'acos', 'addfile', 'addfiles', 'all', 'angmom_atm', 'any', + 'area_conserve_remap', 'area_hi2lores', 'area_poly_sphere', + 'asciiread', 'asciiwrite', 'asin', 'atan', 'atan2', 'attsetvalues', + 'avg', 'betainc', 'bin_avg', 'bin_sum', 'bw_bandpass_filter', + 'cancor', 'cbinread', 'cbinwrite', 'cd_calendar', 'cd_inv_calendar', + 'cdfbin_p', 'cdfbin_pr', 'cdfbin_s', 'cdfbin_xn', 'cdfchi_p', + 'cdfchi_x', 'cdfgam_p', 'cdfgam_x', 'cdfnor_p', 'cdfnor_x', + 'cdft_p', 'cdft_t', 'ceil', 'center_finite_diff', + 'center_finite_diff_n', 'cfftb', 'cfftf', 'cfftf_frq_reorder', + 'charactertodouble', 'charactertofloat', 'charactertointeger', + 'charactertolong', 'charactertoshort', 'charactertostring', + 'chartodouble', 'chartofloat', 'chartoint', 'chartointeger', + 'chartolong', 'chartoshort', 'chartostring', 'chiinv', 'clear', + 'color_index_to_rgba', 'conform', 'conform_dims', 'cos', 'cosh', + 'count_unique_values', 'covcorm', 'covcorm_xy', 'craybinnumrec', + 'craybinrecread', 'create_graphic', 'csa1', 'csa1d', 'csa1s', + 'csa1x', 'csa1xd', 'csa1xs', 'csa2', 'csa2d', 'csa2l', 'csa2ld', + 'csa2ls', 'csa2lx', 'csa2lxd', 'csa2lxs', 'csa2s', 'csa2x', + 'csa2xd', 'csa2xs', 'csa3', 'csa3d', 'csa3l', 'csa3ld', 'csa3ls', + 'csa3lx', 'csa3lxd', 'csa3lxs', 'csa3s', 'csa3x', 'csa3xd', + 'csa3xs', 'csc2s', 'csgetp', 'css2c', 'cssetp', 'cssgrid', 'csstri', + 'csvoro', 'cumsum', 'cz2ccm', 'datatondc', 'day_of_week', + 'day_of_year', 'days_in_month', 'default_fillvalue', 'delete', + 'depth_to_pres', 'destroy', 'determinant', 'dewtemp_trh', + 'dgeevx_lapack', 'dim_acumrun_n', 'dim_avg', 'dim_avg_n', + 'dim_avg_wgt', 'dim_avg_wgt_n', 'dim_cumsum', 'dim_cumsum_n', + 'dim_gamfit_n', 'dim_gbits', 'dim_max', 'dim_max_n', 'dim_median', + 'dim_median_n', 'dim_min', 'dim_min_n', 'dim_num', 'dim_num_n', + 'dim_numrun_n', 'dim_pqsort', 'dim_pqsort_n', 'dim_product', + 'dim_product_n', 'dim_rmsd', 'dim_rmsd_n', 'dim_rmvmean', + 'dim_rmvmean_n', 'dim_rmvmed', 'dim_rmvmed_n', 'dim_spi_n', + 'dim_standardize', 'dim_standardize_n', 'dim_stat4', 'dim_stat4_n', + 'dim_stddev', 'dim_stddev_n', 'dim_sum', 'dim_sum_n', 'dim_sum_wgt', + 'dim_sum_wgt_n', 'dim_variance', 'dim_variance_n', 'dimsizes', + 'doubletobyte', 'doubletochar', 'doubletocharacter', + 'doubletofloat', 'doubletoint', 'doubletointeger', 'doubletolong', + 'doubletoshort', 'dpres_hybrid_ccm', 'dpres_plevel', 'draw', + 'draw_color_palette', 'dsgetp', 'dsgrid2', 'dsgrid2d', 'dsgrid2s', + 'dsgrid3', 'dsgrid3d', 'dsgrid3s', 'dspnt2', 'dspnt2d', 'dspnt2s', + 'dspnt3', 'dspnt3d', 'dspnt3s', 'dssetp', 'dtrend', 'dtrend_msg', + 'dtrend_msg_n', 'dtrend_n', 'dtrend_quadratic', + 'dtrend_quadratic_msg_n', 'dv2uvf', 'dv2uvg', 'dz_height', + 'echo_off', 'echo_on', 'eof2data', 'eof_varimax', 'eofcor', + 'eofcor_pcmsg', 'eofcor_ts', 'eofcov', 'eofcov_pcmsg', 'eofcov_ts', + 'eofunc', 'eofunc_ts', 'eofunc_varimax', 'equiv_sample_size', 'erf', + 'erfc', 'esacr', 'esacv', 'esccr', 'esccv', 'escorc', 'escorc_n', + 'escovc', 'exit', 'exp', 'exp_tapersh', 'exp_tapersh_wgts', + 'exp_tapershC', 'ezfftb', 'ezfftb_n', 'ezfftf', 'ezfftf_n', + 'f2fosh', 'f2foshv', 'f2fsh', 'f2fshv', 'f2gsh', 'f2gshv', 'fabs', + 'fbindirread', 'fbindirwrite', 'fbinnumrec', 'fbinread', + 'fbinrecread', 'fbinrecwrite', 'fbinwrite', 'fft2db', 'fft2df', + 'fftshift', 'fileattdef', 'filechunkdimdef', 'filedimdef', + 'fileexists', 'filegrpdef', 'filevarattdef', 'filevarchunkdef', + 'filevarcompressleveldef', 'filevardef', 'filevardimsizes', + 'filwgts_lancos', 'filwgts_lanczos', 'filwgts_normal', + 'floattobyte', 'floattochar', 'floattocharacter', 'floattoint', + 'floattointeger', 'floattolong', 'floattoshort', 'floor', + 'fluxEddy', 'fo2fsh', 'fo2fshv', 'fourier_info', 'frame', 'fspan', + 'ftcurv', 'ftcurvd', 'ftcurvi', 'ftcurvp', 'ftcurvpi', 'ftcurvps', + 'ftcurvs', 'ftest', 'ftgetp', 'ftkurv', 'ftkurvd', 'ftkurvp', + 'ftkurvpd', 'ftsetp', 'ftsurf', 'g2fsh', 'g2fshv', 'g2gsh', + 'g2gshv', 'gamma', 'gammainc', 'gaus', 'gaus_lobat', + 'gaus_lobat_wgt', 'gc_aangle', 'gc_clkwise', 'gc_dangle', + 'gc_inout', 'gc_latlon', 'gc_onarc', 'gc_pnt2gc', 'gc_qarea', + 'gc_tarea', 'generate_2d_array', 'get_color_index', + 'get_color_rgba', 'get_cpu_time', 'get_isolines', 'get_ncl_version', + 'get_script_name', 'get_script_prefix_name', 'get_sphere_radius', + 'get_unique_values', 'getbitsone', 'getenv', 'getfiledimsizes', + 'getfilegrpnames', 'getfilepath', 'getfilevaratts', + 'getfilevarchunkdimsizes', 'getfilevardims', 'getfilevardimsizes', + 'getfilevarnames', 'getfilevartypes', 'getvaratts', 'getvardims', + 'gradsf', 'gradsg', 'greg2jul', 'grid2triple', 'hlsrgb', 'hsvrgb', + 'hydro', 'hyi2hyo', 'idsfft', 'igradsf', 'igradsg', 'ilapsf', + 'ilapsg', 'ilapvf', 'ilapvg', 'ind', 'ind_resolve', 'int2p', + 'int2p_n', 'integertobyte', 'integertochar', 'integertocharacter', + 'integertoshort', 'inttobyte', 'inttochar', 'inttoshort', + 'inverse_matrix', 'isatt', 'isbigendian', 'isbyte', 'ischar', + 'iscoord', 'isdefined', 'isdim', 'isdimnamed', 'isdouble', + 'isenumeric', 'isfile', 'isfilepresent', 'isfilevar', + 'isfilevaratt', 'isfilevarcoord', 'isfilevardim', 'isfloat', + 'isfunc', 'isgraphic', 'isint', 'isint64', 'isinteger', + 'isleapyear', 'islogical', 'islong', 'ismissing', 'isnan_ieee', + 'isnumeric', 'ispan', 'isproc', 'isshort', 'issnumeric', 'isstring', + 'isubyte', 'isuint', 'isuint64', 'isulong', 'isunlimited', + 'isunsigned', 'isushort', 'isvar', 'jul2greg', 'kmeans_as136', + 'kolsm2_n', 'kron_product', 'lapsf', 'lapsg', 'lapvf', 'lapvg', + 'latlon2utm', 'lclvl', 'lderuvf', 'lderuvg', 'linint1', 'linint1_n', + 'linint2', 'linint2_points', 'linmsg', 'linmsg_n', 'linrood_latwgt', + 'linrood_wgt', 'list_files', 'list_filevars', 'list_hlus', + 'list_procfuncs', 'list_vars', 'ListAppend', 'ListCount', + 'ListGetType', 'ListIndex', 'ListIndexFromName', 'ListPop', + 'ListPush', 'ListSetType', 'loadscript', 'local_max', 'local_min', + 'log', 'log10', 'longtobyte', 'longtochar', 'longtocharacter', + 'longtoint', 'longtointeger', 'longtoshort', 'lspoly', 'lspoly_n', + 'mask', 'max', 'maxind', 'min', 'minind', 'mixed_layer_depth', + 'mixhum_ptd', 'mixhum_ptrh', 'mjo_cross_coh2pha', + 'mjo_cross_segment', 'moc_globe_atl', 'monthday', 'natgrid', + 'natgridd', 'natgrids', 'ncargpath', 'ncargversion', 'ndctodata', + 'ndtooned', 'new', 'NewList', 'ngezlogo', 'nggcog', 'nggetp', + 'nglogo', 'ngsetp', 'NhlAddAnnotation', 'NhlAddData', + 'NhlAddOverlay', 'NhlAddPrimitive', 'NhlAppGetDefaultParentId', + 'NhlChangeWorkstation', 'NhlClassName', 'NhlClearWorkstation', + 'NhlDataPolygon', 'NhlDataPolyline', 'NhlDataPolymarker', + 'NhlDataToNDC', 'NhlDestroy', 'NhlDraw', 'NhlFrame', 'NhlFreeColor', + 'NhlGetBB', 'NhlGetClassResources', 'NhlGetErrorObjectId', + 'NhlGetNamedColorIndex', 'NhlGetParentId', + 'NhlGetParentWorkstation', 'NhlGetWorkspaceObjectId', + 'NhlIsAllocatedColor', 'NhlIsApp', 'NhlIsDataComm', 'NhlIsDataItem', + 'NhlIsDataSpec', 'NhlIsTransform', 'NhlIsView', 'NhlIsWorkstation', + 'NhlName', 'NhlNDCPolygon', 'NhlNDCPolyline', 'NhlNDCPolymarker', + 'NhlNDCToData', 'NhlNewColor', 'NhlNewDashPattern', 'NhlNewMarker', + 'NhlPalGetDefined', 'NhlRemoveAnnotation', 'NhlRemoveData', + 'NhlRemoveOverlay', 'NhlRemovePrimitive', 'NhlSetColor', + 'NhlSetDashPattern', 'NhlSetMarker', 'NhlUpdateData', + 'NhlUpdateWorkstation', 'nice_mnmxintvl', 'nngetaspectd', + 'nngetaspects', 'nngetp', 'nngetsloped', 'nngetslopes', 'nngetwts', + 'nngetwtsd', 'nnpnt', 'nnpntd', 'nnpntend', 'nnpntendd', + 'nnpntinit', 'nnpntinitd', 'nnpntinits', 'nnpnts', 'nnsetp', 'num', + 'obj_anal_ic', 'omega_ccm', 'onedtond', 'overlay', 'paleo_outline', + 'pdfxy_bin', 'poisson_grid_fill', 'pop_remap', 'potmp_insitu_ocn', + 'prcwater_dp', 'pres2hybrid', 'pres_hybrid_ccm', 'pres_sigma', + 'print', 'print_table', 'printFileVarSummary', 'printVarSummary', + 'product', 'pslec', 'pslhor', 'pslhyp', 'qsort', 'rand', + 'random_chi', 'random_gamma', 'random_normal', 'random_setallseed', + 'random_uniform', 'rcm2points', 'rcm2rgrid', 'rdsstoi', + 'read_colormap_file', 'reg_multlin', 'regcoef', 'regCoef_n', + 'regline', 'relhum', 'replace_ieeenan', 'reshape', 'reshape_ind', + 'rgba_to_color_index', 'rgbhls', 'rgbhsv', 'rgbyiq', 'rgrid2rcm', + 'rhomb_trunc', 'rip_cape_2d', 'rip_cape_3d', 'round', 'rtest', + 'runave', 'runave_n', 'set_default_fillvalue', 'set_sphere_radius', + 'setfileoption', 'sfvp2uvf', 'sfvp2uvg', 'shaec', 'shagc', + 'shgetnp', 'shgetp', 'shgrid', 'shorttobyte', 'shorttochar', + 'shorttocharacter', 'show_ascii', 'shsec', 'shsetp', 'shsgc', + 'shsgc_R42', 'sigma2hybrid', 'simpeq', 'simpne', 'sin', + 'sindex_yrmo', 'sinh', 'sizeof', 'sleep', 'smth9', 'snindex_yrmo', + 'solve_linsys', 'span_color_indexes', 'span_color_rgba', + 'sparse_matrix_mult', 'spcorr', 'spcorr_n', 'specx_anal', + 'specxy_anal', 'spei', 'sprintf', 'sprinti', 'sqrt', 'sqsort', + 'srand', 'stat2', 'stat4', 'stat_medrng', 'stat_trim', + 'status_exit', 'stdatmus_p2tdz', 'stdatmus_z2tdp', 'stddev', + 'str_capital', 'str_concat', 'str_fields_count', 'str_get_cols', + 'str_get_dq', 'str_get_field', 'str_get_nl', 'str_get_sq', + 'str_get_tab', 'str_index_of_substr', 'str_insert', 'str_is_blank', + 'str_join', 'str_left_strip', 'str_lower', 'str_match', + 'str_match_ic', 'str_match_ic_regex', 'str_match_ind', + 'str_match_ind_ic', 'str_match_ind_ic_regex', 'str_match_ind_regex', + 'str_match_regex', 'str_right_strip', 'str_split', + 'str_split_by_length', 'str_split_csv', 'str_squeeze', 'str_strip', + 'str_sub_str', 'str_switch', 'str_upper', 'stringtochar', + 'stringtocharacter', 'stringtodouble', 'stringtofloat', + 'stringtoint', 'stringtointeger', 'stringtolong', 'stringtoshort', + 'strlen', 'student_t', 'sum', 'svd_lapack', 'svdcov', 'svdcov_sv', + 'svdstd', 'svdstd_sv', 'system', 'systemfunc', 'tan', 'tanh', + 'taper', 'taper_n', 'tdclrs', 'tdctri', 'tdcudp', 'tdcurv', + 'tddtri', 'tdez2d', 'tdez3d', 'tdgetp', 'tdgrds', 'tdgrid', + 'tdgtrs', 'tdinit', 'tditri', 'tdlbla', 'tdlblp', 'tdlbls', + 'tdline', 'tdlndp', 'tdlnpa', 'tdlpdp', 'tdmtri', 'tdotri', + 'tdpara', 'tdplch', 'tdprpa', 'tdprpi', 'tdprpt', 'tdsetp', + 'tdsort', 'tdstri', 'tdstrs', 'tdttri', 'thornthwaite', 'tobyte', + 'tochar', 'todouble', 'tofloat', 'toint', 'toint64', 'tointeger', + 'tolong', 'toshort', 'tosigned', 'tostring', 'tostring_with_format', + 'totype', 'toubyte', 'touint', 'touint64', 'toulong', 'tounsigned', + 'toushort', 'trend_manken', 'tri_trunc', 'triple2grid', + 'triple2grid2d', 'trop_wmo', 'ttest', 'typeof', 'undef', + 'unique_string', 'update', 'ushorttoint', 'ut_calendar', + 'ut_inv_calendar', 'utm2latlon', 'uv2dv_cfd', 'uv2dvf', 'uv2dvg', + 'uv2sfvpf', 'uv2sfvpg', 'uv2vr_cfd', 'uv2vrdvf', 'uv2vrdvg', + 'uv2vrf', 'uv2vrg', 'v5d_close', 'v5d_create', 'v5d_setLowLev', + 'v5d_setUnits', 'v5d_write', 'v5d_write_var', 'variance', 'vhaec', + 'vhagc', 'vhsec', 'vhsgc', 'vibeta', 'vinth2p', 'vinth2p_ecmwf', + 'vinth2p_ecmwf_nodes', 'vinth2p_nodes', 'vintp2p_ecmwf', 'vr2uvf', + 'vr2uvg', 'vrdv2uvf', 'vrdv2uvg', 'wavelet', 'wavelet_default', + 'weibull', 'wgt_area_smooth', 'wgt_areaave', 'wgt_areaave2', + 'wgt_arearmse', 'wgt_arearmse2', 'wgt_areasum2', 'wgt_runave', + 'wgt_runave_n', 'wgt_vert_avg_beta', 'wgt_volave', 'wgt_volave_ccm', + 'wgt_volrmse', 'wgt_volrmse_ccm', 'where', 'wk_smooth121', 'wmbarb', + 'wmbarbmap', 'wmdrft', 'wmgetp', 'wmlabs', 'wmsetp', 'wmstnm', + 'wmvect', 'wmvectmap', 'wmvlbl', 'wrf_avo', 'wrf_cape_2d', + 'wrf_cape_3d', 'wrf_dbz', 'wrf_eth', 'wrf_helicity', 'wrf_ij_to_ll', + 'wrf_interp_1d', 'wrf_interp_2d_xy', 'wrf_interp_3d_z', + 'wrf_latlon_to_ij', 'wrf_ll_to_ij', 'wrf_omega', 'wrf_pvo', + 'wrf_rh', 'wrf_slp', 'wrf_smooth_2d', 'wrf_td', 'wrf_tk', + 'wrf_updraft_helicity', 'wrf_uvmet', 'wrf_virtual_temp', + 'wrf_wetbulb', 'wrf_wps_close_int', 'wrf_wps_open_int', + 'wrf_wps_rddata_int', 'wrf_wps_rdhead_int', 'wrf_wps_read_int', + 'wrf_wps_write_int', 'write_matrix', 'write_table', 'yiqrgb', + 'z2geouv', 'zonal_mpsi', 'addfiles_GetVar', 'advect_variable', + 'area_conserve_remap_Wrap', 'area_hi2lores_Wrap', + 'array_append_record', 'assignFillValue', 'byte2flt', + 'byte2flt_hdf', 'calcDayAnomTLL', 'calcMonAnomLLLT', + 'calcMonAnomLLT', 'calcMonAnomTLL', 'calcMonAnomTLLL', + 'calculate_monthly_values', 'cd_convert', 'changeCase', + 'changeCaseChar', 'clmDayTLL', 'clmDayTLLL', 'clmMon2clmDay', + 'clmMonLLLT', 'clmMonLLT', 'clmMonTLL', 'clmMonTLLL', 'closest_val', + 'copy_VarAtts', 'copy_VarCoords', 'copy_VarCoords_1', + 'copy_VarCoords_2', 'copy_VarMeta', 'copyatt', 'crossp3', + 'cshstringtolist', 'cssgrid_Wrap', 'dble2flt', 'decimalPlaces', + 'delete_VarAtts', 'dim_avg_n_Wrap', 'dim_avg_wgt_n_Wrap', + 'dim_avg_wgt_Wrap', 'dim_avg_Wrap', 'dim_cumsum_n_Wrap', + 'dim_cumsum_Wrap', 'dim_max_n_Wrap', 'dim_min_n_Wrap', + 'dim_rmsd_n_Wrap', 'dim_rmsd_Wrap', 'dim_rmvmean_n_Wrap', + 'dim_rmvmean_Wrap', 'dim_rmvmed_n_Wrap', 'dim_rmvmed_Wrap', + 'dim_standardize_n_Wrap', 'dim_standardize_Wrap', + 'dim_stddev_n_Wrap', 'dim_stddev_Wrap', 'dim_sum_n_Wrap', + 'dim_sum_wgt_n_Wrap', 'dim_sum_wgt_Wrap', 'dim_sum_Wrap', + 'dim_variance_n_Wrap', 'dim_variance_Wrap', 'dpres_plevel_Wrap', + 'dtrend_leftdim', 'dv2uvF_Wrap', 'dv2uvG_Wrap', 'eof_north', + 'eofcor_Wrap', 'eofcov_Wrap', 'eofunc_north', 'eofunc_ts_Wrap', + 'eofunc_varimax_reorder', 'eofunc_varimax_Wrap', 'eofunc_Wrap', + 'epsZero', 'f2fosh_Wrap', 'f2foshv_Wrap', 'f2fsh_Wrap', + 'f2fshv_Wrap', 'f2gsh_Wrap', 'f2gshv_Wrap', 'fbindirSwap', + 'fbinseqSwap1', 'fbinseqSwap2', 'flt2dble', 'flt2string', + 'fo2fsh_Wrap', 'fo2fshv_Wrap', 'g2fsh_Wrap', 'g2fshv_Wrap', + 'g2gsh_Wrap', 'g2gshv_Wrap', 'generate_resample_indices', + 'generate_sample_indices', 'generate_unique_indices', + 'genNormalDist', 'get1Dindex', 'get1Dindex_Collapse', + 'get1Dindex_Exclude', 'get_file_suffix', 'GetFillColor', + 'GetFillColorIndex', 'getFillValue', 'getind_latlon2d', + 'getVarDimNames', 'getVarFillValue', 'grib_stime2itime', + 'hyi2hyo_Wrap', 'ilapsF_Wrap', 'ilapsG_Wrap', 'ind_nearest_coord', + 'indStrSubset', 'int2dble', 'int2flt', 'int2p_n_Wrap', 'int2p_Wrap', + 'isMonotonic', 'isStrSubset', 'latGau', 'latGauWgt', 'latGlobeF', + 'latGlobeFo', 'latRegWgt', 'linint1_n_Wrap', 'linint1_Wrap', + 'linint2_points_Wrap', 'linint2_Wrap', 'local_max_1d', + 'local_min_1d', 'lonFlip', 'lonGlobeF', 'lonGlobeFo', 'lonPivot', + 'merge_levels_sfc', 'mod', 'month_to_annual', + 'month_to_annual_weighted', 'month_to_season', 'month_to_season12', + 'month_to_seasonN', 'monthly_total_to_daily_mean', 'nameDim', + 'natgrid_Wrap', 'NewCosWeight', 'niceLatLon2D', 'NormCosWgtGlobe', + 'numAsciiCol', 'numAsciiRow', 'numeric2int', + 'obj_anal_ic_deprecated', 'obj_anal_ic_Wrap', 'omega_ccm_driver', + 'omega_to_w', 'oneDtostring', 'pack_values', 'pattern_cor', 'pdfx', + 'pdfxy', 'pdfxy_conform', 'pot_temp', 'pot_vort_hybrid', + 'pot_vort_isobaric', 'pres2hybrid_Wrap', 'print_clock', + 'printMinMax', 'quadroots', 'rcm2points_Wrap', 'rcm2rgrid_Wrap', + 'readAsciiHead', 'readAsciiTable', 'reg_multlin_stats', + 'region_ind', 'regline_stats', 'relhum_ttd', 'replaceSingleChar', + 'RGBtoCmap', 'rgrid2rcm_Wrap', 'rho_mwjf', 'rm_single_dims', + 'rmAnnCycle1D', 'rmInsufData', 'rmMonAnnCycLLLT', 'rmMonAnnCycLLT', + 'rmMonAnnCycTLL', 'runave_n_Wrap', 'runave_Wrap', 'short2flt', + 'short2flt_hdf', 'shsgc_R42_Wrap', 'sign_f90', 'sign_matlab', + 'smth9_Wrap', 'smthClmDayTLL', 'smthClmDayTLLL', 'SqrtCosWeight', + 'stat_dispersion', 'static_stability', 'stdMonLLLT', 'stdMonLLT', + 'stdMonTLL', 'stdMonTLLL', 'symMinMaxPlt', 'table_attach_columns', + 'table_attach_rows', 'time_to_newtime', 'transpose', + 'triple2grid_Wrap', 'ut_convert', 'uv2dvF_Wrap', 'uv2dvG_Wrap', + 'uv2vrF_Wrap', 'uv2vrG_Wrap', 'vr2uvF_Wrap', 'vr2uvG_Wrap', + 'w_to_omega', 'wallClockElapseTime', 'wave_number_spc', + 'wgt_areaave_Wrap', 'wgt_runave_leftdim', 'wgt_runave_n_Wrap', + 'wgt_runave_Wrap', 'wgt_vertical_n', 'wind_component', + 'wind_direction', 'yyyyddd_to_yyyymmdd', 'yyyymm_time', + 'yyyymm_to_yyyyfrac', 'yyyymmdd_time', 'yyyymmdd_to_yyyyddd', + 'yyyymmdd_to_yyyyfrac', 'yyyymmddhh_time', 'yyyymmddhh_to_yyyyfrac', + 'zonal_mpsi_Wrap', 'zonalAve', 'calendar_decode2', 'cd_string', + 'kf_filter', 'run_cor', 'time_axis_labels', 'ut_string', + 'wrf_contour', 'wrf_map', 'wrf_map_overlay', 'wrf_map_overlays', + 'wrf_map_resources', 'wrf_map_zoom', 'wrf_overlay', 'wrf_overlays', + 'wrf_user_getvar', 'wrf_user_ij_to_ll', 'wrf_user_intrp2d', + 'wrf_user_intrp3d', 'wrf_user_latlon_to_ij', 'wrf_user_list_times', + 'wrf_user_ll_to_ij', 'wrf_user_unstagger', 'wrf_user_vert_interp', + 'wrf_vector', 'gsn_add_annotation', 'gsn_add_polygon', + 'gsn_add_polyline', 'gsn_add_polymarker', + 'gsn_add_shapefile_polygons', 'gsn_add_shapefile_polylines', + 'gsn_add_shapefile_polymarkers', 'gsn_add_text', 'gsn_attach_plots', + 'gsn_blank_plot', 'gsn_contour', 'gsn_contour_map', + 'gsn_contour_shade', 'gsn_coordinates', 'gsn_create_labelbar', + 'gsn_create_legend', 'gsn_create_text', + 'gsn_csm_attach_zonal_means', 'gsn_csm_blank_plot', + 'gsn_csm_contour', 'gsn_csm_contour_map', 'gsn_csm_contour_map_ce', + 'gsn_csm_contour_map_overlay', 'gsn_csm_contour_map_polar', + 'gsn_csm_hov', 'gsn_csm_lat_time', 'gsn_csm_map', 'gsn_csm_map_ce', + 'gsn_csm_map_polar', 'gsn_csm_pres_hgt', + 'gsn_csm_pres_hgt_streamline', 'gsn_csm_pres_hgt_vector', + 'gsn_csm_streamline', 'gsn_csm_streamline_contour_map', + 'gsn_csm_streamline_contour_map_ce', + 'gsn_csm_streamline_contour_map_polar', 'gsn_csm_streamline_map', + 'gsn_csm_streamline_map_ce', 'gsn_csm_streamline_map_polar', + 'gsn_csm_streamline_scalar', 'gsn_csm_streamline_scalar_map', + 'gsn_csm_streamline_scalar_map_ce', + 'gsn_csm_streamline_scalar_map_polar', 'gsn_csm_time_lat', + 'gsn_csm_vector', 'gsn_csm_vector_map', 'gsn_csm_vector_map_ce', + 'gsn_csm_vector_map_polar', 'gsn_csm_vector_scalar', + 'gsn_csm_vector_scalar_map', 'gsn_csm_vector_scalar_map_ce', + 'gsn_csm_vector_scalar_map_polar', 'gsn_csm_x2y', 'gsn_csm_x2y2', + 'gsn_csm_xy', 'gsn_csm_xy2', 'gsn_csm_xy3', 'gsn_csm_y', + 'gsn_define_colormap', 'gsn_draw_colormap', 'gsn_draw_named_colors', + 'gsn_histogram', 'gsn_labelbar_ndc', 'gsn_legend_ndc', 'gsn_map', + 'gsn_merge_colormaps', 'gsn_open_wks', 'gsn_panel', 'gsn_polygon', + 'gsn_polygon_ndc', 'gsn_polyline', 'gsn_polyline_ndc', + 'gsn_polymarker', 'gsn_polymarker_ndc', 'gsn_retrieve_colormap', + 'gsn_reverse_colormap', 'gsn_streamline', 'gsn_streamline_map', + 'gsn_streamline_scalar', 'gsn_streamline_scalar_map', 'gsn_table', + 'gsn_text', 'gsn_text_ndc', 'gsn_vector', 'gsn_vector_map', + 'gsn_vector_scalar', 'gsn_vector_scalar_map', 'gsn_xy', 'gsn_y', + 'hsv2rgb', 'maximize_output', 'namedcolor2rgb', 'namedcolor2rgba', + 'reset_device_coordinates', 'span_named_colors'), prefix=r'\b'), + Name.Builtin), + + # Resources + (words(( + 'amDataXF', 'amDataYF', 'amJust', 'amOn', 'amOrthogonalPosF', + 'amParallelPosF', 'amResizeNotify', 'amSide', 'amTrackData', + 'amViewId', 'amZone', 'appDefaultParent', 'appFileSuffix', + 'appResources', 'appSysDir', 'appUsrDir', 'caCopyArrays', + 'caXArray', 'caXCast', 'caXMaxV', 'caXMinV', 'caXMissingV', + 'caYArray', 'caYCast', 'caYMaxV', 'caYMinV', 'caYMissingV', + 'cnCellFillEdgeColor', 'cnCellFillMissingValEdgeColor', + 'cnConpackParams', 'cnConstFEnableFill', 'cnConstFLabelAngleF', + 'cnConstFLabelBackgroundColor', 'cnConstFLabelConstantSpacingF', + 'cnConstFLabelFont', 'cnConstFLabelFontAspectF', + 'cnConstFLabelFontColor', 'cnConstFLabelFontHeightF', + 'cnConstFLabelFontQuality', 'cnConstFLabelFontThicknessF', + 'cnConstFLabelFormat', 'cnConstFLabelFuncCode', 'cnConstFLabelJust', + 'cnConstFLabelOn', 'cnConstFLabelOrthogonalPosF', + 'cnConstFLabelParallelPosF', 'cnConstFLabelPerimColor', + 'cnConstFLabelPerimOn', 'cnConstFLabelPerimSpaceF', + 'cnConstFLabelPerimThicknessF', 'cnConstFLabelSide', + 'cnConstFLabelString', 'cnConstFLabelTextDirection', + 'cnConstFLabelZone', 'cnConstFUseInfoLabelRes', + 'cnExplicitLabelBarLabelsOn', 'cnExplicitLegendLabelsOn', + 'cnExplicitLineLabelsOn', 'cnFillBackgroundColor', 'cnFillColor', + 'cnFillColors', 'cnFillDotSizeF', 'cnFillDrawOrder', 'cnFillMode', + 'cnFillOn', 'cnFillOpacityF', 'cnFillPalette', 'cnFillPattern', + 'cnFillPatterns', 'cnFillScaleF', 'cnFillScales', 'cnFixFillBleed', + 'cnGridBoundFillColor', 'cnGridBoundFillPattern', + 'cnGridBoundFillScaleF', 'cnGridBoundPerimColor', + 'cnGridBoundPerimDashPattern', 'cnGridBoundPerimOn', + 'cnGridBoundPerimThicknessF', 'cnHighLabelAngleF', + 'cnHighLabelBackgroundColor', 'cnHighLabelConstantSpacingF', + 'cnHighLabelCount', 'cnHighLabelFont', 'cnHighLabelFontAspectF', + 'cnHighLabelFontColor', 'cnHighLabelFontHeightF', + 'cnHighLabelFontQuality', 'cnHighLabelFontThicknessF', + 'cnHighLabelFormat', 'cnHighLabelFuncCode', 'cnHighLabelPerimColor', + 'cnHighLabelPerimOn', 'cnHighLabelPerimSpaceF', + 'cnHighLabelPerimThicknessF', 'cnHighLabelString', 'cnHighLabelsOn', + 'cnHighLowLabelOverlapMode', 'cnHighUseLineLabelRes', + 'cnInfoLabelAngleF', 'cnInfoLabelBackgroundColor', + 'cnInfoLabelConstantSpacingF', 'cnInfoLabelFont', + 'cnInfoLabelFontAspectF', 'cnInfoLabelFontColor', + 'cnInfoLabelFontHeightF', 'cnInfoLabelFontQuality', + 'cnInfoLabelFontThicknessF', 'cnInfoLabelFormat', + 'cnInfoLabelFuncCode', 'cnInfoLabelJust', 'cnInfoLabelOn', + 'cnInfoLabelOrthogonalPosF', 'cnInfoLabelParallelPosF', + 'cnInfoLabelPerimColor', 'cnInfoLabelPerimOn', + 'cnInfoLabelPerimSpaceF', 'cnInfoLabelPerimThicknessF', + 'cnInfoLabelSide', 'cnInfoLabelString', 'cnInfoLabelTextDirection', + 'cnInfoLabelZone', 'cnLabelBarEndLabelsOn', 'cnLabelBarEndStyle', + 'cnLabelDrawOrder', 'cnLabelMasking', 'cnLabelScaleFactorF', + 'cnLabelScaleValueF', 'cnLabelScalingMode', 'cnLegendLevelFlags', + 'cnLevelCount', 'cnLevelFlag', 'cnLevelFlags', 'cnLevelSelectionMode', + 'cnLevelSpacingF', 'cnLevels', 'cnLineColor', 'cnLineColors', + 'cnLineDashPattern', 'cnLineDashPatterns', 'cnLineDashSegLenF', + 'cnLineDrawOrder', 'cnLineLabelAngleF', 'cnLineLabelBackgroundColor', + 'cnLineLabelConstantSpacingF', 'cnLineLabelCount', + 'cnLineLabelDensityF', 'cnLineLabelFont', 'cnLineLabelFontAspectF', + 'cnLineLabelFontColor', 'cnLineLabelFontColors', + 'cnLineLabelFontHeightF', 'cnLineLabelFontQuality', + 'cnLineLabelFontThicknessF', 'cnLineLabelFormat', + 'cnLineLabelFuncCode', 'cnLineLabelInterval', 'cnLineLabelPerimColor', + 'cnLineLabelPerimOn', 'cnLineLabelPerimSpaceF', + 'cnLineLabelPerimThicknessF', 'cnLineLabelPlacementMode', + 'cnLineLabelStrings', 'cnLineLabelsOn', 'cnLinePalette', + 'cnLineThicknessF', 'cnLineThicknesses', 'cnLinesOn', + 'cnLowLabelAngleF', 'cnLowLabelBackgroundColor', + 'cnLowLabelConstantSpacingF', 'cnLowLabelCount', 'cnLowLabelFont', + 'cnLowLabelFontAspectF', 'cnLowLabelFontColor', + 'cnLowLabelFontHeightF', 'cnLowLabelFontQuality', + 'cnLowLabelFontThicknessF', 'cnLowLabelFormat', 'cnLowLabelFuncCode', + 'cnLowLabelPerimColor', 'cnLowLabelPerimOn', 'cnLowLabelPerimSpaceF', + 'cnLowLabelPerimThicknessF', 'cnLowLabelString', 'cnLowLabelsOn', + 'cnLowUseHighLabelRes', 'cnMaxDataValueFormat', 'cnMaxLevelCount', + 'cnMaxLevelValF', 'cnMaxPointDistanceF', 'cnMinLevelValF', + 'cnMissingValFillColor', 'cnMissingValFillPattern', + 'cnMissingValFillScaleF', 'cnMissingValPerimColor', + 'cnMissingValPerimDashPattern', 'cnMissingValPerimGridBoundOn', + 'cnMissingValPerimOn', 'cnMissingValPerimThicknessF', + 'cnMonoFillColor', 'cnMonoFillPattern', 'cnMonoFillScale', + 'cnMonoLevelFlag', 'cnMonoLineColor', 'cnMonoLineDashPattern', + 'cnMonoLineLabelFontColor', 'cnMonoLineThickness', 'cnNoDataLabelOn', + 'cnNoDataLabelString', 'cnOutOfRangeFillColor', + 'cnOutOfRangeFillPattern', 'cnOutOfRangeFillScaleF', + 'cnOutOfRangePerimColor', 'cnOutOfRangePerimDashPattern', + 'cnOutOfRangePerimOn', 'cnOutOfRangePerimThicknessF', + 'cnRasterCellSizeF', 'cnRasterMinCellSizeF', 'cnRasterModeOn', + 'cnRasterSampleFactorF', 'cnRasterSmoothingOn', 'cnScalarFieldData', + 'cnSmoothingDistanceF', 'cnSmoothingOn', 'cnSmoothingTensionF', + 'cnSpanFillPalette', 'cnSpanLinePalette', 'ctCopyTables', + 'ctXElementSize', 'ctXMaxV', 'ctXMinV', 'ctXMissingV', 'ctXTable', + 'ctXTableLengths', 'ctXTableType', 'ctYElementSize', 'ctYMaxV', + 'ctYMinV', 'ctYMissingV', 'ctYTable', 'ctYTableLengths', + 'ctYTableType', 'dcDelayCompute', 'errBuffer', + 'errFileName', 'errFilePtr', 'errLevel', 'errPrint', 'errUnitNumber', + 'gsClipOn', 'gsColors', 'gsEdgeColor', 'gsEdgeDashPattern', + 'gsEdgeDashSegLenF', 'gsEdgeThicknessF', 'gsEdgesOn', + 'gsFillBackgroundColor', 'gsFillColor', 'gsFillDotSizeF', + 'gsFillIndex', 'gsFillLineThicknessF', 'gsFillOpacityF', + 'gsFillScaleF', 'gsFont', 'gsFontAspectF', 'gsFontColor', + 'gsFontHeightF', 'gsFontOpacityF', 'gsFontQuality', + 'gsFontThicknessF', 'gsLineColor', 'gsLineDashPattern', + 'gsLineDashSegLenF', 'gsLineLabelConstantSpacingF', 'gsLineLabelFont', + 'gsLineLabelFontAspectF', 'gsLineLabelFontColor', + 'gsLineLabelFontHeightF', 'gsLineLabelFontQuality', + 'gsLineLabelFontThicknessF', 'gsLineLabelFuncCode', + 'gsLineLabelString', 'gsLineOpacityF', 'gsLineThicknessF', + 'gsMarkerColor', 'gsMarkerIndex', 'gsMarkerOpacityF', 'gsMarkerSizeF', + 'gsMarkerThicknessF', 'gsSegments', 'gsTextAngleF', + 'gsTextConstantSpacingF', 'gsTextDirection', 'gsTextFuncCode', + 'gsTextJustification', 'gsnAboveYRefLineBarColors', + 'gsnAboveYRefLineBarFillScales', 'gsnAboveYRefLineBarPatterns', + 'gsnAboveYRefLineColor', 'gsnAddCyclic', 'gsnAttachBorderOn', + 'gsnAttachPlotsXAxis', 'gsnBelowYRefLineBarColors', + 'gsnBelowYRefLineBarFillScales', 'gsnBelowYRefLineBarPatterns', + 'gsnBelowYRefLineColor', 'gsnBoxMargin', 'gsnCenterString', + 'gsnCenterStringFontColor', 'gsnCenterStringFontHeightF', + 'gsnCenterStringFuncCode', 'gsnCenterStringOrthogonalPosF', + 'gsnCenterStringParallelPosF', 'gsnContourLineThicknessesScale', + 'gsnContourNegLineDashPattern', 'gsnContourPosLineDashPattern', + 'gsnContourZeroLineThicknessF', 'gsnDebugWriteFileName', 'gsnDraw', + 'gsnFrame', 'gsnHistogramBarWidthPercent', 'gsnHistogramBinIntervals', + 'gsnHistogramBinMissing', 'gsnHistogramBinWidth', + 'gsnHistogramClassIntervals', 'gsnHistogramCompare', + 'gsnHistogramComputePercentages', + 'gsnHistogramComputePercentagesNoMissing', + 'gsnHistogramDiscreteBinValues', 'gsnHistogramDiscreteClassValues', + 'gsnHistogramHorizontal', 'gsnHistogramMinMaxBinsOn', + 'gsnHistogramNumberOfBins', 'gsnHistogramPercentSign', + 'gsnHistogramSelectNiceIntervals', 'gsnLeftString', + 'gsnLeftStringFontColor', 'gsnLeftStringFontHeightF', + 'gsnLeftStringFuncCode', 'gsnLeftStringOrthogonalPosF', + 'gsnLeftStringParallelPosF', 'gsnMajorLatSpacing', + 'gsnMajorLonSpacing', 'gsnMaskLambertConformal', + 'gsnMaskLambertConformalOutlineOn', 'gsnMaximize', + 'gsnMinorLatSpacing', 'gsnMinorLonSpacing', 'gsnPanelBottom', + 'gsnPanelCenter', 'gsnPanelDebug', 'gsnPanelFigureStrings', + 'gsnPanelFigureStringsBackgroundFillColor', + 'gsnPanelFigureStringsFontHeightF', 'gsnPanelFigureStringsJust', + 'gsnPanelFigureStringsPerimOn', 'gsnPanelLabelBar', 'gsnPanelLeft', + 'gsnPanelMainFont', 'gsnPanelMainFontColor', + 'gsnPanelMainFontHeightF', 'gsnPanelMainString', 'gsnPanelRight', + 'gsnPanelRowSpec', 'gsnPanelScalePlotIndex', 'gsnPanelTop', + 'gsnPanelXF', 'gsnPanelXWhiteSpacePercent', 'gsnPanelYF', + 'gsnPanelYWhiteSpacePercent', 'gsnPaperHeight', 'gsnPaperMargin', + 'gsnPaperOrientation', 'gsnPaperWidth', 'gsnPolar', + 'gsnPolarLabelDistance', 'gsnPolarLabelFont', + 'gsnPolarLabelFontHeightF', 'gsnPolarLabelSpacing', 'gsnPolarTime', + 'gsnPolarUT', 'gsnRightString', 'gsnRightStringFontColor', + 'gsnRightStringFontHeightF', 'gsnRightStringFuncCode', + 'gsnRightStringOrthogonalPosF', 'gsnRightStringParallelPosF', + 'gsnScalarContour', 'gsnScale', 'gsnShape', 'gsnSpreadColorEnd', + 'gsnSpreadColorStart', 'gsnSpreadColors', 'gsnStringFont', + 'gsnStringFontColor', 'gsnStringFontHeightF', 'gsnStringFuncCode', + 'gsnTickMarksOn', 'gsnXAxisIrregular2Linear', 'gsnXAxisIrregular2Log', + 'gsnXRefLine', 'gsnXRefLineColor', 'gsnXRefLineDashPattern', + 'gsnXRefLineThicknessF', 'gsnXYAboveFillColors', 'gsnXYBarChart', + 'gsnXYBarChartBarWidth', 'gsnXYBarChartColors', + 'gsnXYBarChartColors2', 'gsnXYBarChartFillDotSizeF', + 'gsnXYBarChartFillLineThicknessF', 'gsnXYBarChartFillOpacityF', + 'gsnXYBarChartFillScaleF', 'gsnXYBarChartOutlineOnly', + 'gsnXYBarChartOutlineThicknessF', 'gsnXYBarChartPatterns', + 'gsnXYBarChartPatterns2', 'gsnXYBelowFillColors', 'gsnXYFillColors', + 'gsnXYFillOpacities', 'gsnXYLeftFillColors', 'gsnXYRightFillColors', + 'gsnYAxisIrregular2Linear', 'gsnYAxisIrregular2Log', 'gsnYRefLine', + 'gsnYRefLineColor', 'gsnYRefLineColors', 'gsnYRefLineDashPattern', + 'gsnYRefLineDashPatterns', 'gsnYRefLineThicknessF', + 'gsnYRefLineThicknesses', 'gsnZonalMean', 'gsnZonalMeanXMaxF', + 'gsnZonalMeanXMinF', 'gsnZonalMeanYRefLine', 'lbAutoManage', + 'lbBottomMarginF', 'lbBoxCount', 'lbBoxEndCapStyle', 'lbBoxFractions', + 'lbBoxLineColor', 'lbBoxLineDashPattern', 'lbBoxLineDashSegLenF', + 'lbBoxLineThicknessF', 'lbBoxLinesOn', 'lbBoxMajorExtentF', + 'lbBoxMinorExtentF', 'lbBoxSeparatorLinesOn', 'lbBoxSizing', + 'lbFillBackground', 'lbFillColor', 'lbFillColors', 'lbFillDotSizeF', + 'lbFillLineThicknessF', 'lbFillPattern', 'lbFillPatterns', + 'lbFillScaleF', 'lbFillScales', 'lbJustification', 'lbLabelAlignment', + 'lbLabelAngleF', 'lbLabelAutoStride', 'lbLabelBarOn', + 'lbLabelConstantSpacingF', 'lbLabelDirection', 'lbLabelFont', + 'lbLabelFontAspectF', 'lbLabelFontColor', 'lbLabelFontHeightF', + 'lbLabelFontQuality', 'lbLabelFontThicknessF', 'lbLabelFuncCode', + 'lbLabelJust', 'lbLabelOffsetF', 'lbLabelPosition', 'lbLabelStride', + 'lbLabelStrings', 'lbLabelsOn', 'lbLeftMarginF', 'lbMaxLabelLenF', + 'lbMinLabelSpacingF', 'lbMonoFillColor', 'lbMonoFillPattern', + 'lbMonoFillScale', 'lbOrientation', 'lbPerimColor', + 'lbPerimDashPattern', 'lbPerimDashSegLenF', 'lbPerimFill', + 'lbPerimFillColor', 'lbPerimOn', 'lbPerimThicknessF', + 'lbRasterFillOn', 'lbRightMarginF', 'lbTitleAngleF', + 'lbTitleConstantSpacingF', 'lbTitleDirection', 'lbTitleExtentF', + 'lbTitleFont', 'lbTitleFontAspectF', 'lbTitleFontColor', + 'lbTitleFontHeightF', 'lbTitleFontQuality', 'lbTitleFontThicknessF', + 'lbTitleFuncCode', 'lbTitleJust', 'lbTitleOffsetF', 'lbTitleOn', + 'lbTitlePosition', 'lbTitleString', 'lbTopMarginF', 'lgAutoManage', + 'lgBottomMarginF', 'lgBoxBackground', 'lgBoxLineColor', + 'lgBoxLineDashPattern', 'lgBoxLineDashSegLenF', 'lgBoxLineThicknessF', + 'lgBoxLinesOn', 'lgBoxMajorExtentF', 'lgBoxMinorExtentF', + 'lgDashIndex', 'lgDashIndexes', 'lgItemCount', 'lgItemOrder', + 'lgItemPlacement', 'lgItemPositions', 'lgItemType', 'lgItemTypes', + 'lgJustification', 'lgLabelAlignment', 'lgLabelAngleF', + 'lgLabelAutoStride', 'lgLabelConstantSpacingF', 'lgLabelDirection', + 'lgLabelFont', 'lgLabelFontAspectF', 'lgLabelFontColor', + 'lgLabelFontHeightF', 'lgLabelFontQuality', 'lgLabelFontThicknessF', + 'lgLabelFuncCode', 'lgLabelJust', 'lgLabelOffsetF', 'lgLabelPosition', + 'lgLabelStride', 'lgLabelStrings', 'lgLabelsOn', 'lgLeftMarginF', + 'lgLegendOn', 'lgLineColor', 'lgLineColors', 'lgLineDashSegLenF', + 'lgLineDashSegLens', 'lgLineLabelConstantSpacingF', 'lgLineLabelFont', + 'lgLineLabelFontAspectF', 'lgLineLabelFontColor', + 'lgLineLabelFontColors', 'lgLineLabelFontHeightF', + 'lgLineLabelFontHeights', 'lgLineLabelFontQuality', + 'lgLineLabelFontThicknessF', 'lgLineLabelFuncCode', + 'lgLineLabelStrings', 'lgLineLabelsOn', 'lgLineThicknessF', + 'lgLineThicknesses', 'lgMarkerColor', 'lgMarkerColors', + 'lgMarkerIndex', 'lgMarkerIndexes', 'lgMarkerSizeF', 'lgMarkerSizes', + 'lgMarkerThicknessF', 'lgMarkerThicknesses', 'lgMonoDashIndex', + 'lgMonoItemType', 'lgMonoLineColor', 'lgMonoLineDashSegLen', + 'lgMonoLineLabelFontColor', 'lgMonoLineLabelFontHeight', + 'lgMonoLineThickness', 'lgMonoMarkerColor', 'lgMonoMarkerIndex', + 'lgMonoMarkerSize', 'lgMonoMarkerThickness', 'lgOrientation', + 'lgPerimColor', 'lgPerimDashPattern', 'lgPerimDashSegLenF', + 'lgPerimFill', 'lgPerimFillColor', 'lgPerimOn', 'lgPerimThicknessF', + 'lgRightMarginF', 'lgTitleAngleF', 'lgTitleConstantSpacingF', + 'lgTitleDirection', 'lgTitleExtentF', 'lgTitleFont', + 'lgTitleFontAspectF', 'lgTitleFontColor', 'lgTitleFontHeightF', + 'lgTitleFontQuality', 'lgTitleFontThicknessF', 'lgTitleFuncCode', + 'lgTitleJust', 'lgTitleOffsetF', 'lgTitleOn', 'lgTitlePosition', + 'lgTitleString', 'lgTopMarginF', 'mpAreaGroupCount', + 'mpAreaMaskingOn', 'mpAreaNames', 'mpAreaTypes', 'mpBottomAngleF', + 'mpBottomMapPosF', 'mpBottomNDCF', 'mpBottomNPCF', + 'mpBottomPointLatF', 'mpBottomPointLonF', 'mpBottomWindowF', + 'mpCenterLatF', 'mpCenterLonF', 'mpCenterRotF', 'mpCountyLineColor', + 'mpCountyLineDashPattern', 'mpCountyLineDashSegLenF', + 'mpCountyLineThicknessF', 'mpDataBaseVersion', 'mpDataResolution', + 'mpDataSetName', 'mpDefaultFillColor', 'mpDefaultFillPattern', + 'mpDefaultFillScaleF', 'mpDynamicAreaGroups', 'mpEllipticalBoundary', + 'mpFillAreaSpecifiers', 'mpFillBoundarySets', 'mpFillColor', + 'mpFillColors', 'mpFillColors-default', 'mpFillDotSizeF', + 'mpFillDrawOrder', 'mpFillOn', 'mpFillPatternBackground', + 'mpFillPattern', 'mpFillPatterns', 'mpFillPatterns-default', + 'mpFillScaleF', 'mpFillScales', 'mpFillScales-default', + 'mpFixedAreaGroups', 'mpGeophysicalLineColor', + 'mpGeophysicalLineDashPattern', 'mpGeophysicalLineDashSegLenF', + 'mpGeophysicalLineThicknessF', 'mpGreatCircleLinesOn', + 'mpGridAndLimbDrawOrder', 'mpGridAndLimbOn', 'mpGridLatSpacingF', + 'mpGridLineColor', 'mpGridLineDashPattern', 'mpGridLineDashSegLenF', + 'mpGridLineThicknessF', 'mpGridLonSpacingF', 'mpGridMaskMode', + 'mpGridMaxLatF', 'mpGridPolarLonSpacingF', 'mpGridSpacingF', + 'mpInlandWaterFillColor', 'mpInlandWaterFillPattern', + 'mpInlandWaterFillScaleF', 'mpLabelDrawOrder', 'mpLabelFontColor', + 'mpLabelFontHeightF', 'mpLabelsOn', 'mpLambertMeridianF', + 'mpLambertParallel1F', 'mpLambertParallel2F', 'mpLandFillColor', + 'mpLandFillPattern', 'mpLandFillScaleF', 'mpLeftAngleF', + 'mpLeftCornerLatF', 'mpLeftCornerLonF', 'mpLeftMapPosF', + 'mpLeftNDCF', 'mpLeftNPCF', 'mpLeftPointLatF', + 'mpLeftPointLonF', 'mpLeftWindowF', 'mpLimbLineColor', + 'mpLimbLineDashPattern', 'mpLimbLineDashSegLenF', + 'mpLimbLineThicknessF', 'mpLimitMode', 'mpMaskAreaSpecifiers', + 'mpMaskOutlineSpecifiers', 'mpMaxLatF', 'mpMaxLonF', + 'mpMinLatF', 'mpMinLonF', 'mpMonoFillColor', 'mpMonoFillPattern', + 'mpMonoFillScale', 'mpNationalLineColor', 'mpNationalLineDashPattern', + 'mpNationalLineThicknessF', 'mpOceanFillColor', 'mpOceanFillPattern', + 'mpOceanFillScaleF', 'mpOutlineBoundarySets', 'mpOutlineDrawOrder', + 'mpOutlineMaskingOn', 'mpOutlineOn', 'mpOutlineSpecifiers', + 'mpPerimDrawOrder', 'mpPerimLineColor', 'mpPerimLineDashPattern', + 'mpPerimLineDashSegLenF', 'mpPerimLineThicknessF', 'mpPerimOn', + 'mpPolyMode', 'mpProjection', 'mpProvincialLineColor', + 'mpProvincialLineDashPattern', 'mpProvincialLineDashSegLenF', + 'mpProvincialLineThicknessF', 'mpRelativeCenterLat', + 'mpRelativeCenterLon', 'mpRightAngleF', 'mpRightCornerLatF', + 'mpRightCornerLonF', 'mpRightMapPosF', 'mpRightNDCF', + 'mpRightNPCF', 'mpRightPointLatF', 'mpRightPointLonF', + 'mpRightWindowF', 'mpSatelliteAngle1F', 'mpSatelliteAngle2F', + 'mpSatelliteDistF', 'mpShapeMode', 'mpSpecifiedFillColors', + 'mpSpecifiedFillDirectIndexing', 'mpSpecifiedFillPatterns', + 'mpSpecifiedFillPriority', 'mpSpecifiedFillScales', + 'mpTopAngleF', 'mpTopMapPosF', 'mpTopNDCF', 'mpTopNPCF', + 'mpTopPointLatF', 'mpTopPointLonF', 'mpTopWindowF', + 'mpUSStateLineColor', 'mpUSStateLineDashPattern', + 'mpUSStateLineDashSegLenF', 'mpUSStateLineThicknessF', + 'pmAnnoManagers', 'pmAnnoViews', 'pmLabelBarDisplayMode', + 'pmLabelBarHeightF', 'pmLabelBarKeepAspect', 'pmLabelBarOrthogonalPosF', + 'pmLabelBarParallelPosF', 'pmLabelBarSide', 'pmLabelBarWidthF', + 'pmLabelBarZone', 'pmLegendDisplayMode', 'pmLegendHeightF', + 'pmLegendKeepAspect', 'pmLegendOrthogonalPosF', + 'pmLegendParallelPosF', 'pmLegendSide', 'pmLegendWidthF', + 'pmLegendZone', 'pmOverlaySequenceIds', 'pmTickMarkDisplayMode', + 'pmTickMarkZone', 'pmTitleDisplayMode', 'pmTitleZone', + 'prGraphicStyle', 'prPolyType', 'prXArray', 'prYArray', + 'sfCopyData', 'sfDataArray', 'sfDataMaxV', 'sfDataMinV', + 'sfElementNodes', 'sfExchangeDimensions', 'sfFirstNodeIndex', + 'sfMissingValueV', 'sfXArray', 'sfXCActualEndF', 'sfXCActualStartF', + 'sfXCEndIndex', 'sfXCEndSubsetV', 'sfXCEndV', 'sfXCStartIndex', + 'sfXCStartSubsetV', 'sfXCStartV', 'sfXCStride', 'sfXCellBounds', + 'sfYArray', 'sfYCActualEndF', 'sfYCActualStartF', 'sfYCEndIndex', + 'sfYCEndSubsetV', 'sfYCEndV', 'sfYCStartIndex', 'sfYCStartSubsetV', + 'sfYCStartV', 'sfYCStride', 'sfYCellBounds', 'stArrowLengthF', + 'stArrowStride', 'stCrossoverCheckCount', + 'stExplicitLabelBarLabelsOn', 'stLabelBarEndLabelsOn', + 'stLabelFormat', 'stLengthCheckCount', 'stLevelColors', + 'stLevelCount', 'stLevelPalette', 'stLevelSelectionMode', + 'stLevelSpacingF', 'stLevels', 'stLineColor', 'stLineOpacityF', + 'stLineStartStride', 'stLineThicknessF', 'stMapDirection', + 'stMaxLevelCount', 'stMaxLevelValF', 'stMinArrowSpacingF', + 'stMinDistanceF', 'stMinLevelValF', 'stMinLineSpacingF', + 'stMinStepFactorF', 'stMonoLineColor', 'stNoDataLabelOn', + 'stNoDataLabelString', 'stScalarFieldData', 'stScalarMissingValColor', + 'stSpanLevelPalette', 'stStepSizeF', 'stStreamlineDrawOrder', + 'stUseScalarArray', 'stVectorFieldData', 'stZeroFLabelAngleF', + 'stZeroFLabelBackgroundColor', 'stZeroFLabelConstantSpacingF', + 'stZeroFLabelFont', 'stZeroFLabelFontAspectF', + 'stZeroFLabelFontColor', 'stZeroFLabelFontHeightF', + 'stZeroFLabelFontQuality', 'stZeroFLabelFontThicknessF', + 'stZeroFLabelFuncCode', 'stZeroFLabelJust', 'stZeroFLabelOn', + 'stZeroFLabelOrthogonalPosF', 'stZeroFLabelParallelPosF', + 'stZeroFLabelPerimColor', 'stZeroFLabelPerimOn', + 'stZeroFLabelPerimSpaceF', 'stZeroFLabelPerimThicknessF', + 'stZeroFLabelSide', 'stZeroFLabelString', 'stZeroFLabelTextDirection', + 'stZeroFLabelZone', 'tfDoNDCOverlay', 'tfPlotManagerOn', + 'tfPolyDrawList', 'tfPolyDrawOrder', 'tiDeltaF', 'tiMainAngleF', + 'tiMainConstantSpacingF', 'tiMainDirection', 'tiMainFont', + 'tiMainFontAspectF', 'tiMainFontColor', 'tiMainFontHeightF', + 'tiMainFontQuality', 'tiMainFontThicknessF', 'tiMainFuncCode', + 'tiMainJust', 'tiMainOffsetXF', 'tiMainOffsetYF', 'tiMainOn', + 'tiMainPosition', 'tiMainSide', 'tiMainString', 'tiUseMainAttributes', + 'tiXAxisAngleF', 'tiXAxisConstantSpacingF', 'tiXAxisDirection', + 'tiXAxisFont', 'tiXAxisFontAspectF', 'tiXAxisFontColor', + 'tiXAxisFontHeightF', 'tiXAxisFontQuality', 'tiXAxisFontThicknessF', + 'tiXAxisFuncCode', 'tiXAxisJust', 'tiXAxisOffsetXF', + 'tiXAxisOffsetYF', 'tiXAxisOn', 'tiXAxisPosition', 'tiXAxisSide', + 'tiXAxisString', 'tiYAxisAngleF', 'tiYAxisConstantSpacingF', + 'tiYAxisDirection', 'tiYAxisFont', 'tiYAxisFontAspectF', + 'tiYAxisFontColor', 'tiYAxisFontHeightF', 'tiYAxisFontQuality', + 'tiYAxisFontThicknessF', 'tiYAxisFuncCode', 'tiYAxisJust', + 'tiYAxisOffsetXF', 'tiYAxisOffsetYF', 'tiYAxisOn', 'tiYAxisPosition', + 'tiYAxisSide', 'tiYAxisString', 'tmBorderLineColor', + 'tmBorderThicknessF', 'tmEqualizeXYSizes', 'tmLabelAutoStride', + 'tmSciNoteCutoff', 'tmXBAutoPrecision', 'tmXBBorderOn', + 'tmXBDataLeftF', 'tmXBDataRightF', 'tmXBFormat', 'tmXBIrrTensionF', + 'tmXBIrregularPoints', 'tmXBLabelAngleF', 'tmXBLabelConstantSpacingF', + 'tmXBLabelDeltaF', 'tmXBLabelDirection', 'tmXBLabelFont', + 'tmXBLabelFontAspectF', 'tmXBLabelFontColor', 'tmXBLabelFontHeightF', + 'tmXBLabelFontQuality', 'tmXBLabelFontThicknessF', + 'tmXBLabelFuncCode', 'tmXBLabelJust', 'tmXBLabelStride', 'tmXBLabels', + 'tmXBLabelsOn', 'tmXBMajorLengthF', 'tmXBMajorLineColor', + 'tmXBMajorOutwardLengthF', 'tmXBMajorThicknessF', 'tmXBMaxLabelLenF', + 'tmXBMaxTicks', 'tmXBMinLabelSpacingF', 'tmXBMinorLengthF', + 'tmXBMinorLineColor', 'tmXBMinorOn', 'tmXBMinorOutwardLengthF', + 'tmXBMinorPerMajor', 'tmXBMinorThicknessF', 'tmXBMinorValues', + 'tmXBMode', 'tmXBOn', 'tmXBPrecision', 'tmXBStyle', 'tmXBTickEndF', + 'tmXBTickSpacingF', 'tmXBTickStartF', 'tmXBValues', 'tmXMajorGrid', + 'tmXMajorGridLineColor', 'tmXMajorGridLineDashPattern', + 'tmXMajorGridThicknessF', 'tmXMinorGrid', 'tmXMinorGridLineColor', + 'tmXMinorGridLineDashPattern', 'tmXMinorGridThicknessF', + 'tmXTAutoPrecision', 'tmXTBorderOn', 'tmXTDataLeftF', + 'tmXTDataRightF', 'tmXTFormat', 'tmXTIrrTensionF', + 'tmXTIrregularPoints', 'tmXTLabelAngleF', 'tmXTLabelConstantSpacingF', + 'tmXTLabelDeltaF', 'tmXTLabelDirection', 'tmXTLabelFont', + 'tmXTLabelFontAspectF', 'tmXTLabelFontColor', 'tmXTLabelFontHeightF', + 'tmXTLabelFontQuality', 'tmXTLabelFontThicknessF', + 'tmXTLabelFuncCode', 'tmXTLabelJust', 'tmXTLabelStride', 'tmXTLabels', + 'tmXTLabelsOn', 'tmXTMajorLengthF', 'tmXTMajorLineColor', + 'tmXTMajorOutwardLengthF', 'tmXTMajorThicknessF', 'tmXTMaxLabelLenF', + 'tmXTMaxTicks', 'tmXTMinLabelSpacingF', 'tmXTMinorLengthF', + 'tmXTMinorLineColor', 'tmXTMinorOn', 'tmXTMinorOutwardLengthF', + 'tmXTMinorPerMajor', 'tmXTMinorThicknessF', 'tmXTMinorValues', + 'tmXTMode', 'tmXTOn', 'tmXTPrecision', 'tmXTStyle', 'tmXTTickEndF', + 'tmXTTickSpacingF', 'tmXTTickStartF', 'tmXTValues', 'tmXUseBottom', + 'tmYLAutoPrecision', 'tmYLBorderOn', 'tmYLDataBottomF', + 'tmYLDataTopF', 'tmYLFormat', 'tmYLIrrTensionF', + 'tmYLIrregularPoints', 'tmYLLabelAngleF', 'tmYLLabelConstantSpacingF', + 'tmYLLabelDeltaF', 'tmYLLabelDirection', 'tmYLLabelFont', + 'tmYLLabelFontAspectF', 'tmYLLabelFontColor', 'tmYLLabelFontHeightF', + 'tmYLLabelFontQuality', 'tmYLLabelFontThicknessF', + 'tmYLLabelFuncCode', 'tmYLLabelJust', 'tmYLLabelStride', 'tmYLLabels', + 'tmYLLabelsOn', 'tmYLMajorLengthF', 'tmYLMajorLineColor', + 'tmYLMajorOutwardLengthF', 'tmYLMajorThicknessF', 'tmYLMaxLabelLenF', + 'tmYLMaxTicks', 'tmYLMinLabelSpacingF', 'tmYLMinorLengthF', + 'tmYLMinorLineColor', 'tmYLMinorOn', 'tmYLMinorOutwardLengthF', + 'tmYLMinorPerMajor', 'tmYLMinorThicknessF', 'tmYLMinorValues', + 'tmYLMode', 'tmYLOn', 'tmYLPrecision', 'tmYLStyle', 'tmYLTickEndF', + 'tmYLTickSpacingF', 'tmYLTickStartF', 'tmYLValues', 'tmYMajorGrid', + 'tmYMajorGridLineColor', 'tmYMajorGridLineDashPattern', + 'tmYMajorGridThicknessF', 'tmYMinorGrid', 'tmYMinorGridLineColor', + 'tmYMinorGridLineDashPattern', 'tmYMinorGridThicknessF', + 'tmYRAutoPrecision', 'tmYRBorderOn', 'tmYRDataBottomF', + 'tmYRDataTopF', 'tmYRFormat', 'tmYRIrrTensionF', + 'tmYRIrregularPoints', 'tmYRLabelAngleF', 'tmYRLabelConstantSpacingF', + 'tmYRLabelDeltaF', 'tmYRLabelDirection', 'tmYRLabelFont', + 'tmYRLabelFontAspectF', 'tmYRLabelFontColor', 'tmYRLabelFontHeightF', + 'tmYRLabelFontQuality', 'tmYRLabelFontThicknessF', + 'tmYRLabelFuncCode', 'tmYRLabelJust', 'tmYRLabelStride', 'tmYRLabels', + 'tmYRLabelsOn', 'tmYRMajorLengthF', 'tmYRMajorLineColor', + 'tmYRMajorOutwardLengthF', 'tmYRMajorThicknessF', 'tmYRMaxLabelLenF', + 'tmYRMaxTicks', 'tmYRMinLabelSpacingF', 'tmYRMinorLengthF', + 'tmYRMinorLineColor', 'tmYRMinorOn', 'tmYRMinorOutwardLengthF', + 'tmYRMinorPerMajor', 'tmYRMinorThicknessF', 'tmYRMinorValues', + 'tmYRMode', 'tmYROn', 'tmYRPrecision', 'tmYRStyle', 'tmYRTickEndF', + 'tmYRTickSpacingF', 'tmYRTickStartF', 'tmYRValues', 'tmYUseLeft', + 'trGridType', 'trLineInterpolationOn', + 'trXAxisType', 'trXCoordPoints', 'trXInterPoints', 'trXLog', + 'trXMaxF', 'trXMinF', 'trXReverse', 'trXSamples', 'trXTensionF', + 'trYAxisType', 'trYCoordPoints', 'trYInterPoints', 'trYLog', + 'trYMaxF', 'trYMinF', 'trYReverse', 'trYSamples', 'trYTensionF', + 'txAngleF', 'txBackgroundFillColor', 'txConstantSpacingF', 'txDirection', + 'txFont', 'HLU-Fonts', 'txFontAspectF', 'txFontColor', + 'txFontHeightF', 'txFontOpacityF', 'txFontQuality', + 'txFontThicknessF', 'txFuncCode', 'txJust', 'txPerimColor', + 'txPerimDashLengthF', 'txPerimDashPattern', 'txPerimOn', + 'txPerimSpaceF', 'txPerimThicknessF', 'txPosXF', 'txPosYF', + 'txString', 'vcExplicitLabelBarLabelsOn', 'vcFillArrowEdgeColor', + 'vcFillArrowEdgeThicknessF', 'vcFillArrowFillColor', + 'vcFillArrowHeadInteriorXF', 'vcFillArrowHeadMinFracXF', + 'vcFillArrowHeadMinFracYF', 'vcFillArrowHeadXF', 'vcFillArrowHeadYF', + 'vcFillArrowMinFracWidthF', 'vcFillArrowWidthF', 'vcFillArrowsOn', + 'vcFillOverEdge', 'vcGlyphOpacityF', 'vcGlyphStyle', + 'vcLabelBarEndLabelsOn', 'vcLabelFontColor', 'vcLabelFontHeightF', + 'vcLabelsOn', 'vcLabelsUseVectorColor', 'vcLevelColors', + 'vcLevelCount', 'vcLevelPalette', 'vcLevelSelectionMode', + 'vcLevelSpacingF', 'vcLevels', 'vcLineArrowColor', + 'vcLineArrowHeadMaxSizeF', 'vcLineArrowHeadMinSizeF', + 'vcLineArrowThicknessF', 'vcMagnitudeFormat', + 'vcMagnitudeScaleFactorF', 'vcMagnitudeScaleValueF', + 'vcMagnitudeScalingMode', 'vcMapDirection', 'vcMaxLevelCount', + 'vcMaxLevelValF', 'vcMaxMagnitudeF', 'vcMinAnnoAngleF', + 'vcMinAnnoArrowAngleF', 'vcMinAnnoArrowEdgeColor', + 'vcMinAnnoArrowFillColor', 'vcMinAnnoArrowLineColor', + 'vcMinAnnoArrowMinOffsetF', 'vcMinAnnoArrowSpaceF', + 'vcMinAnnoArrowUseVecColor', 'vcMinAnnoBackgroundColor', + 'vcMinAnnoConstantSpacingF', 'vcMinAnnoExplicitMagnitudeF', + 'vcMinAnnoFont', 'vcMinAnnoFontAspectF', 'vcMinAnnoFontColor', + 'vcMinAnnoFontHeightF', 'vcMinAnnoFontQuality', + 'vcMinAnnoFontThicknessF', 'vcMinAnnoFuncCode', 'vcMinAnnoJust', + 'vcMinAnnoOn', 'vcMinAnnoOrientation', 'vcMinAnnoOrthogonalPosF', + 'vcMinAnnoParallelPosF', 'vcMinAnnoPerimColor', 'vcMinAnnoPerimOn', + 'vcMinAnnoPerimSpaceF', 'vcMinAnnoPerimThicknessF', 'vcMinAnnoSide', + 'vcMinAnnoString1', 'vcMinAnnoString1On', 'vcMinAnnoString2', + 'vcMinAnnoString2On', 'vcMinAnnoTextDirection', 'vcMinAnnoZone', + 'vcMinDistanceF', 'vcMinFracLengthF', 'vcMinLevelValF', + 'vcMinMagnitudeF', 'vcMonoFillArrowEdgeColor', + 'vcMonoFillArrowFillColor', 'vcMonoLineArrowColor', + 'vcMonoWindBarbColor', 'vcNoDataLabelOn', 'vcNoDataLabelString', + 'vcPositionMode', 'vcRefAnnoAngleF', 'vcRefAnnoArrowAngleF', + 'vcRefAnnoArrowEdgeColor', 'vcRefAnnoArrowFillColor', + 'vcRefAnnoArrowLineColor', 'vcRefAnnoArrowMinOffsetF', + 'vcRefAnnoArrowSpaceF', 'vcRefAnnoArrowUseVecColor', + 'vcRefAnnoBackgroundColor', 'vcRefAnnoConstantSpacingF', + 'vcRefAnnoExplicitMagnitudeF', 'vcRefAnnoFont', + 'vcRefAnnoFontAspectF', 'vcRefAnnoFontColor', 'vcRefAnnoFontHeightF', + 'vcRefAnnoFontQuality', 'vcRefAnnoFontThicknessF', + 'vcRefAnnoFuncCode', 'vcRefAnnoJust', 'vcRefAnnoOn', + 'vcRefAnnoOrientation', 'vcRefAnnoOrthogonalPosF', + 'vcRefAnnoParallelPosF', 'vcRefAnnoPerimColor', 'vcRefAnnoPerimOn', + 'vcRefAnnoPerimSpaceF', 'vcRefAnnoPerimThicknessF', 'vcRefAnnoSide', + 'vcRefAnnoString1', 'vcRefAnnoString1On', 'vcRefAnnoString2', + 'vcRefAnnoString2On', 'vcRefAnnoTextDirection', 'vcRefAnnoZone', + 'vcRefLengthF', 'vcRefMagnitudeF', 'vcScalarFieldData', + 'vcScalarMissingValColor', 'vcScalarValueFormat', + 'vcScalarValueScaleFactorF', 'vcScalarValueScaleValueF', + 'vcScalarValueScalingMode', 'vcSpanLevelPalette', 'vcUseRefAnnoRes', + 'vcUseScalarArray', 'vcVectorDrawOrder', 'vcVectorFieldData', + 'vcWindBarbCalmCircleSizeF', 'vcWindBarbColor', + 'vcWindBarbLineThicknessF', 'vcWindBarbScaleFactorF', + 'vcWindBarbTickAngleF', 'vcWindBarbTickLengthF', + 'vcWindBarbTickSpacingF', 'vcZeroFLabelAngleF', + 'vcZeroFLabelBackgroundColor', 'vcZeroFLabelConstantSpacingF', + 'vcZeroFLabelFont', 'vcZeroFLabelFontAspectF', + 'vcZeroFLabelFontColor', 'vcZeroFLabelFontHeightF', + 'vcZeroFLabelFontQuality', 'vcZeroFLabelFontThicknessF', + 'vcZeroFLabelFuncCode', 'vcZeroFLabelJust', 'vcZeroFLabelOn', + 'vcZeroFLabelOrthogonalPosF', 'vcZeroFLabelParallelPosF', + 'vcZeroFLabelPerimColor', 'vcZeroFLabelPerimOn', + 'vcZeroFLabelPerimSpaceF', 'vcZeroFLabelPerimThicknessF', + 'vcZeroFLabelSide', 'vcZeroFLabelString', 'vcZeroFLabelTextDirection', + 'vcZeroFLabelZone', 'vfCopyData', 'vfDataArray', + 'vfExchangeDimensions', 'vfExchangeUVData', 'vfMagMaxV', 'vfMagMinV', + 'vfMissingUValueV', 'vfMissingVValueV', 'vfPolarData', + 'vfSingleMissingValue', 'vfUDataArray', 'vfUMaxV', 'vfUMinV', + 'vfVDataArray', 'vfVMaxV', 'vfVMinV', 'vfXArray', 'vfXCActualEndF', + 'vfXCActualStartF', 'vfXCEndIndex', 'vfXCEndSubsetV', 'vfXCEndV', + 'vfXCStartIndex', 'vfXCStartSubsetV', 'vfXCStartV', 'vfXCStride', + 'vfYArray', 'vfYCActualEndF', 'vfYCActualStartF', 'vfYCEndIndex', + 'vfYCEndSubsetV', 'vfYCEndV', 'vfYCStartIndex', 'vfYCStartSubsetV', + 'vfYCStartV', 'vfYCStride', 'vpAnnoManagerId', 'vpClipOn', + 'vpHeightF', 'vpKeepAspect', 'vpOn', 'vpUseSegments', 'vpWidthF', + 'vpXF', 'vpYF', 'wkAntiAlias', 'wkBackgroundColor', 'wkBackgroundOpacityF', + 'wkColorMapLen', 'wkColorMap', 'wkColorModel', 'wkDashTableLength', + 'wkDefGraphicStyleId', 'wkDeviceLowerX', 'wkDeviceLowerY', + 'wkDeviceUpperX', 'wkDeviceUpperY', 'wkFileName', 'wkFillTableLength', + 'wkForegroundColor', 'wkFormat', 'wkFullBackground', 'wkGksWorkId', + 'wkHeight', 'wkMarkerTableLength', 'wkMetaName', 'wkOrientation', + 'wkPDFFileName', 'wkPDFFormat', 'wkPDFResolution', 'wkPSFileName', + 'wkPSFormat', 'wkPSResolution', 'wkPaperHeightF', 'wkPaperSize', + 'wkPaperWidthF', 'wkPause', 'wkTopLevelViews', 'wkViews', + 'wkVisualType', 'wkWidth', 'wkWindowId', 'wkXColorMode', 'wsCurrentSize', + 'wsMaximumSize', 'wsThresholdSize', 'xyComputeXMax', + 'xyComputeXMin', 'xyComputeYMax', 'xyComputeYMin', 'xyCoordData', + 'xyCoordDataSpec', 'xyCurveDrawOrder', 'xyDashPattern', + 'xyDashPatterns', 'xyExplicitLabels', 'xyExplicitLegendLabels', + 'xyLabelMode', 'xyLineColor', 'xyLineColors', 'xyLineDashSegLenF', + 'xyLineLabelConstantSpacingF', 'xyLineLabelFont', + 'xyLineLabelFontAspectF', 'xyLineLabelFontColor', + 'xyLineLabelFontColors', 'xyLineLabelFontHeightF', + 'xyLineLabelFontQuality', 'xyLineLabelFontThicknessF', + 'xyLineLabelFuncCode', 'xyLineThicknessF', 'xyLineThicknesses', + 'xyMarkLineMode', 'xyMarkLineModes', 'xyMarker', 'xyMarkerColor', + 'xyMarkerColors', 'xyMarkerSizeF', 'xyMarkerSizes', + 'xyMarkerThicknessF', 'xyMarkerThicknesses', 'xyMarkers', + 'xyMonoDashPattern', 'xyMonoLineColor', 'xyMonoLineLabelFontColor', + 'xyMonoLineThickness', 'xyMonoMarkLineMode', 'xyMonoMarker', + 'xyMonoMarkerColor', 'xyMonoMarkerSize', 'xyMonoMarkerThickness', + 'xyXIrrTensionF', 'xyXIrregularPoints', 'xyXStyle', 'xyYIrrTensionF', + 'xyYIrregularPoints', 'xyYStyle'), prefix=r'\b'), + Name.Builtin), + + # Booleans + (r'\.(True|False)\.', Name.Builtin), + # Comparing Operators + (r'\.(eq|ne|lt|le|gt|ge|not|and|or|xor)\.', Operator.Word), + ], + + 'strings': [ + (r'(?s)"(\\\\|\\[0-7]+|\\.|[^"\\])*"', String.Double), + ], + + 'nums': [ + (r'\d+(?![.e])(_[a-z]\w+)?', Number.Integer), + (r'[+-]?\d*\.\d+(e[-+]?\d+)?(_[a-z]\w+)?', Number.Float), + (r'[+-]?\d+\.\d*(e[-+]?\d+)?(_[a-z]\w+)?', Number.Float), + ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/nimrod.py b/lib/python3.12/site-packages/pygments/lexers/nimrod.py new file mode 100644 index 0000000000000000000000000000000000000000..365a8dcca961a8b1934b02d33cfaa181ed97736f --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/nimrod.py @@ -0,0 +1,199 @@ +""" + pygments.lexers.nimrod + ~~~~~~~~~~~~~~~~~~~~~~ + + Lexer for the Nim language (formerly known as Nimrod). + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, include, default, bygroups +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Error + +__all__ = ['NimrodLexer'] + + +class NimrodLexer(RegexLexer): + """ + For Nim source code. + """ + + name = 'Nimrod' + url = 'http://nim-lang.org/' + aliases = ['nimrod', 'nim'] + filenames = ['*.nim', '*.nimrod'] + mimetypes = ['text/x-nim'] + version_added = '1.5' + + flags = re.MULTILINE | re.IGNORECASE + + def underscorize(words): + newWords = [] + new = [] + for word in words: + for ch in word: + new.append(ch) + new.append("_?") + newWords.append(''.join(new)) + new = [] + return "|".join(newWords) + + keywords = [ + 'addr', 'and', 'as', 'asm', 'bind', 'block', 'break', 'case', + 'cast', 'concept', 'const', 'continue', 'converter', 'defer', 'discard', + 'distinct', 'div', 'do', 'elif', 'else', 'end', 'enum', 'except', + 'export', 'finally', 'for', 'if', 'in', 'yield', 'interface', + 'is', 'isnot', 'iterator', 'let', 'mixin', 'mod', + 'not', 'notin', 'object', 'of', 'or', 'out', 'ptr', 'raise', + 'ref', 'return', 'shl', 'shr', 'static', 'try', + 'tuple', 'type', 'using', 'when', 'while', 'xor' + ] + + keywordsPseudo = [ + 'nil', 'true', 'false' + ] + + opWords = [ + 'and', 'or', 'not', 'xor', 'shl', 'shr', 'div', 'mod', 'in', + 'notin', 'is', 'isnot' + ] + + types = [ + 'int', 'int8', 'int16', 'int32', 'int64', 'float', 'float32', 'float64', + 'bool', 'char', 'range', 'array', 'seq', 'set', 'string' + ] + + tokens = { + 'root': [ + # Comments + (r'##\[', String.Doc, 'doccomment'), + (r'##.*$', String.Doc), + (r'#\[', Comment.Multiline, 'comment'), + (r'#.*$', Comment), + + # Pragmas + (r'\{\.', String.Other, 'pragma'), + + # Operators + (r'[*=><+\-/@$~&%!?|\\\[\]]', Operator), + (r'\.\.|\.|,|\[\.|\.\]|\{\.|\.\}|\(\.|\.\)|\{|\}|\(|\)|:|\^|`|;', + Punctuation), + + # Case statement branch + (r'(\n\s*)(of)(\s)', bygroups(Text.Whitespace, Keyword, + Text.Whitespace), 'casebranch'), + + # Strings + (r'(?:[\w]+)"', String, 'rdqs'), + (r'"""', String.Double, 'tdqs'), + ('"', String, 'dqs'), + + # Char + ("'", String.Char, 'chars'), + + # Keywords + (rf'({underscorize(opWords)})\b', Operator.Word), + (r'(proc|func|method|macro|template)(\s)(?![(\[\]])', + bygroups(Keyword, Text.Whitespace), 'funcname'), + (rf'({underscorize(keywords)})\b', Keyword), + (r'({})\b'.format(underscorize(['from', 'import', 'include', 'export'])), + Keyword.Namespace), + (r'(v_?a_?r)\b', Keyword.Declaration), + (rf'({underscorize(types)})\b', Name.Builtin), + (rf'({underscorize(keywordsPseudo)})\b', Keyword.Pseudo), + + # Identifiers + (r'\b((?![_\d])\w)(((?!_)\w)|(_(?!_)\w))*', Name), + + # Numbers + (r'[0-9][0-9_]*(?=([e.]|\'f(32|64)))', + Number.Float, ('float-suffix', 'float-number')), + (r'0x[a-f0-9][a-f0-9_]*', Number.Hex, 'int-suffix'), + (r'0b[01][01_]*', Number.Bin, 'int-suffix'), + (r'0o[0-7][0-7_]*', Number.Oct, 'int-suffix'), + (r'[0-9][0-9_]*', Number.Integer, 'int-suffix'), + + # Whitespace + (r'\s+', Text.Whitespace), + (r'.+$', Error), + ], + 'chars': [ + (r'\\([\\abcefnrtvl"\']|x[a-f0-9]{2}|[0-9]{1,3})', String.Escape), + (r"'", String.Char, '#pop'), + (r".", String.Char) + ], + 'strings': [ + (r'(?|>=|>>|>|<=|<<|<|\+|-|=|/|\*|%|\+=|-=|!|@', Operator), + (r'\(|\)|\[|\]|,|\.\.\.|\.\.|\.|::|:', Punctuation), + (r'`\{[^`]*`\}', Text), # Extern blocks won't be Lexed by Nit + (r'[\r\n\t ]+', Text), + ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/objective.py b/lib/python3.12/site-packages/pygments/lexers/objective.py new file mode 100644 index 0000000000000000000000000000000000000000..899c2c44c965248e98a705d9bb330d4e8158b9ac --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/objective.py @@ -0,0 +1,513 @@ +""" + pygments.lexers.objective + ~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for Objective-C family languages. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, include, bygroups, using, this, words, \ + inherit, default +from pygments.token import Text, Keyword, Name, String, Operator, \ + Number, Punctuation, Literal, Comment, Whitespace + +from pygments.lexers.c_cpp import CLexer, CppLexer + +__all__ = ['ObjectiveCLexer', 'ObjectiveCppLexer', 'LogosLexer', 'SwiftLexer'] + + +def objective(baselexer): + """ + Generate a subclass of baselexer that accepts the Objective-C syntax + extensions. + """ + + # Have to be careful not to accidentally match JavaDoc/Doxygen syntax here, + # since that's quite common in ordinary C/C++ files. It's OK to match + # JavaDoc/Doxygen keywords that only apply to Objective-C, mind. + # + # The upshot of this is that we CANNOT match @class or @interface + _oc_keywords = re.compile(r'@(?:end|implementation|protocol)') + + # Matches [ ? identifier ( identifier ? ] | identifier? : ) + # (note the identifier is *optional* when there is a ':'!) + _oc_message = re.compile(r'\[\s*[a-zA-Z_]\w*\s+' + r'(?:[a-zA-Z_]\w*\s*\]|' + r'(?:[a-zA-Z_]\w*)?:)') + + class GeneratedObjectiveCVariant(baselexer): + """ + Implements Objective-C syntax on top of an existing C family lexer. + """ + + tokens = { + 'statements': [ + (r'@"', String, 'string'), + (r'@(YES|NO)', Number), + (r"@'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'", String.Char), + (r'@(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[lL]?', Number.Float), + (r'@(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float), + (r'@0x[0-9a-fA-F]+[Ll]?', Number.Hex), + (r'@0[0-7]+[Ll]?', Number.Oct), + (r'@\d+[Ll]?', Number.Integer), + (r'@\(', Literal, 'literal_number'), + (r'@\[', Literal, 'literal_array'), + (r'@\{', Literal, 'literal_dictionary'), + (words(( + '@selector', '@private', '@protected', '@public', '@encode', + '@synchronized', '@try', '@throw', '@catch', '@finally', + '@end', '@property', '@synthesize', '__bridge', '__bridge_transfer', + '__autoreleasing', '__block', '__weak', '__strong', 'weak', 'strong', + 'copy', 'retain', 'assign', 'unsafe_unretained', 'atomic', 'nonatomic', + 'readonly', 'readwrite', 'setter', 'getter', 'typeof', 'in', + 'out', 'inout', 'release', 'class', '@dynamic', '@optional', + '@required', '@autoreleasepool', '@import'), suffix=r'\b'), + Keyword), + (words(('id', 'instancetype', 'Class', 'IMP', 'SEL', 'BOOL', + 'IBOutlet', 'IBAction', 'unichar'), suffix=r'\b'), + Keyword.Type), + (r'@(true|false|YES|NO)\n', Name.Builtin), + (r'(YES|NO|nil|self|super)\b', Name.Builtin), + # Carbon types + (r'(Boolean|UInt8|SInt8|UInt16|SInt16|UInt32|SInt32)\b', Keyword.Type), + # Carbon built-ins + (r'(TRUE|FALSE)\b', Name.Builtin), + (r'(@interface|@implementation)(\s+)', bygroups(Keyword, Text), + ('#pop', 'oc_classname')), + (r'(@class|@protocol)(\s+)', bygroups(Keyword, Text), + ('#pop', 'oc_forward_classname')), + # @ can also prefix other expressions like @{...} or @(...) + (r'@', Punctuation), + inherit, + ], + 'oc_classname': [ + # interface definition that inherits + (r'([a-zA-Z$_][\w$]*)(\s*:\s*)([a-zA-Z$_][\w$]*)?(\s*)(\{)', + bygroups(Name.Class, Text, Name.Class, Text, Punctuation), + ('#pop', 'oc_ivars')), + (r'([a-zA-Z$_][\w$]*)(\s*:\s*)([a-zA-Z$_][\w$]*)?', + bygroups(Name.Class, Text, Name.Class), '#pop'), + # interface definition for a category + (r'([a-zA-Z$_][\w$]*)(\s*)(\([a-zA-Z$_][\w$]*\))(\s*)(\{)', + bygroups(Name.Class, Text, Name.Label, Text, Punctuation), + ('#pop', 'oc_ivars')), + (r'([a-zA-Z$_][\w$]*)(\s*)(\([a-zA-Z$_][\w$]*\))', + bygroups(Name.Class, Text, Name.Label), '#pop'), + # simple interface / implementation + (r'([a-zA-Z$_][\w$]*)(\s*)(\{)', + bygroups(Name.Class, Text, Punctuation), ('#pop', 'oc_ivars')), + (r'([a-zA-Z$_][\w$]*)', Name.Class, '#pop') + ], + 'oc_forward_classname': [ + (r'([a-zA-Z$_][\w$]*)(\s*,\s*)', + bygroups(Name.Class, Text), 'oc_forward_classname'), + (r'([a-zA-Z$_][\w$]*)(\s*;?)', + bygroups(Name.Class, Text), '#pop') + ], + 'oc_ivars': [ + include('whitespace'), + include('statements'), + (';', Punctuation), + (r'\{', Punctuation, '#push'), + (r'\}', Punctuation, '#pop'), + ], + 'root': [ + # methods + (r'^([-+])(\s*)' # method marker + r'(\(.*?\))?(\s*)' # return type + r'([a-zA-Z$_][\w$]*:?)', # begin of method name + bygroups(Punctuation, Text, using(this), + Text, Name.Function), + 'method'), + inherit, + ], + 'method': [ + include('whitespace'), + # TODO unsure if ellipses are allowed elsewhere, see + # discussion in Issue 789 + (r',', Punctuation), + (r'\.\.\.', Punctuation), + (r'(\(.*?\))(\s*)([a-zA-Z$_][\w$]*)', + bygroups(using(this), Text, Name.Variable)), + (r'[a-zA-Z$_][\w$]*:', Name.Function), + (';', Punctuation, '#pop'), + (r'\{', Punctuation, 'function'), + default('#pop'), + ], + 'literal_number': [ + (r'\(', Punctuation, 'literal_number_inner'), + (r'\)', Literal, '#pop'), + include('statement'), + ], + 'literal_number_inner': [ + (r'\(', Punctuation, '#push'), + (r'\)', Punctuation, '#pop'), + include('statement'), + ], + 'literal_array': [ + (r'\[', Punctuation, 'literal_array_inner'), + (r'\]', Literal, '#pop'), + include('statement'), + ], + 'literal_array_inner': [ + (r'\[', Punctuation, '#push'), + (r'\]', Punctuation, '#pop'), + include('statement'), + ], + 'literal_dictionary': [ + (r'\}', Literal, '#pop'), + include('statement'), + ], + } + + def analyse_text(text): + if _oc_keywords.search(text): + return 1.0 + elif '@"' in text: # strings + return 0.8 + elif re.search('@[0-9]+', text): + return 0.7 + elif _oc_message.search(text): + return 0.8 + return 0 + + def get_tokens_unprocessed(self, text, stack=('root',)): + from pygments.lexers._cocoa_builtins import COCOA_INTERFACES, \ + COCOA_PROTOCOLS, COCOA_PRIMITIVES + + for index, token, value in \ + baselexer.get_tokens_unprocessed(self, text, stack): + if token is Name or token is Name.Class: + if value in COCOA_INTERFACES or value in COCOA_PROTOCOLS \ + or value in COCOA_PRIMITIVES: + token = Name.Builtin.Pseudo + + yield index, token, value + + return GeneratedObjectiveCVariant + + +class ObjectiveCLexer(objective(CLexer)): + """ + For Objective-C source code with preprocessor directives. + """ + + name = 'Objective-C' + url = 'https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/Introduction/Introduction.html' + aliases = ['objective-c', 'objectivec', 'obj-c', 'objc'] + filenames = ['*.m', '*.h'] + mimetypes = ['text/x-objective-c'] + version_added = '' + priority = 0.05 # Lower than C + + +class ObjectiveCppLexer(objective(CppLexer)): + """ + For Objective-C++ source code with preprocessor directives. + """ + + name = 'Objective-C++' + aliases = ['objective-c++', 'objectivec++', 'obj-c++', 'objc++'] + filenames = ['*.mm', '*.hh'] + mimetypes = ['text/x-objective-c++'] + version_added = '' + priority = 0.05 # Lower than C++ + + +class LogosLexer(ObjectiveCppLexer): + """ + For Logos + Objective-C source code with preprocessor directives. + """ + + name = 'Logos' + aliases = ['logos'] + filenames = ['*.x', '*.xi', '*.xm', '*.xmi'] + mimetypes = ['text/x-logos'] + version_added = '1.6' + priority = 0.25 + + tokens = { + 'statements': [ + (r'(%orig|%log)\b', Keyword), + (r'(%c)\b(\()(\s*)([a-zA-Z$_][\w$]*)(\s*)(\))', + bygroups(Keyword, Punctuation, Text, Name.Class, Text, Punctuation)), + (r'(%init)\b(\()', + bygroups(Keyword, Punctuation), 'logos_init_directive'), + (r'(%init)(?=\s*;)', bygroups(Keyword)), + (r'(%hook|%group)(\s+)([a-zA-Z$_][\w$]+)', + bygroups(Keyword, Text, Name.Class), '#pop'), + (r'(%subclass)(\s+)', bygroups(Keyword, Text), + ('#pop', 'logos_classname')), + inherit, + ], + 'logos_init_directive': [ + (r'\s+', Text), + (',', Punctuation, ('logos_init_directive', '#pop')), + (r'([a-zA-Z$_][\w$]*)(\s*)(=)(\s*)([^);]*)', + bygroups(Name.Class, Text, Punctuation, Text, Text)), + (r'([a-zA-Z$_][\w$]*)', Name.Class), + (r'\)', Punctuation, '#pop'), + ], + 'logos_classname': [ + (r'([a-zA-Z$_][\w$]*)(\s*:\s*)([a-zA-Z$_][\w$]*)?', + bygroups(Name.Class, Text, Name.Class), '#pop'), + (r'([a-zA-Z$_][\w$]*)', Name.Class, '#pop') + ], + 'root': [ + (r'(%subclass)(\s+)', bygroups(Keyword, Text), + 'logos_classname'), + (r'(%hook|%group)(\s+)([a-zA-Z$_][\w$]+)', + bygroups(Keyword, Text, Name.Class)), + (r'(%config)(\s*\(\s*)(\w+)(\s*=)(.*?)(\)\s*)', + bygroups(Keyword, Text, Name.Variable, Text, String, Text)), + (r'(%ctor)(\s*)(\{)', bygroups(Keyword, Text, Punctuation), + 'function'), + (r'(%new)(\s*)(\()(.*?)(\))', + bygroups(Keyword, Text, Keyword, String, Keyword)), + (r'(\s*)(%end)(\s*)', bygroups(Text, Keyword, Text)), + inherit, + ], + } + + _logos_keywords = re.compile(r'%(?:hook|ctor|init|c\()') + + def analyse_text(text): + if LogosLexer._logos_keywords.search(text): + return 1.0 + return 0 + + +class SwiftLexer(RegexLexer): + """ + For Swift source. + """ + name = 'Swift' + url = 'https://www.swift.org/' + filenames = ['*.swift'] + aliases = ['swift'] + mimetypes = ['text/x-swift'] + version_added = '2.0' + + tokens = { + 'root': [ + # Whitespace and Comments + (r'\n', Text), + (r'\s+', Whitespace), + (r'//', Comment.Single, 'comment-single'), + (r'/\*', Comment.Multiline, 'comment-multi'), + (r'#(if|elseif|else|endif|available)\b', Comment.Preproc, 'preproc'), + + # Keywords + include('keywords'), + + # Global Types + (words(( + 'Array', 'AutoreleasingUnsafeMutablePointer', 'BidirectionalReverseView', + 'Bit', 'Bool', 'CFunctionPointer', 'COpaquePointer', 'CVaListPointer', + 'Character', 'ClosedInterval', 'CollectionOfOne', 'ContiguousArray', + 'Dictionary', 'DictionaryGenerator', 'DictionaryIndex', 'Double', + 'EmptyCollection', 'EmptyGenerator', 'EnumerateGenerator', + 'EnumerateSequence', 'FilterCollectionView', + 'FilterCollectionViewIndex', 'FilterGenerator', 'FilterSequenceView', + 'Float', 'Float80', 'FloatingPointClassification', 'GeneratorOf', + 'GeneratorOfOne', 'GeneratorSequence', 'HalfOpenInterval', 'HeapBuffer', + 'HeapBufferStorage', 'ImplicitlyUnwrappedOptional', 'IndexingGenerator', + 'Int', 'Int16', 'Int32', 'Int64', 'Int8', 'LazyBidirectionalCollection', + 'LazyForwardCollection', 'LazyRandomAccessCollection', + 'LazySequence', 'MapCollectionView', 'MapSequenceGenerator', + 'MapSequenceView', 'MirrorDisposition', 'ObjectIdentifier', 'OnHeap', + 'Optional', 'PermutationGenerator', 'QuickLookObject', + 'RandomAccessReverseView', 'Range', 'RangeGenerator', 'RawByte', 'Repeat', + 'ReverseBidirectionalIndex', 'ReverseRandomAccessIndex', 'SequenceOf', + 'SinkOf', 'Slice', 'StaticString', 'StrideThrough', 'StrideThroughGenerator', + 'StrideTo', 'StrideToGenerator', 'String', 'UInt', 'UInt16', 'UInt32', + 'UInt64', 'UInt8', 'UTF16', 'UTF32', 'UTF8', 'UnicodeDecodingResult', + 'UnicodeScalar', 'Unmanaged', 'UnsafeBufferPointer', + 'UnsafeBufferPointerGenerator', 'UnsafeMutableBufferPointer', + 'UnsafeMutablePointer', 'UnsafePointer', 'Zip2', 'ZipGenerator2', + # Protocols + 'AbsoluteValuable', 'AnyObject', 'ArrayLiteralConvertible', + 'BidirectionalIndexType', 'BitwiseOperationsType', + 'BooleanLiteralConvertible', 'BooleanType', 'CVarArgType', + 'CollectionType', 'Comparable', 'DebugPrintable', + 'DictionaryLiteralConvertible', 'Equatable', + 'ExtendedGraphemeClusterLiteralConvertible', + 'ExtensibleCollectionType', 'FloatLiteralConvertible', + 'FloatingPointType', 'ForwardIndexType', 'GeneratorType', 'Hashable', + 'IntegerArithmeticType', 'IntegerLiteralConvertible', 'IntegerType', + 'IntervalType', 'MirrorType', 'MutableCollectionType', 'MutableSliceable', + 'NilLiteralConvertible', 'OutputStreamType', 'Printable', + 'RandomAccessIndexType', 'RangeReplaceableCollectionType', + 'RawOptionSetType', 'RawRepresentable', 'Reflectable', 'SequenceType', + 'SignedIntegerType', 'SignedNumberType', 'SinkType', 'Sliceable', + 'Streamable', 'Strideable', 'StringInterpolationConvertible', + 'StringLiteralConvertible', 'UnicodeCodecType', + 'UnicodeScalarLiteralConvertible', 'UnsignedIntegerType', + '_ArrayBufferType', '_BidirectionalIndexType', '_CocoaStringType', + '_CollectionType', '_Comparable', '_ExtensibleCollectionType', + '_ForwardIndexType', '_Incrementable', '_IntegerArithmeticType', + '_IntegerType', '_ObjectiveCBridgeable', '_RandomAccessIndexType', + '_RawOptionSetType', '_SequenceType', '_Sequence_Type', + '_SignedIntegerType', '_SignedNumberType', '_Sliceable', '_Strideable', + '_SwiftNSArrayRequiredOverridesType', '_SwiftNSArrayType', + '_SwiftNSCopyingType', '_SwiftNSDictionaryRequiredOverridesType', + '_SwiftNSDictionaryType', '_SwiftNSEnumeratorType', + '_SwiftNSFastEnumerationType', '_SwiftNSStringRequiredOverridesType', + '_SwiftNSStringType', '_UnsignedIntegerType', + # Variables + 'C_ARGC', 'C_ARGV', 'Process', + # Typealiases + 'Any', 'AnyClass', 'BooleanLiteralType', 'CBool', 'CChar', 'CChar16', + 'CChar32', 'CDouble', 'CFloat', 'CInt', 'CLong', 'CLongLong', 'CShort', + 'CSignedChar', 'CUnsignedInt', 'CUnsignedLong', 'CUnsignedShort', + 'CWideChar', 'ExtendedGraphemeClusterType', 'Float32', 'Float64', + 'FloatLiteralType', 'IntMax', 'IntegerLiteralType', 'StringLiteralType', + 'UIntMax', 'UWord', 'UnicodeScalarType', 'Void', 'Word', + # Foundation/Cocoa + 'NSErrorPointer', 'NSObjectProtocol', 'Selector'), suffix=r'\b'), + Name.Builtin), + # Functions + (words(( + 'abs', 'advance', 'alignof', 'alignofValue', 'assert', 'assertionFailure', + 'contains', 'count', 'countElements', 'debugPrint', 'debugPrintln', + 'distance', 'dropFirst', 'dropLast', 'dump', 'enumerate', 'equal', + 'extend', 'fatalError', 'filter', 'find', 'first', 'getVaList', 'indices', + 'insert', 'isEmpty', 'join', 'last', 'lazy', 'lexicographicalCompare', + 'map', 'max', 'maxElement', 'min', 'minElement', 'numericCast', 'overlaps', + 'partition', 'precondition', 'preconditionFailure', 'prefix', 'print', + 'println', 'reduce', 'reflect', 'removeAll', 'removeAtIndex', 'removeLast', + 'removeRange', 'reverse', 'sizeof', 'sizeofValue', 'sort', 'sorted', + 'splice', 'split', 'startsWith', 'stride', 'strideof', 'strideofValue', + 'suffix', 'swap', 'toDebugString', 'toString', 'transcode', + 'underestimateCount', 'unsafeAddressOf', 'unsafeBitCast', 'unsafeDowncast', + 'withExtendedLifetime', 'withUnsafeMutablePointer', + 'withUnsafeMutablePointers', 'withUnsafePointer', 'withUnsafePointers', + 'withVaList'), suffix=r'\b'), + Name.Builtin.Pseudo), + + # Implicit Block Variables + (r'\$\d+', Name.Variable), + + # Binary Literal + (r'0b[01_]+', Number.Bin), + # Octal Literal + (r'0o[0-7_]+', Number.Oct), + # Hexadecimal Literal + (r'0x[0-9a-fA-F_]+', Number.Hex), + # Decimal Literal + (r'[0-9][0-9_]*(\.[0-9_]+[eE][+\-]?[0-9_]+|' + r'\.[0-9_]*|[eE][+\-]?[0-9_]+)', Number.Float), + (r'[0-9][0-9_]*', Number.Integer), + # String Literal + (r'"""', String, 'string-multi'), + (r'"', String, 'string'), + + # Operators and Punctuation + (r'[(){}\[\].,:;=@#`?]|->|[<&?](?=\w)|(?<=\w)[>!?]', Punctuation), + (r'[/=\-+!*%<>&|^?~]+', Operator), + + # Identifier + (r'[a-zA-Z_]\w*', Name) + ], + 'keywords': [ + (words(( + 'as', 'async', 'await', 'break', 'case', 'catch', 'continue', 'default', 'defer', + 'do', 'else', 'fallthrough', 'for', 'guard', 'if', 'in', 'is', + 'repeat', 'return', '#selector', 'switch', 'throw', 'try', + 'where', 'while'), suffix=r'\b'), + Keyword), + (r'@availability\([^)]+\)', Keyword.Reserved), + (words(( + 'associativity', 'convenience', 'dynamic', 'didSet', 'final', + 'get', 'indirect', 'infix', 'inout', 'lazy', 'left', 'mutating', + 'none', 'nonmutating', 'optional', 'override', 'postfix', + 'precedence', 'prefix', 'Protocol', 'required', 'rethrows', + 'right', 'set', 'throws', 'Type', 'unowned', 'weak', 'willSet', + '@availability', '@autoclosure', '@noreturn', + '@NSApplicationMain', '@NSCopying', '@NSManaged', '@objc', + '@UIApplicationMain', '@IBAction', '@IBDesignable', + '@IBInspectable', '@IBOutlet'), suffix=r'\b'), + Keyword.Reserved), + (r'(as|dynamicType|false|is|nil|self|Self|super|true|__COLUMN__' + r'|__FILE__|__FUNCTION__|__LINE__|_' + r'|#(?:file|line|column|function))\b', Keyword.Constant), + (r'import\b', Keyword.Declaration, 'module'), + (r'(class|enum|extension|struct|protocol)(\s+)([a-zA-Z_]\w*)', + bygroups(Keyword.Declaration, Whitespace, Name.Class)), + (r'(func)(\s+)([a-zA-Z_]\w*)', + bygroups(Keyword.Declaration, Whitespace, Name.Function)), + (r'(var|let)(\s+)([a-zA-Z_]\w*)', bygroups(Keyword.Declaration, + Whitespace, Name.Variable)), + (words(( + 'actor', 'associatedtype', 'class', 'deinit', 'enum', 'extension', 'func', 'import', + 'init', 'internal', 'let', 'operator', 'private', 'protocol', 'public', + 'static', 'struct', 'subscript', 'typealias', 'var'), suffix=r'\b'), + Keyword.Declaration) + ], + 'comment': [ + (r':param: [a-zA-Z_]\w*|:returns?:|(FIXME|MARK|TODO):', + Comment.Special) + ], + + # Nested + 'comment-single': [ + (r'\n', Whitespace, '#pop'), + include('comment'), + (r'[^\n]+', Comment.Single) + ], + 'comment-multi': [ + include('comment'), + (r'[^*/]+', Comment.Multiline), + (r'/\*', Comment.Multiline, '#push'), + (r'\*/', Comment.Multiline, '#pop'), + (r'[*/]+', Comment.Multiline) + ], + 'module': [ + (r'\n', Whitespace, '#pop'), + (r'[a-zA-Z_]\w*', Name.Class), + include('root') + ], + 'preproc': [ + (r'\n', Whitespace, '#pop'), + include('keywords'), + (r'[A-Za-z]\w*', Comment.Preproc), + include('root') + ], + 'string': [ + (r'"', String, '#pop'), + include("string-common"), + ], + 'string-multi': [ + (r'"""', String, '#pop'), + include("string-common"), + ], + 'string-common': [ + (r'\\\(', String.Interpol, 'string-intp'), + (r"""\\['"\\nrt]|\\x[0-9a-fA-F]{2}|\\[0-7]{1,3}""" + r"""|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}""", String.Escape), + (r'[^\\"]+', String), + (r'\\', String) + ], + 'string-intp': [ + (r'\(', String.Interpol, '#push'), + (r'\)', String.Interpol, '#pop'), + include('root') + ] + } + + def get_tokens_unprocessed(self, text): + from pygments.lexers._cocoa_builtins import COCOA_INTERFACES, \ + COCOA_PROTOCOLS, COCOA_PRIMITIVES + + for index, token, value in \ + RegexLexer.get_tokens_unprocessed(self, text): + if token is Name or token is Name.Class: + if value in COCOA_INTERFACES or value in COCOA_PROTOCOLS \ + or value in COCOA_PRIMITIVES: + token = Name.Builtin.Pseudo + + yield index, token, value diff --git a/lib/python3.12/site-packages/pygments/lexers/parsers.py b/lib/python3.12/site-packages/pygments/lexers/parsers.py new file mode 100644 index 0000000000000000000000000000000000000000..7a4ed9d1df789fd8e559e3c6de2fb161c4620547 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/parsers.py @@ -0,0 +1,798 @@ +""" + pygments.lexers.parsers + ~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for parser generators. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, DelegatingLexer, \ + include, bygroups, using +from pygments.token import Punctuation, Other, Text, Comment, Operator, \ + Keyword, Name, String, Number, Whitespace +from pygments.lexers.jvm import JavaLexer +from pygments.lexers.c_cpp import CLexer, CppLexer +from pygments.lexers.objective import ObjectiveCLexer +from pygments.lexers.d import DLexer +from pygments.lexers.dotnet import CSharpLexer +from pygments.lexers.ruby import RubyLexer +from pygments.lexers.python import PythonLexer +from pygments.lexers.perl import PerlLexer + +__all__ = ['RagelLexer', 'RagelEmbeddedLexer', 'RagelCLexer', 'RagelDLexer', + 'RagelCppLexer', 'RagelObjectiveCLexer', 'RagelRubyLexer', + 'RagelJavaLexer', 'AntlrLexer', 'AntlrPythonLexer', + 'AntlrPerlLexer', 'AntlrRubyLexer', 'AntlrCppLexer', + 'AntlrCSharpLexer', 'AntlrObjectiveCLexer', + 'AntlrJavaLexer', 'AntlrActionScriptLexer', + 'TreetopLexer', 'EbnfLexer'] + + +class RagelLexer(RegexLexer): + """A pure `Ragel `_ lexer. Use this + for fragments of Ragel. For ``.rl`` files, use + :class:`RagelEmbeddedLexer` instead (or one of the + language-specific subclasses). + + """ + + name = 'Ragel' + url = 'http://www.colm.net/open-source/ragel/' + aliases = ['ragel'] + filenames = [] + version_added = '1.1' + + tokens = { + 'whitespace': [ + (r'\s+', Whitespace) + ], + 'comments': [ + (r'\#.*$', Comment), + ], + 'keywords': [ + (r'(access|action|alphtype)\b', Keyword), + (r'(getkey|write|machine|include)\b', Keyword), + (r'(any|ascii|extend|alpha|digit|alnum|lower|upper)\b', Keyword), + (r'(xdigit|cntrl|graph|print|punct|space|zlen|empty)\b', Keyword) + ], + 'numbers': [ + (r'0x[0-9A-Fa-f]+', Number.Hex), + (r'[+-]?[0-9]+', Number.Integer), + ], + 'literals': [ + (r'"(\\\\|\\[^\\]|[^"\\])*"', String.Double), + (r"'(\\\\|\\[^\\]|[^'\\])*'", String.Single), + (r'\[(\\\\|\\[^\\]|[^\\\]])*\]', String), # square bracket literals + (r'/(?!\*)(\\\\|\\[^\\]|[^/\\])*/', String.Regex), # regular expressions + ], + 'identifiers': [ + (r'[a-zA-Z_]\w*', Name.Variable), + ], + 'operators': [ + (r',', Operator), # Join + (r'\||&|--?', Operator), # Union, Intersection and Subtraction + (r'\.|<:|:>>?', Operator), # Concatention + (r':', Operator), # Label + (r'->', Operator), # Epsilon Transition + (r'(>|\$|%|<|@|<>)(/|eof\b)', Operator), # EOF Actions + (r'(>|\$|%|<|@|<>)(!|err\b)', Operator), # Global Error Actions + (r'(>|\$|%|<|@|<>)(\^|lerr\b)', Operator), # Local Error Actions + (r'(>|\$|%|<|@|<>)(~|to\b)', Operator), # To-State Actions + (r'(>|\$|%|<|@|<>)(\*|from\b)', Operator), # From-State Actions + (r'>|@|\$|%', Operator), # Transition Actions and Priorities + (r'\*|\?|\+|\{[0-9]*,[0-9]*\}', Operator), # Repetition + (r'!|\^', Operator), # Negation + (r'\(|\)', Operator), # Grouping + ], + 'root': [ + include('literals'), + include('whitespace'), + include('comments'), + include('keywords'), + include('numbers'), + include('identifiers'), + include('operators'), + (r'\{', Punctuation, 'host'), + (r'=', Operator), + (r';', Punctuation), + ], + 'host': [ + (r'(' + r'|'.join(( # keep host code in largest possible chunks + r'[^{}\'"/#]+', # exclude unsafe characters + r'[^\\]\\[{}]', # allow escaped { or } + + # strings and comments may safely contain unsafe characters + r'"(\\\\|\\[^\\]|[^"\\])*"', + r"'(\\\\|\\[^\\]|[^'\\])*'", + r'//.*$\n?', # single line comment + r'/\*(.|\n)*?\*/', # multi-line javadoc-style comment + r'\#.*$\n?', # ruby comment + + # regular expression: There's no reason for it to start + # with a * and this stops confusion with comments. + r'/(?!\*)(\\\\|\\[^\\]|[^/\\])*/', + + # / is safe now that we've handled regex and javadoc comments + r'/', + )) + r')+', Other), + + (r'\{', Punctuation, '#push'), + (r'\}', Punctuation, '#pop'), + ], + } + + +class RagelEmbeddedLexer(RegexLexer): + """ + A lexer for Ragel embedded in a host language file. + + This will only highlight Ragel statements. If you want host language + highlighting then call the language-specific Ragel lexer. + """ + + name = 'Embedded Ragel' + aliases = ['ragel-em'] + filenames = ['*.rl'] + url = 'http://www.colm.net/open-source/ragel/' + version_added = '1.1' + + tokens = { + 'root': [ + (r'(' + r'|'.join(( # keep host code in largest possible chunks + r'[^%\'"/#]+', # exclude unsafe characters + r'%(?=[^%]|$)', # a single % sign is okay, just not 2 of them + + # strings and comments may safely contain unsafe characters + r'"(\\\\|\\[^\\]|[^"\\])*"', + r"'(\\\\|\\[^\\]|[^'\\])*'", + r'/\*(.|\n)*?\*/', # multi-line javadoc-style comment + r'//.*$\n?', # single line comment + r'\#.*$\n?', # ruby/ragel comment + r'/(?!\*)(\\\\|\\[^\\]|[^/\\])*/', # regular expression + + # / is safe now that we've handled regex and javadoc comments + r'/', + )) + r')+', Other), + + # Single Line FSM. + # Please don't put a quoted newline in a single line FSM. + # That's just mean. It will break this. + (r'(%%)(?![{%])(.*)($|;)(\n?)', bygroups(Punctuation, + using(RagelLexer), + Punctuation, Text)), + + # Multi Line FSM. + (r'(%%%%|%%)\{', Punctuation, 'multi-line-fsm'), + ], + 'multi-line-fsm': [ + (r'(' + r'|'.join(( # keep ragel code in largest possible chunks. + r'(' + r'|'.join(( + r'[^}\'"\[/#]', # exclude unsafe characters + r'\}(?=[^%]|$)', # } is okay as long as it's not followed by % + r'\}%(?=[^%]|$)', # ...well, one %'s okay, just not two... + r'[^\\]\\[{}]', # ...and } is okay if it's escaped + + # allow / if it's preceded with one of these symbols + # (ragel EOF actions) + r'(>|\$|%|<|@|<>)/', + + # specifically allow regex followed immediately by * + # so it doesn't get mistaken for a comment + r'/(?!\*)(\\\\|\\[^\\]|[^/\\])*/\*', + + # allow / as long as it's not followed by another / or by a * + r'/(?=[^/*]|$)', + + # We want to match as many of these as we can in one block. + # Not sure if we need the + sign here, + # does it help performance? + )) + r')+', + + # strings and comments may safely contain unsafe characters + r'"(\\\\|\\[^\\]|[^"\\])*"', + r"'(\\\\|\\[^\\]|[^'\\])*'", + r"\[(\\\\|\\[^\\]|[^\]\\])*\]", # square bracket literal + r'/\*(.|\n)*?\*/', # multi-line javadoc-style comment + r'//.*$\n?', # single line comment + r'\#.*$\n?', # ruby/ragel comment + )) + r')+', using(RagelLexer)), + + (r'\}%%', Punctuation, '#pop'), + ] + } + + def analyse_text(text): + return '@LANG: indep' in text + + +class RagelRubyLexer(DelegatingLexer): + """ + A lexer for Ragel in a Ruby host file. + """ + + name = 'Ragel in Ruby Host' + aliases = ['ragel-ruby', 'ragel-rb'] + filenames = ['*.rl'] + url = 'http://www.colm.net/open-source/ragel/' + version_added = '1.1' + + def __init__(self, **options): + super().__init__(RubyLexer, RagelEmbeddedLexer, **options) + + def analyse_text(text): + return '@LANG: ruby' in text + + +class RagelCLexer(DelegatingLexer): + """ + A lexer for Ragel in a C host file. + """ + + name = 'Ragel in C Host' + aliases = ['ragel-c'] + filenames = ['*.rl'] + url = 'http://www.colm.net/open-source/ragel/' + version_added = '1.1' + + def __init__(self, **options): + super().__init__(CLexer, RagelEmbeddedLexer, **options) + + def analyse_text(text): + return '@LANG: c' in text + + +class RagelDLexer(DelegatingLexer): + """ + A lexer for Ragel in a D host file. + """ + + name = 'Ragel in D Host' + aliases = ['ragel-d'] + filenames = ['*.rl'] + url = 'http://www.colm.net/open-source/ragel/' + version_added = '1.1' + + def __init__(self, **options): + super().__init__(DLexer, RagelEmbeddedLexer, **options) + + def analyse_text(text): + return '@LANG: d' in text + + +class RagelCppLexer(DelegatingLexer): + """ + A lexer for Ragel in a C++ host file. + """ + + name = 'Ragel in CPP Host' + aliases = ['ragel-cpp'] + filenames = ['*.rl'] + url = 'http://www.colm.net/open-source/ragel/' + version_added = '1.1' + + def __init__(self, **options): + super().__init__(CppLexer, RagelEmbeddedLexer, **options) + + def analyse_text(text): + return '@LANG: c++' in text + + +class RagelObjectiveCLexer(DelegatingLexer): + """ + A lexer for Ragel in an Objective C host file. + """ + + name = 'Ragel in Objective C Host' + aliases = ['ragel-objc'] + filenames = ['*.rl'] + url = 'http://www.colm.net/open-source/ragel/' + version_added = '1.1' + + def __init__(self, **options): + super().__init__(ObjectiveCLexer, RagelEmbeddedLexer, **options) + + def analyse_text(text): + return '@LANG: objc' in text + + +class RagelJavaLexer(DelegatingLexer): + """ + A lexer for Ragel in a Java host file. + """ + + name = 'Ragel in Java Host' + aliases = ['ragel-java'] + filenames = ['*.rl'] + url = 'http://www.colm.net/open-source/ragel/' + version_added = '1.1' + + def __init__(self, **options): + super().__init__(JavaLexer, RagelEmbeddedLexer, **options) + + def analyse_text(text): + return '@LANG: java' in text + + +class AntlrLexer(RegexLexer): + """ + Generic ANTLR Lexer. + Should not be called directly, instead + use DelegatingLexer for your target language. + """ + + name = 'ANTLR' + aliases = ['antlr'] + filenames = [] + url = 'https://www.antlr.org' + version_added = '1.1' + + _id = r'[A-Za-z]\w*' + _TOKEN_REF = r'[A-Z]\w*' + _RULE_REF = r'[a-z]\w*' + _STRING_LITERAL = r'\'(?:\\\\|\\\'|[^\']*)\'' + _INT = r'[0-9]+' + + tokens = { + 'whitespace': [ + (r'\s+', Whitespace), + ], + 'comments': [ + (r'//.*$', Comment), + (r'/\*(.|\n)*?\*/', Comment), + ], + 'root': [ + include('whitespace'), + include('comments'), + + (r'(lexer|parser|tree)?(\s*)(grammar\b)(\s*)(' + _id + ')(;)', + bygroups(Keyword, Whitespace, Keyword, Whitespace, Name.Class, + Punctuation)), + # optionsSpec + (r'options\b', Keyword, 'options'), + # tokensSpec + (r'tokens\b', Keyword, 'tokens'), + # attrScope + (r'(scope)(\s*)(' + _id + r')(\s*)(\{)', + bygroups(Keyword, Whitespace, Name.Variable, Whitespace, + Punctuation), 'action'), + # exception + (r'(catch|finally)\b', Keyword, 'exception'), + # action + (r'(@' + _id + r')(\s*)(::)?(\s*)(' + _id + r')(\s*)(\{)', + bygroups(Name.Label, Whitespace, Punctuation, Whitespace, + Name.Label, Whitespace, Punctuation), 'action'), + # rule + (r'((?:protected|private|public|fragment)\b)?(\s*)(' + _id + ')(!)?', + bygroups(Keyword, Whitespace, Name.Label, Punctuation), + ('rule-alts', 'rule-prelims')), + ], + 'exception': [ + (r'\n', Whitespace, '#pop'), + (r'\s', Whitespace), + include('comments'), + + (r'\[', Punctuation, 'nested-arg-action'), + (r'\{', Punctuation, 'action'), + ], + 'rule-prelims': [ + include('whitespace'), + include('comments'), + + (r'returns\b', Keyword), + (r'\[', Punctuation, 'nested-arg-action'), + (r'\{', Punctuation, 'action'), + # throwsSpec + (r'(throws)(\s+)(' + _id + ')', + bygroups(Keyword, Whitespace, Name.Label)), + (r'(,)(\s*)(' + _id + ')', + bygroups(Punctuation, Whitespace, Name.Label)), # Additional throws + # optionsSpec + (r'options\b', Keyword, 'options'), + # ruleScopeSpec - scope followed by target language code or name of action + # TODO finish implementing other possibilities for scope + # L173 ANTLRv3.g from ANTLR book + (r'(scope)(\s+)(\{)', bygroups(Keyword, Whitespace, Punctuation), + 'action'), + (r'(scope)(\s+)(' + _id + r')(\s*)(;)', + bygroups(Keyword, Whitespace, Name.Label, Whitespace, Punctuation)), + # ruleAction + (r'(@' + _id + r')(\s*)(\{)', + bygroups(Name.Label, Whitespace, Punctuation), 'action'), + # finished prelims, go to rule alts! + (r':', Punctuation, '#pop') + ], + 'rule-alts': [ + include('whitespace'), + include('comments'), + + # These might need to go in a separate 'block' state triggered by ( + (r'options\b', Keyword, 'options'), + (r':', Punctuation), + + # literals + (r'"(\\\\|\\[^\\]|[^"\\])*"', String.Double), + (r"'(\\\\|\\[^\\]|[^'\\])*'", String.Single), + (r'<<([^>]|>[^>])>>', String), + # identifiers + # Tokens start with capital letter. + (r'\$?[A-Z_]\w*', Name.Constant), + # Rules start with small letter. + (r'\$?[a-z_]\w*', Name.Variable), + # operators + (r'(\+|\||->|=>|=|\(|\)|\.\.|\.|\?|\*|\^|!|\#|~)', Operator), + (r',', Punctuation), + (r'\[', Punctuation, 'nested-arg-action'), + (r'\{', Punctuation, 'action'), + (r';', Punctuation, '#pop') + ], + 'tokens': [ + include('whitespace'), + include('comments'), + (r'\{', Punctuation), + (r'(' + _TOKEN_REF + r')(\s*)(=)?(\s*)(' + _STRING_LITERAL + + r')?(\s*)(;)', + bygroups(Name.Label, Whitespace, Punctuation, Whitespace, + String, Whitespace, Punctuation)), + (r'\}', Punctuation, '#pop'), + ], + 'options': [ + include('whitespace'), + include('comments'), + (r'\{', Punctuation), + (r'(' + _id + r')(\s*)(=)(\s*)(' + + '|'.join((_id, _STRING_LITERAL, _INT, r'\*')) + r')(\s*)(;)', + bygroups(Name.Variable, Whitespace, Punctuation, Whitespace, + Text, Whitespace, Punctuation)), + (r'\}', Punctuation, '#pop'), + ], + 'action': [ + (r'(' + r'|'.join(( # keep host code in largest possible chunks + r'[^${}\'"/\\]+', # exclude unsafe characters + + # strings and comments may safely contain unsafe characters + r'"(\\\\|\\[^\\]|[^"\\])*"', + r"'(\\\\|\\[^\\]|[^'\\])*'", + r'//.*$\n?', # single line comment + r'/\*(.|\n)*?\*/', # multi-line javadoc-style comment + + # regular expression: There's no reason for it to start + # with a * and this stops confusion with comments. + r'/(?!\*)(\\\\|\\[^\\]|[^/\\])*/', + + # backslashes are okay, as long as we are not backslashing a % + r'\\(?!%)', + + # Now that we've handled regex and javadoc comments + # it's safe to let / through. + r'/', + )) + r')+', Other), + (r'(\\)(%)', bygroups(Punctuation, Other)), + (r'(\$[a-zA-Z]+)(\.?)(text|value)?', + bygroups(Name.Variable, Punctuation, Name.Property)), + (r'\{', Punctuation, '#push'), + (r'\}', Punctuation, '#pop'), + ], + 'nested-arg-action': [ + (r'(' + r'|'.join(( # keep host code in largest possible chunks. + r'[^$\[\]\'"/]+', # exclude unsafe characters + + # strings and comments may safely contain unsafe characters + r'"(\\\\|\\[^\\]|[^"\\])*"', + r"'(\\\\|\\[^\\]|[^'\\])*'", + r'//.*$\n?', # single line comment + r'/\*(.|\n)*?\*/', # multi-line javadoc-style comment + + # regular expression: There's no reason for it to start + # with a * and this stops confusion with comments. + r'/(?!\*)(\\\\|\\[^\\]|[^/\\])*/', + + # Now that we've handled regex and javadoc comments + # it's safe to let / through. + r'/', + )) + r')+', Other), + + + (r'\[', Punctuation, '#push'), + (r'\]', Punctuation, '#pop'), + (r'(\$[a-zA-Z]+)(\.?)(text|value)?', + bygroups(Name.Variable, Punctuation, Name.Property)), + (r'(\\\\|\\\]|\\\[|[^\[\]])+', Other), + ] + } + + def analyse_text(text): + return re.search(r'^\s*grammar\s+[a-zA-Z0-9]+\s*;', text, re.M) + + +# http://www.antlr.org/wiki/display/ANTLR3/Code+Generation+Targets + +class AntlrCppLexer(DelegatingLexer): + """ + ANTLR with C++ Target + """ + + name = 'ANTLR With CPP Target' + aliases = ['antlr-cpp'] + filenames = ['*.G', '*.g'] + url = 'https://www.antlr.org' + version_added = '1.1' + + def __init__(self, **options): + super().__init__(CppLexer, AntlrLexer, **options) + + def analyse_text(text): + return AntlrLexer.analyse_text(text) and \ + re.search(r'^\s*language\s*=\s*C\s*;', text, re.M) + + +class AntlrObjectiveCLexer(DelegatingLexer): + """ + ANTLR with Objective-C Target + """ + + name = 'ANTLR With ObjectiveC Target' + aliases = ['antlr-objc'] + filenames = ['*.G', '*.g'] + url = 'https://www.antlr.org' + version_added = '1.1' + + def __init__(self, **options): + super().__init__(ObjectiveCLexer, AntlrLexer, **options) + + def analyse_text(text): + return AntlrLexer.analyse_text(text) and \ + re.search(r'^\s*language\s*=\s*ObjC\s*;', text) + + +class AntlrCSharpLexer(DelegatingLexer): + """ + ANTLR with C# Target + """ + + name = 'ANTLR With C# Target' + aliases = ['antlr-csharp', 'antlr-c#'] + filenames = ['*.G', '*.g'] + url = 'https://www.antlr.org' + version_added = '1.1' + + def __init__(self, **options): + super().__init__(CSharpLexer, AntlrLexer, **options) + + def analyse_text(text): + return AntlrLexer.analyse_text(text) and \ + re.search(r'^\s*language\s*=\s*CSharp2\s*;', text, re.M) + + +class AntlrPythonLexer(DelegatingLexer): + """ + ANTLR with Python Target + """ + + name = 'ANTLR With Python Target' + aliases = ['antlr-python'] + filenames = ['*.G', '*.g'] + url = 'https://www.antlr.org' + version_added = '1.1' + + def __init__(self, **options): + super().__init__(PythonLexer, AntlrLexer, **options) + + def analyse_text(text): + return AntlrLexer.analyse_text(text) and \ + re.search(r'^\s*language\s*=\s*Python\s*;', text, re.M) + + +class AntlrJavaLexer(DelegatingLexer): + """ + ANTLR with Java Target + """ + + name = 'ANTLR With Java Target' + aliases = ['antlr-java'] + filenames = ['*.G', '*.g'] + url = 'https://www.antlr.org' + version_added = '1.1' + + def __init__(self, **options): + super().__init__(JavaLexer, AntlrLexer, **options) + + def analyse_text(text): + # Antlr language is Java by default + return AntlrLexer.analyse_text(text) and 0.9 + + +class AntlrRubyLexer(DelegatingLexer): + """ + ANTLR with Ruby Target + """ + + name = 'ANTLR With Ruby Target' + aliases = ['antlr-ruby', 'antlr-rb'] + filenames = ['*.G', '*.g'] + url = 'https://www.antlr.org' + version_added = '1.1' + + def __init__(self, **options): + super().__init__(RubyLexer, AntlrLexer, **options) + + def analyse_text(text): + return AntlrLexer.analyse_text(text) and \ + re.search(r'^\s*language\s*=\s*Ruby\s*;', text, re.M) + + +class AntlrPerlLexer(DelegatingLexer): + """ + ANTLR with Perl Target + """ + + name = 'ANTLR With Perl Target' + aliases = ['antlr-perl'] + filenames = ['*.G', '*.g'] + url = 'https://www.antlr.org' + version_added = '1.1' + + def __init__(self, **options): + super().__init__(PerlLexer, AntlrLexer, **options) + + def analyse_text(text): + return AntlrLexer.analyse_text(text) and \ + re.search(r'^\s*language\s*=\s*Perl5\s*;', text, re.M) + + +class AntlrActionScriptLexer(DelegatingLexer): + """ + ANTLR with ActionScript Target + """ + + name = 'ANTLR With ActionScript Target' + aliases = ['antlr-actionscript', 'antlr-as'] + filenames = ['*.G', '*.g'] + url = 'https://www.antlr.org' + version_added = '1.1' + + def __init__(self, **options): + from pygments.lexers.actionscript import ActionScriptLexer + super().__init__(ActionScriptLexer, AntlrLexer, **options) + + def analyse_text(text): + return AntlrLexer.analyse_text(text) and \ + re.search(r'^\s*language\s*=\s*ActionScript\s*;', text, re.M) + + +class TreetopBaseLexer(RegexLexer): + """ + A base lexer for `Treetop `_ grammars. + Not for direct use; use :class:`TreetopLexer` instead. + + .. versionadded:: 1.6 + """ + + tokens = { + 'root': [ + include('space'), + (r'require[ \t]+[^\n\r]+[\n\r]', Other), + (r'module\b', Keyword.Namespace, 'module'), + (r'grammar\b', Keyword, 'grammar'), + ], + 'module': [ + include('space'), + include('end'), + (r'module\b', Keyword, '#push'), + (r'grammar\b', Keyword, 'grammar'), + (r'[A-Z]\w*(?:::[A-Z]\w*)*', Name.Namespace), + ], + 'grammar': [ + include('space'), + include('end'), + (r'rule\b', Keyword, 'rule'), + (r'include\b', Keyword, 'include'), + (r'[A-Z]\w*', Name), + ], + 'include': [ + include('space'), + (r'[A-Z]\w*(?:::[A-Z]\w*)*', Name.Class, '#pop'), + ], + 'rule': [ + include('space'), + include('end'), + (r'"(\\\\|\\[^\\]|[^"\\])*"', String.Double), + (r"'(\\\\|\\[^\\]|[^'\\])*'", String.Single), + (r'([A-Za-z_]\w*)(:)', bygroups(Name.Label, Punctuation)), + (r'[A-Za-z_]\w*', Name), + (r'[()]', Punctuation), + (r'[?+*/&!~]', Operator), + (r'\[(?:\\.|\[:\^?[a-z]+:\]|[^\\\]])+\]', String.Regex), + (r'([0-9]*)(\.\.)([0-9]*)', + bygroups(Number.Integer, Operator, Number.Integer)), + (r'(<)([^>]+)(>)', bygroups(Punctuation, Name.Class, Punctuation)), + (r'\{', Punctuation, 'inline_module'), + (r'\.', String.Regex), + ], + 'inline_module': [ + (r'\{', Other, 'ruby'), + (r'\}', Punctuation, '#pop'), + (r'[^{}]+', Other), + ], + 'ruby': [ + (r'\{', Other, '#push'), + (r'\}', Other, '#pop'), + (r'[^{}]+', Other), + ], + 'space': [ + (r'[ \t\n\r]+', Whitespace), + (r'#[^\n]*', Comment.Single), + ], + 'end': [ + (r'end\b', Keyword, '#pop'), + ], + } + + +class TreetopLexer(DelegatingLexer): + """ + A lexer for Treetop grammars. + """ + + name = 'Treetop' + aliases = ['treetop'] + filenames = ['*.treetop', '*.tt'] + url = 'https://cjheath.github.io/treetop' + version_added = '1.6' + + def __init__(self, **options): + super().__init__(RubyLexer, TreetopBaseLexer, **options) + + +class EbnfLexer(RegexLexer): + """ + Lexer for `ISO/IEC 14977 EBNF + `_ + grammars. + """ + + name = 'EBNF' + aliases = ['ebnf'] + filenames = ['*.ebnf'] + mimetypes = ['text/x-ebnf'] + url = 'https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_Form' + version_added = '2.0' + + tokens = { + 'root': [ + include('whitespace'), + include('comment_start'), + include('identifier'), + (r'=', Operator, 'production'), + ], + 'production': [ + include('whitespace'), + include('comment_start'), + include('identifier'), + (r'"[^"]*"', String.Double), + (r"'[^']*'", String.Single), + (r'(\?[^?]*\?)', Name.Entity), + (r'[\[\]{}(),|]', Punctuation), + (r'-', Operator), + (r';', Punctuation, '#pop'), + (r'\.', Punctuation, '#pop'), + ], + 'whitespace': [ + (r'\s+', Text), + ], + 'comment_start': [ + (r'\(\*', Comment.Multiline, 'comment'), + ], + 'comment': [ + (r'[^*)]', Comment.Multiline), + include('comment_start'), + (r'\*\)', Comment.Multiline, '#pop'), + (r'[*)]', Comment.Multiline), + ], + 'identifier': [ + (r'([a-zA-Z][\w \-]*)', Keyword), + ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/pddl.py b/lib/python3.12/site-packages/pygments/lexers/pddl.py new file mode 100644 index 0000000000000000000000000000000000000000..77aa75362ff0dd87901ccc27be0f688ef40b39f4 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/pddl.py @@ -0,0 +1,82 @@ +""" + pygments.lexers.pddl + ~~~~~~~~~~~~~~~~~~~~ + + Lexer for the Planning Domain Definition Language. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + + +from pygments.lexer import RegexLexer, words, include +from pygments.token import Punctuation, Keyword, Whitespace, Name, Comment, \ + Operator, Number + + +__all__ = ['PddlLexer'] + + +class PddlLexer(RegexLexer): + """ + A PDDL lexer. + + It should support up to PDDL 3.1. + """ + + name = 'PDDL' + aliases = ['pddl'] + filenames = ['*.pddl'] + # there doesn't really seem to be a PDDL homepage. + url = 'https://en.wikipedia.org/wiki/Planning_Domain_Definition_Language' + version_added = '2.19' + + tokens = { + 'root': [ + (r'\s+', Whitespace), + (r';.*$', Comment.Singleline), + include('keywords'), + include('builtins'), + (r'[()]', Punctuation), + (r'[=/*+><-]', Operator), + (r'[a-zA-Z][a-zA-Z0-9_-]*', Name), + (r'\?[a-zA-Z][a-zA-Z0-9_-]*', Name.Variable), + (r'[0-9]+\.[0-9]+', Number.Float), + (r'[0-9]+', Number.Integer), + ], + 'keywords': [ + (words(( + ':requirements', ':types', ':constants', + ':predicates', ':functions', ':action', ':agent', + ':parameters', ':precondition', ':effect', + ':durative-action', ':duration', ':condition', + ':derived', ':domain', ':objects', ':init', + ':goal', ':metric', ':length', ':serial', ':parallel', + # the following are requirements + ':strips', ':typing', ':negative-preconditions', + ':disjunctive-preconditions', ':equality', + ':existential-preconditions', ':universal-preconditions', + ':conditional-effects', ':fluents', ':numeric-fluents', + ':object-fluents', ':adl', ':durative-actions', + ':continuous-effects', ':derived-predicates', + ':time-intial-literals', ':preferences', + ':constraints', ':action-costs', ':multi-agent', + ':unfactored-privacy', ':factored-privacy', + ':non-deterministic' + ), suffix=r'\b'), Keyword) + ], + 'builtins': [ + (words(( + 'define', 'domain', 'object', 'either', 'and', + 'forall', 'preference', 'imply', 'or', 'exists', + 'not', 'when', 'assign', 'scale-up', 'scale-down', + 'increase', 'decrease', 'at', 'over', 'start', + 'end', 'all', 'problem', 'always', 'sometime', + 'within', 'at-most-once', 'sometime-after', + 'sometime-before', 'always-within', 'hold-during', + 'hold-after', 'minimize', 'maximize', + 'total-time', 'is-violated'), suffix=r'\b'), + Name.Builtin) + ] + } + diff --git a/lib/python3.12/site-packages/pygments/lexers/phix.py b/lib/python3.12/site-packages/pygments/lexers/phix.py new file mode 100644 index 0000000000000000000000000000000000000000..f0b03775e27efedbcd60b6f8ef0df0c93bb1eebc --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/phix.py @@ -0,0 +1,363 @@ +""" + pygments.lexers.phix + ~~~~~~~~~~~~~~~~~~~~ + + Lexers for Phix. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, words +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Whitespace + +__all__ = ['PhixLexer'] + + +class PhixLexer(RegexLexer): + """ + Pygments Lexer for Phix files (.exw). + See http://phix.x10.mx + """ + + name = 'Phix' + url = 'http://phix.x10.mx' + aliases = ['phix'] + filenames = ['*.exw'] + mimetypes = ['text/x-phix'] + version_added = '2.14' + + flags = re.MULTILINE # nb: **NOT** re.DOTALL! (totally spanners comment handling) + + preproc = ( + 'ifdef', 'elsifdef', 'elsedef' + ) + # Note these lists are auto-generated by pwa/p2js.exw, when pwa\src\p2js_keywords.e (etc) + # change, though of course subsequent copy/commit/pull requests are all manual steps. + types = ( + 'string', 'nullable_string', 'atom_string', 'atom', 'bool', 'boolean', + 'cdCanvan', 'cdCanvas', 'complex', 'CURLcode', 'dictionary', 'int', + 'integer', 'Ihandle', 'Ihandles', 'Ihandln', 'mpfr', 'mpq', 'mpz', + 'mpz_or_string', 'number', 'rid_string', 'seq', 'sequence', 'timedate', + 'object' + ) + keywords = ( + 'abstract', 'class', 'continue', 'export', 'extends', 'nullable', + 'private', 'public', 'static', 'struct', 'trace', + 'and', 'break', 'by', 'case', 'catch', 'const', 'constant', 'debug', + 'default', 'do', 'else', 'elsif', 'end', 'enum', 'exit', 'fallthru', + 'fallthrough', 'for', 'forward', 'function', 'global', 'if', 'in', + 'include', 'js', 'javascript', 'javascript_semantics', 'let', 'not', + 'or', 'procedure', 'profile', 'profile_time', 'return', 'safe_mode', + 'switch', 'then', 'to', 'try', 'type', 'type_check', 'until', 'warning', + 'while', 'with', 'without', 'xor' + ) + routines = ( + 'abort', 'abs', 'adjust_timedate', 'and_bits', 'and_bitsu', 'apply', + 'append', 'arccos', 'arcsin', 'arctan', 'assert', 'atan2', + 'atom_to_float32', 'atom_to_float64', 'bankers_rounding', 'beep', + 'begins', 'binary_search', 'bits_to_int', 'bk_color', 'bytes_to_int', + 'call_func', 'call_proc', 'cdCanvasActivate', 'cdCanvasArc', + 'cdCanvasBegin', 'cdCanvasBox', 'cdCanvasChord', 'cdCanvasCircle', + 'cdCanvasClear', 'cdCanvasEnd', 'cdCanvasFlush', 'cdCanvasFont', + 'cdCanvasGetImageRGB', 'cdCanvasGetSize', 'cdCanvasGetTextAlignment', + 'cdCanvasGetTextSize', 'cdCanvasLine', 'cdCanvasMark', + 'cdCanvasMarkSize', 'cdCanvasMultiLineVectorText', 'cdCanvasPixel', + 'cdCanvasRect', 'cdCanvasRoundedBox', 'cdCanvasRoundedRect', + 'cdCanvasSector', 'cdCanvasSetAttribute', 'cdCanvasSetBackground', + 'cdCanvasSetFillMode', 'cdCanvasSetForeground', + 'cdCanvasSetInteriorStyle', 'cdCanvasSetLineStyle', + 'cdCanvasSetLineWidth', 'cdCanvasSetTextAlignment', 'cdCanvasText', + 'cdCanvasSetTextOrientation', 'cdCanvasGetTextOrientation', + 'cdCanvasVectorText', 'cdCanvasVectorTextDirection', + 'cdCanvasVectorTextSize', 'cdCanvasVertex', 'cdCreateCanvas', + 'cdDecodeAlpha', 'cdDecodeColor', 'cdDecodeColorAlpha', 'cdEncodeAlpha', + 'cdEncodeColor', 'cdEncodeColorAlpha', 'cdKillCanvas', 'cdVersion', + 'cdVersionDate', 'ceil', 'change_timezone', 'choose', 'clear_screen', + 'columnize', 'command_line', 'compare', 'complex_abs', 'complex_add', + 'complex_arg', 'complex_conjugate', 'complex_cos', 'complex_cosh', + 'complex_div', 'complex_exp', 'complex_imag', 'complex_inv', + 'complex_log', 'complex_mul', 'complex_neg', 'complex_new', + 'complex_norm', 'complex_power', 'complex_rho', 'complex_real', + 'complex_round', 'complex_sin', 'complex_sinh', 'complex_sprint', + 'complex_sqrt', 'complex_sub', 'complex_theta', 'concat', 'cos', + 'crash', 'custom_sort', 'date', 'day_of_week', 'day_of_year', + 'days_in_month', 'decode_base64', 'decode_flags', 'deep_copy', 'deld', + 'deserialize', 'destroy_dict', 'destroy_queue', 'destroy_stack', + 'dict_name', 'dict_size', 'elapsed', 'elapsed_short', 'encode_base64', + 'equal', 'even', 'exp', 'extract', 'factorial', 'factors', + 'file_size_k', 'find', 'find_all', 'find_any', 'find_replace', 'filter', + 'flatten', 'float32_to_atom', 'float64_to_atom', 'floor', + 'format_timedate', 'free_console', 'from_polar', 'gcd', 'get_file_base', + 'get_file_extension', 'get_file_name', 'get_file_name_and_path', + 'get_file_path', 'get_file_path_and_name', 'get_maxprime', 'get_prime', + 'get_primes', 'get_primes_le', 'get_proper_dir', 'get_proper_path', + 'get_rand', 'get_routine_info', 'get_test_abort', 'get_test_logfile', + 'get_test_pause', 'get_test_verbosity', 'get_tzid', 'getd', 'getdd', + 'getd_all_keys', 'getd_by_index', 'getd_index', 'getd_partial_key', + 'glAttachShader', 'glBindBuffer', 'glBindTexture', 'glBufferData', + 'glCanvasSpecialText', 'glClear', 'glClearColor', 'glColor', + 'glCompileShader', 'glCreateBuffer', 'glCreateProgram', + 'glCreateShader', 'glCreateTexture', 'glDeleteProgram', + 'glDeleteShader', 'glDrawArrays', 'glEnable', + 'glEnableVertexAttribArray', 'glFloat32Array', 'glInt32Array', + 'glFlush', 'glGetAttribLocation', 'glGetError', 'glGetProgramInfoLog', + 'glGetProgramParameter', 'glGetShaderInfoLog', 'glGetShaderParameter', + 'glGetUniformLocation', 'glLinkProgram', 'glLoadIdentity', + 'glMatrixMode', 'glOrtho', 'glRotatef', 'glShadeModel', + 'glShaderSource', 'glSimpleA7texcoords', 'glTexImage2Dc', + 'glTexParameteri', 'glTranslate', 'glUniform1f', 'glUniform1i', + 'glUniformMatrix4fv', 'glUseProgram', 'glVertex', + 'glVertexAttribPointer', 'glViewport', 'head', 'hsv_to_rgb', 'iff', + 'iif', 'include_file', 'incl0de_file', 'insert', 'instance', + 'int_to_bits', 'int_to_bytes', 'is_dict', 'is_integer', 's_leap_year', + 'is_prime', 'is_prime2', 'islower', 'isupper', 'Icallback', + 'iup_isdouble', 'iup_isprint', 'iup_XkeyBase', 'IupAppend', 'IupAlarm', + 'IupBackgroundBox', 'IupButton', 'IupCalendar', 'IupCanvas', + 'IupClipboard', 'IupClose', 'IupCloseOnEscape', 'IupControlsOpen', + 'IupDatePick', 'IupDestroy', 'IupDialog', 'IupDrawArc', 'IupDrawBegin', + 'IupDrawEnd', 'IupDrawGetSize', 'IupDrawGetTextSize', 'IupDrawLine', + 'IupDrawRectangle', 'IupDrawText', 'IupExpander', 'IupFill', + 'IupFlatLabel', 'IupFlatList', 'IupFlatTree', 'IupFlush', 'IupFrame', + 'IupGetAttribute', 'IupGetAttributeId', 'IupGetAttributePtr', + 'IupGetBrother', 'IupGetChild', 'IupGetChildCount', 'IupGetClassName', + 'IupGetDialog', 'IupGetDialogChild', 'IupGetDouble', 'IupGetFocus', + 'IupGetGlobal', 'IupGetGlobalInt', 'IupGetGlobalIntInt', 'IupGetInt', + 'IupGetInt2', 'IupGetIntId', 'IupGetIntInt', 'IupGetParent', + 'IupGLCanvas', 'IupGLCanvasOpen', 'IupGLMakeCurrent', 'IupGraph', + 'IupHbox', 'IupHide', 'IupImage', 'IupImageRGBA', 'IupItem', + 'iupKeyCodeToName', 'IupLabel', 'IupLink', 'IupList', 'IupMap', + 'IupMenu', 'IupMenuItem', 'IupMessage', 'IupMessageDlg', 'IupMultiBox', + 'IupMultiLine', 'IupNextField', 'IupNormaliser', 'IupOpen', + 'IupPlayInput', 'IupPopup', 'IupPreviousField', 'IupProgressBar', + 'IupRadio', 'IupRecordInput', 'IupRedraw', 'IupRefresh', + 'IupRefreshChildren', 'IupSeparator', 'IupSetAttribute', + 'IupSetAttributes', 'IupSetAttributeHandle', 'IupSetAttributeId', + 'IupSetAttributePtr', 'IupSetCallback', 'IupSetCallbacks', + 'IupSetDouble', 'IupSetFocus', 'IupSetGlobal', 'IupSetGlobalInt', + 'IupSetGlobalFunction', 'IupSetHandle', 'IupSetInt', + 'IupSetStrAttribute', 'IupSetStrGlobal', 'IupShow', 'IupShowXY', + 'IupSplit', 'IupStoreAttribute', 'IupSubmenu', 'IupTable', + 'IupTableClearSelected', 'IupTableClick_cb', 'IupTableGetSelected', + 'IupTableResize_cb', 'IupTableSetData', 'IupTabs', 'IupText', + 'IupTimer', 'IupToggle', 'IupTreeAddNodes', 'IupTreeView', 'IupUpdate', + 'IupValuator', 'IupVbox', 'join', 'join_by', 'join_path', 'k_perm', + 'largest', 'lcm', 'length', 'log', 'log10', 'log2', 'lower', + 'm4_crossProduct', 'm4_inverse', 'm4_lookAt', 'm4_multiply', + 'm4_normalize', 'm4_perspective', 'm4_subtractVectors', 'm4_xRotate', + 'm4_yRotate', 'machine_bits', 'machine_word', 'match', 'match_all', + 'match_replace', 'max', 'maxsq', 'min', 'minsq', 'mod', 'mpfr_add', + 'mpfr_ceil', 'mpfr_cmp', 'mpfr_cmp_si', 'mpfr_const_pi', 'mpfr_div', + 'mpfr_div_si', 'mpfr_div_z', 'mpfr_floor', 'mpfr_free', 'mpfr_get_d', + 'mpfr_get_default_precision', 'mpfr_get_default_rounding_mode', + 'mpfr_get_fixed', 'mpfr_get_precision', 'mpfr_get_si', 'mpfr_init', + 'mpfr_inits', 'mpfr_init_set', 'mpfr_init_set_q', 'mpfr_init_set_z', + 'mpfr_mul', 'mpfr_mul_si', 'mpfr_pow_si', 'mpfr_set', 'mpfr_set_d', + 'mpfr_set_default_precision', 'mpfr_set_default_rounding_mode', + 'mpfr_set_precision', 'mpfr_set_q', 'mpfr_set_si', 'mpfr_set_str', + 'mpfr_set_z', 'mpfr_si_div', 'mpfr_si_sub', 'mpfr_sqrt', 'mpfr_sub', + 'mpfr_sub_si', 'mpq_abs', 'mpq_add', 'mpq_add_si', 'mpq_canonicalize', + 'mpq_cmp', 'mpq_cmp_si', 'mpq_div', 'mpq_div_2exp', 'mpq_free', + 'mpq_get_den', 'mpq_get_num', 'mpq_get_str', 'mpq_init', 'mpq_init_set', + 'mpq_init_set_si', 'mpq_init_set_str', 'mpq_init_set_z', 'mpq_inits', + 'mpq_inv', 'mpq_mul', 'mpq_neg', 'mpq_set', 'mpq_set_si', 'mpq_set_str', + 'mpq_set_z', 'mpq_sub', 'mpz_abs', 'mpz_add', 'mpz_addmul', + 'mpz_addmul_ui', 'mpz_addmul_si', 'mpz_add_si', 'mpz_add_ui', 'mpz_and', + 'mpz_bin_uiui', 'mpz_cdiv_q', 'mpz_cmp', 'mpz_cmp_si', 'mpz_divexact', + 'mpz_divexact_ui', 'mpz_divisible_p', 'mpz_divisible_ui_p', 'mpz_even', + 'mpz_fac_ui', 'mpz_factorstring', 'mpz_fdiv_q', 'mpz_fdiv_q_2exp', + 'mpz_fdiv_q_ui', 'mpz_fdiv_qr', 'mpz_fdiv_r', 'mpz_fdiv_ui', + 'mpz_fib_ui', 'mpz_fib2_ui', 'mpz_fits_atom', 'mpz_fits_integer', + 'mpz_free', 'mpz_gcd', 'mpz_gcd_ui', 'mpz_get_atom', 'mpz_get_integer', + 'mpz_get_short_str', 'mpz_get_str', 'mpz_init', 'mpz_init_set', + 'mpz_inits', 'mpz_invert', 'mpz_lcm', 'mpz_lcm_ui', 'mpz_max', + 'mpz_min', 'mpz_mod', 'mpz_mod_ui', 'mpz_mul', 'mpz_mul_2exp', + 'mpz_mul_d', 'mpz_mul_si', 'mpz_neg', 'mpz_nthroot', 'mpz_odd', + 'mpz_pollard_rho', 'mpz_pow_ui', 'mpz_powm', 'mpz_powm_ui', 'mpz_prime', + 'mpz_prime_factors', 'mpz_prime_mr', 'mpz_rand', 'mpz_rand_ui', + 'mpz_re_compose', 'mpz_remove', 'mpz_scan0', 'mpz_scan1', 'mpz_set', + 'mpz_set_d', 'mpz_set_si', 'mpz_set_str', 'mpz_set_v', 'mpz_sign', + 'mpz_sizeinbase', 'mpz_sqrt', 'mpz_sub', 'mpz_sub_si', 'mpz_sub_ui', + 'mpz_si_sub', 'mpz_tdiv_q_2exp', 'mpz_tdiv_r_2exp', 'mpz_tstbit', + 'mpz_ui_pow_ui', 'mpz_xor', 'named_dict', 'new_dict', 'new_queue', + 'new_stack', 'not_bits', 'not_bitsu', 'odd', 'or_all', 'or_allu', + 'or_bits', 'or_bitsu', 'ord', 'ordinal', 'ordinant', + 'override_timezone', 'pad', 'pad_head', 'pad_tail', 'parse_date_string', + 'papply', 'peep', 'peepn', 'peep_dict', 'permute', 'permutes', + 'platform', 'pop', 'popn', 'pop_dict', 'power', 'pp', 'ppEx', 'ppExf', + 'ppf', 'ppOpt', 'pq_add', 'pq_destroy', 'pq_empty', 'pq_new', 'pq_peek', + 'pq_pop', 'pq_pop_data', 'pq_size', 'prepend', 'prime_factors', + 'printf', 'product', 'proper', 'push', 'pushn', 'putd', 'puts', + 'queue_empty', 'queue_size', 'rand', 'rand_range', 'reinstate', + 'remainder', 'remove', 'remove_all', 'repeat', 'repeatch', 'replace', + 'requires', 'reverse', 'rfind', 'rgb', 'rmatch', 'rmdr', 'rnd', 'round', + 'routine_id', 'scanf', 'serialize', 'series', 'set_rand', + 'set_test_abort', 'set_test_logfile', 'set_test_module', + 'set_test_pause', 'set_test_verbosity', 'set_timedate_formats', + 'set_timezone', 'setd', 'setd_default', 'shorten', 'sha256', + 'shift_bits', 'shuffle', 'sign', 'sin', 'smallest', 'sort', + 'sort_columns', 'speak', 'splice', 'split', 'split_any', 'split_by', + 'sprint', 'sprintf', 'sq_abs', 'sq_add', 'sq_and', 'sq_and_bits', + 'sq_arccos', 'sq_arcsin', 'sq_arctan', 'sq_atom', 'sq_ceil', 'sq_cmp', + 'sq_cos', 'sq_div', 'sq_even', 'sq_eq', 'sq_floor', 'sq_floor_div', + 'sq_ge', 'sq_gt', 'sq_int', 'sq_le', 'sq_log', 'sq_log10', 'sq_log2', + 'sq_lt', 'sq_max', 'sq_min', 'sq_mod', 'sq_mul', 'sq_ne', 'sq_not', + 'sq_not_bits', 'sq_odd', 'sq_or', 'sq_or_bits', 'sq_power', 'sq_rand', + 'sq_remainder', 'sq_rmdr', 'sq_rnd', 'sq_round', 'sq_seq', 'sq_sign', + 'sq_sin', 'sq_sqrt', 'sq_str', 'sq_sub', 'sq_tan', 'sq_trunc', + 'sq_uminus', 'sq_xor', 'sq_xor_bits', 'sqrt', 'square_free', + 'stack_empty', 'stack_size', 'substitute', 'substitute_all', 'sum', + 'tail', 'tan', 'test_equal', 'test_fail', 'test_false', + 'test_not_equal', 'test_pass', 'test_summary', 'test_true', + 'text_color', 'throw', 'time', 'timedate_diff', 'timedelta', + 'to_integer', 'to_number', 'to_rgb', 'to_string', 'traverse_dict', + 'traverse_dict_partial_key', 'trim', 'trim_head', 'trim_tail', 'trunc', + 'tagset', 'tagstart', 'typeof', 'unique', 'unix_dict', 'upper', + 'utf8_to_utf32', 'utf32_to_utf8', 'version', 'vlookup', 'vslice', + 'wglGetProcAddress', 'wildcard_file', 'wildcard_match', 'with_rho', + 'with_theta', 'xml_new_doc', 'xml_new_element', 'xml_set_attribute', + 'xml_sprint', 'xor_bits', 'xor_bitsu', + 'accept', 'allocate', 'allocate_string', 'allow_break', 'ARM', + 'atom_to_float80', 'c_func', 'c_proc', 'call_back', 'chdir', + 'check_break', 'clearDib', 'close', 'closesocket', 'console', + 'copy_file', 'create', 'create_directory', 'create_thread', + 'curl_easy_cleanup', 'curl_easy_get_file', 'curl_easy_init', + 'curl_easy_perform', 'curl_easy_perform_ex', 'curl_easy_setopt', + 'curl_easy_strerror', 'curl_global_cleanup', 'curl_global_init', + 'curl_slist_append', 'curl_slist_free_all', 'current_dir', 'cursor', + 'define_c_func', 'define_c_proc', 'delete', 'delete_cs', 'delete_file', + 'dir', 'DLL', 'drawDib', 'drawShadedPolygonToDib', 'ELF32', 'ELF64', + 'enter_cs', 'eval', 'exit_thread', 'free', 'file_exists', 'final', + 'float80_to_atom', 'format', 'get_bytes', 'get_file_date', + 'get_file_size', 'get_file_type', 'get_interpreter', 'get_key', + 'get_socket_error', 'get_text', 'get_thread_exitcode', 'get_thread_id', + 'getc', 'getenv', 'gets', 'getsockaddr', 'glBegin', 'glCallList', + 'glFrustum', 'glGenLists', 'glGetString', 'glLight', 'glMaterial', + 'glNewList', 'glNormal', 'glPopMatrix', 'glPushMatrix', 'glRotate', + 'glEnd', 'glEndList', 'glTexImage2D', 'goto', 'GUI', 'icons', 'ilASM', + 'include_files', 'include_paths', 'init_cs', 'ip_to_string', + 'IupConfig', 'IupConfigDialogClosed', 'IupConfigDialogShow', + 'IupConfigGetVariableInt', 'IupConfigLoad', 'IupConfigSave', + 'IupConfigSetVariableInt', 'IupExitLoop', 'IupFileDlg', 'IupFileList', + 'IupGLSwapBuffers', 'IupHelp', 'IupLoopStep', 'IupMainLoop', + 'IupNormalizer', 'IupPlot', 'IupPlotAdd', 'IupPlotBegin', 'IupPlotEnd', + 'IupPlotInsert', 'IupSaveImage', 'IupTreeGetUserId', 'IupUser', + 'IupVersion', 'IupVersionDate', 'IupVersionNumber', 'IupVersionShow', + 'killDib', 'leave_cs', 'listen', 'manifest', 'mem_copy', 'mem_set', + 'mpfr_gamma', 'mpfr_printf', 'mpfr_sprintf', 'mpz_export', 'mpz_import', + 'namespace', 'new', 'newDib', 'open', 'open_dll', 'PE32', 'PE64', + 'peek', 'peek_string', 'peek1s', 'peek1u', 'peek2s', 'peek2u', 'peek4s', + 'peek4u', 'peek8s', 'peek8u', 'peekNS', 'peekns', 'peeknu', 'poke', + 'poke2', 'poke4', 'poke8', 'pokeN', 'poke_string', 'poke_wstring', + 'position', 'progress', 'prompt_number', 'prompt_string', 'read_file', + 'read_lines', 'recv', 'resume_thread', 'seek', 'select', 'send', + 'setHandler', 'shutdown', 'sleep', 'SO', 'sockaddr_in', 'socket', + 'split_path', 'suspend_thread', 'system', 'system_exec', 'system_open', + 'system_wait', 'task_clock_start', 'task_clock_stop', 'task_create', + 'task_delay', 'task_list', 'task_schedule', 'task_self', 'task_status', + 'task_suspend', 'task_yield', 'thread_safe_string', 'try_cs', + 'utf8_to_utf16', 'utf16_to_utf8', 'utf16_to_utf32', 'utf32_to_utf16', + 'video_config', 'WSACleanup', 'wait_thread', 'walk_dir', 'where', + 'write_lines', 'wait_key' + ) + constants = ( + 'ANY_QUEUE', 'ASCENDING', 'BLACK', 'BLOCK_CURSOR', 'BLUE', + 'BRIGHT_CYAN', 'BRIGHT_BLUE', 'BRIGHT_GREEN', 'BRIGHT_MAGENTA', + 'BRIGHT_RED', 'BRIGHT_WHITE', 'BROWN', 'C_DWORD', 'C_INT', 'C_POINTER', + 'C_USHORT', 'C_WORD', 'CD_AMBER', 'CD_BLACK', 'CD_BLUE', 'CD_BOLD', + 'CD_BOLD_ITALIC', 'CD_BOX', 'CD_CENTER', 'CD_CIRCLE', 'CD_CLOSED_LINES', + 'CD_CONTINUOUS', 'CD_CUSTOM', 'CD_CYAN', 'CD_DARK_BLUE', 'CD_DARK_CYAN', + 'CD_DARK_GRAY', 'CD_DARK_GREY', 'CD_DARK_GREEN', 'CD_DARK_MAGENTA', + 'CD_DARK_RED', 'CD_DARK_YELLOW', 'CD_DASH_DOT', 'CD_DASH_DOT_DOT', + 'CD_DASHED', 'CD_DBUFFER', 'CD_DEG2RAD', 'CD_DIAMOND', 'CD_DOTTED', + 'CD_EAST', 'CD_EVENODD', 'CD_FILL', 'CD_GL', 'CD_GRAY', 'CD_GREY', + 'CD_GREEN', 'CD_HATCH', 'CD_HOLLOW', 'CD_HOLLOW_BOX', + 'CD_HOLLOW_CIRCLE', 'CD_HOLLOW_DIAMOND', 'CD_INDIGO', 'CD_ITALIC', + 'CD_IUP', 'CD_IUPDBUFFER', 'CD_LIGHT_BLUE', 'CD_LIGHT_GRAY', + 'CD_LIGHT_GREY', 'CD_LIGHT_GREEN', 'CD_LIGHT_PARCHMENT', 'CD_MAGENTA', + 'CD_NAVY', 'CD_NORTH', 'CD_NORTH_EAST', 'CD_NORTH_WEST', 'CD_OLIVE', + 'CD_OPEN_LINES', 'CD_ORANGE', 'CD_PARCHMENT', 'CD_PATTERN', + 'CD_PRINTER', 'CD_PURPLE', 'CD_PLAIN', 'CD_PLUS', 'CD_QUERY', + 'CD_RAD2DEG', 'CD_RED', 'CD_SILVER', 'CD_SOLID', 'CD_SOUTH_EAST', + 'CD_SOUTH_WEST', 'CD_STAR', 'CD_STIPPLE', 'CD_STRIKEOUT', + 'CD_UNDERLINE', 'CD_WEST', 'CD_WHITE', 'CD_WINDING', 'CD_VIOLET', + 'CD_X', 'CD_YELLOW', 'CURLE_OK', 'CURLOPT_MAIL_FROM', + 'CURLOPT_MAIL_RCPT', 'CURLOPT_PASSWORD', 'CURLOPT_READDATA', + 'CURLOPT_READFUNCTION', 'CURLOPT_SSL_VERIFYPEER', + 'CURLOPT_SSL_VERIFYHOST', 'CURLOPT_UPLOAD', 'CURLOPT_URL', + 'CURLOPT_USE_SSL', 'CURLOPT_USERNAME', 'CURLOPT_VERBOSE', + 'CURLOPT_WRITEFUNCTION', 'CURLUSESSL_ALL', 'CYAN', 'D_NAME', + 'D_ATTRIBUTES', 'D_SIZE', 'D_YEAR', 'D_MONTH', 'D_DAY', 'D_HOUR', + 'D_MINUTE', 'D_SECOND', 'D_CREATION', 'D_LASTACCESS', 'D_MODIFICATION', + 'DT_YEAR', 'DT_MONTH', 'DT_DAY', 'DT_HOUR', 'DT_MINUTE', 'DT_SECOND', + 'DT_DOW', 'DT_MSEC', 'DT_DOY', 'DT_GMT', 'EULER', 'E_CODE', 'E_ADDR', + 'E_LINE', 'E_RTN', 'E_NAME', 'E_FILE', 'E_PATH', 'E_USER', 'false', + 'False', 'FALSE', 'FIFO_QUEUE', 'FILETYPE_DIRECTORY', 'FILETYPE_FILE', + 'GET_EOF', 'GET_FAIL', 'GET_IGNORE', 'GET_SUCCESS', + 'GL_AMBIENT_AND_DIFFUSE', 'GL_ARRAY_BUFFER', 'GL_CLAMP', + 'GL_CLAMP_TO_BORDER', 'GL_CLAMP_TO_EDGE', 'GL_COLOR_BUFFER_BIT', + 'GL_COMPILE', 'GL_COMPILE_STATUS', 'GL_CULL_FACE', + 'GL_DEPTH_BUFFER_BIT', 'GL_DEPTH_TEST', 'GL_EXTENSIONS', 'GL_FLAT', + 'GL_FLOAT', 'GL_FRAGMENT_SHADER', 'GL_FRONT', 'GL_LIGHT0', + 'GL_LIGHTING', 'GL_LINEAR', 'GL_LINK_STATUS', 'GL_MODELVIEW', + 'GL_NEAREST', 'GL_NO_ERROR', 'GL_NORMALIZE', 'GL_POSITION', + 'GL_PROJECTION', 'GL_QUAD_STRIP', 'GL_QUADS', 'GL_RENDERER', + 'GL_REPEAT', 'GL_RGB', 'GL_RGBA', 'GL_SMOOTH', 'GL_STATIC_DRAW', + 'GL_TEXTURE_2D', 'GL_TEXTURE_MAG_FILTER', 'GL_TEXTURE_MIN_FILTER', + 'GL_TEXTURE_WRAP_S', 'GL_TEXTURE_WRAP_T', 'GL_TRIANGLES', + 'GL_UNSIGNED_BYTE', 'GL_VENDOR', 'GL_VERSION', 'GL_VERTEX_SHADER', + 'GRAY', 'GREEN', 'GT_LF_STRIPPED', 'GT_WHOLE_FILE', 'INVLN10', + 'IUP_CLOSE', 'IUP_CONTINUE', 'IUP_DEFAULT', 'IUP_BLACK', 'IUP_BLUE', + 'IUP_BUTTON1', 'IUP_BUTTON3', 'IUP_CENTER', 'IUP_CYAN', 'IUP_DARK_BLUE', + 'IUP_DARK_CYAN', 'IUP_DARK_GRAY', 'IUP_DARK_GREY', 'IUP_DARK_GREEN', + 'IUP_DARK_MAGENTA', 'IUP_DARK_RED', 'IUP_GRAY', 'IUP_GREY', 'IUP_GREEN', + 'IUP_IGNORE', 'IUP_INDIGO', 'IUP_MAGENTA', 'IUP_MASK_INT', + 'IUP_MASK_UINT', 'IUP_MOUSEPOS', 'IUP_NAVY', 'IUP_OLIVE', 'IUP_RECTEXT', + 'IUP_RED', 'IUP_LIGHT_BLUE', 'IUP_LIGHT_GRAY', 'IUP_LIGHT_GREY', + 'IUP_LIGHT_GREEN', 'IUP_ORANGE', 'IUP_PARCHMENT', 'IUP_PURPLE', + 'IUP_SILVER', 'IUP_TEAL', 'IUP_VIOLET', 'IUP_WHITE', 'IUP_YELLOW', + 'K_BS', 'K_cA', 'K_cC', 'K_cD', 'K_cF5', 'K_cK', 'K_cM', 'K_cN', 'K_cO', + 'K_cP', 'K_cR', 'K_cS', 'K_cT', 'K_cW', 'K_CR', 'K_DEL', 'K_DOWN', + 'K_END', 'K_ESC', 'K_F1', 'K_F2', 'K_F3', 'K_F4', 'K_F5', 'K_F6', + 'K_F7', 'K_F8', 'K_F9', 'K_F10', 'K_F11', 'K_F12', 'K_HOME', 'K_INS', + 'K_LEFT', 'K_MIDDLE', 'K_PGDN', 'K_PGUP', 'K_RIGHT', 'K_SP', 'K_TAB', + 'K_UP', 'K_h', 'K_i', 'K_j', 'K_p', 'K_r', 'K_s', 'JS', 'LIFO_QUEUE', + 'LINUX', 'MAX_HEAP', 'MAGENTA', 'MIN_HEAP', 'Nan', 'NO_CURSOR', 'null', + 'NULL', 'PI', 'pp_Ascii', 'pp_Brkt', 'pp_Date', 'pp_File', 'pp_FltFmt', + 'pp_Indent', 'pp_IntCh', 'pp_IntFmt', 'pp_Maxlen', 'pp_Nest', + 'pp_Pause', 'pp_Q22', 'pp_StrFmt', 'RED', 'SEEK_OK', 'SLASH', + 'TEST_ABORT', 'TEST_CRASH', 'TEST_PAUSE', 'TEST_PAUSE_FAIL', + 'TEST_QUIET', 'TEST_SHOW_ALL', 'TEST_SHOW_FAILED', 'TEST_SUMMARY', + 'true', 'True', 'TRUE', 'VC_SCRNLINES', 'WHITE', 'WINDOWS', 'YELLOW' + ) + + tokens = { + 'root': [ + (r"\s+", Whitespace), + (r'/\*|--/\*|#\[', Comment.Multiline, 'comment'), + (r'(?://|--|#!).*$', Comment.Single), +#Alt: +# (r'//.*$|--.*$|#!.*$', Comment.Single), + (r'"([^"\\]|\\.)*"', String.Other), + (r'\'[^\']*\'', String.Other), + (r'`[^`]*`', String.Other), + + (words(types, prefix=r'\b', suffix=r'\b'), Name.Function), + (words(routines, prefix=r'\b', suffix=r'\b'), Name.Function), + (words(preproc, prefix=r'\b', suffix=r'\b'), Keyword.Declaration), + (words(keywords, prefix=r'\b', suffix=r'\b'), Keyword.Declaration), + (words(constants, prefix=r'\b', suffix=r'\b'), Name.Constant), + # Aside: Phix only supports/uses the ascii/non-unicode tilde + (r'!=|==|<<|>>|:=|[-~+/*%=<>&^|\.(){},?:\[\]$\\;#]', Operator), + (r'[\w-]+', Text) + ], + 'comment': [ + (r'[^*/#]+', Comment.Multiline), + (r'/\*|#\[', Comment.Multiline, '#push'), + (r'\*/|#\]', Comment.Multiline, '#pop'), + (r'[*/#]', Comment.Multiline) + ] + } diff --git a/lib/python3.12/site-packages/pygments/lexers/pony.py b/lib/python3.12/site-packages/pygments/lexers/pony.py new file mode 100644 index 0000000000000000000000000000000000000000..055423a4694c3aa9ecb5f3ff6e64d17d6487be93 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/pony.py @@ -0,0 +1,93 @@ +""" + pygments.lexers.pony + ~~~~~~~~~~~~~~~~~~~~ + + Lexers for Pony and related languages. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, bygroups, words +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation + +__all__ = ['PonyLexer'] + + +class PonyLexer(RegexLexer): + """ + For Pony source code. + """ + + name = 'Pony' + aliases = ['pony'] + filenames = ['*.pony'] + url = 'https://www.ponylang.io' + version_added = '2.4' + + _caps = r'(iso|trn|ref|val|box|tag)' + + tokens = { + 'root': [ + (r'\n', Text), + (r'[^\S\n]+', Text), + (r'//.*\n', Comment.Single), + (r'/\*', Comment.Multiline, 'nested_comment'), + (r'"""(?:.|\n)*?"""', String.Doc), + (r'"', String, 'string'), + (r'\'.*\'', String.Char), + (r'=>|[]{}:().~;,|&!^?[]', Punctuation), + (words(( + 'addressof', 'and', 'as', 'consume', 'digestof', 'is', 'isnt', + 'not', 'or'), + suffix=r'\b'), + Operator.Word), + (r'!=|==|<<|>>|[-+/*%=<>]', Operator), + (words(( + 'box', 'break', 'compile_error', 'compile_intrinsic', + 'continue', 'do', 'else', 'elseif', 'embed', 'end', 'error', + 'for', 'if', 'ifdef', 'in', 'iso', 'lambda', 'let', 'match', + 'object', 'recover', 'ref', 'repeat', 'return', 'tag', 'then', + 'this', 'trn', 'try', 'until', 'use', 'var', 'val', 'where', + 'while', 'with', '#any', '#read', '#send', '#share'), + suffix=r'\b'), + Keyword), + (r'(actor|class|struct|primitive|interface|trait|type)((?:\s)+)', + bygroups(Keyword, Text), 'typename'), + (r'(new|fun|be)((?:\s)+)', bygroups(Keyword, Text), 'methodname'), + (words(( + 'I8', 'U8', 'I16', 'U16', 'I32', 'U32', 'I64', 'U64', 'I128', + 'U128', 'ILong', 'ULong', 'ISize', 'USize', 'F32', 'F64', + 'Bool', 'Pointer', 'None', 'Any', 'Array', 'String', + 'Iterator'), + suffix=r'\b'), + Name.Builtin.Type), + (r'_?[A-Z]\w*', Name.Type), + (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+', Number.Float), + (r'0x[0-9a-fA-F]+', Number.Hex), + (r'\d+', Number.Integer), + (r'(true|false)\b', Name.Builtin), + (r'_\d*', Name), + (r'_?[a-z][\w\']*', Name) + ], + 'typename': [ + (_caps + r'?((?:\s)*)(_?[A-Z]\w*)', + bygroups(Keyword, Text, Name.Class), '#pop') + ], + 'methodname': [ + (_caps + r'?((?:\s)*)(_?[a-z]\w*)', + bygroups(Keyword, Text, Name.Function), '#pop') + ], + 'nested_comment': [ + (r'[^*/]+', Comment.Multiline), + (r'/\*', Comment.Multiline, '#push'), + (r'\*/', Comment.Multiline, '#pop'), + (r'[*/]', Comment.Multiline) + ], + 'string': [ + (r'"', String, '#pop'), + (r'\\"', String), + (r'[^\\"]+', String) + ] + } diff --git a/lib/python3.12/site-packages/pygments/lexers/procfile.py b/lib/python3.12/site-packages/pygments/lexers/procfile.py new file mode 100644 index 0000000000000000000000000000000000000000..32619804f8888b592f51de2541573dcf8bc0f9ea --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/procfile.py @@ -0,0 +1,41 @@ +""" + pygments.lexers.procfile + ~~~~~~~~~~~~~~~~~~~~~~~~ + + Lexer for Procfile file format. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, bygroups +from pygments.token import Name, Number, String, Text, Punctuation + +__all__ = ["ProcfileLexer"] + + +class ProcfileLexer(RegexLexer): + """ + Lexer for Procfile file format. + + The format is used to run processes on Heroku or is used by Foreman or + Honcho tools. + """ + name = 'Procfile' + url = 'https://devcenter.heroku.com/articles/procfile#procfile-format' + aliases = ['procfile'] + filenames = ['Procfile'] + version_added = '2.10' + + tokens = { + 'root': [ + (r'^([a-z]+)(:)', bygroups(Name.Label, Punctuation)), + (r'\s+', Text.Whitespace), + (r'"[^"]*"', String), + (r"'[^']*'", String), + (r'[0-9]+', Number.Integer), + (r'\$[a-zA-Z_][\w]*', Name.Variable), + (r'(\w+)(=)(\w+)', bygroups(Name.Variable, Punctuation, String)), + (r'([\w\-\./]+)', Text), + ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/prolog.py b/lib/python3.12/site-packages/pygments/lexers/prolog.py new file mode 100644 index 0000000000000000000000000000000000000000..7bf951c1c4fdc68c5748ef7eba807b41ea5f8847 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/prolog.py @@ -0,0 +1,318 @@ +""" + pygments.lexers.prolog + ~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for Prolog and Prolog-like languages. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, bygroups +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation + +__all__ = ['PrologLexer', 'LogtalkLexer'] + + +class PrologLexer(RegexLexer): + """ + Lexer for Prolog files. + """ + name = 'Prolog' + aliases = ['prolog'] + filenames = ['*.ecl', '*.prolog', '*.pro', '*.pl'] + mimetypes = ['text/x-prolog'] + url = 'https://en.wikipedia.org/wiki/Prolog' + version_added = '' + + tokens = { + 'root': [ + (r'/\*', Comment.Multiline, 'nested-comment'), + (r'%.*', Comment.Single), + # character literal + (r'0\'.', String.Char), + (r'0b[01]+', Number.Bin), + (r'0o[0-7]+', Number.Oct), + (r'0x[0-9a-fA-F]+', Number.Hex), + # literal with prepended base + (r'\d\d?\'[a-zA-Z0-9]+', Number.Integer), + (r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float), + (r'\d+', Number.Integer), + (r'[\[\](){}|.,;!]', Punctuation), + (r':-|-->', Punctuation), + (r'"(?:\\x[0-9a-fA-F]+\\|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|' + r'\\[0-7]+\\|\\["\\abcefnrstv]|[^\\"])*"', String.Double), + (r"'(?:''|[^'])*'", String.Atom), # quoted atom + # Needs to not be followed by an atom. + # (r'=(?=\s|[a-zA-Z\[])', Operator), + (r'is\b', Operator), + (r'(<|>|=<|>=|==|=:=|=|/|//|\*|\+|-)(?=\s|[a-zA-Z0-9\[])', + Operator), + (r'(mod|div|not)\b', Operator), + (r'_', Keyword), # The don't-care variable + (r'([a-z]+)(:)', bygroups(Name.Namespace, Punctuation)), + (r'([a-z\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]' + r'[\w$\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]*)' + r'(\s*)(:-|-->)', + bygroups(Name.Function, Text, Operator)), # function defn + (r'([a-z\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]' + r'[\w$\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]*)' + r'(\s*)(\()', + bygroups(Name.Function, Text, Punctuation)), + (r'[a-z\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]' + r'[\w$\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]*', + String.Atom), # atom, characters + # This one includes ! + (r'[#&*+\-./:<=>?@\\^~\u00a1-\u00bf\u2010-\u303f]+', + String.Atom), # atom, graphics + (r'[A-Z_]\w*', Name.Variable), + (r'\s+|[\u2000-\u200f\ufff0-\ufffe\uffef]', Text), + ], + 'nested-comment': [ + (r'\*/', Comment.Multiline, '#pop'), + (r'/\*', Comment.Multiline, '#push'), + (r'[^*/]+', Comment.Multiline), + (r'[*/]', Comment.Multiline), + ], + } + + def analyse_text(text): + """Competes with IDL and Visual Prolog on *.pro""" + if ':-' in text: + # Visual Prolog also uses :- + return 0.5 + else: + return 0 + + +class LogtalkLexer(RegexLexer): + """ + For Logtalk source code. + """ + + name = 'Logtalk' + url = 'http://logtalk.org/' + aliases = ['logtalk'] + filenames = ['*.lgt', '*.logtalk'] + mimetypes = ['text/x-logtalk'] + version_added = '0.10' + + tokens = { + 'root': [ + # Directives + (r'^\s*:-\s', Punctuation, 'directive'), + # Comments + (r'%.*?\n', Comment), + (r'/\*(.|\n)*?\*/', Comment), + # Whitespace + (r'\n', Text), + (r'\s+', Text), + # Numbers + (r"0'[\\]?.", Number), + (r'0b[01]+', Number.Bin), + (r'0o[0-7]+', Number.Oct), + (r'0x[0-9a-fA-F]+', Number.Hex), + (r'\d+\.?\d*((e|E)(\+|-)?\d+)?', Number), + # Variables + (r'([A-Z_][a-zA-Z0-9_]*)', Name.Variable), + # Event handlers + (r'(after|before)(?=[(])', Keyword), + # Message forwarding handler + (r'forward(?=[(])', Keyword), + # Execution-context methods + (r'(context|parameter|this|se(lf|nder))(?=[(])', Keyword), + # Reflection + (r'(current_predicate|predicate_property)(?=[(])', Keyword), + # DCGs and term expansion + (r'(expand_(goal|term)|(goal|term)_expansion|phrase)(?=[(])', Keyword), + # Entity + (r'(abolish|c(reate|urrent))_(object|protocol|category)(?=[(])', Keyword), + (r'(object|protocol|category)_property(?=[(])', Keyword), + # Entity relations + (r'co(mplements_object|nforms_to_protocol)(?=[(])', Keyword), + (r'extends_(object|protocol|category)(?=[(])', Keyword), + (r'imp(lements_protocol|orts_category)(?=[(])', Keyword), + (r'(instantiat|specializ)es_class(?=[(])', Keyword), + # Events + (r'(current_event|(abolish|define)_events)(?=[(])', Keyword), + # Flags + (r'(create|current|set)_logtalk_flag(?=[(])', Keyword), + # Compiling, loading, and library paths + (r'logtalk_(compile|l(ibrary_path|oad|oad_context)|make(_target_action)?)(?=[(])', Keyword), + (r'\blogtalk_make\b', Keyword), + # Database + (r'(clause|retract(all)?)(?=[(])', Keyword), + (r'a(bolish|ssert(a|z))(?=[(])', Keyword), + # Control constructs + (r'(ca(ll|tch)|throw)(?=[(])', Keyword), + (r'(fa(il|lse)|true|(instantiation|system)_error)\b', Keyword), + (r'(uninstantiation|type|domain|existence|permission|representation|evaluation|resource|syntax)_error(?=[(])', Keyword), + # All solutions + (r'((bag|set)of|f(ind|or)all)(?=[(])', Keyword), + # Multi-threading predicates + (r'threaded(_(ca(ll|ncel)|once|ignore|exit|peek|wait|notify))?(?=[(])', Keyword), + # Engine predicates + (r'threaded_engine(_(create|destroy|self|next|next_reified|yield|post|fetch))?(?=[(])', Keyword), + # Term unification + (r'(subsumes_term|unify_with_occurs_check)(?=[(])', Keyword), + # Term creation and decomposition + (r'(functor|arg|copy_term|numbervars|term_variables)(?=[(])', Keyword), + # Evaluable functors + (r'(div|rem|m(ax|in|od)|abs|sign)(?=[(])', Keyword), + (r'float(_(integer|fractional)_part)?(?=[(])', Keyword), + (r'(floor|t(an|runcate)|round|ceiling)(?=[(])', Keyword), + # Other arithmetic functors + (r'(cos|a(cos|sin|tan|tan2)|exp|log|s(in|qrt)|xor)(?=[(])', Keyword), + # Term testing + (r'(var|atom(ic)?|integer|float|c(allable|ompound)|n(onvar|umber)|ground|acyclic_term)(?=[(])', Keyword), + # Term comparison + (r'compare(?=[(])', Keyword), + # Stream selection and control + (r'(curren|se)t_(in|out)put(?=[(])', Keyword), + (r'(open|close)(?=[(])', Keyword), + (r'flush_output(?=[(])', Keyword), + (r'(at_end_of_stream|flush_output)\b', Keyword), + (r'(stream_property|at_end_of_stream|set_stream_position)(?=[(])', Keyword), + # Character and byte input/output + (r'(nl|(get|peek|put)_(byte|c(har|ode)))(?=[(])', Keyword), + (r'\bnl\b', Keyword), + # Term input/output + (r'read(_term)?(?=[(])', Keyword), + (r'write(q|_(canonical|term))?(?=[(])', Keyword), + (r'(current_)?op(?=[(])', Keyword), + (r'(current_)?char_conversion(?=[(])', Keyword), + # Atomic term processing + (r'atom_(length|c(hars|o(ncat|des)))(?=[(])', Keyword), + (r'(char_code|sub_atom)(?=[(])', Keyword), + (r'number_c(har|ode)s(?=[(])', Keyword), + # Implementation defined hooks functions + (r'(se|curren)t_prolog_flag(?=[(])', Keyword), + (r'\bhalt\b', Keyword), + (r'halt(?=[(])', Keyword), + # Message sending operators + (r'(::|:|\^\^)', Operator), + # External call + (r'[{}]', Keyword), + # Logic and control + (r'(ignore|once)(?=[(])', Keyword), + (r'\brepeat\b', Keyword), + # Sorting + (r'(key)?sort(?=[(])', Keyword), + # Bitwise functors + (r'(>>|<<|/\\|\\\\|\\)', Operator), + # Predicate aliases + (r'\bas\b', Operator), + # Arithmetic evaluation + (r'\bis\b', Keyword), + # Arithmetic comparison + (r'(=:=|=\\=|<|=<|>=|>)', Operator), + # Term creation and decomposition + (r'=\.\.', Operator), + # Term unification + (r'(=|\\=)', Operator), + # Term comparison + (r'(==|\\==|@=<|@<|@>=|@>)', Operator), + # Evaluable functors + (r'(//|[-+*/])', Operator), + (r'\b(e|pi|div|mod|rem)\b', Operator), + # Other arithmetic functors + (r'\b\*\*\b', Operator), + # DCG rules + (r'-->', Operator), + # Control constructs + (r'([!;]|->)', Operator), + # Logic and control + (r'\\+', Operator), + # Mode operators + (r'[?@]', Operator), + # Existential quantifier + (r'\^', Operator), + # Punctuation + (r'[()\[\],.|]', Text), + # Atoms + (r"[a-z][a-zA-Z0-9_]*", Text), + (r"'", String, 'quoted_atom'), + # Double-quoted terms + (r'"', String, 'double_quoted_term'), + ], + + 'quoted_atom': [ + (r"''", String), + (r"'", String, '#pop'), + (r'\\([\\abfnrtv"\']|(x[a-fA-F0-9]+|[0-7]+)\\)', String.Escape), + (r"[^\\'\n]+", String), + (r'\\', String), + ], + + 'double_quoted_term': [ + (r'""', String), + (r'"', String, '#pop'), + (r'\\([\\abfnrtv"\']|(x[a-fA-F0-9]+|[0-7]+)\\)', String.Escape), + (r'[^\\"\n]+', String), + (r'\\', String), + ], + + 'directive': [ + # Conditional compilation directives + (r'(el)?if(?=[(])', Keyword, 'root'), + (r'(e(lse|ndif))(?=[.])', Keyword, 'root'), + # Entity directives + (r'(category|object|protocol)(?=[(])', Keyword, 'entityrelations'), + (r'(end_(category|object|protocol))(?=[.])', Keyword, 'root'), + # Predicate scope directives + (r'(public|protected|private)(?=[(])', Keyword, 'root'), + # Other directives + (r'e(n(coding|sure_loaded)|xport)(?=[(])', Keyword, 'root'), + (r'in(clude|itialization|fo)(?=[(])', Keyword, 'root'), + (r'(built_in|dynamic|synchronized|threaded)(?=[.])', Keyword, 'root'), + (r'(alias|d(ynamic|iscontiguous)|m(eta_(non_terminal|predicate)|ode|ultifile)|s(et_(logtalk|prolog)_flag|ynchronized))(?=[(])', Keyword, 'root'), + (r'op(?=[(])', Keyword, 'root'), + (r'(c(alls|oinductive)|module|reexport|use(s|_module))(?=[(])', Keyword, 'root'), + (r'[a-z][a-zA-Z0-9_]*(?=[(])', Text, 'root'), + (r'[a-z][a-zA-Z0-9_]*(?=[.])', Text, 'root'), + ], + + 'entityrelations': [ + (r'(complements|extends|i(nstantiates|mp(lements|orts))|specializes)(?=[(])', Keyword), + # Numbers + (r"0'[\\]?.", Number), + (r'0b[01]+', Number.Bin), + (r'0o[0-7]+', Number.Oct), + (r'0x[0-9a-fA-F]+', Number.Hex), + (r'\d+\.?\d*((e|E)(\+|-)?\d+)?', Number), + # Variables + (r'([A-Z_][a-zA-Z0-9_]*)', Name.Variable), + # Atoms + (r"[a-z][a-zA-Z0-9_]*", Text), + (r"'", String, 'quoted_atom'), + # Double-quoted terms + (r'"', String, 'double_quoted_term'), + # End of entity-opening directive + (r'([)]\.)', Text, 'root'), + # Scope operator + (r'(::)', Operator), + # Punctuation + (r'[()\[\],.|]', Text), + # Comments + (r'%.*?\n', Comment), + (r'/\*(.|\n)*?\*/', Comment), + # Whitespace + (r'\n', Text), + (r'\s+', Text), + ] + } + + def analyse_text(text): + if ':- object(' in text: + return 1.0 + elif ':- protocol(' in text: + return 1.0 + elif ':- category(' in text: + return 1.0 + elif re.search(r'^:-\s[a-z]', text, re.M): + return 0.9 + else: + return 0.0 diff --git a/lib/python3.12/site-packages/pygments/lexers/python.py b/lib/python3.12/site-packages/pygments/lexers/python.py new file mode 100644 index 0000000000000000000000000000000000000000..805f6ff2ac778176926cbdb40eca17ef4c93ee70 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/python.py @@ -0,0 +1,1201 @@ +""" + pygments.lexers.python + ~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for Python and related languages. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import keyword + +from pygments.lexer import DelegatingLexer, RegexLexer, include, \ + bygroups, using, default, words, combined, this +from pygments.util import get_bool_opt, shebang_matches +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Generic, Other, Error, Whitespace +from pygments import unistring as uni + +__all__ = ['PythonLexer', 'PythonConsoleLexer', 'PythonTracebackLexer', + 'Python2Lexer', 'Python2TracebackLexer', + 'CythonLexer', 'DgLexer', 'NumPyLexer'] + + +class PythonLexer(RegexLexer): + """ + For Python source code (version 3.x). + + .. versionchanged:: 2.5 + This is now the default ``PythonLexer``. It is still available as the + alias ``Python3Lexer``. + """ + + name = 'Python' + url = 'https://www.python.org' + aliases = ['python', 'py', 'sage', 'python3', 'py3', 'bazel', 'starlark', 'pyi'] + filenames = [ + '*.py', + '*.pyw', + # Type stubs + '*.pyi', + # Jython + '*.jy', + # Sage + '*.sage', + # SCons + '*.sc', + 'SConstruct', + 'SConscript', + # Skylark/Starlark (used by Bazel, Buck, and Pants) + '*.bzl', + 'BUCK', + 'BUILD', + 'BUILD.bazel', + 'WORKSPACE', + # Twisted Application infrastructure + '*.tac', + ] + mimetypes = ['text/x-python', 'application/x-python', + 'text/x-python3', 'application/x-python3'] + version_added = '0.10' + + uni_name = f"[{uni.xid_start}][{uni.xid_continue}]*" + + def innerstring_rules(ttype): + return [ + # the old style '%s' % (...) string formatting (still valid in Py3) + (r'%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?' + '[hlL]?[E-GXc-giorsaux%]', String.Interpol), + # the new style '{}'.format(...) string formatting + (r'\{' + r'((\w+)((\.\w+)|(\[[^\]]+\]))*)?' # field name + r'(\![sra])?' # conversion + r'(\:(.?[<>=\^])?[-+ ]?#?0?(\d+)?,?(\.\d+)?[E-GXb-gnosx%]?)?' + r'\}', String.Interpol), + + # backslashes, quotes and formatting signs must be parsed one at a time + (r'[^\\\'"%{\n]+', ttype), + (r'[\'"\\]', ttype), + # unhandled string formatting sign + (r'%|(\{{1,2})', ttype) + # newlines are an error (use "nl" state) + ] + + def fstring_rules(ttype): + return [ + # Assuming that a '}' is the closing brace after format specifier. + # Sadly, this means that we won't detect syntax error. But it's + # more important to parse correct syntax correctly, than to + # highlight invalid syntax. + (r'\}', String.Interpol), + (r'\{', String.Interpol, 'expr-inside-fstring'), + # backslashes, quotes and formatting signs must be parsed one at a time + (r'[^\\\'"{}\n]+', ttype), + (r'[\'"\\]', ttype), + # newlines are an error (use "nl" state) + ] + + tokens = { + 'root': [ + (r'\n', Whitespace), + (r'^(\s*)([rRuUbB]{,2})("""(?:.|\n)*?""")', + bygroups(Whitespace, String.Affix, String.Doc)), + (r"^(\s*)([rRuUbB]{,2})('''(?:.|\n)*?''')", + bygroups(Whitespace, String.Affix, String.Doc)), + (r'\A#!.+$', Comment.Hashbang), + (r'#.*$', Comment.Single), + (r'\\\n', Text), + (r'\\', Text), + include('keywords'), + include('soft-keywords'), + (r'(def)((?:\s|\\\s)+)', bygroups(Keyword, Whitespace), 'funcname'), + (r'(class)((?:\s|\\\s)+)', bygroups(Keyword, Whitespace), 'classname'), + (r'(from)((?:\s|\\\s)+)', bygroups(Keyword.Namespace, Whitespace), + 'fromimport'), + (r'(import)((?:\s|\\\s)+)', bygroups(Keyword.Namespace, Whitespace), + 'import'), + include('expr'), + ], + 'expr': [ + # raw f-strings + ('(?i)(rf|fr)(""")', + bygroups(String.Affix, String.Double), + combined('rfstringescape', 'tdqf')), + ("(?i)(rf|fr)(''')", + bygroups(String.Affix, String.Single), + combined('rfstringescape', 'tsqf')), + ('(?i)(rf|fr)(")', + bygroups(String.Affix, String.Double), + combined('rfstringescape', 'dqf')), + ("(?i)(rf|fr)(')", + bygroups(String.Affix, String.Single), + combined('rfstringescape', 'sqf')), + # non-raw f-strings + ('([fF])(""")', bygroups(String.Affix, String.Double), + combined('fstringescape', 'tdqf')), + ("([fF])(''')", bygroups(String.Affix, String.Single), + combined('fstringescape', 'tsqf')), + ('([fF])(")', bygroups(String.Affix, String.Double), + combined('fstringescape', 'dqf')), + ("([fF])(')", bygroups(String.Affix, String.Single), + combined('fstringescape', 'sqf')), + # raw bytes and strings + ('(?i)(rb|br|r)(""")', + bygroups(String.Affix, String.Double), 'tdqs'), + ("(?i)(rb|br|r)(''')", + bygroups(String.Affix, String.Single), 'tsqs'), + ('(?i)(rb|br|r)(")', + bygroups(String.Affix, String.Double), 'dqs'), + ("(?i)(rb|br|r)(')", + bygroups(String.Affix, String.Single), 'sqs'), + # non-raw strings + ('([uU]?)(""")', bygroups(String.Affix, String.Double), + combined('stringescape', 'tdqs')), + ("([uU]?)(''')", bygroups(String.Affix, String.Single), + combined('stringescape', 'tsqs')), + ('([uU]?)(")', bygroups(String.Affix, String.Double), + combined('stringescape', 'dqs')), + ("([uU]?)(')", bygroups(String.Affix, String.Single), + combined('stringescape', 'sqs')), + # non-raw bytes + ('([bB])(""")', bygroups(String.Affix, String.Double), + combined('bytesescape', 'tdqs')), + ("([bB])(''')", bygroups(String.Affix, String.Single), + combined('bytesescape', 'tsqs')), + ('([bB])(")', bygroups(String.Affix, String.Double), + combined('bytesescape', 'dqs')), + ("([bB])(')", bygroups(String.Affix, String.Single), + combined('bytesescape', 'sqs')), + + (r'[^\S\n]+', Text), + include('numbers'), + (r'!=|==|<<|>>|:=|[-~+/*%=<>&^|.]', Operator), + (r'[]{}:(),;[]', Punctuation), + (r'(in|is|and|or|not)\b', Operator.Word), + include('expr-keywords'), + include('builtins'), + include('magicfuncs'), + include('magicvars'), + include('name'), + ], + 'expr-inside-fstring': [ + (r'[{([]', Punctuation, 'expr-inside-fstring-inner'), + # without format specifier + (r'(=\s*)?' # debug (https://bugs.python.org/issue36817) + r'(\![sraf])?' # conversion + r'\}', String.Interpol, '#pop'), + # with format specifier + # we'll catch the remaining '}' in the outer scope + (r'(=\s*)?' # debug (https://bugs.python.org/issue36817) + r'(\![sraf])?' # conversion + r':', String.Interpol, '#pop'), + (r'\s+', Whitespace), # allow new lines + include('expr'), + ], + 'expr-inside-fstring-inner': [ + (r'[{([]', Punctuation, 'expr-inside-fstring-inner'), + (r'[])}]', Punctuation, '#pop'), + (r'\s+', Whitespace), # allow new lines + include('expr'), + ], + 'expr-keywords': [ + # Based on https://docs.python.org/3/reference/expressions.html + (words(( + 'async for', 'await', 'else', 'for', 'if', 'lambda', + 'yield', 'yield from'), suffix=r'\b'), + Keyword), + (words(('True', 'False', 'None'), suffix=r'\b'), Keyword.Constant), + ], + 'keywords': [ + (words(( + 'assert', 'async', 'await', 'break', 'continue', 'del', 'elif', + 'else', 'except', 'finally', 'for', 'global', 'if', 'lambda', + 'pass', 'raise', 'nonlocal', 'return', 'try', 'while', 'yield', + 'yield from', 'as', 'with'), suffix=r'\b'), + Keyword), + (words(('True', 'False', 'None'), suffix=r'\b'), Keyword.Constant), + ], + 'soft-keywords': [ + # `match`, `case` and `_` soft keywords + (r'(^[ \t]*)' # at beginning of line + possible indentation + r'(match|case)\b' # a possible keyword + r'(?![ \t]*(?:' # not followed by... + r'[:,;=^&|@~)\]}]|(?:' + # characters and keywords that mean this isn't + # pattern matching (but None/True/False is ok) + r'|'.join(k for k in keyword.kwlist if k[0].islower()) + r')\b))', + bygroups(Text, Keyword), 'soft-keywords-inner'), + ], + 'soft-keywords-inner': [ + # optional `_` keyword + (r'(\s+)([^\n_]*)(_\b)', bygroups(Whitespace, using(this), Keyword)), + default('#pop') + ], + 'builtins': [ + (words(( + '__import__', 'abs', 'aiter', 'all', 'any', 'bin', 'bool', 'bytearray', + 'breakpoint', 'bytes', 'callable', 'chr', 'classmethod', 'compile', + 'complex', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', + 'filter', 'float', 'format', 'frozenset', 'getattr', 'globals', + 'hasattr', 'hash', 'hex', 'id', 'input', 'int', 'isinstance', + 'issubclass', 'iter', 'len', 'list', 'locals', 'map', 'max', + 'memoryview', 'min', 'next', 'object', 'oct', 'open', 'ord', 'pow', + 'print', 'property', 'range', 'repr', 'reversed', 'round', 'set', + 'setattr', 'slice', 'sorted', 'staticmethod', 'str', 'sum', 'super', + 'tuple', 'type', 'vars', 'zip'), prefix=r'(?>|[-~+/*%=<>&^|.]', Operator), + include('keywords'), + (r'(def)((?:\s|\\\s)+)', bygroups(Keyword, Whitespace), 'funcname'), + (r'(class)((?:\s|\\\s)+)', bygroups(Keyword, Whitespace), 'classname'), + (r'(from)((?:\s|\\\s)+)', bygroups(Keyword.Namespace, Whitespace), + 'fromimport'), + (r'(import)((?:\s|\\\s)+)', bygroups(Keyword.Namespace, Whitespace), + 'import'), + include('builtins'), + include('magicfuncs'), + include('magicvars'), + include('backtick'), + ('([rR]|[uUbB][rR]|[rR][uUbB])(""")', + bygroups(String.Affix, String.Double), 'tdqs'), + ("([rR]|[uUbB][rR]|[rR][uUbB])(''')", + bygroups(String.Affix, String.Single), 'tsqs'), + ('([rR]|[uUbB][rR]|[rR][uUbB])(")', + bygroups(String.Affix, String.Double), 'dqs'), + ("([rR]|[uUbB][rR]|[rR][uUbB])(')", + bygroups(String.Affix, String.Single), 'sqs'), + ('([uUbB]?)(""")', bygroups(String.Affix, String.Double), + combined('stringescape', 'tdqs')), + ("([uUbB]?)(''')", bygroups(String.Affix, String.Single), + combined('stringescape', 'tsqs')), + ('([uUbB]?)(")', bygroups(String.Affix, String.Double), + combined('stringescape', 'dqs')), + ("([uUbB]?)(')", bygroups(String.Affix, String.Single), + combined('stringescape', 'sqs')), + include('name'), + include('numbers'), + ], + 'keywords': [ + (words(( + 'assert', 'break', 'continue', 'del', 'elif', 'else', 'except', + 'exec', 'finally', 'for', 'global', 'if', 'lambda', 'pass', + 'print', 'raise', 'return', 'try', 'while', 'yield', + 'yield from', 'as', 'with'), suffix=r'\b'), + Keyword), + ], + 'builtins': [ + (words(( + '__import__', 'abs', 'all', 'any', 'apply', 'basestring', 'bin', + 'bool', 'buffer', 'bytearray', 'bytes', 'callable', 'chr', 'classmethod', + 'cmp', 'coerce', 'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod', + 'enumerate', 'eval', 'execfile', 'exit', 'file', 'filter', 'float', + 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'hex', 'id', + 'input', 'int', 'intern', 'isinstance', 'issubclass', 'iter', 'len', + 'list', 'locals', 'long', 'map', 'max', 'min', 'next', 'object', + 'oct', 'open', 'ord', 'pow', 'property', 'range', 'raw_input', 'reduce', + 'reload', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice', + 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', + 'unichr', 'unicode', 'vars', 'xrange', 'zip'), + prefix=r'(?>> )(.*\n)', bygroups(Generic.Prompt, Other.Code), 'continuations'), + # This happens, e.g., when tracebacks are embedded in documentation; + # trailing whitespaces are often stripped in such contexts. + (r'(>>>)(\n)', bygroups(Generic.Prompt, Whitespace)), + (r'(\^C)?Traceback \(most recent call last\):\n', Other.Traceback, 'traceback'), + # SyntaxError starts with this + (r' File "[^"]+", line \d+', Other.Traceback, 'traceback'), + (r'.*\n', Generic.Output), + ], + 'continuations': [ + (r'(\.\.\. )(.*\n)', bygroups(Generic.Prompt, Other.Code)), + # See above. + (r'(\.\.\.)(\n)', bygroups(Generic.Prompt, Whitespace)), + default('#pop'), + ], + 'traceback': [ + # As soon as we see a traceback, consume everything until the next + # >>> prompt. + (r'(?=>>>( |$))', Text, '#pop'), + (r'(KeyboardInterrupt)(\n)', bygroups(Name.Class, Whitespace)), + (r'.*\n', Other.Traceback), + ], + } + + +class PythonConsoleLexer(DelegatingLexer): + """ + For Python console output or doctests, such as: + + .. sourcecode:: pycon + + >>> a = 'foo' + >>> print(a) + foo + >>> 1 / 0 + Traceback (most recent call last): + File "", line 1, in + ZeroDivisionError: integer division or modulo by zero + + Additional options: + + `python3` + Use Python 3 lexer for code. Default is ``True``. + + .. versionadded:: 1.0 + .. versionchanged:: 2.5 + Now defaults to ``True``. + """ + + name = 'Python console session' + aliases = ['pycon', 'python-console'] + mimetypes = ['text/x-python-doctest'] + url = 'https://python.org' + version_added = '' + + def __init__(self, **options): + python3 = get_bool_opt(options, 'python3', True) + if python3: + pylexer = PythonLexer + tblexer = PythonTracebackLexer + else: + pylexer = Python2Lexer + tblexer = Python2TracebackLexer + # We have two auxiliary lexers. Use DelegatingLexer twice with + # different tokens. TODO: DelegatingLexer should support this + # directly, by accepting a tuplet of auxiliary lexers and a tuple of + # distinguishing tokens. Then we wouldn't need this intermediary + # class. + class _ReplaceInnerCode(DelegatingLexer): + def __init__(self, **options): + super().__init__(pylexer, _PythonConsoleLexerBase, Other.Code, **options) + super().__init__(tblexer, _ReplaceInnerCode, Other.Traceback, **options) + + +class PythonTracebackLexer(RegexLexer): + """ + For Python 3.x tracebacks, with support for chained exceptions. + + .. versionchanged:: 2.5 + This is now the default ``PythonTracebackLexer``. It is still available + as the alias ``Python3TracebackLexer``. + """ + + name = 'Python Traceback' + aliases = ['pytb', 'py3tb'] + filenames = ['*.pytb', '*.py3tb'] + mimetypes = ['text/x-python-traceback', 'text/x-python3-traceback'] + url = 'https://python.org' + version_added = '1.0' + + tokens = { + 'root': [ + (r'\n', Whitespace), + (r'^(\^C)?Traceback \(most recent call last\):\n', Generic.Traceback, 'intb'), + (r'^During handling of the above exception, another ' + r'exception occurred:\n\n', Generic.Traceback), + (r'^The above exception was the direct cause of the ' + r'following exception:\n\n', Generic.Traceback), + (r'^(?= File "[^"]+", line \d+)', Generic.Traceback, 'intb'), + (r'^.*\n', Other), + ], + 'intb': [ + (r'^( File )("[^"]+")(, line )(\d+)(, in )(.+)(\n)', + bygroups(Text, Name.Builtin, Text, Number, Text, Name, Whitespace)), + (r'^( File )("[^"]+")(, line )(\d+)(\n)', + bygroups(Text, Name.Builtin, Text, Number, Whitespace)), + (r'^( )(.+)(\n)', + bygroups(Whitespace, using(PythonLexer), Whitespace), 'markers'), + (r'^([ \t]*)(\.\.\.)(\n)', + bygroups(Whitespace, Comment, Whitespace)), # for doctests... + (r'^([^:]+)(: )(.+)(\n)', + bygroups(Generic.Error, Text, Name, Whitespace), '#pop'), + (r'^([a-zA-Z_][\w.]*)(:?\n)', + bygroups(Generic.Error, Whitespace), '#pop'), + default('#pop'), + ], + 'markers': [ + # Either `PEP 657 ` + # error locations in Python 3.11+, or single-caret markers + # for syntax errors before that. + (r'^( {4,})([~^]+)(\n)', + bygroups(Whitespace, Punctuation.Marker, Whitespace), + '#pop'), + default('#pop'), + ], + } + + +Python3TracebackLexer = PythonTracebackLexer + + +class Python2TracebackLexer(RegexLexer): + """ + For Python tracebacks. + + .. versionchanged:: 2.5 + This class has been renamed from ``PythonTracebackLexer``. + ``PythonTracebackLexer`` now refers to the Python 3 variant. + """ + + name = 'Python 2.x Traceback' + aliases = ['py2tb'] + filenames = ['*.py2tb'] + mimetypes = ['text/x-python2-traceback'] + url = 'https://python.org' + version_added = '0.7' + + tokens = { + 'root': [ + # Cover both (most recent call last) and (innermost last) + # The optional ^C allows us to catch keyboard interrupt signals. + (r'^(\^C)?(Traceback.*\n)', + bygroups(Text, Generic.Traceback), 'intb'), + # SyntaxError starts with this. + (r'^(?= File "[^"]+", line \d+)', Generic.Traceback, 'intb'), + (r'^.*\n', Other), + ], + 'intb': [ + (r'^( File )("[^"]+")(, line )(\d+)(, in )(.+)(\n)', + bygroups(Text, Name.Builtin, Text, Number, Text, Name, Whitespace)), + (r'^( File )("[^"]+")(, line )(\d+)(\n)', + bygroups(Text, Name.Builtin, Text, Number, Whitespace)), + (r'^( )(.+)(\n)', + bygroups(Text, using(Python2Lexer), Whitespace), 'marker'), + (r'^([ \t]*)(\.\.\.)(\n)', + bygroups(Text, Comment, Whitespace)), # for doctests... + (r'^([^:]+)(: )(.+)(\n)', + bygroups(Generic.Error, Text, Name, Whitespace), '#pop'), + (r'^([a-zA-Z_]\w*)(:?\n)', + bygroups(Generic.Error, Whitespace), '#pop') + ], + 'marker': [ + # For syntax errors. + (r'( {4,})(\^)', bygroups(Text, Punctuation.Marker), '#pop'), + default('#pop'), + ], + } + + +class CythonLexer(RegexLexer): + """ + For Pyrex and Cython source code. + """ + + name = 'Cython' + url = 'https://cython.org' + aliases = ['cython', 'pyx', 'pyrex'] + filenames = ['*.pyx', '*.pxd', '*.pxi'] + mimetypes = ['text/x-cython', 'application/x-cython'] + version_added = '1.1' + + tokens = { + 'root': [ + (r'\n', Whitespace), + (r'^(\s*)("""(?:.|\n)*?""")', bygroups(Whitespace, String.Doc)), + (r"^(\s*)('''(?:.|\n)*?''')", bygroups(Whitespace, String.Doc)), + (r'[^\S\n]+', Text), + (r'#.*$', Comment), + (r'[]{}:(),;[]', Punctuation), + (r'\\\n', Whitespace), + (r'\\', Text), + (r'(in|is|and|or|not)\b', Operator.Word), + (r'(<)([a-zA-Z0-9.?]+)(>)', + bygroups(Punctuation, Keyword.Type, Punctuation)), + (r'!=|==|<<|>>|[-~+/*%=<>&^|.?]', Operator), + (r'(from)(\d+)(<=)(\s+)(<)(\d+)(:)', + bygroups(Keyword, Number.Integer, Operator, Whitespace, Operator, + Name, Punctuation)), + include('keywords'), + (r'(def|property)(\s+)', bygroups(Keyword, Whitespace), 'funcname'), + (r'(cp?def)(\s+)', bygroups(Keyword, Whitespace), 'cdef'), + # (should actually start a block with only cdefs) + (r'(cdef)(:)', bygroups(Keyword, Punctuation)), + (r'(class|struct)(\s+)', bygroups(Keyword, Whitespace), 'classname'), + (r'(from)(\s+)', bygroups(Keyword, Whitespace), 'fromimport'), + (r'(c?import)(\s+)', bygroups(Keyword, Whitespace), 'import'), + include('builtins'), + include('backtick'), + ('(?:[rR]|[uU][rR]|[rR][uU])"""', String, 'tdqs'), + ("(?:[rR]|[uU][rR]|[rR][uU])'''", String, 'tsqs'), + ('(?:[rR]|[uU][rR]|[rR][uU])"', String, 'dqs'), + ("(?:[rR]|[uU][rR]|[rR][uU])'", String, 'sqs'), + ('[uU]?"""', String, combined('stringescape', 'tdqs')), + ("[uU]?'''", String, combined('stringescape', 'tsqs')), + ('[uU]?"', String, combined('stringescape', 'dqs')), + ("[uU]?'", String, combined('stringescape', 'sqs')), + include('name'), + include('numbers'), + ], + 'keywords': [ + (words(( + 'assert', 'async', 'await', 'break', 'by', 'continue', 'ctypedef', 'del', 'elif', + 'else', 'except', 'except?', 'exec', 'finally', 'for', 'fused', 'gil', + 'global', 'if', 'include', 'lambda', 'nogil', 'pass', 'print', + 'raise', 'return', 'try', 'while', 'yield', 'as', 'with'), suffix=r'\b'), + Keyword), + (r'(DEF|IF|ELIF|ELSE)\b', Comment.Preproc), + ], + 'builtins': [ + (words(( + '__import__', 'abs', 'all', 'any', 'apply', 'basestring', 'bin', 'bint', + 'bool', 'buffer', 'bytearray', 'bytes', 'callable', 'chr', + 'classmethod', 'cmp', 'coerce', 'compile', 'complex', 'delattr', + 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'execfile', 'exit', + 'file', 'filter', 'float', 'frozenset', 'getattr', 'globals', + 'hasattr', 'hash', 'hex', 'id', 'input', 'int', 'intern', 'isinstance', + 'issubclass', 'iter', 'len', 'list', 'locals', 'long', 'map', 'max', + 'min', 'next', 'object', 'oct', 'open', 'ord', 'pow', 'property', 'Py_ssize_t', + 'range', 'raw_input', 'reduce', 'reload', 'repr', 'reversed', + 'round', 'set', 'setattr', 'slice', 'sorted', 'staticmethod', + 'str', 'sum', 'super', 'tuple', 'type', 'unichr', 'unicode', 'unsigned', + 'vars', 'xrange', 'zip'), prefix=r'(?>)\b', Keyword), # stereotypes + (r'!=|<>|==|=|!->|->|>=|<=|[.]{3}|[+/*%=<>&|.~]', Operator), + (r'[]{}:(),;[]', Punctuation), + (r'(true|false|unlimited|null)\b', Keyword.Constant), + (r'(this|self|result)\b', Name.Builtin.Pseudo), + (r'(var)\b', Keyword.Declaration), + (r'(from|import)\b', Keyword.Namespace, 'fromimport'), + (r'(metamodel|class|exception|primitive|enum|transformation|' + r'library)(\s+)(\w+)', + bygroups(Keyword.Word, Text, Name.Class)), + (r'(exception)(\s+)(\w+)', + bygroups(Keyword.Word, Text, Name.Exception)), + (r'(main)\b', Name.Function), + (r'(mapping|helper|query)(\s+)', + bygroups(Keyword.Declaration, Text), 'operation'), + (r'(assert)(\s+)\b', bygroups(Keyword, Text), 'assert'), + (r'(Bag|Collection|Dict|OrderedSet|Sequence|Set|Tuple|List)\b', + Keyword.Type), + include('keywords'), + ('"', String, combined('stringescape', 'dqs')), + ("'", String, combined('stringescape', 'sqs')), + include('name'), + include('numbers'), + # (r'([a-zA-Z_]\w*)(::)([a-zA-Z_]\w*)', + # bygroups(Text, Text, Text)), + ], + + 'fromimport': [ + (r'(?:[ \t]|\\\n)+', Text), + (r'[a-zA-Z_][\w.]*', Name.Namespace), + default('#pop'), + ], + + 'operation': [ + (r'::', Text), + (r'(.*::)([a-zA-Z_]\w*)([ \t]*)(\()', + bygroups(Text, Name.Function, Text, Punctuation), '#pop') + ], + + 'assert': [ + (r'(warning|error|fatal)\b', Keyword, '#pop'), + default('#pop'), # all else: go back + ], + + 'keywords': [ + (words(( + 'abstract', 'access', 'any', 'assert', 'blackbox', 'break', + 'case', 'collect', 'collectNested', 'collectOne', 'collectselect', + 'collectselectOne', 'composes', 'compute', 'configuration', + 'constructor', 'continue', 'datatype', 'default', 'derived', + 'disjuncts', 'do', 'elif', 'else', 'end', 'endif', 'except', + 'exists', 'extends', 'forAll', 'forEach', 'forOne', 'from', 'if', + 'implies', 'in', 'inherits', 'init', 'inout', 'intermediate', + 'invresolve', 'invresolveIn', 'invresolveone', 'invresolveoneIn', + 'isUnique', 'iterate', 'late', 'let', 'literal', 'log', 'map', + 'merges', 'modeltype', 'new', 'object', 'one', 'ordered', 'out', + 'package', 'population', 'property', 'raise', 'readonly', + 'references', 'refines', 'reject', 'resolve', 'resolveIn', + 'resolveone', 'resolveoneIn', 'return', 'select', 'selectOne', + 'sortedBy', 'static', 'switch', 'tag', 'then', 'try', 'typedef', + 'unlimited', 'uses', 'when', 'where', 'while', 'with', 'xcollect', + 'xmap', 'xselect'), suffix=r'\b'), Keyword), + ], + + # There is no need to distinguish between String.Single and + # String.Double: 'strings' is factorised for 'dqs' and 'sqs' + 'strings': [ + (r'[^\\\'"\n]+', String), + # quotes, percents and backslashes must be parsed one at a time + (r'[\'"\\]', String), + ], + 'stringescape': [ + (r'\\([\\btnfr"\']|u[0-3][0-7]{2}|u[0-7]{1,2})', String.Escape) + ], + 'dqs': [ # double-quoted string + (r'"', String, '#pop'), + (r'\\\\|\\"', String.Escape), + include('strings') + ], + 'sqs': [ # single-quoted string + (r"'", String, '#pop'), + (r"\\\\|\\'", String.Escape), + include('strings') + ], + 'name': [ + (r'[a-zA-Z_]\w*', Name), + ], + # numbers: excerpt taken from the python lexer + 'numbers': [ + (r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float), + (r'\d+[eE][+-]?[0-9]+', Number.Float), + (r'\d+', Number.Integer) + ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/roboconf.py b/lib/python3.12/site-packages/pygments/lexers/roboconf.py new file mode 100644 index 0000000000000000000000000000000000000000..31adba9f48f99a4f9c38941e3c0d73714051a994 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/roboconf.py @@ -0,0 +1,81 @@ +""" + pygments.lexers.roboconf + ~~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for Roboconf DSL. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, words, re +from pygments.token import Text, Operator, Keyword, Name, Comment + +__all__ = ['RoboconfGraphLexer', 'RoboconfInstancesLexer'] + + +class RoboconfGraphLexer(RegexLexer): + """ + Lexer for Roboconf graph files. + """ + name = 'Roboconf Graph' + aliases = ['roboconf-graph'] + filenames = ['*.graph'] + url = 'https://roboconf.github.io/en/user-guide/graph-definition.html' + version_added = '2.1' + + flags = re.IGNORECASE | re.MULTILINE + tokens = { + 'root': [ + # Skip white spaces + (r'\s+', Text), + + # There is one operator + (r'=', Operator), + + # Keywords + (words(('facet', 'import'), suffix=r'\s*\b', prefix=r'\b'), Keyword), + (words(( + 'installer', 'extends', 'exports', 'imports', 'facets', + 'children'), suffix=r'\s*:?', prefix=r'\b'), Name), + + # Comments + (r'#.*\n', Comment), + + # Default + (r'[^#]', Text), + (r'.*\n', Text) + ] + } + + +class RoboconfInstancesLexer(RegexLexer): + """ + Lexer for Roboconf instances files. + """ + name = 'Roboconf Instances' + aliases = ['roboconf-instances'] + filenames = ['*.instances'] + url = 'https://roboconf.github.io' + version_added = '2.1' + + flags = re.IGNORECASE | re.MULTILINE + tokens = { + 'root': [ + + # Skip white spaces + (r'\s+', Text), + + # Keywords + (words(('instance of', 'import'), suffix=r'\s*\b', prefix=r'\b'), Keyword), + (words(('name', 'count'), suffix=r's*:?', prefix=r'\b'), Name), + (r'\s*[\w.-]+\s*:', Name), + + # Comments + (r'#.*\n', Comment), + + # Default + (r'[^#]', Text), + (r'.*\n', Text) + ] + } diff --git a/lib/python3.12/site-packages/pygments/lexers/robotframework.py b/lib/python3.12/site-packages/pygments/lexers/robotframework.py new file mode 100644 index 0000000000000000000000000000000000000000..f92d567503fbb371a224d531f504c59fbf77e1a8 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/robotframework.py @@ -0,0 +1,551 @@ +""" + pygments.lexers.robotframework + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lexer for Robot Framework. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +# Copyright 2012 Nokia Siemens Networks Oyj +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import re + +from pygments.lexer import Lexer +from pygments.token import Token + +__all__ = ['RobotFrameworkLexer'] + + +HEADING = Token.Generic.Heading +SETTING = Token.Keyword.Namespace +IMPORT = Token.Name.Namespace +TC_KW_NAME = Token.Generic.Subheading +KEYWORD = Token.Name.Function +ARGUMENT = Token.String +VARIABLE = Token.Name.Variable +COMMENT = Token.Comment +SEPARATOR = Token.Punctuation +SYNTAX = Token.Punctuation +GHERKIN = Token.Generic.Emph +ERROR = Token.Error + + +def normalize(string, remove=''): + string = string.lower() + for char in remove + ' ': + if char in string: + string = string.replace(char, '') + return string + + +class RobotFrameworkLexer(Lexer): + """ + For Robot Framework test data. + + Supports both space and pipe separated plain text formats. + """ + name = 'RobotFramework' + url = 'http://robotframework.org' + aliases = ['robotframework'] + filenames = ['*.robot', '*.resource'] + mimetypes = ['text/x-robotframework'] + version_added = '1.6' + + def __init__(self, **options): + options['tabsize'] = 2 + options['encoding'] = 'UTF-8' + Lexer.__init__(self, **options) + + def get_tokens_unprocessed(self, text): + row_tokenizer = RowTokenizer() + var_tokenizer = VariableTokenizer() + index = 0 + for row in text.splitlines(): + for value, token in row_tokenizer.tokenize(row): + for value, token in var_tokenizer.tokenize(value, token): + if value: + yield index, token, str(value) + index += len(value) + + +class VariableTokenizer: + + def tokenize(self, string, token): + var = VariableSplitter(string, identifiers='$@%&') + if var.start < 0 or token in (COMMENT, ERROR): + yield string, token + return + for value, token in self._tokenize(var, string, token): + if value: + yield value, token + + def _tokenize(self, var, string, orig_token): + before = string[:var.start] + yield before, orig_token + yield var.identifier + '{', SYNTAX + yield from self.tokenize(var.base, VARIABLE) + yield '}', SYNTAX + if var.index is not None: + yield '[', SYNTAX + yield from self.tokenize(var.index, VARIABLE) + yield ']', SYNTAX + yield from self.tokenize(string[var.end:], orig_token) + + +class RowTokenizer: + + def __init__(self): + self._table = UnknownTable() + self._splitter = RowSplitter() + testcases = TestCaseTable() + settings = SettingTable(testcases.set_default_template) + variables = VariableTable() + keywords = KeywordTable() + self._tables = {'settings': settings, 'setting': settings, + 'metadata': settings, + 'variables': variables, 'variable': variables, + 'testcases': testcases, 'testcase': testcases, + 'tasks': testcases, 'task': testcases, + 'keywords': keywords, 'keyword': keywords, + 'userkeywords': keywords, 'userkeyword': keywords} + + def tokenize(self, row): + commented = False + heading = False + for index, value in enumerate(self._splitter.split(row)): + # First value, and every second after that, is a separator. + index, separator = divmod(index-1, 2) + if value.startswith('#'): + commented = True + elif index == 0 and value.startswith('*'): + self._table = self._start_table(value) + heading = True + yield from self._tokenize(value, index, commented, + separator, heading) + self._table.end_row() + + def _start_table(self, header): + name = normalize(header, remove='*') + return self._tables.get(name, UnknownTable()) + + def _tokenize(self, value, index, commented, separator, heading): + if commented: + yield value, COMMENT + elif separator: + yield value, SEPARATOR + elif heading: + yield value, HEADING + else: + yield from self._table.tokenize(value, index) + + +class RowSplitter: + _space_splitter = re.compile('( {2,})') + _pipe_splitter = re.compile(r'((?:^| +)\|(?: +|$))') + + def split(self, row): + splitter = (row.startswith('| ') and self._split_from_pipes + or self._split_from_spaces) + yield from splitter(row) + yield '\n' + + def _split_from_spaces(self, row): + yield '' # Start with (pseudo)separator similarly as with pipes + yield from self._space_splitter.split(row) + + def _split_from_pipes(self, row): + _, separator, rest = self._pipe_splitter.split(row, 1) + yield separator + while self._pipe_splitter.search(rest): + cell, separator, rest = self._pipe_splitter.split(rest, 1) + yield cell + yield separator + yield rest + + +class Tokenizer: + _tokens = None + + def __init__(self): + self._index = 0 + + def tokenize(self, value): + values_and_tokens = self._tokenize(value, self._index) + self._index += 1 + if isinstance(values_and_tokens, type(Token)): + values_and_tokens = [(value, values_and_tokens)] + return values_and_tokens + + def _tokenize(self, value, index): + index = min(index, len(self._tokens) - 1) + return self._tokens[index] + + def _is_assign(self, value): + if value.endswith('='): + value = value[:-1].strip() + var = VariableSplitter(value, identifiers='$@&') + return var.start == 0 and var.end == len(value) + + +class Comment(Tokenizer): + _tokens = (COMMENT,) + + +class Setting(Tokenizer): + _tokens = (SETTING, ARGUMENT) + _keyword_settings = ('suitesetup', 'suiteprecondition', 'suiteteardown', + 'suitepostcondition', 'testsetup', 'tasksetup', 'testprecondition', + 'testteardown','taskteardown', 'testpostcondition', 'testtemplate', 'tasktemplate') + _import_settings = ('library', 'resource', 'variables') + _other_settings = ('documentation', 'metadata', 'forcetags', 'defaulttags', + 'testtimeout','tasktimeout') + _custom_tokenizer = None + + def __init__(self, template_setter=None): + Tokenizer.__init__(self) + self._template_setter = template_setter + + def _tokenize(self, value, index): + if index == 1 and self._template_setter: + self._template_setter(value) + if index == 0: + normalized = normalize(value) + if normalized in self._keyword_settings: + self._custom_tokenizer = KeywordCall(support_assign=False) + elif normalized in self._import_settings: + self._custom_tokenizer = ImportSetting() + elif normalized not in self._other_settings: + return ERROR + elif self._custom_tokenizer: + return self._custom_tokenizer.tokenize(value) + return Tokenizer._tokenize(self, value, index) + + +class ImportSetting(Tokenizer): + _tokens = (IMPORT, ARGUMENT) + + +class TestCaseSetting(Setting): + _keyword_settings = ('setup', 'precondition', 'teardown', 'postcondition', + 'template') + _import_settings = () + _other_settings = ('documentation', 'tags', 'timeout') + + def _tokenize(self, value, index): + if index == 0: + type = Setting._tokenize(self, value[1:-1], index) + return [('[', SYNTAX), (value[1:-1], type), (']', SYNTAX)] + return Setting._tokenize(self, value, index) + + +class KeywordSetting(TestCaseSetting): + _keyword_settings = ('teardown',) + _other_settings = ('documentation', 'arguments', 'return', 'timeout', 'tags') + + +class Variable(Tokenizer): + _tokens = (SYNTAX, ARGUMENT) + + def _tokenize(self, value, index): + if index == 0 and not self._is_assign(value): + return ERROR + return Tokenizer._tokenize(self, value, index) + + +class KeywordCall(Tokenizer): + _tokens = (KEYWORD, ARGUMENT) + + def __init__(self, support_assign=True): + Tokenizer.__init__(self) + self._keyword_found = not support_assign + self._assigns = 0 + + def _tokenize(self, value, index): + if not self._keyword_found and self._is_assign(value): + self._assigns += 1 + return SYNTAX # VariableTokenizer tokenizes this later. + if self._keyword_found: + return Tokenizer._tokenize(self, value, index - self._assigns) + self._keyword_found = True + return GherkinTokenizer().tokenize(value, KEYWORD) + + +class GherkinTokenizer: + _gherkin_prefix = re.compile('^(Given|When|Then|And|But) ', re.IGNORECASE) + + def tokenize(self, value, token): + match = self._gherkin_prefix.match(value) + if not match: + return [(value, token)] + end = match.end() + return [(value[:end], GHERKIN), (value[end:], token)] + + +class TemplatedKeywordCall(Tokenizer): + _tokens = (ARGUMENT,) + + +class ForLoop(Tokenizer): + + def __init__(self): + Tokenizer.__init__(self) + self._in_arguments = False + + def _tokenize(self, value, index): + token = self._in_arguments and ARGUMENT or SYNTAX + if value.upper() in ('IN', 'IN RANGE'): + self._in_arguments = True + return token + + +class _Table: + _tokenizer_class = None + + def __init__(self, prev_tokenizer=None): + self._tokenizer = self._tokenizer_class() + self._prev_tokenizer = prev_tokenizer + self._prev_values_on_row = [] + + def tokenize(self, value, index): + if self._continues(value, index): + self._tokenizer = self._prev_tokenizer + yield value, SYNTAX + else: + yield from self._tokenize(value, index) + self._prev_values_on_row.append(value) + + def _continues(self, value, index): + return value == '...' and all(self._is_empty(t) + for t in self._prev_values_on_row) + + def _is_empty(self, value): + return value in ('', '\\') + + def _tokenize(self, value, index): + return self._tokenizer.tokenize(value) + + def end_row(self): + self.__init__(prev_tokenizer=self._tokenizer) + + +class UnknownTable(_Table): + _tokenizer_class = Comment + + def _continues(self, value, index): + return False + + +class VariableTable(_Table): + _tokenizer_class = Variable + + +class SettingTable(_Table): + _tokenizer_class = Setting + + def __init__(self, template_setter, prev_tokenizer=None): + _Table.__init__(self, prev_tokenizer) + self._template_setter = template_setter + + def _tokenize(self, value, index): + if index == 0 and normalize(value) == 'testtemplate': + self._tokenizer = Setting(self._template_setter) + return _Table._tokenize(self, value, index) + + def end_row(self): + self.__init__(self._template_setter, prev_tokenizer=self._tokenizer) + + +class TestCaseTable(_Table): + _setting_class = TestCaseSetting + _test_template = None + _default_template = None + + @property + def _tokenizer_class(self): + if self._test_template or (self._default_template and + self._test_template is not False): + return TemplatedKeywordCall + return KeywordCall + + def _continues(self, value, index): + return index > 0 and _Table._continues(self, value, index) + + def _tokenize(self, value, index): + if index == 0: + if value: + self._test_template = None + return GherkinTokenizer().tokenize(value, TC_KW_NAME) + if index == 1 and self._is_setting(value): + if self._is_template(value): + self._test_template = False + self._tokenizer = self._setting_class(self.set_test_template) + else: + self._tokenizer = self._setting_class() + if index == 1 and self._is_for_loop(value): + self._tokenizer = ForLoop() + if index == 1 and self._is_empty(value): + return [(value, SYNTAX)] + return _Table._tokenize(self, value, index) + + def _is_setting(self, value): + return value.startswith('[') and value.endswith(']') + + def _is_template(self, value): + return normalize(value) == '[template]' + + def _is_for_loop(self, value): + return value.startswith(':') and normalize(value, remove=':') == 'for' + + def set_test_template(self, template): + self._test_template = self._is_template_set(template) + + def set_default_template(self, template): + self._default_template = self._is_template_set(template) + + def _is_template_set(self, template): + return normalize(template) not in ('', '\\', 'none', '${empty}') + + +class KeywordTable(TestCaseTable): + _tokenizer_class = KeywordCall + _setting_class = KeywordSetting + + def _is_template(self, value): + return False + + +# Following code copied directly from Robot Framework 2.7.5. + +class VariableSplitter: + + def __init__(self, string, identifiers): + self.identifier = None + self.base = None + self.index = None + self.start = -1 + self.end = -1 + self._identifiers = identifiers + self._may_have_internal_variables = False + try: + self._split(string) + except ValueError: + pass + else: + self._finalize() + + def get_replaced_base(self, variables): + if self._may_have_internal_variables: + return variables.replace_string(self.base) + return self.base + + def _finalize(self): + self.identifier = self._variable_chars[0] + self.base = ''.join(self._variable_chars[2:-1]) + self.end = self.start + len(self._variable_chars) + if self._has_list_or_dict_variable_index(): + self.index = ''.join(self._list_and_dict_variable_index_chars[1:-1]) + self.end += len(self._list_and_dict_variable_index_chars) + + def _has_list_or_dict_variable_index(self): + return self._list_and_dict_variable_index_chars\ + and self._list_and_dict_variable_index_chars[-1] == ']' + + def _split(self, string): + start_index, max_index = self._find_variable(string) + self.start = start_index + self._open_curly = 1 + self._state = self._variable_state + self._variable_chars = [string[start_index], '{'] + self._list_and_dict_variable_index_chars = [] + self._string = string + start_index += 2 + for index, char in enumerate(string[start_index:]): + index += start_index # Giving start to enumerate only in Py 2.6+ + try: + self._state(char, index) + except StopIteration: + return + if index == max_index and not self._scanning_list_variable_index(): + return + + def _scanning_list_variable_index(self): + return self._state in [self._waiting_list_variable_index_state, + self._list_variable_index_state] + + def _find_variable(self, string): + max_end_index = string.rfind('}') + if max_end_index == -1: + raise ValueError('No variable end found') + if self._is_escaped(string, max_end_index): + return self._find_variable(string[:max_end_index]) + start_index = self._find_start_index(string, 1, max_end_index) + if start_index == -1: + raise ValueError('No variable start found') + return start_index, max_end_index + + def _find_start_index(self, string, start, end): + index = string.find('{', start, end) - 1 + if index < 0: + return -1 + if self._start_index_is_ok(string, index): + return index + return self._find_start_index(string, index+2, end) + + def _start_index_is_ok(self, string, index): + return string[index] in self._identifiers\ + and not self._is_escaped(string, index) + + def _is_escaped(self, string, index): + escaped = False + while index > 0 and string[index-1] == '\\': + index -= 1 + escaped = not escaped + return escaped + + def _variable_state(self, char, index): + self._variable_chars.append(char) + if char == '}' and not self._is_escaped(self._string, index): + self._open_curly -= 1 + if self._open_curly == 0: + if not self._is_list_or_dict_variable(): + raise StopIteration + self._state = self._waiting_list_variable_index_state + elif char in self._identifiers: + self._state = self._internal_variable_start_state + + def _is_list_or_dict_variable(self): + return self._variable_chars[0] in ('@','&') + + def _internal_variable_start_state(self, char, index): + self._state = self._variable_state + if char == '{': + self._variable_chars.append(char) + self._open_curly += 1 + self._may_have_internal_variables = True + else: + self._variable_state(char, index) + + def _waiting_list_variable_index_state(self, char, index): + if char != '[': + raise StopIteration + self._list_and_dict_variable_index_chars.append(char) + self._state = self._list_variable_index_state + + def _list_variable_index_state(self, char, index): + self._list_and_dict_variable_index_chars.append(char) + if char == ']': + raise StopIteration diff --git a/lib/python3.12/site-packages/pygments/lexers/ruby.py b/lib/python3.12/site-packages/pygments/lexers/ruby.py new file mode 100644 index 0000000000000000000000000000000000000000..72aaeb5fec08c7c14e3f827d9c297c485a087e67 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/ruby.py @@ -0,0 +1,518 @@ +""" + pygments.lexers.ruby + ~~~~~~~~~~~~~~~~~~~~ + + Lexers for Ruby and related languages. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import Lexer, RegexLexer, ExtendedRegexLexer, include, \ + bygroups, default, LexerContext, do_insertions, words, line_re +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Error, Generic, Whitespace +from pygments.util import shebang_matches + +__all__ = ['RubyLexer', 'RubyConsoleLexer', 'FancyLexer'] + + +RUBY_OPERATORS = ( + '*', '**', '-', '+', '-@', '+@', '/', '%', '&', '|', '^', '`', '~', + '[]', '[]=', '<<', '>>', '<', '<>', '<=>', '>', '>=', '==', '===' +) + + +class RubyLexer(ExtendedRegexLexer): + """ + For Ruby source code. + """ + + name = 'Ruby' + url = 'http://www.ruby-lang.org' + aliases = ['ruby', 'rb', 'duby'] + filenames = ['*.rb', '*.rbw', 'Rakefile', '*.rake', '*.gemspec', + '*.rbx', '*.duby', 'Gemfile', 'Vagrantfile'] + mimetypes = ['text/x-ruby', 'application/x-ruby'] + version_added = '' + + flags = re.DOTALL | re.MULTILINE + + def heredoc_callback(self, match, ctx): + # okay, this is the hardest part of parsing Ruby... + # match: 1 = <<[-~]?, 2 = quote? 3 = name 4 = quote? 5 = rest of line + + start = match.start(1) + yield start, Operator, match.group(1) # <<[-~]? + yield match.start(2), String.Heredoc, match.group(2) # quote ", ', ` + yield match.start(3), String.Delimiter, match.group(3) # heredoc name + yield match.start(4), String.Heredoc, match.group(4) # quote again + + heredocstack = ctx.__dict__.setdefault('heredocstack', []) + outermost = not bool(heredocstack) + heredocstack.append((match.group(1) in ('<<-', '<<~'), match.group(3))) + + ctx.pos = match.start(5) + ctx.end = match.end(5) + # this may find other heredocs, so limit the recursion depth + if len(heredocstack) < 100: + yield from self.get_tokens_unprocessed(context=ctx) + else: + yield ctx.pos, String.Heredoc, match.group(5) + ctx.pos = match.end() + + if outermost: + # this is the outer heredoc again, now we can process them all + for tolerant, hdname in heredocstack: + lines = [] + for match in line_re.finditer(ctx.text, ctx.pos): + if tolerant: + check = match.group().strip() + else: + check = match.group().rstrip() + if check == hdname: + for amatch in lines: + yield amatch.start(), String.Heredoc, amatch.group() + yield match.start(), String.Delimiter, match.group() + ctx.pos = match.end() + break + else: + lines.append(match) + else: + # end of heredoc not found -- error! + for amatch in lines: + yield amatch.start(), Error, amatch.group() + ctx.end = len(ctx.text) + del heredocstack[:] + + def gen_rubystrings_rules(): + def intp_regex_callback(self, match, ctx): + yield match.start(1), String.Regex, match.group(1) # begin + nctx = LexerContext(match.group(3), 0, ['interpolated-regex']) + for i, t, v in self.get_tokens_unprocessed(context=nctx): + yield match.start(3)+i, t, v + yield match.start(4), String.Regex, match.group(4) # end[mixounse]* + ctx.pos = match.end() + + def intp_string_callback(self, match, ctx): + yield match.start(1), String.Other, match.group(1) + nctx = LexerContext(match.group(3), 0, ['interpolated-string']) + for i, t, v in self.get_tokens_unprocessed(context=nctx): + yield match.start(3)+i, t, v + yield match.start(4), String.Other, match.group(4) # end + ctx.pos = match.end() + + states = {} + states['strings'] = [ + # easy ones + (r'\:@{0,2}[a-zA-Z_]\w*[!?]?', String.Symbol), + (words(RUBY_OPERATORS, prefix=r'\:@{0,2}'), String.Symbol), + (r":'(\\\\|\\[^\\]|[^'\\])*'", String.Symbol), + (r':"', String.Symbol, 'simple-sym'), + (r'([a-zA-Z_]\w*)(:)(?!:)', + bygroups(String.Symbol, Punctuation)), # Since Ruby 1.9 + (r'"', String.Double, 'simple-string-double'), + (r"'", String.Single, 'simple-string-single'), + (r'(?', '<>', 'ab'): + states[name+'-intp-string'] = [ + (r'\\[\\' + bracecc + ']', String.Other), + (lbrace, String.Other, '#push'), + (rbrace, String.Other, '#pop'), + include('string-intp-escaped'), + (r'[\\#' + bracecc + ']', String.Other), + (r'[^\\#' + bracecc + ']+', String.Other), + ] + states['strings'].append((r'%[QWx]?' + lbrace, String.Other, + name+'-intp-string')) + states[name+'-string'] = [ + (r'\\[\\' + bracecc + ']', String.Other), + (lbrace, String.Other, '#push'), + (rbrace, String.Other, '#pop'), + (r'[\\#' + bracecc + ']', String.Other), + (r'[^\\#' + bracecc + ']+', String.Other), + ] + states['strings'].append((r'%[qsw]' + lbrace, String.Other, + name+'-string')) + states[name+'-regex'] = [ + (r'\\[\\' + bracecc + ']', String.Regex), + (lbrace, String.Regex, '#push'), + (rbrace + '[mixounse]*', String.Regex, '#pop'), + include('string-intp'), + (r'[\\#' + bracecc + ']', String.Regex), + (r'[^\\#' + bracecc + ']+', String.Regex), + ] + states['strings'].append((r'%r' + lbrace, String.Regex, + name+'-regex')) + + # these must come after %! + states['strings'] += [ + # %r regex + (r'(%r([\W_]))((?:\\\2|(?!\2).)*)(\2[mixounse]*)', + intp_regex_callback), + # regular fancy strings with qsw + (r'%[qsw]([\W_])((?:\\\1|(?!\1).)*)\1', String.Other), + (r'(%[QWx]([\W_]))((?:\\\2|(?!\2).)*)(\2)', + intp_string_callback), + # special forms of fancy strings after operators or + # in method calls with braces + (r'(?<=[-+/*%=<>&!^|~,(])(\s*)(%([\t ])(?:(?:\\\3|(?!\3).)*)\3)', + bygroups(Whitespace, String.Other, None)), + # and because of fixed width lookbehinds the whole thing a + # second time for line startings... + (r'^(\s*)(%([\t ])(?:(?:\\\3|(?!\3).)*)\3)', + bygroups(Whitespace, String.Other, None)), + # all regular fancy strings without qsw + (r'(%([^a-zA-Z0-9\s]))((?:\\\2|(?!\2).)*)(\2)', + intp_string_callback), + ] + + return states + + tokens = { + 'root': [ + (r'\A#!.+?$', Comment.Hashbang), + (r'#.*?$', Comment.Single), + (r'=begin\s.*?\n=end.*?$', Comment.Multiline), + # keywords + (words(( + 'BEGIN', 'END', 'alias', 'begin', 'break', 'case', 'defined?', + 'do', 'else', 'elsif', 'end', 'ensure', 'for', 'if', 'in', 'next', 'redo', + 'rescue', 'raise', 'retry', 'return', 'super', 'then', 'undef', + 'unless', 'until', 'when', 'while', 'yield'), suffix=r'\b'), + Keyword), + # start of function, class and module names + (r'(module)(\s+)([a-zA-Z_]\w*' + r'(?:::[a-zA-Z_]\w*)*)', + bygroups(Keyword, Whitespace, Name.Namespace)), + (r'(def)(\s+)', bygroups(Keyword, Whitespace), 'funcname'), + (r'def(?=[*%&^`~+-/\[<>=])', Keyword, 'funcname'), + (r'(class)(\s+)', bygroups(Keyword, Whitespace), 'classname'), + # special methods + (words(( + 'initialize', 'new', 'loop', 'include', 'extend', 'raise', 'attr_reader', + 'attr_writer', 'attr_accessor', 'attr', 'catch', 'throw', 'private', + 'module_function', 'public', 'protected', 'true', 'false', 'nil'), + suffix=r'\b'), + Keyword.Pseudo), + (r'(not|and|or)\b', Operator.Word), + (words(( + 'autoload', 'block_given', 'const_defined', 'eql', 'equal', 'frozen', 'include', + 'instance_of', 'is_a', 'iterator', 'kind_of', 'method_defined', 'nil', + 'private_method_defined', 'protected_method_defined', + 'public_method_defined', 'respond_to', 'tainted'), suffix=r'\?'), + Name.Builtin), + (r'(chomp|chop|exit|gsub|sub)!', Name.Builtin), + (words(( + 'Array', 'Float', 'Integer', 'String', '__id__', '__send__', 'abort', + 'ancestors', 'at_exit', 'autoload', 'binding', 'callcc', 'caller', + 'catch', 'chomp', 'chop', 'class_eval', 'class_variables', + 'clone', 'const_defined?', 'const_get', 'const_missing', 'const_set', + 'constants', 'display', 'dup', 'eval', 'exec', 'exit', 'extend', 'fail', 'fork', + 'format', 'freeze', 'getc', 'gets', 'global_variables', 'gsub', + 'hash', 'id', 'included_modules', 'inspect', 'instance_eval', + 'instance_method', 'instance_methods', + 'instance_variable_get', 'instance_variable_set', 'instance_variables', + 'lambda', 'load', 'local_variables', 'loop', + 'method', 'method_missing', 'methods', 'module_eval', 'name', + 'object_id', 'open', 'p', 'print', 'printf', 'private_class_method', + 'private_instance_methods', + 'private_methods', 'proc', 'protected_instance_methods', + 'protected_methods', 'public_class_method', + 'public_instance_methods', 'public_methods', + 'putc', 'puts', 'raise', 'rand', 'readline', 'readlines', 'require', + 'scan', 'select', 'self', 'send', 'set_trace_func', 'singleton_methods', 'sleep', + 'split', 'sprintf', 'srand', 'sub', 'syscall', 'system', 'taint', + 'test', 'throw', 'to_a', 'to_s', 'trace_var', 'trap', 'untaint', + 'untrace_var', 'warn'), prefix=r'(?~!:])|' + r'(?<=(?:\s|;)when\s)|' + r'(?<=(?:\s|;)or\s)|' + r'(?<=(?:\s|;)and\s)|' + r'(?<=\.index\s)|' + r'(?<=\.scan\s)|' + r'(?<=\.sub\s)|' + r'(?<=\.sub!\s)|' + r'(?<=\.gsub\s)|' + r'(?<=\.gsub!\s)|' + r'(?<=\.match\s)|' + r'(?<=(?:\s|;)if\s)|' + r'(?<=(?:\s|;)elsif\s)|' + r'(?<=^when\s)|' + r'(?<=^index\s)|' + r'(?<=^scan\s)|' + r'(?<=^sub\s)|' + r'(?<=^gsub\s)|' + r'(?<=^sub!\s)|' + r'(?<=^gsub!\s)|' + r'(?<=^match\s)|' + r'(?<=^if\s)|' + r'(?<=^elsif\s)' + r')(\s*)(/)', bygroups(Text, String.Regex), 'multiline-regex'), + # multiline regex (in method calls or subscripts) + (r'(?<=\(|,|\[)/', String.Regex, 'multiline-regex'), + # multiline regex (this time the funny no whitespace rule) + (r'(\s+)(/)(?![\s=])', bygroups(Whitespace, String.Regex), + 'multiline-regex'), + # lex numbers and ignore following regular expressions which + # are division operators in fact (grrrr. i hate that. any + # better ideas?) + # since pygments 0.7 we also eat a "?" operator after numbers + # so that the char operator does not work. Chars are not allowed + # there so that you can use the ternary operator. + # stupid example: + # x>=0?n[x]:"" + (r'(0_?[0-7]+(?:_[0-7]+)*)(\s*)([/?])?', + bygroups(Number.Oct, Whitespace, Operator)), + (r'(0x[0-9A-Fa-f]+(?:_[0-9A-Fa-f]+)*)(\s*)([/?])?', + bygroups(Number.Hex, Whitespace, Operator)), + (r'(0b[01]+(?:_[01]+)*)(\s*)([/?])?', + bygroups(Number.Bin, Whitespace, Operator)), + (r'([\d]+(?:_\d+)*)(\s*)([/?])?', + bygroups(Number.Integer, Whitespace, Operator)), + # Names + (r'@@[a-zA-Z_]\w*', Name.Variable.Class), + (r'@[a-zA-Z_]\w*', Name.Variable.Instance), + (r'\$\w+', Name.Variable.Global), + (r'\$[!@&`\'+~=/\\,;.<>_*$?:"^-]', Name.Variable.Global), + (r'\$-[0adFiIlpvw]', Name.Variable.Global), + (r'::', Operator), + include('strings'), + # chars + (r'\?(\\[MC]-)*' # modifiers + r'(\\([\\abefnrstv#"\']|x[a-fA-F0-9]{1,2}|[0-7]{1,3})|\S)' + r'(?!\w)', + String.Char), + (r'[A-Z]\w+', Name.Constant), + # this is needed because ruby attributes can look + # like keywords (class) or like this: ` ?!? + (words(RUBY_OPERATORS, prefix=r'(\.|::)'), + bygroups(Operator, Name.Operator)), + (r'(\.|::)([a-zA-Z_]\w*[!?]?|[*%&^`~+\-/\[<>=])', + bygroups(Operator, Name)), + (r'[a-zA-Z_]\w*[!?]?', Name), + (r'(\[|\]|\*\*|<>?|>=|<=|<=>|=~|={3}|' + r'!~|&&?|\|\||\.{1,3})', Operator), + (r'[-+/*%=<>&!^|~]=?', Operator), + (r'[(){};,/?:\\]', Punctuation), + (r'\s+', Whitespace) + ], + 'funcname': [ + (r'\(', Punctuation, 'defexpr'), + (r'(?:([a-zA-Z_]\w*)(\.))?' # optional scope name, like "self." + r'(' + r'[a-zA-Z\u0080-\uffff][a-zA-Z0-9_\u0080-\uffff]*[!?=]?' # method name + r'|!=|!~|=~|\*\*?|[-+!~]@?|[/%&|^]|<=>|<[<=]?|>[>=]?|===?' # or operator override + r'|\[\]=?' # or element reference/assignment override + r'|`' # or the undocumented backtick override + r')', + bygroups(Name.Class, Operator, Name.Function), '#pop'), + default('#pop') + ], + 'classname': [ + (r'\(', Punctuation, 'defexpr'), + (r'<<', Operator, '#pop'), + (r'[A-Z_]\w*', Name.Class, '#pop'), + default('#pop') + ], + 'defexpr': [ + (r'(\))(\.|::)?', bygroups(Punctuation, Operator), '#pop'), + (r'\(', Operator, '#push'), + include('root') + ], + 'in-intp': [ + (r'\{', String.Interpol, '#push'), + (r'\}', String.Interpol, '#pop'), + include('root'), + ], + 'string-intp': [ + (r'#\{', String.Interpol, 'in-intp'), + (r'#@@?[a-zA-Z_]\w*', String.Interpol), + (r'#\$[a-zA-Z_]\w*', String.Interpol) + ], + 'string-intp-escaped': [ + include('string-intp'), + (r'\\([\\abefnrstv#"\']|x[a-fA-F0-9]{1,2}|[0-7]{1,3})', + String.Escape) + ], + 'interpolated-regex': [ + include('string-intp'), + (r'[\\#]', String.Regex), + (r'[^\\#]+', String.Regex), + ], + 'interpolated-string': [ + include('string-intp'), + (r'[\\#]', String.Other), + (r'[^\\#]+', String.Other), + ], + 'multiline-regex': [ + include('string-intp'), + (r'\\\\', String.Regex), + (r'\\/', String.Regex), + (r'[\\#]', String.Regex), + (r'[^\\/#]+', String.Regex), + (r'/[mixounse]*', String.Regex, '#pop'), + ], + 'end-part': [ + (r'.+', Comment.Preproc, '#pop') + ] + } + tokens.update(gen_rubystrings_rules()) + + def analyse_text(text): + return shebang_matches(text, r'ruby(1\.\d)?') + + +class RubyConsoleLexer(Lexer): + """ + For Ruby interactive console (**irb**) output. + """ + name = 'Ruby irb session' + aliases = ['rbcon', 'irb'] + mimetypes = ['text/x-ruby-shellsession'] + url = 'https://www.ruby-lang.org' + version_added = '' + _example = 'rbcon/console' + + _prompt_re = re.compile(r'irb\([a-zA-Z_]\w*\):\d{3}:\d+[>*"\'] ' + r'|>> |\?> ') + + def get_tokens_unprocessed(self, text): + rblexer = RubyLexer(**self.options) + + curcode = '' + insertions = [] + for match in line_re.finditer(text): + line = match.group() + m = self._prompt_re.match(line) + if m is not None: + end = m.end() + insertions.append((len(curcode), + [(0, Generic.Prompt, line[:end])])) + curcode += line[end:] + else: + if curcode: + yield from do_insertions( + insertions, rblexer.get_tokens_unprocessed(curcode)) + curcode = '' + insertions = [] + yield match.start(), Generic.Output, line + if curcode: + yield from do_insertions( + insertions, rblexer.get_tokens_unprocessed(curcode)) + + +class FancyLexer(RegexLexer): + """ + Pygments Lexer For Fancy. + + Fancy is a self-hosted, pure object-oriented, dynamic, + class-based, concurrent general-purpose programming language + running on Rubinius, the Ruby VM. + """ + name = 'Fancy' + url = 'https://github.com/bakkdoor/fancy' + filenames = ['*.fy', '*.fancypack'] + aliases = ['fancy', 'fy'] + mimetypes = ['text/x-fancysrc'] + version_added = '1.5' + + tokens = { + # copied from PerlLexer: + 'balanced-regex': [ + (r'/(\\\\|\\[^\\]|[^/\\])*/[egimosx]*', String.Regex, '#pop'), + (r'!(\\\\|\\[^\\]|[^!\\])*![egimosx]*', String.Regex, '#pop'), + (r'\\(\\\\|[^\\])*\\[egimosx]*', String.Regex, '#pop'), + (r'\{(\\\\|\\[^\\]|[^}\\])*\}[egimosx]*', String.Regex, '#pop'), + (r'<(\\\\|\\[^\\]|[^>\\])*>[egimosx]*', String.Regex, '#pop'), + (r'\[(\\\\|\\[^\\]|[^\]\\])*\][egimosx]*', String.Regex, '#pop'), + (r'\((\\\\|\\[^\\]|[^)\\])*\)[egimosx]*', String.Regex, '#pop'), + (r'@(\\\\|\\[^\\]|[^@\\])*@[egimosx]*', String.Regex, '#pop'), + (r'%(\\\\|\\[^\\]|[^%\\])*%[egimosx]*', String.Regex, '#pop'), + (r'\$(\\\\|\\[^\\]|[^$\\])*\$[egimosx]*', String.Regex, '#pop'), + ], + 'root': [ + (r'\s+', Whitespace), + + # balanced delimiters (copied from PerlLexer): + (r's\{(\\\\|\\[^\\]|[^}\\])*\}\s*', String.Regex, 'balanced-regex'), + (r's<(\\\\|\\[^\\]|[^>\\])*>\s*', String.Regex, 'balanced-regex'), + (r's\[(\\\\|\\[^\\]|[^\]\\])*\]\s*', String.Regex, 'balanced-regex'), + (r's\((\\\\|\\[^\\]|[^)\\])*\)\s*', String.Regex, 'balanced-regex'), + (r'm?/(\\\\|\\[^\\]|[^///\n])*/[gcimosx]*', String.Regex), + (r'm(?=[/!\\{<\[(@%$])', String.Regex, 'balanced-regex'), + + # Comments + (r'#(.*?)\n', Comment.Single), + # Symbols + (r'\'([^\'\s\[\](){}]+|\[\])', String.Symbol), + # Multi-line DoubleQuotedString + (r'"""(\\\\|\\[^\\]|[^\\])*?"""', String), + # DoubleQuotedString + (r'"(\\\\|\\[^\\]|[^"\\])*"', String), + # keywords + (r'(def|class|try|catch|finally|retry|return|return_local|match|' + r'case|->|=>)\b', Keyword), + # constants + (r'(self|super|nil|false|true)\b', Name.Constant), + (r'[(){};,/?|:\\]', Punctuation), + # names + (words(( + 'Object', 'Array', 'Hash', 'Directory', 'File', 'Class', 'String', + 'Number', 'Enumerable', 'FancyEnumerable', 'Block', 'TrueClass', + 'NilClass', 'FalseClass', 'Tuple', 'Symbol', 'Stack', 'Set', + 'FancySpec', 'Method', 'Package', 'Range'), suffix=r'\b'), + Name.Builtin), + # functions + (r'[a-zA-Z](\w|[-+?!=*/^><%])*:', Name.Function), + # operators, must be below functions + (r'[-+*/~,<>=&!?%^\[\].$]+', Operator), + (r'[A-Z]\w*', Name.Constant), + (r'@[a-zA-Z_]\w*', Name.Variable.Instance), + (r'@@[a-zA-Z_]\w*', Name.Variable.Class), + ('@@?', Operator), + (r'[a-zA-Z_]\w*', Name), + # numbers - / checks are necessary to avoid mismarking regexes, + # see comment in RubyLexer + (r'(0[oO]?[0-7]+(?:_[0-7]+)*)(\s*)([/?])?', + bygroups(Number.Oct, Whitespace, Operator)), + (r'(0[xX][0-9A-Fa-f]+(?:_[0-9A-Fa-f]+)*)(\s*)([/?])?', + bygroups(Number.Hex, Whitespace, Operator)), + (r'(0[bB][01]+(?:_[01]+)*)(\s*)([/?])?', + bygroups(Number.Bin, Whitespace, Operator)), + (r'([\d]+(?:_\d+)*)(\s*)([/?])?', + bygroups(Number.Integer, Whitespace, Operator)), + (r'\d+([eE][+-]?[0-9]+)|\d+\.\d+([eE][+-]?[0-9]+)?', Number.Float), + (r'\d+', Number.Integer) + ] + } diff --git a/lib/python3.12/site-packages/pygments/lexers/rust.py b/lib/python3.12/site-packages/pygments/lexers/rust.py new file mode 100644 index 0000000000000000000000000000000000000000..63410475553d44d7aa080e075ac71180f3160d6c --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/rust.py @@ -0,0 +1,222 @@ +""" + pygments.lexers.rust + ~~~~~~~~~~~~~~~~~~~~ + + Lexers for the Rust language. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, include, bygroups, words, default +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Whitespace + +__all__ = ['RustLexer'] + + +class RustLexer(RegexLexer): + """ + Lexer for the Rust programming language (version 1.47). + """ + name = 'Rust' + url = 'https://www.rust-lang.org/' + filenames = ['*.rs', '*.rs.in'] + aliases = ['rust', 'rs'] + mimetypes = ['text/rust', 'text/x-rust'] + version_added = '1.6' + + keyword_types = (words(( + 'u8', 'u16', 'u32', 'u64', 'u128', 'i8', 'i16', 'i32', 'i64', 'i128', + 'usize', 'isize', 'f32', 'f64', 'char', 'str', 'bool', + ), suffix=r'\b'), Keyword.Type) + + builtin_funcs_types = (words(( + 'Copy', 'Send', 'Sized', 'Sync', 'Unpin', + 'Drop', 'Fn', 'FnMut', 'FnOnce', 'drop', + 'Box', 'ToOwned', 'Clone', + 'PartialEq', 'PartialOrd', 'Eq', 'Ord', + 'AsRef', 'AsMut', 'Into', 'From', 'Default', + 'Iterator', 'Extend', 'IntoIterator', 'DoubleEndedIterator', + 'ExactSizeIterator', + 'Option', 'Some', 'None', + 'Result', 'Ok', 'Err', + 'String', 'ToString', 'Vec', + ), suffix=r'\b'), Name.Builtin) + + builtin_macros = (words(( + 'asm', 'assert', 'assert_eq', 'assert_ne', 'cfg', 'column', + 'compile_error', 'concat', 'concat_idents', 'dbg', 'debug_assert', + 'debug_assert_eq', 'debug_assert_ne', 'env', 'eprint', 'eprintln', + 'file', 'format', 'format_args', 'format_args_nl', 'global_asm', + 'include', 'include_bytes', 'include_str', + 'is_aarch64_feature_detected', + 'is_arm_feature_detected', + 'is_mips64_feature_detected', + 'is_mips_feature_detected', + 'is_powerpc64_feature_detected', + 'is_powerpc_feature_detected', + 'is_x86_feature_detected', + 'line', 'llvm_asm', 'log_syntax', 'macro_rules', 'matches', + 'module_path', 'option_env', 'panic', 'print', 'println', 'stringify', + 'thread_local', 'todo', 'trace_macros', 'unimplemented', 'unreachable', + 'vec', 'write', 'writeln', + ), suffix=r'!'), Name.Function.Magic) + + tokens = { + 'root': [ + # rust allows a file to start with a shebang, but if the first line + # starts with #![ then it's not a shebang but a crate attribute. + (r'#![^[\r\n].*$', Comment.Preproc), + default('base'), + ], + 'base': [ + # Whitespace and Comments + (r'\n', Whitespace), + (r'\s+', Whitespace), + (r'//!.*?\n', String.Doc), + (r'///(\n|[^/].*?\n)', String.Doc), + (r'//(.*?)\n', Comment.Single), + (r'/\*\*(\n|[^/*])', String.Doc, 'doccomment'), + (r'/\*!', String.Doc, 'doccomment'), + (r'/\*', Comment.Multiline, 'comment'), + + # Macro parameters + (r"""\$([a-zA-Z_]\w*|\(,?|\),?|,?)""", Comment.Preproc), + # Keywords + (words(('as', 'async', 'await', 'box', 'const', 'crate', 'dyn', + 'else', 'extern', 'for', 'if', 'impl', 'in', 'loop', + 'match', 'move', 'mut', 'pub', 'ref', 'return', 'static', + 'super', 'trait', 'unsafe', 'use', 'where', 'while'), + suffix=r'\b'), Keyword), + (words(('abstract', 'become', 'do', 'final', 'macro', 'override', + 'priv', 'typeof', 'try', 'unsized', 'virtual', 'yield'), + suffix=r'\b'), Keyword.Reserved), + (r'(true|false)\b', Keyword.Constant), + (r'self\b', Name.Builtin.Pseudo), + (r'mod\b', Keyword, 'modname'), + (r'let\b', Keyword.Declaration), + (r'fn\b', Keyword, 'funcname'), + (r'(struct|enum|type|union)\b', Keyword, 'typename'), + (r'(default)(\s+)(type|fn)\b', bygroups(Keyword, Whitespace, Keyword)), + keyword_types, + (r'[sS]elf\b', Name.Builtin.Pseudo), + # Prelude (taken from Rust's src/libstd/prelude.rs) + builtin_funcs_types, + builtin_macros, + # Path separators, so types don't catch them. + (r'::\b', Punctuation), + # Types in positions. + (r'(?::|->)', Punctuation, 'typename'), + # Labels + (r'(break|continue)(\b\s*)(\'[A-Za-z_]\w*)?', + bygroups(Keyword, Text.Whitespace, Name.Label)), + + # Character literals + (r"""'(\\['"\\nrt]|\\x[0-7][0-9a-fA-F]|\\0""" + r"""|\\u\{[0-9a-fA-F]{1,6}\}|.)'""", + String.Char), + (r"""b'(\\['"\\nrt]|\\x[0-9a-fA-F]{2}|\\0""" + r"""|\\u\{[0-9a-fA-F]{1,6}\}|.)'""", + String.Char), + + # Binary literals + (r'0b[01_]+', Number.Bin, 'number_lit'), + # Octal literals + (r'0o[0-7_]+', Number.Oct, 'number_lit'), + # Hexadecimal literals + (r'0[xX][0-9a-fA-F_]+', Number.Hex, 'number_lit'), + # Decimal literals + (r'[0-9][0-9_]*(\.[0-9_]+[eE][+\-]?[0-9_]+|' + r'\.[0-9_]*(?!\.)|[eE][+\-]?[0-9_]+)', Number.Float, + 'number_lit'), + (r'[0-9][0-9_]*', Number.Integer, 'number_lit'), + + # String literals + (r'b"', String, 'bytestring'), + (r'"', String, 'string'), + (r'(?s)b?r(#*)".*?"\1', String), + + # Lifetime names + (r"'", Operator, 'lifetime'), + + # Operators and Punctuation + (r'\.\.=?', Operator), + (r'[{}()\[\],.;]', Punctuation), + (r'[+\-*/%&|<>^!~@=:?]', Operator), + + # Identifiers + (r'[a-zA-Z_]\w*', Name), + # Raw identifiers + (r'r#[a-zA-Z_]\w*', Name), + + # Attributes + (r'#!?\[', Comment.Preproc, 'attribute['), + + # Misc + # Lone hashes: not used in Rust syntax, but allowed in macro + # arguments, most famously for quote::quote!() + (r'#', Punctuation), + ], + 'comment': [ + (r'[^*/]+', Comment.Multiline), + (r'/\*', Comment.Multiline, '#push'), + (r'\*/', Comment.Multiline, '#pop'), + (r'[*/]', Comment.Multiline), + ], + 'doccomment': [ + (r'[^*/]+', String.Doc), + (r'/\*', String.Doc, '#push'), + (r'\*/', String.Doc, '#pop'), + (r'[*/]', String.Doc), + ], + 'modname': [ + (r'\s+', Whitespace), + (r'[a-zA-Z_]\w*', Name.Namespace, '#pop'), + default('#pop'), + ], + 'funcname': [ + (r'\s+', Whitespace), + (r'[a-zA-Z_]\w*', Name.Function, '#pop'), + default('#pop'), + ], + 'typename': [ + (r'\s+', Whitespace), + (r'&', Keyword.Pseudo), + (r"'", Operator, 'lifetime'), + builtin_funcs_types, + keyword_types, + (r'[a-zA-Z_]\w*', Name.Class, '#pop'), + default('#pop'), + ], + 'lifetime': [ + (r"(static|_)", Name.Builtin), + (r"[a-zA-Z_]+\w*", Name.Attribute), + default('#pop'), + ], + 'number_lit': [ + (r'[ui](8|16|32|64|size)', Keyword, '#pop'), + (r'f(32|64)', Keyword, '#pop'), + default('#pop'), + ], + 'string': [ + (r'"', String, '#pop'), + (r"""\\['"\\nrt]|\\x[0-7][0-9a-fA-F]|\\0""" + r"""|\\u\{[0-9a-fA-F]{1,6}\}""", String.Escape), + (r'[^\\"]+', String), + (r'\\', String), + ], + 'bytestring': [ + (r"""\\x[89a-fA-F][0-9a-fA-F]""", String.Escape), + include('string'), + ], + 'attribute_common': [ + (r'"', String, 'string'), + (r'\[', Comment.Preproc, 'attribute['), + ], + 'attribute[': [ + include('attribute_common'), + (r'\]', Comment.Preproc, '#pop'), + (r'[^"\]\[]+', Comment.Preproc), + ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/sas.py b/lib/python3.12/site-packages/pygments/lexers/sas.py new file mode 100644 index 0000000000000000000000000000000000000000..1b2ad432d231d21192c4f3653ef2e541588afd1d --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/sas.py @@ -0,0 +1,227 @@ +""" + pygments.lexers.sas + ~~~~~~~~~~~~~~~~~~~ + + Lexer for SAS. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re +from pygments.lexer import RegexLexer, include, words +from pygments.token import Comment, Keyword, Name, Number, String, Text, \ + Other, Generic + +__all__ = ['SASLexer'] + + +class SASLexer(RegexLexer): + """ + For SAS files. + """ + # Syntax from syntax/sas.vim by James Kidd + + name = 'SAS' + aliases = ['sas'] + filenames = ['*.SAS', '*.sas'] + mimetypes = ['text/x-sas', 'text/sas', 'application/x-sas'] + url = 'https://en.wikipedia.org/wiki/SAS_(software)' + version_added = '2.2' + flags = re.IGNORECASE | re.MULTILINE + + builtins_macros = ( + "bquote", "nrbquote", "cmpres", "qcmpres", "compstor", "datatyp", + "display", "do", "else", "end", "eval", "global", "goto", "if", + "index", "input", "keydef", "label", "left", "length", "let", + "local", "lowcase", "macro", "mend", "nrquote", + "nrstr", "put", "qleft", "qlowcase", "qscan", + "qsubstr", "qsysfunc", "qtrim", "quote", "qupcase", "scan", + "str", "substr", "superq", "syscall", "sysevalf", "sysexec", + "sysfunc", "sysget", "syslput", "sysprod", "sysrc", "sysrput", + "then", "to", "trim", "unquote", "until", "upcase", "verify", + "while", "window" + ) + + builtins_conditionals = ( + "do", "if", "then", "else", "end", "until", "while" + ) + + builtins_statements = ( + "abort", "array", "attrib", "by", "call", "cards", "cards4", + "catname", "continue", "datalines", "datalines4", "delete", "delim", + "delimiter", "display", "dm", "drop", "endsas", "error", "file", + "filename", "footnote", "format", "goto", "in", "infile", "informat", + "input", "keep", "label", "leave", "length", "libname", "link", + "list", "lostcard", "merge", "missing", "modify", "options", "output", + "out", "page", "put", "redirect", "remove", "rename", "replace", + "retain", "return", "select", "set", "skip", "startsas", "stop", + "title", "update", "waitsas", "where", "window", "x", "systask" + ) + + builtins_sql = ( + "add", "and", "alter", "as", "cascade", "check", "create", + "delete", "describe", "distinct", "drop", "foreign", "from", + "group", "having", "index", "insert", "into", "in", "key", "like", + "message", "modify", "msgtype", "not", "null", "on", "or", + "order", "primary", "references", "reset", "restrict", "select", + "set", "table", "unique", "update", "validate", "view", "where" + ) + + builtins_functions = ( + "abs", "addr", "airy", "arcos", "arsin", "atan", "attrc", + "attrn", "band", "betainv", "blshift", "bnot", "bor", + "brshift", "bxor", "byte", "cdf", "ceil", "cexist", "cinv", + "close", "cnonct", "collate", "compbl", "compound", + "compress", "cos", "cosh", "css", "curobs", "cv", "daccdb", + "daccdbsl", "daccsl", "daccsyd", "dacctab", "dairy", "date", + "datejul", "datepart", "datetime", "day", "dclose", "depdb", + "depdbsl", "depsl", "depsyd", + "deptab", "dequote", "dhms", "dif", "digamma", + "dim", "dinfo", "dnum", "dopen", "doptname", "doptnum", + "dread", "dropnote", "dsname", "erf", "erfc", "exist", "exp", + "fappend", "fclose", "fcol", "fdelete", "fetch", "fetchobs", + "fexist", "fget", "fileexist", "filename", "fileref", + "finfo", "finv", "fipname", "fipnamel", "fipstate", "floor", + "fnonct", "fnote", "fopen", "foptname", "foptnum", "fpoint", + "fpos", "fput", "fread", "frewind", "frlen", "fsep", "fuzz", + "fwrite", "gaminv", "gamma", "getoption", "getvarc", "getvarn", + "hbound", "hms", "hosthelp", "hour", "ibessel", "index", + "indexc", "indexw", "input", "inputc", "inputn", "int", + "intck", "intnx", "intrr", "irr", "jbessel", "juldate", + "kurtosis", "lag", "lbound", "left", "length", "lgamma", + "libname", "libref", "log", "log10", "log2", "logpdf", "logpmf", + "logsdf", "lowcase", "max", "mdy", "mean", "min", "minute", + "mod", "month", "mopen", "mort", "n", "netpv", "nmiss", + "normal", "note", "npv", "open", "ordinal", "pathname", + "pdf", "peek", "peekc", "pmf", "point", "poisson", "poke", + "probbeta", "probbnml", "probchi", "probf", "probgam", + "probhypr", "probit", "probnegb", "probnorm", "probt", + "put", "putc", "putn", "qtr", "quote", "ranbin", "rancau", + "ranexp", "rangam", "range", "rank", "rannor", "ranpoi", + "rantbl", "rantri", "ranuni", "repeat", "resolve", "reverse", + "rewind", "right", "round", "saving", "scan", "sdf", "second", + "sign", "sin", "sinh", "skewness", "soundex", "spedis", + "sqrt", "std", "stderr", "stfips", "stname", "stnamel", + "substr", "sum", "symget", "sysget", "sysmsg", "sysprod", + "sysrc", "system", "tan", "tanh", "time", "timepart", "tinv", + "tnonct", "today", "translate", "tranwrd", "trigamma", + "trim", "trimn", "trunc", "uniform", "upcase", "uss", "var", + "varfmt", "varinfmt", "varlabel", "varlen", "varname", + "varnum", "varray", "varrayx", "vartype", "verify", "vformat", + "vformatd", "vformatdx", "vformatn", "vformatnx", "vformatw", + "vformatwx", "vformatx", "vinarray", "vinarrayx", "vinformat", + "vinformatd", "vinformatdx", "vinformatn", "vinformatnx", + "vinformatw", "vinformatwx", "vinformatx", "vlabel", + "vlabelx", "vlength", "vlengthx", "vname", "vnamex", "vtype", + "vtypex", "weekday", "year", "yyq", "zipfips", "zipname", + "zipnamel", "zipstate" + ) + + tokens = { + 'root': [ + include('comments'), + include('proc-data'), + include('cards-datalines'), + include('logs'), + include('general'), + (r'.', Text), + ], + # SAS is multi-line regardless, but * is ended by ; + 'comments': [ + (r'^\s*\*.*?;', Comment), + (r'/\*.*?\*/', Comment), + (r'^\s*\*(.|\n)*?;', Comment.Multiline), + (r'/[*](.|\n)*?[*]/', Comment.Multiline), + ], + # Special highlight for proc, data, quit, run + 'proc-data': [ + (r'(^|;)\s*(proc \w+|data|run|quit)[\s;]', + Keyword.Reserved), + ], + # Special highlight cards and datalines + 'cards-datalines': [ + (r'^\s*(datalines|cards)\s*;\s*$', Keyword, 'data'), + ], + 'data': [ + (r'(.|\n)*^\s*;\s*$', Other, '#pop'), + ], + # Special highlight for put NOTE|ERROR|WARNING (order matters) + 'logs': [ + (r'\n?^\s*%?put ', Keyword, 'log-messages'), + ], + 'log-messages': [ + (r'NOTE(:|-).*', Generic, '#pop'), + (r'WARNING(:|-).*', Generic.Emph, '#pop'), + (r'ERROR(:|-).*', Generic.Error, '#pop'), + include('general'), + ], + 'general': [ + include('keywords'), + include('vars-strings'), + include('special'), + include('numbers'), + ], + # Keywords, statements, functions, macros + 'keywords': [ + (words(builtins_statements, + prefix = r'\b', + suffix = r'\b'), + Keyword), + (words(builtins_sql, + prefix = r'\b', + suffix = r'\b'), + Keyword), + (words(builtins_conditionals, + prefix = r'\b', + suffix = r'\b'), + Keyword), + (words(builtins_macros, + prefix = r'%', + suffix = r'\b'), + Name.Builtin), + (words(builtins_functions, + prefix = r'\b', + suffix = r'\('), + Name.Builtin), + ], + # Strings and user-defined variables and macros (order matters) + 'vars-strings': [ + (r'&[a-z_]\w{0,31}\.?', Name.Variable), + (r'%[a-z_]\w{0,31}', Name.Function), + (r'\'', String, 'string_squote'), + (r'"', String, 'string_dquote'), + ], + 'string_squote': [ + ('\'', String, '#pop'), + (r'\\\\|\\"|\\\n', String.Escape), + # AFAIK, macro variables are not evaluated in single quotes + # (r'&', Name.Variable, 'validvar'), + (r'[^$\'\\]+', String), + (r'[$\'\\]', String), + ], + 'string_dquote': [ + (r'"', String, '#pop'), + (r'\\\\|\\"|\\\n', String.Escape), + (r'&', Name.Variable, 'validvar'), + (r'[^$&"\\]+', String), + (r'[$"\\]', String), + ], + 'validvar': [ + (r'[a-z_]\w{0,31}\.?', Name.Variable, '#pop'), + ], + # SAS numbers and special variables + 'numbers': [ + (r'\b[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+|\.)(E[+-]?[0-9]+)?i?\b', + Number), + ], + 'special': [ + (r'(null|missing|_all_|_automatic_|_character_|_n_|' + r'_infile_|_name_|_null_|_numeric_|_user_|_webout_)', + Keyword.Constant), + ], + # 'operators': [ + # (r'(-|=|<=|>=|<|>|<>|&|!=|' + # r'\||\*|\+|\^|/|!|~|~=)', Operator) + # ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/shell.py b/lib/python3.12/site-packages/pygments/lexers/shell.py new file mode 100644 index 0000000000000000000000000000000000000000..744767a1d4464f838b7c062f63c850e3a2f18554 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/shell.py @@ -0,0 +1,902 @@ +""" + pygments.lexers.shell + ~~~~~~~~~~~~~~~~~~~~~ + + Lexers for various shells. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import Lexer, RegexLexer, do_insertions, bygroups, \ + include, default, this, using, words, line_re +from pygments.token import Punctuation, Whitespace, \ + Text, Comment, Operator, Keyword, Name, String, Number, Generic +from pygments.util import shebang_matches + +__all__ = ['BashLexer', 'BashSessionLexer', 'TcshLexer', 'BatchLexer', + 'SlurmBashLexer', 'MSDOSSessionLexer', 'PowerShellLexer', + 'PowerShellSessionLexer', 'TcshSessionLexer', 'FishShellLexer', + 'ExeclineLexer'] + + +class BashLexer(RegexLexer): + """ + Lexer for (ba|k|z|)sh shell scripts. + """ + + name = 'Bash' + aliases = ['bash', 'sh', 'ksh', 'zsh', 'shell', 'openrc'] + filenames = ['*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass', + '*.exheres-0', '*.exlib', '*.zsh', + '.bashrc', 'bashrc', '.bash_*', 'bash_*', 'zshrc', '.zshrc', + '.kshrc', 'kshrc', + 'PKGBUILD'] + mimetypes = ['application/x-sh', 'application/x-shellscript', 'text/x-shellscript'] + url = 'https://en.wikipedia.org/wiki/Unix_shell' + version_added = '0.6' + + tokens = { + 'root': [ + include('basic'), + (r'`', String.Backtick, 'backticks'), + include('data'), + include('interp'), + ], + 'interp': [ + (r'\$\(\(', Keyword, 'math'), + (r'\$\(', Keyword, 'paren'), + (r'\$\{#?', String.Interpol, 'curly'), + (r'\$[a-zA-Z_]\w*', Name.Variable), # user variable + (r'\$(?:\d+|[#$?!_*@-])', Name.Variable), # builtin + (r'\$', Text), + ], + 'basic': [ + (r'\b(if|fi|else|while|in|do|done|for|then|return|function|case|' + r'select|break|continue|until|esac|elif)(\s*)\b', + bygroups(Keyword, Whitespace)), + (r'\b(alias|bg|bind|builtin|caller|cd|command|compgen|' + r'complete|declare|dirs|disown|echo|enable|eval|exec|exit|' + r'export|false|fc|fg|getopts|hash|help|history|jobs|kill|let|' + r'local|logout|popd|printf|pushd|pwd|read|readonly|set|shift|' + r'shopt|source|suspend|test|time|times|trap|true|type|typeset|' + r'ulimit|umask|unalias|unset|wait)(?=[\s)`])', + Name.Builtin), + (r'\A#!.+\n', Comment.Hashbang), + (r'#.*\n', Comment.Single), + (r'\\[\w\W]', String.Escape), + (r'(\b\w+)(\s*)(\+?=)', bygroups(Name.Variable, Whitespace, Operator)), + (r'[\[\]{}()=]', Operator), + (r'<<<', Operator), # here-string + (r'<<-?\s*(\'?)\\?(\w+)[\w\W]+?\2', String), + (r'&&|\|\|', Operator), + ], + 'data': [ + (r'(?s)\$?"(\\.|[^"\\$])*"', String.Double), + (r'"', String.Double, 'string'), + (r"(?s)\$'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single), + (r"(?s)'.*?'", String.Single), + (r';', Punctuation), + (r'&', Punctuation), + (r'\|', Punctuation), + (r'\s+', Whitespace), + (r'\d+\b', Number), + (r'[^=\s\[\]{}()$"\'`\\<&|;]+', Text), + (r'<', Text), + ], + 'string': [ + (r'"', String.Double, '#pop'), + (r'(?s)(\\\\|\\[0-7]+|\\.|[^"\\$])+', String.Double), + include('interp'), + ], + 'curly': [ + (r'\}', String.Interpol, '#pop'), + (r':-', Keyword), + (r'\w+', Name.Variable), + (r'[^}:"\'`$\\]+', Punctuation), + (r':', Punctuation), + include('root'), + ], + 'paren': [ + (r'\)', Keyword, '#pop'), + include('root'), + ], + 'math': [ + (r'\)\)', Keyword, '#pop'), + (r'\*\*|\|\||<<|>>|[-+*/%^|&<>]', Operator), + (r'\d+#[\da-zA-Z]+', Number), + (r'\d+#(?! )', Number), + (r'0[xX][\da-fA-F]+', Number), + (r'\d+', Number), + (r'[a-zA-Z_]\w*', Name.Variable), # user variable + include('root'), + ], + 'backticks': [ + (r'`', String.Backtick, '#pop'), + include('root'), + ], + } + + def analyse_text(text): + if shebang_matches(text, r'(ba|z|)sh'): + return 1 + if text.startswith('$ '): + return 0.2 + + +class SlurmBashLexer(BashLexer): + """ + Lexer for (ba|k|z|)sh Slurm scripts. + """ + + name = 'Slurm' + aliases = ['slurm', 'sbatch'] + filenames = ['*.sl'] + mimetypes = [] + version_added = '2.4' + EXTRA_KEYWORDS = {'srun'} + + def get_tokens_unprocessed(self, text): + for index, token, value in BashLexer.get_tokens_unprocessed(self, text): + if token is Text and value in self.EXTRA_KEYWORDS: + yield index, Name.Builtin, value + elif token is Comment.Single and 'SBATCH' in value: + yield index, Keyword.Pseudo, value + else: + yield index, token, value + + +class ShellSessionBaseLexer(Lexer): + """ + Base lexer for shell sessions. + + .. versionadded:: 2.1 + """ + + _bare_continuation = False + _venv = re.compile(r'^(\([^)]*\))(\s*)') + + def get_tokens_unprocessed(self, text): + innerlexer = self._innerLexerCls(**self.options) + + pos = 0 + curcode = '' + insertions = [] + backslash_continuation = False + + for match in line_re.finditer(text): + line = match.group() + + venv_match = self._venv.match(line) + if venv_match: + venv = venv_match.group(1) + venv_whitespace = venv_match.group(2) + insertions.append((len(curcode), + [(0, Generic.Prompt.VirtualEnv, venv)])) + if venv_whitespace: + insertions.append((len(curcode), + [(0, Text, venv_whitespace)])) + line = line[venv_match.end():] + + m = self._ps1rgx.match(line) + if m: + # To support output lexers (say diff output), the output + # needs to be broken by prompts whenever the output lexer + # changes. + if not insertions: + pos = match.start() + + insertions.append((len(curcode), + [(0, Generic.Prompt, m.group(1))])) + curcode += m.group(2) + backslash_continuation = curcode.endswith('\\\n') + elif backslash_continuation: + if line.startswith(self._ps2): + insertions.append((len(curcode), + [(0, Generic.Prompt, + line[:len(self._ps2)])])) + curcode += line[len(self._ps2):] + else: + curcode += line + backslash_continuation = curcode.endswith('\\\n') + elif self._bare_continuation and line.startswith(self._ps2): + insertions.append((len(curcode), + [(0, Generic.Prompt, + line[:len(self._ps2)])])) + curcode += line[len(self._ps2):] + else: + if insertions: + toks = innerlexer.get_tokens_unprocessed(curcode) + for i, t, v in do_insertions(insertions, toks): + yield pos+i, t, v + yield match.start(), Generic.Output, line + insertions = [] + curcode = '' + if insertions: + for i, t, v in do_insertions(insertions, + innerlexer.get_tokens_unprocessed(curcode)): + yield pos+i, t, v + + +class BashSessionLexer(ShellSessionBaseLexer): + """ + Lexer for Bash shell sessions, i.e. command lines, including a + prompt, interspersed with output. + """ + + name = 'Bash Session' + aliases = ['console', 'shell-session'] + filenames = ['*.sh-session', '*.shell-session'] + mimetypes = ['application/x-shell-session', 'application/x-sh-session'] + url = 'https://en.wikipedia.org/wiki/Unix_shell' + version_added = '1.1' + _example = "console/example.sh-session" + + _innerLexerCls = BashLexer + _ps1rgx = re.compile( + r'^((?:(?:\[.*?\])|(?:\(\S+\))?(?:| |sh\S*?|\w+\S+[@:]\S+(?:\s+\S+)' \ + r'?|\[\S+[@:][^\n]+\].+))\s*[$#%]\s*)(.*\n?)') + _ps2 = '> ' + + +class BatchLexer(RegexLexer): + """ + Lexer for the DOS/Windows Batch file format. + """ + name = 'Batchfile' + aliases = ['batch', 'bat', 'dosbatch', 'winbatch'] + filenames = ['*.bat', '*.cmd'] + mimetypes = ['application/x-dos-batch'] + url = 'https://en.wikipedia.org/wiki/Batch_file' + version_added = '0.7' + + flags = re.MULTILINE | re.IGNORECASE + + _nl = r'\n\x1a' + _punct = r'&<>|' + _ws = r'\t\v\f\r ,;=\xa0' + _nlws = r'\s\x1a\xa0,;=' + _space = rf'(?:(?:(?:\^[{_nl}])?[{_ws}])+)' + _keyword_terminator = (rf'(?=(?:\^[{_nl}]?)?[{_ws}+./:[\\\]]|[{_nl}{_punct}(])') + _token_terminator = rf'(?=\^?[{_ws}]|[{_punct}{_nl}])' + _start_label = rf'((?:(?<=^[^:])|^[^:]?)[{_ws}]*)(:)' + _label = rf'(?:(?:[^{_nlws}{_punct}+:^]|\^[{_nl}]?[\w\W])*)' + _label_compound = rf'(?:(?:[^{_nlws}{_punct}+:^)]|\^[{_nl}]?[^)])*)' + _number = rf'(?:-?(?:0[0-7]+|0x[\da-f]+|\d+){_token_terminator})' + _opword = r'(?:equ|geq|gtr|leq|lss|neq)' + _string = rf'(?:"[^{_nl}"]*(?:"|(?=[{_nl}])))' + _variable = (r'(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|' + rf'[^%:{_nl}]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%{_nl}^]|' + rf'\^[^%{_nl}])[^={_nl}]*=(?:[^%{_nl}^]|\^[^%{_nl}])*)?)?%))|' + rf'(?:\^?![^!:{_nl}]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:' + rf'[^!{_nl}^]|\^[^!{_nl}])[^={_nl}]*=(?:[^!{_nl}^]|\^[^!{_nl}])*)?)?\^?!))') + _core_token = rf'(?:(?:(?:\^[{_nl}]?)?[^"{_nlws}{_punct}])+)' + _core_token_compound = rf'(?:(?:(?:\^[{_nl}]?)?[^"{_nlws}{_punct})])+)' + _token = rf'(?:[{_punct}]+|{_core_token})' + _token_compound = rf'(?:[{_punct}]+|{_core_token_compound})' + _stoken = (rf'(?:[{_punct}]+|(?:{_string}|{_variable}|{_core_token})+)') + + def _make_begin_state(compound, _core_token=_core_token, + _core_token_compound=_core_token_compound, + _keyword_terminator=_keyword_terminator, + _nl=_nl, _punct=_punct, _string=_string, + _space=_space, _start_label=_start_label, + _stoken=_stoken, _token_terminator=_token_terminator, + _variable=_variable, _ws=_ws): + rest = '(?:{}|{}|[^"%{}{}{}])*'.format(_string, _variable, _nl, _punct, + ')' if compound else '') + rest_of_line = rf'(?:(?:[^{_nl}^]|\^[{_nl}]?[\w\W])*)' + rest_of_line_compound = rf'(?:(?:[^{_nl}^)]|\^[{_nl}]?[^)])*)' + set_space = rf'((?:(?:\^[{_nl}]?)?[^\S\n])*)' + suffix = '' + if compound: + _keyword_terminator = rf'(?:(?=\))|{_keyword_terminator})' + _token_terminator = rf'(?:(?=\))|{_token_terminator})' + suffix = '/compound' + return [ + ((r'\)', Punctuation, '#pop') if compound else + (rf'\)((?=\()|{_token_terminator}){rest_of_line}', + Comment.Single)), + (rf'(?={_start_label})', Text, f'follow{suffix}'), + (_space, using(this, state='text')), + include(f'redirect{suffix}'), + (rf'[{_nl}]+', Text), + (r'\(', Punctuation, 'root/compound'), + (r'@+', Punctuation), + (rf'((?:for|if|rem)(?:(?=(?:\^[{_nl}]?)?/)|(?:(?!\^)|' + rf'(?<=m))(?:(?=\()|{_token_terminator})))({_space}?{_core_token_compound if compound else _core_token}?(?:\^[{_nl}]?)?/(?:\^[{_nl}]?)?\?)', + bygroups(Keyword, using(this, state='text')), + f'follow{suffix}'), + (rf'(goto{_keyword_terminator})({rest}(?:\^[{_nl}]?)?/(?:\^[{_nl}]?)?\?{rest})', + bygroups(Keyword, using(this, state='text')), + f'follow{suffix}'), + (words(('assoc', 'break', 'cd', 'chdir', 'cls', 'color', 'copy', + 'date', 'del', 'dir', 'dpath', 'echo', 'endlocal', 'erase', + 'exit', 'ftype', 'keys', 'md', 'mkdir', 'mklink', 'move', + 'path', 'pause', 'popd', 'prompt', 'pushd', 'rd', 'ren', + 'rename', 'rmdir', 'setlocal', 'shift', 'start', 'time', + 'title', 'type', 'ver', 'verify', 'vol'), + suffix=_keyword_terminator), Keyword, f'follow{suffix}'), + (rf'(call)({_space}?)(:)', + bygroups(Keyword, using(this, state='text'), Punctuation), + f'call{suffix}'), + (rf'call{_keyword_terminator}', Keyword), + (rf'(for{_token_terminator}(?!\^))({_space})(/f{_token_terminator})', + bygroups(Keyword, using(this, state='text'), Keyword), + ('for/f', 'for')), + (rf'(for{_token_terminator}(?!\^))({_space})(/l{_token_terminator})', + bygroups(Keyword, using(this, state='text'), Keyword), + ('for/l', 'for')), + (rf'for{_token_terminator}(?!\^)', Keyword, ('for2', 'for')), + (rf'(goto{_keyword_terminator})({_space}?)(:?)', + bygroups(Keyword, using(this, state='text'), Punctuation), + f'label{suffix}'), + (rf'(if(?:(?=\()|{_token_terminator})(?!\^))({_space}?)((?:/i{_token_terminator})?)({_space}?)((?:not{_token_terminator})?)({_space}?)', + bygroups(Keyword, using(this, state='text'), Keyword, + using(this, state='text'), Keyword, + using(this, state='text')), ('(?', 'if')), + (rf'rem(((?=\()|{_token_terminator}){_space}?{_stoken}?.*|{_keyword_terminator}{rest_of_line_compound if compound else rest_of_line})', + Comment.Single, f'follow{suffix}'), + (rf'(set{_keyword_terminator}){set_space}(/a)', + bygroups(Keyword, using(this, state='text'), Keyword), + f'arithmetic{suffix}'), + (r'(set{}){}((?:/p)?){}((?:(?:(?:\^[{}]?)?[^"{}{}^={}]|' + r'\^[{}]?[^"=])+)?)((?:(?:\^[{}]?)?=)?)'.format(_keyword_terminator, set_space, set_space, _nl, _nl, _punct, + ')' if compound else '', _nl, _nl), + bygroups(Keyword, using(this, state='text'), Keyword, + using(this, state='text'), using(this, state='variable'), + Punctuation), + f'follow{suffix}'), + default(f'follow{suffix}') + ] + + def _make_follow_state(compound, _label=_label, + _label_compound=_label_compound, _nl=_nl, + _space=_space, _start_label=_start_label, + _token=_token, _token_compound=_token_compound, + _ws=_ws): + suffix = '/compound' if compound else '' + state = [] + if compound: + state.append((r'(?=\))', Text, '#pop')) + state += [ + (rf'{_start_label}([{_ws}]*)({_label_compound if compound else _label})(.*)', + bygroups(Text, Punctuation, Text, Name.Label, Comment.Single)), + include(f'redirect{suffix}'), + (rf'(?=[{_nl}])', Text, '#pop'), + (r'\|\|?|&&?', Punctuation, '#pop'), + include('text') + ] + return state + + def _make_arithmetic_state(compound, _nl=_nl, _punct=_punct, + _string=_string, _variable=_variable, + _ws=_ws, _nlws=_nlws): + op = r'=+\-*/!~' + state = [] + if compound: + state.append((r'(?=\))', Text, '#pop')) + state += [ + (r'0[0-7]+', Number.Oct), + (r'0x[\da-f]+', Number.Hex), + (r'\d+', Number.Integer), + (r'[(),]+', Punctuation), + (rf'([{op}]|%|\^\^)+', Operator), + (r'({}|{}|(\^[{}]?)?[^(){}%\^"{}{}]|\^[{}]?{})+'.format(_string, _variable, _nl, op, _nlws, _punct, _nlws, + r'[^)]' if compound else r'[\w\W]'), + using(this, state='variable')), + (r'(?=[\x00|&])', Text, '#pop'), + include('follow') + ] + return state + + def _make_call_state(compound, _label=_label, + _label_compound=_label_compound): + state = [] + if compound: + state.append((r'(?=\))', Text, '#pop')) + state.append((r'(:?)(%s)' % (_label_compound if compound else _label), + bygroups(Punctuation, Name.Label), '#pop')) + return state + + def _make_label_state(compound, _label=_label, + _label_compound=_label_compound, _nl=_nl, + _punct=_punct, _string=_string, _variable=_variable): + state = [] + if compound: + state.append((r'(?=\))', Text, '#pop')) + state.append((r'({}?)((?:{}|{}|\^[{}]?{}|[^"%^{}{}{}])*)'.format(_label_compound if compound else _label, _string, + _variable, _nl, r'[^)]' if compound else r'[\w\W]', _nl, + _punct, r')' if compound else ''), + bygroups(Name.Label, Comment.Single), '#pop')) + return state + + def _make_redirect_state(compound, + _core_token_compound=_core_token_compound, + _nl=_nl, _punct=_punct, _stoken=_stoken, + _string=_string, _space=_space, + _variable=_variable, _nlws=_nlws): + stoken_compound = (rf'(?:[{_punct}]+|(?:{_string}|{_variable}|{_core_token_compound})+)') + return [ + (rf'((?:(?<=[{_nlws}])\d)?)(>>?&|<&)([{_nlws}]*)(\d)', + bygroups(Number.Integer, Punctuation, Text, Number.Integer)), + (rf'((?:(?<=[{_nlws}])(?>?|<)({_space}?{stoken_compound if compound else _stoken})', + bygroups(Number.Integer, Punctuation, using(this, state='text'))) + ] + + tokens = { + 'root': _make_begin_state(False), + 'follow': _make_follow_state(False), + 'arithmetic': _make_arithmetic_state(False), + 'call': _make_call_state(False), + 'label': _make_label_state(False), + 'redirect': _make_redirect_state(False), + 'root/compound': _make_begin_state(True), + 'follow/compound': _make_follow_state(True), + 'arithmetic/compound': _make_arithmetic_state(True), + 'call/compound': _make_call_state(True), + 'label/compound': _make_label_state(True), + 'redirect/compound': _make_redirect_state(True), + 'variable-or-escape': [ + (_variable, Name.Variable), + (rf'%%|\^[{_nl}]?(\^!|[\w\W])', String.Escape) + ], + 'string': [ + (r'"', String.Double, '#pop'), + (_variable, Name.Variable), + (r'\^!|%%', String.Escape), + (rf'[^"%^{_nl}]+|[%^]', String.Double), + default('#pop') + ], + 'sqstring': [ + include('variable-or-escape'), + (r'[^%]+|%', String.Single) + ], + 'bqstring': [ + include('variable-or-escape'), + (r'[^%]+|%', String.Backtick) + ], + 'text': [ + (r'"', String.Double, 'string'), + include('variable-or-escape'), + (rf'[^"%^{_nlws}{_punct}\d)]+|.', Text) + ], + 'variable': [ + (r'"', String.Double, 'string'), + include('variable-or-escape'), + (rf'[^"%^{_nl}]+|.', Name.Variable) + ], + 'for': [ + (rf'({_space})(in)({_space})(\()', + bygroups(using(this, state='text'), Keyword, + using(this, state='text'), Punctuation), '#pop'), + include('follow') + ], + 'for2': [ + (r'\)', Punctuation), + (rf'({_space})(do{_token_terminator})', + bygroups(using(this, state='text'), Keyword), '#pop'), + (rf'[{_nl}]+', Text), + include('follow') + ], + 'for/f': [ + (rf'(")((?:{_variable}|[^"])*?")([{_nlws}]*)(\))', + bygroups(String.Double, using(this, state='string'), Text, + Punctuation)), + (r'"', String.Double, ('#pop', 'for2', 'string')), + (rf"('(?:%%|{_variable}|[\w\W])*?')([{_nlws}]*)(\))", + bygroups(using(this, state='sqstring'), Text, Punctuation)), + (rf'(`(?:%%|{_variable}|[\w\W])*?`)([{_nlws}]*)(\))', + bygroups(using(this, state='bqstring'), Text, Punctuation)), + include('for2') + ], + 'for/l': [ + (r'-?\d+', Number.Integer), + include('for2') + ], + 'if': [ + (rf'((?:cmdextversion|errorlevel){_token_terminator})({_space})(\d+)', + bygroups(Keyword, using(this, state='text'), + Number.Integer), '#pop'), + (rf'(defined{_token_terminator})({_space})({_stoken})', + bygroups(Keyword, using(this, state='text'), + using(this, state='variable')), '#pop'), + (rf'(exist{_token_terminator})({_space}{_stoken})', + bygroups(Keyword, using(this, state='text')), '#pop'), + (rf'({_number}{_space})({_opword})({_space}{_number})', + bygroups(using(this, state='arithmetic'), Operator.Word, + using(this, state='arithmetic')), '#pop'), + (_stoken, using(this, state='text'), ('#pop', 'if2')), + ], + 'if2': [ + (rf'({_space}?)(==)({_space}?{_stoken})', + bygroups(using(this, state='text'), Operator, + using(this, state='text')), '#pop'), + (rf'({_space})({_opword})({_space}{_stoken})', + bygroups(using(this, state='text'), Operator.Word, + using(this, state='text')), '#pop') + ], + '(?': [ + (_space, using(this, state='text')), + (r'\(', Punctuation, ('#pop', 'else?', 'root/compound')), + default('#pop') + ], + 'else?': [ + (_space, using(this, state='text')), + (rf'else{_token_terminator}', Keyword, '#pop'), + default('#pop') + ] + } + + +class MSDOSSessionLexer(ShellSessionBaseLexer): + """ + Lexer for MS DOS shell sessions, i.e. command lines, including a + prompt, interspersed with output. + """ + + name = 'MSDOS Session' + aliases = ['doscon'] + filenames = [] + mimetypes = [] + url = 'https://en.wikipedia.org/wiki/MS-DOS' + version_added = '2.1' + _example = "doscon/session" + + _innerLexerCls = BatchLexer + _ps1rgx = re.compile(r'^([^>]*>)(.*\n?)') + _ps2 = 'More? ' + + +class TcshLexer(RegexLexer): + """ + Lexer for tcsh scripts. + """ + + name = 'Tcsh' + aliases = ['tcsh', 'csh'] + filenames = ['*.tcsh', '*.csh'] + mimetypes = ['application/x-csh'] + url = 'https://www.tcsh.org' + version_added = '0.10' + + tokens = { + 'root': [ + include('basic'), + (r'\$\(', Keyword, 'paren'), + (r'\$\{#?', Keyword, 'curly'), + (r'`', String.Backtick, 'backticks'), + include('data'), + ], + 'basic': [ + (r'\b(if|endif|else|while|then|foreach|case|default|' + r'break|continue|goto|breaksw|end|switch|endsw)\s*\b', + Keyword), + (r'\b(alias|alloc|bg|bindkey|builtins|bye|caller|cd|chdir|' + r'complete|dirs|echo|echotc|eval|exec|exit|fg|filetest|getxvers|' + r'glob|getspath|hashstat|history|hup|inlib|jobs|kill|' + r'limit|log|login|logout|ls-F|migrate|newgrp|nice|nohup|notify|' + r'onintr|popd|printenv|pushd|rehash|repeat|rootnode|popd|pushd|' + r'set|shift|sched|setenv|setpath|settc|setty|setxvers|shift|' + r'source|stop|suspend|source|suspend|telltc|time|' + r'umask|unalias|uncomplete|unhash|universe|unlimit|unset|unsetenv|' + r'ver|wait|warp|watchlog|where|which)\s*\b', + Name.Builtin), + (r'#.*', Comment), + (r'\\[\w\W]', String.Escape), + (r'(\b\w+)(\s*)(=)', bygroups(Name.Variable, Text, Operator)), + (r'[\[\]{}()=]+', Operator), + (r'<<\s*(\'?)\\?(\w+)[\w\W]+?\2', String), + (r';', Punctuation), + ], + 'data': [ + (r'(?s)"(\\\\|\\[0-7]+|\\.|[^"\\])*"', String.Double), + (r"(?s)'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single), + (r'\s+', Text), + (r'[^=\s\[\]{}()$"\'`\\;#]+', Text), + (r'\d+(?= |\Z)', Number), + (r'\$#?(\w+|.)', Name.Variable), + ], + 'curly': [ + (r'\}', Keyword, '#pop'), + (r':-', Keyword), + (r'\w+', Name.Variable), + (r'[^}:"\'`$]+', Punctuation), + (r':', Punctuation), + include('root'), + ], + 'paren': [ + (r'\)', Keyword, '#pop'), + include('root'), + ], + 'backticks': [ + (r'`', String.Backtick, '#pop'), + include('root'), + ], + } + + +class TcshSessionLexer(ShellSessionBaseLexer): + """ + Lexer for Tcsh sessions, i.e. command lines, including a + prompt, interspersed with output. + """ + + name = 'Tcsh Session' + aliases = ['tcshcon'] + filenames = [] + mimetypes = [] + url = 'https://www.tcsh.org' + version_added = '2.1' + _example = "tcshcon/session" + + _innerLexerCls = TcshLexer + _ps1rgx = re.compile(r'^([^>]+>)(.*\n?)') + _ps2 = '? ' + + +class PowerShellLexer(RegexLexer): + """ + For Windows PowerShell code. + """ + name = 'PowerShell' + aliases = ['powershell', 'pwsh', 'posh', 'ps1', 'psm1'] + filenames = ['*.ps1', '*.psm1'] + mimetypes = ['text/x-powershell'] + url = 'https://learn.microsoft.com/en-us/powershell' + version_added = '1.5' + + flags = re.DOTALL | re.IGNORECASE | re.MULTILINE + + keywords = ( + 'while validateset validaterange validatepattern validatelength ' + 'validatecount until trap switch return ref process param parameter in ' + 'if global: local: function foreach for finally filter end elseif else ' + 'dynamicparam do default continue cmdletbinding break begin alias \\? ' + '% #script #private #local #global mandatory parametersetname position ' + 'valuefrompipeline valuefrompipelinebypropertyname ' + 'valuefromremainingarguments helpmessage try catch throw').split() + + operators = ( + 'and as band bnot bor bxor casesensitive ccontains ceq cge cgt cle ' + 'clike clt cmatch cne cnotcontains cnotlike cnotmatch contains ' + 'creplace eq exact f file ge gt icontains ieq ige igt ile ilike ilt ' + 'imatch ine inotcontains inotlike inotmatch ireplace is isnot le like ' + 'lt match ne not notcontains notlike notmatch or regex replace ' + 'wildcard').split() + + verbs = ( + 'write where watch wait use update unregister unpublish unprotect ' + 'unlock uninstall undo unblock trace test tee take sync switch ' + 'suspend submit stop step start split sort skip show set send select ' + 'search scroll save revoke resume restore restart resolve resize ' + 'reset request repair rename remove register redo receive read push ' + 'publish protect pop ping out optimize open new move mount merge ' + 'measure lock limit join invoke install initialize import hide group ' + 'grant get format foreach find export expand exit enter enable edit ' + 'dismount disconnect disable deny debug cxnew copy convertto ' + 'convertfrom convert connect confirm compress complete compare close ' + 'clear checkpoint block backup assert approve aggregate add').split() + + aliases_ = ( + 'ac asnp cat cd cfs chdir clc clear clhy cli clp cls clv cnsn ' + 'compare copy cp cpi cpp curl cvpa dbp del diff dir dnsn ebp echo epal ' + 'epcsv epsn erase etsn exsn fc fhx fl foreach ft fw gal gbp gc gci gcm ' + 'gcs gdr ghy gi gjb gl gm gmo gp gps gpv group gsn gsnp gsv gu gv gwmi ' + 'h history icm iex ihy ii ipal ipcsv ipmo ipsn irm ise iwmi iwr kill lp ' + 'ls man md measure mi mount move mp mv nal ndr ni nmo npssc nsn nv ogv ' + 'oh popd ps pushd pwd r rbp rcjb rcsn rd rdr ren ri rjb rm rmdir rmo ' + 'rni rnp rp rsn rsnp rujb rv rvpa rwmi sajb sal saps sasv sbp sc select ' + 'set shcm si sl sleep sls sort sp spjb spps spsv start sujb sv swmi tee ' + 'trcm type wget where wjb write').split() + + commenthelp = ( + 'component description example externalhelp forwardhelpcategory ' + 'forwardhelptargetname functionality inputs link ' + 'notes outputs parameter remotehelprunspace role synopsis').split() + + tokens = { + 'root': [ + # we need to count pairs of parentheses for correct highlight + # of '$(...)' blocks in strings + (r'\(', Punctuation, 'child'), + (r'\s+', Text), + (r'^(\s*#[#\s]*)(\.(?:{}))([^\n]*$)'.format('|'.join(commenthelp)), + bygroups(Comment, String.Doc, Comment)), + (r'#[^\n]*?$', Comment), + (r'(<|<)#', Comment.Multiline, 'multline'), + (r'@"\n', String.Heredoc, 'heredoc-double'), + (r"@'\n.*?\n'@", String.Heredoc), + # escaped syntax + (r'`[\'"$@-]', Punctuation), + (r'"', String.Double, 'string'), + (r"'([^']|'')*'", String.Single), + (r'(\$|@@|@)((global|script|private|env):)?\w+', + Name.Variable), + (r'({})\b'.format('|'.join(keywords)), Keyword), + (r'-({})\b'.format('|'.join(operators)), Operator), + (r'({})-[a-z_]\w*\b'.format('|'.join(verbs)), Name.Builtin), + (r'({})\s'.format('|'.join(aliases_)), Name.Builtin), + (r'\[[a-z_\[][\w. `,\[\]]*\]', Name.Constant), # .net [type]s + (r'-[a-z_]\w*', Name), + (r'\w+', Name), + (r'[.,;:@{}\[\]$()=+*/\\&%!~?^`|<>-]', Punctuation), + ], + 'child': [ + (r'\)', Punctuation, '#pop'), + include('root'), + ], + 'multline': [ + (r'[^#&.]+', Comment.Multiline), + (r'#(>|>)', Comment.Multiline, '#pop'), + (r'\.({})'.format('|'.join(commenthelp)), String.Doc), + (r'[#&.]', Comment.Multiline), + ], + 'string': [ + (r"`[0abfnrtv'\"$`]", String.Escape), + (r'[^$`"]+', String.Double), + (r'\$\(', Punctuation, 'child'), + (r'""', String.Double), + (r'[`$]', String.Double), + (r'"', String.Double, '#pop'), + ], + 'heredoc-double': [ + (r'\n"@', String.Heredoc, '#pop'), + (r'\$\(', Punctuation, 'child'), + (r'[^@\n]+"]', String.Heredoc), + (r".", String.Heredoc), + ] + } + + +class PowerShellSessionLexer(ShellSessionBaseLexer): + """ + Lexer for PowerShell sessions, i.e. command lines, including a + prompt, interspersed with output. + """ + + name = 'PowerShell Session' + aliases = ['pwsh-session', 'ps1con'] + filenames = [] + mimetypes = [] + url = 'https://learn.microsoft.com/en-us/powershell' + version_added = '2.1' + _example = "pwsh-session/session" + + _innerLexerCls = PowerShellLexer + _bare_continuation = True + _ps1rgx = re.compile(r'^((?:\[[^]]+\]: )?PS[^>]*> ?)(.*\n?)') + _ps2 = '> ' + + +class FishShellLexer(RegexLexer): + """ + Lexer for Fish shell scripts. + """ + + name = 'Fish' + aliases = ['fish', 'fishshell'] + filenames = ['*.fish', '*.load'] + mimetypes = ['application/x-fish'] + url = 'https://fishshell.com' + version_added = '2.1' + + tokens = { + 'root': [ + include('basic'), + include('data'), + include('interp'), + ], + 'interp': [ + (r'\$\(\(', Keyword, 'math'), + (r'\(', Keyword, 'paren'), + (r'\$#?(\w+|.)', Name.Variable), + ], + 'basic': [ + (r'\b(begin|end|if|else|while|break|for|in|return|function|block|' + r'case|continue|switch|not|and|or|set|echo|exit|pwd|true|false|' + r'cd|count|test)(\s*)\b', + bygroups(Keyword, Text)), + (r'\b(alias|bg|bind|breakpoint|builtin|command|commandline|' + r'complete|contains|dirh|dirs|emit|eval|exec|fg|fish|fish_config|' + r'fish_indent|fish_pager|fish_prompt|fish_right_prompt|' + r'fish_update_completions|fishd|funced|funcsave|functions|help|' + r'history|isatty|jobs|math|mimedb|nextd|open|popd|prevd|psub|' + r'pushd|random|read|set_color|source|status|trap|type|ulimit|' + r'umask|vared|fc|getopts|hash|kill|printf|time|wait)\s*\b(?!\.)', + Name.Builtin), + (r'#.*\n', Comment), + (r'\\[\w\W]', String.Escape), + (r'(\b\w+)(\s*)(=)', bygroups(Name.Variable, Whitespace, Operator)), + (r'[\[\]()=]', Operator), + (r'<<-?\s*(\'?)\\?(\w+)[\w\W]+?\2', String), + ], + 'data': [ + (r'(?s)\$?"(\\\\|\\[0-7]+|\\.|[^"\\$])*"', String.Double), + (r'"', String.Double, 'string'), + (r"(?s)\$'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single), + (r"(?s)'.*?'", String.Single), + (r';', Punctuation), + (r'&|\||\^|<|>', Operator), + (r'\s+', Text), + (r'\d+(?= |\Z)', Number), + (r'[^=\s\[\]{}()$"\'`\\<&|;]+', Text), + ], + 'string': [ + (r'"', String.Double, '#pop'), + (r'(?s)(\\\\|\\[0-7]+|\\.|[^"\\$])+', String.Double), + include('interp'), + ], + 'paren': [ + (r'\)', Keyword, '#pop'), + include('root'), + ], + 'math': [ + (r'\)\)', Keyword, '#pop'), + (r'[-+*/%^|&]|\*\*|\|\|', Operator), + (r'\d+#\d+', Number), + (r'\d+#(?! )', Number), + (r'\d+', Number), + include('root'), + ], + } + +class ExeclineLexer(RegexLexer): + """ + Lexer for Laurent Bercot's execline language. + """ + + name = 'execline' + aliases = ['execline'] + filenames = ['*.exec'] + url = 'https://skarnet.org/software/execline' + version_added = '2.7' + + tokens = { + 'root': [ + include('basic'), + include('data'), + include('interp') + ], + 'interp': [ + (r'\$\{', String.Interpol, 'curly'), + (r'\$[\w@#]+', Name.Variable), # user variable + (r'\$', Text), + ], + 'basic': [ + (r'\b(background|backtick|cd|define|dollarat|elgetopt|' + r'elgetpositionals|elglob|emptyenv|envfile|exec|execlineb|' + r'exit|export|fdblock|fdclose|fdmove|fdreserve|fdswap|' + r'forbacktickx|foreground|forstdin|forx|getcwd|getpid|heredoc|' + r'homeof|if|ifelse|ifte|ifthenelse|importas|loopwhilex|' + r'multidefine|multisubstitute|pipeline|piperw|posix-cd|' + r'redirfd|runblock|shift|trap|tryexec|umask|unexport|wait|' + r'withstdinas)\b', Name.Builtin), + (r'\A#!.+\n', Comment.Hashbang), + (r'#.*\n', Comment.Single), + (r'[{}]', Operator) + ], + 'data': [ + (r'(?s)"(\\.|[^"\\$])*"', String.Double), + (r'"', String.Double, 'string'), + (r'\s+', Text), + (r'[^\s{}$"\\]+', Text) + ], + 'string': [ + (r'"', String.Double, '#pop'), + (r'(?s)(\\\\|\\.|[^"\\$])+', String.Double), + include('interp'), + ], + 'curly': [ + (r'\}', String.Interpol, '#pop'), + (r'[\w#@]+', Name.Variable), + include('root') + ] + + } + + def analyse_text(text): + if shebang_matches(text, r'execlineb'): + return 1 diff --git a/lib/python3.12/site-packages/pygments/lexers/slash.py b/lib/python3.12/site-packages/pygments/lexers/slash.py new file mode 100644 index 0000000000000000000000000000000000000000..1c439d0db0fd51d6870f1294b2eb276aa64e8a6c --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/slash.py @@ -0,0 +1,183 @@ +""" + pygments.lexers.slash + ~~~~~~~~~~~~~~~~~~~~~ + + Lexer for the Slash programming language. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import ExtendedRegexLexer, bygroups, DelegatingLexer +from pygments.token import Name, Number, String, Comment, Punctuation, \ + Other, Keyword, Operator, Whitespace + +__all__ = ['SlashLexer'] + + +class SlashLanguageLexer(ExtendedRegexLexer): + _nkw = r'(?=[^a-zA-Z_0-9])' + + def move_state(new_state): + return ("#pop", new_state) + + def right_angle_bracket(lexer, match, ctx): + if len(ctx.stack) > 1 and ctx.stack[-2] == "string": + ctx.stack.pop() + yield match.start(), String.Interpol, '}' + ctx.pos = match.end() + pass + + tokens = { + "root": [ + (r"<%=", Comment.Preproc, move_state("slash")), + (r"<%!!", Comment.Preproc, move_state("slash")), + (r"<%#.*?%>", Comment.Multiline), + (r"<%", Comment.Preproc, move_state("slash")), + (r".|\n", Other), + ], + "string": [ + (r"\\", String.Escape, move_state("string_e")), + (r"\"", String, move_state("slash")), + (r"#\{", String.Interpol, "slash"), + (r'.|\n', String), + ], + "string_e": [ + (r'n', String.Escape, move_state("string")), + (r't', String.Escape, move_state("string")), + (r'r', String.Escape, move_state("string")), + (r'e', String.Escape, move_state("string")), + (r'x[a-fA-F0-9]{2}', String.Escape, move_state("string")), + (r'.', String.Escape, move_state("string")), + ], + "regexp": [ + (r'}[a-z]*', String.Regex, move_state("slash")), + (r'\\(.|\n)', String.Regex), + (r'{', String.Regex, "regexp_r"), + (r'.|\n', String.Regex), + ], + "regexp_r": [ + (r'}[a-z]*', String.Regex, "#pop"), + (r'\\(.|\n)', String.Regex), + (r'{', String.Regex, "regexp_r"), + ], + "slash": [ + (r"%>", Comment.Preproc, move_state("root")), + (r"\"", String, move_state("string")), + (r"'[a-zA-Z0-9_]+", String), + (r'%r{', String.Regex, move_state("regexp")), + (r'/\*.*?\*/', Comment.Multiline), + (r"(#|//).*?\n", Comment.Single), + (r'-?[0-9]+e[+-]?[0-9]+', Number.Float), + (r'-?[0-9]+\.[0-9]+(e[+-]?[0-9]+)?', Number.Float), + (r'-?[0-9]+', Number.Integer), + (r'nil'+_nkw, Name.Builtin), + (r'true'+_nkw, Name.Builtin), + (r'false'+_nkw, Name.Builtin), + (r'self'+_nkw, Name.Builtin), + (r'(class)(\s+)([A-Z][a-zA-Z0-9_\']*)', + bygroups(Keyword, Whitespace, Name.Class)), + (r'class'+_nkw, Keyword), + (r'extends'+_nkw, Keyword), + (r'(def)(\s+)(self)(\s*)(\.)(\s*)([a-z_][a-zA-Z0-9_\']*=?|<<|>>|==|<=>|<=|<|>=|>|\+|-(self)?|~(self)?|\*|/|%|^|&&|&|\||\[\]=?)', + bygroups(Keyword, Whitespace, Name.Builtin, Whitespace, Punctuation, Whitespace, Name.Function)), + (r'(def)(\s+)([a-z_][a-zA-Z0-9_\']*=?|<<|>>|==|<=>|<=|<|>=|>|\+|-(self)?|~(self)?|\*|/|%|^|&&|&|\||\[\]=?)', + bygroups(Keyword, Whitespace, Name.Function)), + (r'def'+_nkw, Keyword), + (r'if'+_nkw, Keyword), + (r'elsif'+_nkw, Keyword), + (r'else'+_nkw, Keyword), + (r'unless'+_nkw, Keyword), + (r'for'+_nkw, Keyword), + (r'in'+_nkw, Keyword), + (r'while'+_nkw, Keyword), + (r'until'+_nkw, Keyword), + (r'and'+_nkw, Keyword), + (r'or'+_nkw, Keyword), + (r'not'+_nkw, Keyword), + (r'lambda'+_nkw, Keyword), + (r'try'+_nkw, Keyword), + (r'catch'+_nkw, Keyword), + (r'return'+_nkw, Keyword), + (r'next'+_nkw, Keyword), + (r'last'+_nkw, Keyword), + (r'throw'+_nkw, Keyword), + (r'use'+_nkw, Keyword), + (r'switch'+_nkw, Keyword), + (r'\\', Keyword), + (r'λ', Keyword), + (r'__FILE__'+_nkw, Name.Builtin.Pseudo), + (r'__LINE__'+_nkw, Name.Builtin.Pseudo), + (r'[A-Z][a-zA-Z0-9_\']*'+_nkw, Name.Constant), + (r'[a-z_][a-zA-Z0-9_\']*'+_nkw, Name), + (r'@[a-z_][a-zA-Z0-9_\']*'+_nkw, Name.Variable.Instance), + (r'@@[a-z_][a-zA-Z0-9_\']*'+_nkw, Name.Variable.Class), + (r'\(', Punctuation), + (r'\)', Punctuation), + (r'\[', Punctuation), + (r'\]', Punctuation), + (r'\{', Punctuation), + (r'\}', right_angle_bracket), + (r';', Punctuation), + (r',', Punctuation), + (r'<<=', Operator), + (r'>>=', Operator), + (r'<<', Operator), + (r'>>', Operator), + (r'==', Operator), + (r'!=', Operator), + (r'=>', Operator), + (r'=', Operator), + (r'<=>', Operator), + (r'<=', Operator), + (r'>=', Operator), + (r'<', Operator), + (r'>', Operator), + (r'\+\+', Operator), + (r'\+=', Operator), + (r'-=', Operator), + (r'\*\*=', Operator), + (r'\*=', Operator), + (r'\*\*', Operator), + (r'\*', Operator), + (r'/=', Operator), + (r'\+', Operator), + (r'-', Operator), + (r'/', Operator), + (r'%=', Operator), + (r'%', Operator), + (r'^=', Operator), + (r'&&=', Operator), + (r'&=', Operator), + (r'&&', Operator), + (r'&', Operator), + (r'\|\|=', Operator), + (r'\|=', Operator), + (r'\|\|', Operator), + (r'\|', Operator), + (r'!', Operator), + (r'\.\.\.', Operator), + (r'\.\.', Operator), + (r'\.', Operator), + (r'::', Operator), + (r':', Operator), + (r'(\s|\n)+', Whitespace), + (r'[a-z_][a-zA-Z0-9_\']*', Name.Variable), + ], + } + + +class SlashLexer(DelegatingLexer): + """ + Lexer for the Slash programming language. + """ + + name = 'Slash' + aliases = ['slash'] + filenames = ['*.sla'] + url = 'https://github.com/arturadib/Slash-A' + version_added = '2.4' + + def __init__(self, **options): + from pygments.lexers.web import HtmlLexer + super().__init__(HtmlLexer, SlashLanguageLexer, **options) diff --git a/lib/python3.12/site-packages/pygments/lexers/smalltalk.py b/lib/python3.12/site-packages/pygments/lexers/smalltalk.py new file mode 100644 index 0000000000000000000000000000000000000000..674b7b4b345a4b968f080bcd1552979201da6164 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/smalltalk.py @@ -0,0 +1,194 @@ +""" + pygments.lexers.smalltalk + ~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for Smalltalk and related languages. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, include, bygroups, default +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation + +__all__ = ['SmalltalkLexer', 'NewspeakLexer'] + + +class SmalltalkLexer(RegexLexer): + """ + For Smalltalk syntax. + Contributed by Stefan Matthias Aust. + Rewritten by Nils Winter. + """ + name = 'Smalltalk' + url = 'http://www.smalltalk.org/' + filenames = ['*.st'] + aliases = ['smalltalk', 'squeak', 'st'] + mimetypes = ['text/x-smalltalk'] + version_added = '0.10' + + tokens = { + 'root': [ + (r'(<)(\w+:)(.*?)(>)', bygroups(Text, Keyword, Text, Text)), + include('squeak fileout'), + include('whitespaces'), + include('method definition'), + (r'(\|)([\w\s]*)(\|)', bygroups(Operator, Name.Variable, Operator)), + include('objects'), + (r'\^|\:=|\_', Operator), + # temporaries + (r'[\]({}.;!]', Text), + ], + 'method definition': [ + # Not perfect can't allow whitespaces at the beginning and the + # without breaking everything + (r'([a-zA-Z]+\w*:)(\s*)(\w+)', + bygroups(Name.Function, Text, Name.Variable)), + (r'^(\b[a-zA-Z]+\w*\b)(\s*)$', bygroups(Name.Function, Text)), + (r'^([-+*/\\~<>=|&!?,@%]+)(\s*)(\w+)(\s*)$', + bygroups(Name.Function, Text, Name.Variable, Text)), + ], + 'blockvariables': [ + include('whitespaces'), + (r'(:)(\s*)(\w+)', + bygroups(Operator, Text, Name.Variable)), + (r'\|', Operator, '#pop'), + default('#pop'), # else pop + ], + 'literals': [ + (r"'(''|[^'])*'", String, 'afterobject'), + (r'\$.', String.Char, 'afterobject'), + (r'#\(', String.Symbol, 'parenth'), + (r'\)', Text, 'afterobject'), + (r'(\d+r)?-?\d+(\.\d+)?(e-?\d+)?', Number, 'afterobject'), + ], + '_parenth_helper': [ + include('whitespaces'), + (r'(\d+r)?-?\d+(\.\d+)?(e-?\d+)?', Number), + (r'[-+*/\\~<>=|&#!?,@%\w:]+', String.Symbol), + # literals + (r"'(''|[^'])*'", String), + (r'\$.', String.Char), + (r'#*\(', String.Symbol, 'inner_parenth'), + ], + 'parenth': [ + # This state is a bit tricky since + # we can't just pop this state + (r'\)', String.Symbol, ('root', 'afterobject')), + include('_parenth_helper'), + ], + 'inner_parenth': [ + (r'\)', String.Symbol, '#pop'), + include('_parenth_helper'), + ], + 'whitespaces': [ + # skip whitespace and comments + (r'\s+', Text), + (r'"(""|[^"])*"', Comment), + ], + 'objects': [ + (r'\[', Text, 'blockvariables'), + (r'\]', Text, 'afterobject'), + (r'\b(self|super|true|false|nil|thisContext)\b', + Name.Builtin.Pseudo, 'afterobject'), + (r'\b[A-Z]\w*(?!:)\b', Name.Class, 'afterobject'), + (r'\b[a-z]\w*(?!:)\b', Name.Variable, 'afterobject'), + (r'#("(""|[^"])*"|[-+*/\\~<>=|&!?,@%]+|[\w:]+)', + String.Symbol, 'afterobject'), + include('literals'), + ], + 'afterobject': [ + (r'! !$', Keyword, '#pop'), # squeak chunk delimiter + include('whitespaces'), + (r'\b(ifTrue:|ifFalse:|whileTrue:|whileFalse:|timesRepeat:)', + Name.Builtin, '#pop'), + (r'\b(new\b(?!:))', Name.Builtin), + (r'\:=|\_', Operator, '#pop'), + (r'\b[a-zA-Z]+\w*:', Name.Function, '#pop'), + (r'\b[a-zA-Z]+\w*', Name.Function), + (r'\w+:?|[-+*/\\~<>=|&!?,@%]+', Name.Function, '#pop'), + (r'\.', Punctuation, '#pop'), + (r';', Punctuation), + (r'[\])}]', Text), + (r'[\[({]', Text, '#pop'), + ], + 'squeak fileout': [ + # Squeak fileout format (optional) + (r'^"(""|[^"])*"!', Keyword), + (r"^'(''|[^'])*'!", Keyword), + (r'^(!)(\w+)( commentStamp: )(.*?)( prior: .*?!\n)(.*?)(!)', + bygroups(Keyword, Name.Class, Keyword, String, Keyword, Text, Keyword)), + (r"^(!)(\w+(?: class)?)( methodsFor: )('(?:''|[^'])*')(.*?!)", + bygroups(Keyword, Name.Class, Keyword, String, Keyword)), + (r'^(\w+)( subclass: )(#\w+)' + r'(\s+instanceVariableNames: )(.*?)' + r'(\s+classVariableNames: )(.*?)' + r'(\s+poolDictionaries: )(.*?)' + r'(\s+category: )(.*?)(!)', + bygroups(Name.Class, Keyword, String.Symbol, Keyword, String, Keyword, + String, Keyword, String, Keyword, String, Keyword)), + (r'^(\w+(?: class)?)(\s+instanceVariableNames: )(.*?)(!)', + bygroups(Name.Class, Keyword, String, Keyword)), + (r'(!\n)(\].*)(! !)$', bygroups(Keyword, Text, Keyword)), + (r'! !$', Keyword), + ], + } + + +class NewspeakLexer(RegexLexer): + """ + For Newspeak syntax. + """ + name = 'Newspeak' + url = 'http://newspeaklanguage.org/' + filenames = ['*.ns2'] + aliases = ['newspeak', ] + mimetypes = ['text/x-newspeak'] + version_added = '1.1' + + tokens = { + 'root': [ + (r'\b(Newsqueak2)\b', Keyword.Declaration), + (r"'[^']*'", String), + (r'\b(class)(\s+)(\w+)(\s*)', + bygroups(Keyword.Declaration, Text, Name.Class, Text)), + (r'\b(mixin|self|super|private|public|protected|nil|true|false)\b', + Keyword), + (r'(\w+\:)(\s*)([a-zA-Z_]\w+)', + bygroups(Name.Function, Text, Name.Variable)), + (r'(\w+)(\s*)(=)', + bygroups(Name.Attribute, Text, Operator)), + (r'<\w+>', Comment.Special), + include('expressionstat'), + include('whitespace') + ], + + 'expressionstat': [ + (r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float), + (r'\d+', Number.Integer), + (r':\w+', Name.Variable), + (r'(\w+)(::)', bygroups(Name.Variable, Operator)), + (r'\w+:', Name.Function), + (r'\w+', Name.Variable), + (r'\(|\)', Punctuation), + (r'\[|\]', Punctuation), + (r'\{|\}', Punctuation), + + (r'(\^|\+|\/|~|\*|<|>|=|@|%|\||&|\?|!|,|-|:)', Operator), + (r'\.|;', Punctuation), + include('whitespace'), + include('literals'), + ], + 'literals': [ + (r'\$.', String), + (r"'[^']*'", String), + (r"#'[^']*'", String.Symbol), + (r"#\w+:?", String.Symbol), + (r"#(\+|\/|~|\*|<|>|=|@|%|\||&|\?|!|,|-)+", String.Symbol) + ], + 'whitespace': [ + (r'\s+', Text), + (r'"[^"]*"', Comment) + ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/sophia.py b/lib/python3.12/site-packages/pygments/lexers/sophia.py new file mode 100644 index 0000000000000000000000000000000000000000..37fcec5c39bfe4e8f52bf735618971684ab27739 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/sophia.py @@ -0,0 +1,102 @@ +""" + pygments.lexers.sophia + ~~~~~~~~~~~~~~~~~~~~~~ + + Lexer for Sophia. + + Derived from pygments/lexers/reason.py. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, include, default, words +from pygments.token import Comment, Keyword, Name, Number, Operator, \ + Punctuation, String, Text + +__all__ = ['SophiaLexer'] + +class SophiaLexer(RegexLexer): + """ + A Sophia lexer. + """ + + name = 'Sophia' + aliases = ['sophia'] + filenames = ['*.aes'] + mimetypes = [] + url = 'https://docs.aeternity.com/aesophia' + version_added = '2.11' + + keywords = ( + 'contract', 'include', 'let', 'switch', 'type', 'record', 'datatype', + 'if', 'elif', 'else', 'function', 'stateful', 'payable', 'public', + 'entrypoint', 'private', 'indexed', 'namespace', 'interface', 'main', + 'using', 'as', 'for', 'hiding', + ) + + builtins = ('state', 'put', 'abort', 'require') + + word_operators = ('mod', 'band', 'bor', 'bxor', 'bnot') + + primitive_types = ('int', 'address', 'bool', 'bits', 'bytes', 'string', + 'list', 'option', 'char', 'unit', 'map', 'event', + 'hash', 'signature', 'oracle', 'oracle_query') + + tokens = { + 'escape-sequence': [ + (r'\\[\\"\'ntbr]', String.Escape), + (r'\\[0-9]{3}', String.Escape), + (r'\\x[0-9a-fA-F]{2}', String.Escape), + ], + 'root': [ + (r'\s+', Text.Whitespace), + (r'(true|false)\b', Keyword.Constant), + (r'\b([A-Z][\w\']*)(?=\s*\.)', Name.Class, 'dotted'), + (r'\b([A-Z][\w\']*)', Name.Function), + (r'//.*?\n', Comment.Single), + (r'\/\*(?!/)', Comment.Multiline, 'comment'), + + (r'0[xX][\da-fA-F][\da-fA-F_]*', Number.Hex), + (r'#[\da-fA-F][\da-fA-F_]*', Name.Label), + (r'\d[\d_]*', Number.Integer), + + (words(keywords, suffix=r'\b'), Keyword), + (words(builtins, suffix=r'\b'), Name.Builtin), + (words(word_operators, prefix=r'\b', suffix=r'\b'), Operator.Word), + (words(primitive_types, prefix=r'\b', suffix=r'\b'), Keyword.Type), + + (r'[=!<>+\\*/:&|?~@^-]', Operator.Word), + (r'[.;:{}(),\[\]]', Punctuation), + + (r"(ak_|ok_|oq_|ct_)[\w']*", Name.Label), + (r"[^\W\d][\w']*", Name), + + (r"'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'", + String.Char), + (r"'.'", String.Char), + (r"'[a-z][\w]*", Name.Variable), + + (r'"', String.Double, 'string') + ], + 'comment': [ + (r'[^/*]+', Comment.Multiline), + (r'\/\*', Comment.Multiline, '#push'), + (r'\*\/', Comment.Multiline, '#pop'), + (r'\*', Comment.Multiline), + ], + 'string': [ + (r'[^\\"]+', String.Double), + include('escape-sequence'), + (r'\\\n', String.Double), + (r'"', String.Double, '#pop'), + ], + 'dotted': [ + (r'\s+', Text), + (r'\.', Punctuation), + (r'[A-Z][\w\']*(?=\s*\.)', Name.Function), + (r'[A-Z][\w\']*', Name.Function, '#pop'), + (r'[a-z_][\w\']*', Name, '#pop'), + default('#pop'), + ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/srcinfo.py b/lib/python3.12/site-packages/pygments/lexers/srcinfo.py new file mode 100644 index 0000000000000000000000000000000000000000..daf654ea9d3254278276a18cd3bb0315f91e0cf1 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/srcinfo.py @@ -0,0 +1,62 @@ +""" + pygments.lexers.srcinfo + ~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for .SRCINFO files used by Arch Linux Packages. + + The description of the format can be found in the wiki: + https://wiki.archlinux.org/title/.SRCINFO + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, words +from pygments.token import Text, Comment, Keyword, Name, Operator, Whitespace + +__all__ = ['SrcinfoLexer'] + +keywords = ( + 'pkgbase', 'pkgname', + 'pkgver', 'pkgrel', 'epoch', + 'pkgdesc', 'url', 'install', 'changelog', + 'arch', 'groups', 'license', 'noextract', 'options', 'backup', + 'validpgpkeys', +) + +architecture_dependent_keywords = ( + 'source', 'depends', 'checkdepends', 'makedepends', 'optdepends', + 'provides', 'conflicts', 'replaces', + 'md5sums', 'sha1sums', 'sha224sums', 'sha256sums', 'sha384sums', + 'sha512sums', +) + + +class SrcinfoLexer(RegexLexer): + """Lexer for .SRCINFO files used by Arch Linux Packages. + """ + + name = 'Srcinfo' + aliases = ['srcinfo'] + filenames = ['.SRCINFO'] + url = 'https://wiki.archlinux.org/title/.SRCINFO' + version_added = '2.11' + + tokens = { + 'root': [ + (r'\s+', Whitespace), + (r'#.*', Comment.Single), + (words(keywords), Keyword, 'assignment'), + (words(architecture_dependent_keywords, suffix=r'_\w+'), + Keyword, 'assignment'), + (r'\w+', Name.Variable, 'assignment'), + ], + 'assignment': [ + (r' +', Whitespace), + (r'=', Operator, 'value'), + ], + 'value': [ + (r' +', Whitespace), + (r'.*', Text, '#pop:2'), + ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/testing.py b/lib/python3.12/site-packages/pygments/lexers/testing.py new file mode 100644 index 0000000000000000000000000000000000000000..e6c59269f04d133b382cff1fba03e39ace7fdf42 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/testing.py @@ -0,0 +1,209 @@ +""" + pygments.lexers.testing + ~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for testing languages. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, include, bygroups +from pygments.token import Comment, Keyword, Name, String, Number, Generic, Text + +__all__ = ['GherkinLexer', 'TAPLexer'] + + +class GherkinLexer(RegexLexer): + """ + For Gherkin syntax. + """ + name = 'Gherkin' + aliases = ['gherkin', 'cucumber'] + filenames = ['*.feature'] + mimetypes = ['text/x-gherkin'] + url = 'https://cucumber.io/docs/gherkin' + version_added = '1.2' + + feature_keywords = '^(기능|機能|功能|フィーチャ|خاصية|תכונה|Функціонал|Функционалност|Функционал|Фича|Особина|Могућност|Özellik|Właściwość|Tính năng|Trajto|Savybė|Požiadavka|Požadavek|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Fīča|Funzionalità|Funktionalität|Funkcionalnost|Funkcionalitāte|Funcționalitate|Functionaliteit|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Feature|Egenskap|Egenskab|Crikey|Característica|Arwedd)(:)(.*)$' + feature_element_keywords = '^(\\s*)(시나리오 개요|시나리오|배경|背景|場景大綱|場景|场景大纲|场景|劇本大綱|劇本|剧本大纲|剧本|テンプレ|シナリオテンプレート|シナリオテンプレ|シナリオアウトライン|シナリオ|سيناريو مخطط|سيناريو|الخلفية|תרחיש|תבנית תרחיש|רקע|Тарих|Сценарій|Сценарио|Сценарий структураси|Сценарий|Структура сценарію|Структура сценарија|Структура сценария|Скица|Рамка на сценарий|Пример|Предыстория|Предистория|Позадина|Передумова|Основа|Концепт|Контекст|Założenia|Wharrimean is|Tình huống|The thing of it is|Tausta|Taust|Tapausaihio|Tapaus|Szenariogrundriss|Szenario|Szablon scenariusza|Stsenaarium|Struktura scenarija|Skica|Skenario konsep|Skenario|Situācija|Senaryo taslağı|Senaryo|Scénář|Scénario|Schema dello scenario|Scenārijs pēc parauga|Scenārijs|Scenár|Scenaro|Scenariusz|Scenariul de şablon|Scenariul de sablon|Scenariu|Scenario Outline|Scenario Amlinellol|Scenario|Scenarijus|Scenarijaus šablonas|Scenarij|Scenarie|Rerefons|Raamstsenaarium|Primer|Pozadí|Pozadina|Pozadie|Plan du scénario|Plan du Scénario|Osnova scénáře|Osnova|Náčrt Scénáře|Náčrt Scenáru|Mate|MISHUN SRSLY|MISHUN|Kịch bản|Konturo de la scenaro|Kontext|Konteksts|Kontekstas|Kontekst|Koncept|Khung tình huống|Khung kịch bản|Háttér|Grundlage|Geçmiş|Forgatókönyv vázlat|Forgatókönyv|Fono|Esquema do Cenário|Esquema do Cenario|Esquema del escenario|Esquema de l\'escenari|Escenario|Escenari|Dis is what went down|Dasar|Contexto|Contexte|Contesto|Condiţii|Conditii|Cenário|Cenario|Cefndir|Bối cảnh|Blokes|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|All y\'all|Achtergrond|Abstrakt Scenario|Abstract Scenario)(:)(.*)$' + examples_keywords = '^(\\s*)(예|例子|例|サンプル|امثلة|דוגמאות|Сценарији|Примери|Приклади|Мисоллар|Значения|Örnekler|Voorbeelden|Variantai|Tapaukset|Scenarios|Scenariji|Scenarijai|Příklady|Példák|Príklady|Przykłady|Primjeri|Primeri|Piemēri|Pavyzdžiai|Paraugs|Juhtumid|Exemplos|Exemples|Exemplele|Exempel|Examples|Esempi|Enghreifftiau|Ekzemploj|Eksempler|Ejemplos|EXAMPLZ|Dữ liệu|Contoh|Cobber|Beispiele)(:)(.*)$' + step_keywords = '^(\\s*)(하지만|조건|먼저|만일|만약|단|그리고|그러면|那麼|那么|而且|當|当|前提|假設|假设|假如|假定|但是|但し|並且|并且|同時|同时|もし|ならば|ただし|しかし|かつ|و |متى |لكن |عندما |ثم |بفرض |اذاً |כאשר |וגם |בהינתן |אזי |אז |אבל |Якщо |Унда |То |Припустимо, що |Припустимо |Онда |Но |Нехай |Лекин |Когато |Када |Кад |К тому же |И |Задато |Задати |Задате |Если |Допустим |Дадено |Ва |Бирок |Аммо |Али |Але |Агар |А |І |Și |És |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Youse know when youse got |Youse know like when |Yna |Ya know how |Ya gotta |Y |Wun |Wtedy |When y\'all |When |Wenn |WEN |Và |Ve |Und |Un |Thì |Then y\'all |Then |Tapi |Tak |Tada |Tad |Så |Stel |Soit |Siis |Si |Sed |Se |Quando |Quand |Quan |Pryd |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Når |När |Niin |Nhưng |N |Mutta |Men |Mas |Maka |Majd |Mais |Maar |Ma |Lorsque |Lorsqu\'|Kun |Kuid |Kui |Khi |Keď |Ketika |Když |Kaj |Kai |Kada |Kad |Jeżeli |Ja |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y\'all |Given |Gitt |Gegeven |Gegeben sei |Fakat |Eğer ki |Etant donné |Et |Então |Entonces |Entao |En |Eeldades |E |Duota |Dun |Donitaĵo |Donat |Donada |Do |Diyelim ki |Dengan |Den youse gotta |De |Dato |Dar |Dann |Dan |Dado |Dacă |Daca |DEN |Când |Cuando |Cho |Cept |Cand |Cal |But y\'all |But |Buh |Biết |Bet |BUT |Atès |Atunci |Atesa |Anrhegedig a |Angenommen |And y\'all |And |An |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Aber |AN |A také |A |\\* )' + + tokens = { + 'comments': [ + (r'^\s*#.*$', Comment), + ], + 'feature_elements': [ + (step_keywords, Keyword, "step_content_stack"), + include('comments'), + (r"(\s|.)", Name.Function), + ], + 'feature_elements_on_stack': [ + (step_keywords, Keyword, "#pop:2"), + include('comments'), + (r"(\s|.)", Name.Function), + ], + 'examples_table': [ + (r"\s+\|", Keyword, 'examples_table_header'), + include('comments'), + (r"(\s|.)", Name.Function), + ], + 'examples_table_header': [ + (r"\s+\|\s*$", Keyword, "#pop:2"), + include('comments'), + (r"\\\|", Name.Variable), + (r"\s*\|", Keyword), + (r"[^|]", Name.Variable), + ], + 'scenario_sections_on_stack': [ + (feature_element_keywords, + bygroups(Name.Function, Keyword, Keyword, Name.Function), + "feature_elements_on_stack"), + ], + 'narrative': [ + include('scenario_sections_on_stack'), + include('comments'), + (r"(\s|.)", Name.Function), + ], + 'table_vars': [ + (r'(<[^>]+>)', Name.Variable), + ], + 'numbers': [ + (r'(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', String), + ], + 'string': [ + include('table_vars'), + (r'(\s|.)', String), + ], + 'py_string': [ + (r'"""', Keyword, "#pop"), + include('string'), + ], + 'step_content_root': [ + (r"$", Keyword, "#pop"), + include('step_content'), + ], + 'step_content_stack': [ + (r"$", Keyword, "#pop:2"), + include('step_content'), + ], + 'step_content': [ + (r'"', Name.Function, "double_string"), + include('table_vars'), + include('numbers'), + include('comments'), + (r'(\s|.)', Name.Function), + ], + 'table_content': [ + (r"\s+\|\s*$", Keyword, "#pop"), + include('comments'), + (r"\\\|", String), + (r"\s*\|", Keyword), + include('string'), + ], + 'double_string': [ + (r'"', Name.Function, "#pop"), + include('string'), + ], + 'root': [ + (r'\n', Name.Function), + include('comments'), + (r'"""', Keyword, "py_string"), + (r'\s+\|', Keyword, 'table_content'), + (r'"', Name.Function, "double_string"), + include('table_vars'), + include('numbers'), + (r'(\s*)(@[^@\r\n\t ]+)', bygroups(Name.Function, Name.Tag)), + (step_keywords, bygroups(Name.Function, Keyword), + 'step_content_root'), + (feature_keywords, bygroups(Keyword, Keyword, Name.Function), + 'narrative'), + (feature_element_keywords, + bygroups(Name.Function, Keyword, Keyword, Name.Function), + 'feature_elements'), + (examples_keywords, + bygroups(Name.Function, Keyword, Keyword, Name.Function), + 'examples_table'), + (r'(\s|.)', Name.Function), + ] + } + + def analyse_text(self, text): + return + + +class TAPLexer(RegexLexer): + """ + For Test Anything Protocol (TAP) output. + """ + name = 'TAP' + url = 'https://testanything.org/' + aliases = ['tap'] + filenames = ['*.tap'] + version_added = '2.1' + + tokens = { + 'root': [ + # A TAP version may be specified. + (r'^TAP version \d+\n', Name.Namespace), + + # Specify a plan with a plan line. + (r'^1\.\.\d+', Keyword.Declaration, 'plan'), + + # A test failure + (r'^(not ok)([^\S\n]*)(\d*)', + bygroups(Generic.Error, Text, Number.Integer), 'test'), + + # A test success + (r'^(ok)([^\S\n]*)(\d*)', + bygroups(Keyword.Reserved, Text, Number.Integer), 'test'), + + # Diagnostics start with a hash. + (r'^#.*\n', Comment), + + # TAP's version of an abort statement. + (r'^Bail out!.*\n', Generic.Error), + + # TAP ignores any unrecognized lines. + (r'^.*\n', Text), + ], + 'plan': [ + # Consume whitespace (but not newline). + (r'[^\S\n]+', Text), + + # A plan may have a directive with it. + (r'#', Comment, 'directive'), + + # Or it could just end. + (r'\n', Comment, '#pop'), + + # Anything else is wrong. + (r'.*\n', Generic.Error, '#pop'), + ], + 'test': [ + # Consume whitespace (but not newline). + (r'[^\S\n]+', Text), + + # A test may have a directive with it. + (r'#', Comment, 'directive'), + + (r'\S+', Text), + + (r'\n', Text, '#pop'), + ], + 'directive': [ + # Consume whitespace (but not newline). + (r'[^\S\n]+', Comment), + + # Extract todo items. + (r'(?i)\bTODO\b', Comment.Preproc), + + # Extract skip items. + (r'(?i)\bSKIP\S*', Comment.Preproc), + + (r'\S+', Comment), + + (r'\n', Comment, '#pop:2'), + ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/textfmts.py b/lib/python3.12/site-packages/pygments/lexers/textfmts.py new file mode 100644 index 0000000000000000000000000000000000000000..6dd4e581b8ff408c6735113fbda6e34b8990f313 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/textfmts.py @@ -0,0 +1,436 @@ +""" + pygments.lexers.textfmts + ~~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for various text formats. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexers import guess_lexer, get_lexer_by_name +from pygments.lexer import RegexLexer, bygroups, default, include +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Generic, Literal, Punctuation +from pygments.util import ClassNotFound + +__all__ = ['IrcLogsLexer', 'TodotxtLexer', 'HttpLexer', 'GettextLexer', + 'NotmuchLexer', 'KernelLogLexer'] + + +class IrcLogsLexer(RegexLexer): + """ + Lexer for IRC logs in *irssi*, *xchat* or *weechat* style. + """ + + name = 'IRC logs' + aliases = ['irc'] + filenames = ['*.weechatlog'] + mimetypes = ['text/x-irclog'] + url = 'https://en.wikipedia.org/wiki/Internet_Relay_Chat' + version_added = '' + + flags = re.VERBOSE | re.MULTILINE + timestamp = r""" + ( + # irssi / xchat and others + (?: \[|\()? # Opening bracket or paren for the timestamp + (?: # Timestamp + (?: (?:\d{1,4} [-/])* # Date as - or /-separated groups of digits + (?:\d{1,4}) + [T ])? # Date/time separator: T or space + (?: \d?\d [:.])* # Time as :/.-separated groups of 1 or 2 digits + (?: \d?\d) + ) + (?: \]|\))?\s+ # Closing bracket or paren for the timestamp + | + # weechat + \d{4}\s\w{3}\s\d{2}\s # Date + \d{2}:\d{2}:\d{2}\s+ # Time + Whitespace + | + # xchat + \w{3}\s\d{2}\s # Date + \d{2}:\d{2}:\d{2}\s+ # Time + Whitespace + )? + """ + tokens = { + 'root': [ + # log start/end + (r'^\*\*\*\*(.*)\*\*\*\*$', Comment), + # hack + ("^" + timestamp + r'(\s*<[^>]*>\s*)$', bygroups(Comment.Preproc, Name.Tag)), + # normal msgs + ("^" + timestamp + r""" + (\s*<.*?>\s*) # Nick """, + bygroups(Comment.Preproc, Name.Tag), 'msg'), + # /me msgs + ("^" + timestamp + r""" + (\s*[*]\s+) # Star + (\S+\s+.*?\n) # Nick + rest of message """, + bygroups(Comment.Preproc, Keyword, Generic.Inserted)), + # join/part msgs + ("^" + timestamp + r""" + (\s*(?:\*{3}|?)\s*) # Star(s) or symbols + (\S+\s+) # Nick + Space + (.*?\n) # Rest of message """, + bygroups(Comment.Preproc, Keyword, String, Comment)), + (r"^.*?\n", Text), + ], + 'msg': [ + (r"\S+:(?!//)", Name.Attribute), # Prefix + (r".*\n", Text, '#pop'), + ], + } + + +class GettextLexer(RegexLexer): + """ + Lexer for Gettext catalog files. + """ + name = 'Gettext Catalog' + aliases = ['pot', 'po'] + filenames = ['*.pot', '*.po'] + mimetypes = ['application/x-gettext', 'text/x-gettext', 'text/gettext'] + url = 'https://www.gnu.org/software/gettext' + version_added = '0.9' + + tokens = { + 'root': [ + (r'^#,\s.*?$', Keyword.Type), + (r'^#:\s.*?$', Keyword.Declaration), + # (r'^#$', Comment), + (r'^(#|#\.\s|#\|\s|#~\s|#\s).*$', Comment.Single), + (r'^(")([A-Za-z-]+:)(.*")$', + bygroups(String, Name.Property, String)), + (r'^".*"$', String), + (r'^(msgid|msgid_plural|msgstr|msgctxt)(\s+)(".*")$', + bygroups(Name.Variable, Text, String)), + (r'^(msgstr\[)(\d)(\])(\s+)(".*")$', + bygroups(Name.Variable, Number.Integer, Name.Variable, Text, String)), + ] + } + + +class HttpLexer(RegexLexer): + """ + Lexer for HTTP sessions. + """ + + name = 'HTTP' + aliases = ['http'] + url = 'https://httpwg.org/specs' + version_added = '1.5' + + flags = re.DOTALL + + def get_tokens_unprocessed(self, text, stack=('root',)): + """Reset the content-type state.""" + self.content_type = None + return RegexLexer.get_tokens_unprocessed(self, text, stack) + + def header_callback(self, match): + if match.group(1).lower() == 'content-type': + content_type = match.group(5).strip() + if ';' in content_type: + content_type = content_type[:content_type.find(';')].strip() + self.content_type = content_type + yield match.start(1), Name.Attribute, match.group(1) + yield match.start(2), Text, match.group(2) + yield match.start(3), Operator, match.group(3) + yield match.start(4), Text, match.group(4) + yield match.start(5), Literal, match.group(5) + yield match.start(6), Text, match.group(6) + + def continuous_header_callback(self, match): + yield match.start(1), Text, match.group(1) + yield match.start(2), Literal, match.group(2) + yield match.start(3), Text, match.group(3) + + def content_callback(self, match): + content_type = getattr(self, 'content_type', None) + content = match.group() + offset = match.start() + if content_type: + from pygments.lexers import get_lexer_for_mimetype + possible_lexer_mimetypes = [content_type] + if '+' in content_type: + # application/calendar+xml can be treated as application/xml + # if there's not a better match. + general_type = re.sub(r'^(.*)/.*\+(.*)$', r'\1/\2', + content_type) + possible_lexer_mimetypes.append(general_type) + + for i in possible_lexer_mimetypes: + try: + lexer = get_lexer_for_mimetype(i) + except ClassNotFound: + pass + else: + for idx, token, value in lexer.get_tokens_unprocessed(content): + yield offset + idx, token, value + return + yield offset, Text, content + + tokens = { + 'root': [ + (r'([a-zA-Z][-_a-zA-Z]+)( +)([^ ]+)( +)' + r'(HTTP)(/)(1\.[01]|2(?:\.0)?|3)(\r?\n|\Z)', + bygroups(Name.Function, Text, Name.Namespace, Text, + Keyword.Reserved, Operator, Number, Text), + 'headers'), + (r'(HTTP)(/)(1\.[01]|2(?:\.0)?|3)( +)(\d{3})(?:( +)([^\r\n]*))?(\r?\n|\Z)', + bygroups(Keyword.Reserved, Operator, Number, Text, Number, Text, + Name.Exception, Text), + 'headers'), + ], + 'headers': [ + (r'([^\s:]+)( *)(:)( *)([^\r\n]*)(\r?\n|\Z)', header_callback), + (r'([\t ]+)([^\r\n]+)(\r?\n|\Z)', continuous_header_callback), + (r'\r?\n', Text, 'content') + ], + 'content': [ + (r'.+', content_callback) + ] + } + + def analyse_text(text): + return any ( + re.search(pattern, text) is not None + for pattern in ( + r'^([a-zA-Z][-_a-zA-Z]+)( +)([^ ]+)( +)(HTTP)(/)(1\.[01]|2(?:\.0)?|3)(\r?\n|\Z)', + r'^(HTTP)(/)(1\.[01]|2(?:\.0)?|3)( +)(\d{3})(?:( +)([^\r\n]*))?(\r?\n|\Z)', + ) + ) + + +class TodotxtLexer(RegexLexer): + """ + Lexer for Todo.txt todo list format. + """ + + name = 'Todotxt' + url = 'http://todotxt.com/' + aliases = ['todotxt'] + version_added = '2.0' + # *.todotxt is not a standard extension for Todo.txt files; including it + # makes testing easier, and also makes autodetecting file type easier. + filenames = ['todo.txt', '*.todotxt'] + mimetypes = ['text/x-todo'] + + # Aliases mapping standard token types of Todo.txt format concepts + CompleteTaskText = Operator # Chosen to de-emphasize complete tasks + IncompleteTaskText = Text # Incomplete tasks should look like plain text + + # Priority should have most emphasis to indicate importance of tasks + Priority = Generic.Heading + # Dates should have next most emphasis because time is important + Date = Generic.Subheading + + # Project and context should have equal weight, and be in different colors + Project = Generic.Error + Context = String + + # If tag functionality is added, it should have the same weight as Project + # and Context, and a different color. Generic.Traceback would work well. + + # Regex patterns for building up rules; dates, priorities, projects, and + # contexts are all atomic + # TODO: Make date regex more ISO 8601 compliant + date_regex = r'\d{4,}-\d{2}-\d{2}' + priority_regex = r'\([A-Z]\)' + project_regex = r'\+\S+' + context_regex = r'@\S+' + + # Compound regex expressions + complete_one_date_regex = r'(x )(' + date_regex + r')' + complete_two_date_regex = (complete_one_date_regex + r'( )(' + + date_regex + r')') + priority_date_regex = r'(' + priority_regex + r')( )(' + date_regex + r')' + + tokens = { + # Should parse starting at beginning of line; each line is a task + 'root': [ + # Complete task entry points: two total: + # 1. Complete task with two dates + (complete_two_date_regex, bygroups(CompleteTaskText, Date, + CompleteTaskText, Date), + 'complete'), + # 2. Complete task with one date + (complete_one_date_regex, bygroups(CompleteTaskText, Date), + 'complete'), + + # Incomplete task entry points: six total: + # 1. Priority plus date + (priority_date_regex, bygroups(Priority, IncompleteTaskText, Date), + 'incomplete'), + # 2. Priority only + (priority_regex, Priority, 'incomplete'), + # 3. Leading date + (date_regex, Date, 'incomplete'), + # 4. Leading context + (context_regex, Context, 'incomplete'), + # 5. Leading project + (project_regex, Project, 'incomplete'), + # 6. Non-whitespace catch-all + (r'\S+', IncompleteTaskText, 'incomplete'), + ], + + # Parse a complete task + 'complete': [ + # Newline indicates end of task, should return to root + (r'\s*\n', CompleteTaskText, '#pop'), + # Tokenize contexts and projects + (context_regex, Context), + (project_regex, Project), + # Tokenize non-whitespace text + (r'\S+', CompleteTaskText), + # Tokenize whitespace not containing a newline + (r'\s+', CompleteTaskText), + ], + + # Parse an incomplete task + 'incomplete': [ + # Newline indicates end of task, should return to root + (r'\s*\n', IncompleteTaskText, '#pop'), + # Tokenize contexts and projects + (context_regex, Context), + (project_regex, Project), + # Tokenize non-whitespace text + (r'\S+', IncompleteTaskText), + # Tokenize whitespace not containing a newline + (r'\s+', IncompleteTaskText), + ], + } + + +class NotmuchLexer(RegexLexer): + """ + For Notmuch email text format. + + Additional options accepted: + + `body_lexer` + If given, highlight the contents of the message body with the specified + lexer, else guess it according to the body content (default: ``None``). + """ + + name = 'Notmuch' + url = 'https://notmuchmail.org/' + aliases = ['notmuch'] + version_added = '2.5' + + def _highlight_code(self, match): + code = match.group(1) + + try: + if self.body_lexer: + lexer = get_lexer_by_name(self.body_lexer) + else: + lexer = guess_lexer(code.strip()) + except ClassNotFound: + lexer = get_lexer_by_name('text') + + yield from lexer.get_tokens_unprocessed(code) + + tokens = { + 'root': [ + (r'\fmessage\{\s*', Keyword, ('message', 'message-attr')), + ], + 'message-attr': [ + (r'(\s*id:\s*)(\S+)', bygroups(Name.Attribute, String)), + (r'(\s*(?:depth|match|excluded):\s*)(\d+)', + bygroups(Name.Attribute, Number.Integer)), + (r'(\s*filename:\s*)(.+\n)', + bygroups(Name.Attribute, String)), + default('#pop'), + ], + 'message': [ + (r'\fmessage\}\n', Keyword, '#pop'), + (r'\fheader\{\n', Keyword, 'header'), + (r'\fbody\{\n', Keyword, 'body'), + ], + 'header': [ + (r'\fheader\}\n', Keyword, '#pop'), + (r'((?:Subject|From|To|Cc|Date):\s*)(.*\n)', + bygroups(Name.Attribute, String)), + (r'(.*)(\s*\(.*\))(\s*\(.*\)\n)', + bygroups(Generic.Strong, Literal, Name.Tag)), + ], + 'body': [ + (r'\fpart\{\n', Keyword, 'part'), + (r'\f(part|attachment)\{\s*', Keyword, ('part', 'part-attr')), + (r'\fbody\}\n', Keyword, '#pop'), + ], + 'part-attr': [ + (r'(ID:\s*)(\d+)', bygroups(Name.Attribute, Number.Integer)), + (r'(,\s*)((?:Filename|Content-id):\s*)([^,]+)', + bygroups(Punctuation, Name.Attribute, String)), + (r'(,\s*)(Content-type:\s*)(.+\n)', + bygroups(Punctuation, Name.Attribute, String)), + default('#pop'), + ], + 'part': [ + (r'\f(?:part|attachment)\}\n', Keyword, '#pop'), + (r'\f(?:part|attachment)\{\s*', Keyword, ('#push', 'part-attr')), + (r'^Non-text part: .*\n', Comment), + (r'(?s)(.*?(?=\f(?:part|attachment)\}\n))', _highlight_code), + ], + } + + def analyse_text(text): + return 1.0 if text.startswith('\fmessage{') else 0.0 + + def __init__(self, **options): + self.body_lexer = options.get('body_lexer', None) + RegexLexer.__init__(self, **options) + + +class KernelLogLexer(RegexLexer): + """ + For Linux Kernel log ("dmesg") output. + """ + name = 'Kernel log' + aliases = ['kmsg', 'dmesg'] + filenames = ['*.kmsg', '*.dmesg'] + url = 'https://fr.wikipedia.org/wiki/Dmesg' + version_added = '2.6' + + tokens = { + 'root': [ + (r'^[^:]+:debug : (?=\[)', Text, 'debug'), + (r'^[^:]+:info : (?=\[)', Text, 'info'), + (r'^[^:]+:warn : (?=\[)', Text, 'warn'), + (r'^[^:]+:notice: (?=\[)', Text, 'warn'), + (r'^[^:]+:err : (?=\[)', Text, 'error'), + (r'^[^:]+:crit : (?=\[)', Text, 'error'), + (r'^(?=\[)', Text, 'unknown'), + ], + 'unknown': [ + (r'^(?=.+(warning|notice|audit|deprecated))', Text, 'warn'), + (r'^(?=.+(error|critical|fail|Bug))', Text, 'error'), + default('info'), + ], + 'base': [ + (r'\[[0-9. ]+\] ', Number), + (r'(?<=\] ).+?:', Keyword), + (r'\n', Text, '#pop'), + ], + 'debug': [ + include('base'), + (r'.+\n', Comment, '#pop') + ], + 'info': [ + include('base'), + (r'.+\n', Text, '#pop') + ], + 'warn': [ + include('base'), + (r'.+\n', Generic.Strong, '#pop') + ], + 'error': [ + include('base'), + (r'.+\n', Generic.Error, '#pop') + ] + } diff --git a/lib/python3.12/site-packages/pygments/lexers/theorem.py b/lib/python3.12/site-packages/pygments/lexers/theorem.py new file mode 100644 index 0000000000000000000000000000000000000000..9e3f150d41115e5105d9cd44c25093af29b4e637 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/theorem.py @@ -0,0 +1,410 @@ +""" + pygments.lexers.theorem + ~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for theorem-proving languages. + + See also :mod:`pygments.lexers.lean` + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, bygroups, default, words +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Generic, Whitespace +# compatibility import +from pygments.lexers.lean import LeanLexer # noqa: F401 + +__all__ = ['CoqLexer', 'IsabelleLexer'] + + +class CoqLexer(RegexLexer): + """ + For the Coq theorem prover. + """ + + name = 'Coq' + url = 'http://coq.inria.fr/' + aliases = ['coq'] + filenames = ['*.v'] + mimetypes = ['text/x-coq'] + version_added = '1.5' + + flags = 0 # no re.MULTILINE + + keywords1 = ( + # Vernacular commands + 'Section', 'Module', 'End', 'Require', 'Import', 'Export', 'Include', 'Variable', + 'Variables', 'Parameter', 'Parameters', 'Axiom', 'Axioms', 'Hypothesis', + 'Hypotheses', 'Notation', 'Local', 'Tactic', 'Reserved', 'Scope', + 'Open', 'Close', 'Bind', 'Declare', 'Delimit', 'Definition', 'Example', 'Let', + 'Ltac', 'Ltac2', 'Fixpoint', 'CoFixpoint', 'Morphism', 'Relation', 'Implicit', + 'Arguments', 'Types', 'Contextual', 'Strict', 'Prenex', + 'Implicits', 'Inductive', 'CoInductive', 'Record', 'Structure', + 'Variant', 'Canonical', 'Coercion', 'Theorem', 'Lemma', 'Fact', + 'Remark', 'Corollary', 'Proposition', 'Property', 'Goal', + 'Proof', 'Restart', 'Save', 'Qed', 'Defined', 'Abort', 'Admitted', + 'Hint', 'Resolve', 'Rewrite', 'View', 'Search', 'Compute', 'Eval', + 'Show', 'Print', 'Printing', 'All', 'Graph', 'Projections', 'inside', + 'outside', 'Check', 'Global', 'Instance', 'Class', 'Existing', + 'Universe', 'Polymorphic', 'Monomorphic', 'Context', 'Scheme', 'From', + 'Undo', 'Fail', 'Function', 'Program', 'Elpi', 'Extract', 'Opaque', + 'Transparent', 'Unshelve', 'Next Obligation', + ) + keywords2 = ( + # Gallina + 'forall', 'exists', 'exists2', 'fun', 'fix', 'cofix', 'struct', + 'match', 'end', 'in', 'return', 'let', 'if', 'is', 'then', 'else', + 'for', 'of', 'nosimpl', 'with', 'as', + ) + keywords3 = ( + # Sorts + 'Type', 'Prop', 'SProp', 'Set', + ) + keywords4 = ( + # Tactics + 'pose', 'set', 'move', 'case', 'elim', 'apply', 'clear', 'hnf', 'intro', + 'intros', 'generalize', 'rename', 'pattern', 'after', 'destruct', + 'induction', 'using', 'refine', 'inversion', 'injection', 'rewrite', + 'congr', 'unlock', 'compute', 'ring', 'field', 'replace', 'fold', + 'unfold', 'change', 'cutrewrite', 'simpl', 'have', 'suff', 'wlog', + 'suffices', 'without', 'loss', 'nat_norm', 'assert', 'cut', 'trivial', + 'revert', 'bool_congr', 'nat_congr', 'symmetry', 'transitivity', 'auto', + 'split', 'left', 'right', 'autorewrite', 'tauto', 'setoid_rewrite', + 'intuition', 'eauto', 'eapply', 'econstructor', 'etransitivity', + 'constructor', 'erewrite', 'red', 'cbv', 'lazy', 'vm_compute', + 'native_compute', 'subst', + ) + keywords5 = ( + # Terminators + 'by', 'now', 'done', 'exact', 'reflexivity', + 'tauto', 'romega', 'omega', 'lia', 'nia', 'lra', 'nra', 'psatz', + 'assumption', 'solve', 'contradiction', 'discriminate', + 'congruence', 'admit' + ) + keywords6 = ( + # Control + 'do', 'last', 'first', 'try', 'idtac', 'repeat', + ) + # 'as', 'assert', 'begin', 'class', 'constraint', 'do', 'done', + # 'downto', 'else', 'end', 'exception', 'external', 'false', + # 'for', 'fun', 'function', 'functor', 'if', 'in', 'include', + # 'inherit', 'initializer', 'lazy', 'let', 'match', 'method', + # 'module', 'mutable', 'new', 'object', 'of', 'open', 'private', + # 'raise', 'rec', 'sig', 'struct', 'then', 'to', 'true', 'try', + # 'type', 'val', 'virtual', 'when', 'while', 'with' + keyopts = ( + '!=', '#', '&', '&&', r'\(', r'\)', r'\*', r'\+', ',', '-', r'-\.', + '->', r'\.', r'\.\.', ':', '::', ':=', ':>', ';', ';;', '<', '<-', + '<->', '=', '>', '>]', r'>\}', r'\?', r'\?\?', r'\[', r'\[<', r'\[>', + r'\[\|', ']', '_', '`', r'\{', r'\{<', r'lp:\{\{', r'\|', r'\|]', r'\}', '~', '=>', + r'/\\', r'\\/', r'\{\|', r'\|\}', + # 'Π', 'Σ', # Not defined in the standard library + 'λ', '¬', '∧', '∨', '∀', '∃', '→', '↔', '≠', '≤', '≥', + ) + operators = r'[!$%&*+\./:<=>?@^|~-]' + prefix_syms = r'[!?~]' + infix_syms = r'[=<>@^|&+\*/$%-]' + + tokens = { + 'root': [ + (r'\s+', Text), + (r'false|true|\(\)|\[\]', Name.Builtin.Pseudo), + (r'\(\*', Comment, 'comment'), + (r'\b(?:[^\W\d][\w\']*\.)+[^\W\d][\w\']*\b', Name), + (r'\bEquations\b\??', Keyword.Namespace), + (r'\b(Elpi)(\s+)(Program|Query|Accumulate|Command|Typecheck|Db|Export|Tactic)?\b', bygroups(Keyword.Namespace,Text,Keyword.Namespace)), + # Very weak heuristic to distinguish the Set vernacular from the Set sort + (r'\bUnset\b|\bSet(?=[ \t]+[A-Z][a-z][^\n]*?\.)', Keyword.Namespace, 'set-options'), + (r'\b(?:String|Number)\s+Notation', Keyword.Namespace, 'sn-notation'), + (words(keywords1, prefix=r'\b', suffix=r'\b'), Keyword.Namespace), + (words(keywords2, prefix=r'\b', suffix=r'\b'), Keyword), + (words(keywords3, prefix=r'\b', suffix=r'\b'), Keyword.Type), + (words(keywords4, prefix=r'\b', suffix=r'\b'), Keyword), + (words(keywords5, prefix=r'\b', suffix=r'\b'), Keyword.Pseudo), + (words(keywords6, prefix=r'\b', suffix=r'\b'), Keyword.Reserved), + # (r'\b([A-Z][\w\']*)(\.)', Name.Namespace, 'dotted'), + (r'\b([A-Z][\w\']*)', Name), + (r'({})'.format('|'.join(keyopts[::-1])), Operator), + (rf'({infix_syms}|{prefix_syms})?{operators}', Operator), + + (r"[^\W\d][\w']*", Name), + + (r'\d[\d_]*', Number.Integer), + (r'0[xX][\da-fA-F][\da-fA-F_]*', Number.Hex), + (r'0[oO][0-7][0-7_]*', Number.Oct), + (r'0[bB][01][01_]*', Number.Bin), + (r'-?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)', Number.Float), + + (r"'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'", String.Char), + + (r"'.'", String.Char), + (r"'", Keyword), # a stray quote is another syntax element + + (r'"', String.Double, 'string'), + + (r'[~?][a-z][\w\']*:', Name), + (r'\S', Name.Builtin.Pseudo), + ], + 'set-options': [ + (r'\s+', Text), + (r'[A-Z]\w*', Keyword.Namespace), + (r'"', String.Double, 'string'), + (r'\d+', Number.Integer), + (r'\.', Punctuation, '#pop'), + ], + 'sn-notation': [ + (r'\s+', Text), + # Extra keywords to highlight only in this scope + (r'\b(?:via|mapping|abstract|warning|after)\b', Keyword), + (r'=>|[()\[\]:,]', Operator), + (r'\b[^\W\d][\w\']*(?:\.[^\W\d][\w\']*)*\b', Name), + (r'\d[\d_]*', Number.Integer), + (r'0[xX][\da-fA-F][\da-fA-F_]*', Number.Hex), + (r'\(\*', Comment, 'comment'), + (r'\.', Punctuation, '#pop'), + ], + 'comment': [ + # Consume comments like ***** as one token + (r'([^(*)]+|\*+(?!\)))+', Comment), + (r'\(\*', Comment, '#push'), + (r'\*\)', Comment, '#pop'), + (r'[(*)]', Comment), + ], + 'string': [ + (r'[^"]+', String.Double), + (r'""', String.Double), + (r'"', String.Double, '#pop'), + ], + 'dotted': [ + (r'\s+', Text), + (r'\.', Punctuation), + (r'[A-Z][\w\']*(?=\s*\.)', Name.Namespace), + (r'[A-Z][\w\']*', Name.Class, '#pop'), + (r'[a-z][a-z0-9_\']*', Name, '#pop'), + default('#pop') + ], + } + + def analyse_text(text): + if 'Qed' in text and 'Proof' in text: + return 1 + + +class IsabelleLexer(RegexLexer): + """ + For the Isabelle proof assistant. + """ + + name = 'Isabelle' + url = 'https://isabelle.in.tum.de/' + aliases = ['isabelle'] + filenames = ['*.thy'] + mimetypes = ['text/x-isabelle'] + version_added = '2.0' + + keyword_minor = ( + 'and', 'assumes', 'attach', 'avoids', 'binder', 'checking', + 'class_instance', 'class_relation', 'code_module', 'congs', + 'constant', 'constrains', 'datatypes', 'defines', 'file', 'fixes', + 'for', 'functions', 'hints', 'identifier', 'if', 'imports', 'in', + 'includes', 'infix', 'infixl', 'infixr', 'is', 'keywords', 'lazy', + 'module_name', 'monos', 'morphisms', 'no_discs_sels', 'notes', + 'obtains', 'open', 'output', 'overloaded', 'parametric', 'permissive', + 'pervasive', 'rep_compat', 'shows', 'structure', 'type_class', + 'type_constructor', 'unchecked', 'unsafe', 'where', + ) + + keyword_diag = ( + 'ML_command', 'ML_val', 'class_deps', 'code_deps', 'code_thms', + 'display_drafts', 'find_consts', 'find_theorems', 'find_unused_assms', + 'full_prf', 'help', 'locale_deps', 'nitpick', 'pr', 'prf', + 'print_abbrevs', 'print_antiquotations', 'print_attributes', + 'print_binds', 'print_bnfs', 'print_bundles', + 'print_case_translations', 'print_cases', 'print_claset', + 'print_classes', 'print_codeproc', 'print_codesetup', + 'print_coercions', 'print_commands', 'print_context', + 'print_defn_rules', 'print_dependencies', 'print_facts', + 'print_induct_rules', 'print_inductives', 'print_interps', + 'print_locale', 'print_locales', 'print_methods', 'print_options', + 'print_orders', 'print_quot_maps', 'print_quotconsts', + 'print_quotients', 'print_quotientsQ3', 'print_quotmapsQ3', + 'print_rules', 'print_simpset', 'print_state', 'print_statement', + 'print_syntax', 'print_theorems', 'print_theory', 'print_trans_rules', + 'prop', 'pwd', 'quickcheck', 'refute', 'sledgehammer', 'smt_status', + 'solve_direct', 'spark_status', 'term', 'thm', 'thm_deps', 'thy_deps', + 'try', 'try0', 'typ', 'unused_thms', 'value', 'values', 'welcome', + 'print_ML_antiquotations', 'print_term_bindings', 'values_prolog', + ) + + keyword_thy = ('theory', 'begin', 'end') + + keyword_section = ('header', 'chapter') + + keyword_subsection = ( + 'section', 'subsection', 'subsubsection', 'sect', 'subsect', + 'subsubsect', + ) + + keyword_theory_decl = ( + 'ML', 'ML_file', 'abbreviation', 'adhoc_overloading', 'arities', + 'atom_decl', 'attribute_setup', 'axiomatization', 'bundle', + 'case_of_simps', 'class', 'classes', 'classrel', 'codatatype', + 'code_abort', 'code_class', 'code_const', 'code_datatype', + 'code_identifier', 'code_include', 'code_instance', 'code_modulename', + 'code_monad', 'code_printing', 'code_reflect', 'code_reserved', + 'code_type', 'coinductive', 'coinductive_set', 'consts', 'context', + 'datatype', 'datatype_new', 'datatype_new_compat', 'declaration', + 'declare', 'default_sort', 'defer_recdef', 'definition', 'defs', + 'domain', 'domain_isomorphism', 'domaindef', 'equivariance', + 'export_code', 'extract', 'extract_type', 'fixrec', 'fun', + 'fun_cases', 'hide_class', 'hide_const', 'hide_fact', 'hide_type', + 'import_const_map', 'import_file', 'import_tptp', 'import_type_map', + 'inductive', 'inductive_set', 'instantiation', 'judgment', 'lemmas', + 'lifting_forget', 'lifting_update', 'local_setup', 'locale', + 'method_setup', 'nitpick_params', 'no_adhoc_overloading', + 'no_notation', 'no_syntax', 'no_translations', 'no_type_notation', + 'nominal_datatype', 'nonterminal', 'notation', 'notepad', 'oracle', + 'overloading', 'parse_ast_translation', 'parse_translation', + 'partial_function', 'primcorec', 'primrec', 'primrec_new', + 'print_ast_translation', 'print_translation', 'quickcheck_generator', + 'quickcheck_params', 'realizability', 'realizers', 'recdef', 'record', + 'refute_params', 'setup', 'setup_lifting', 'simproc_setup', + 'simps_of_case', 'sledgehammer_params', 'spark_end', 'spark_open', + 'spark_open_siv', 'spark_open_vcg', 'spark_proof_functions', + 'spark_types', 'statespace', 'syntax', 'syntax_declaration', 'text', + 'text_raw', 'theorems', 'translations', 'type_notation', + 'type_synonym', 'typed_print_translation', 'typedecl', 'hoarestate', + 'install_C_file', 'install_C_types', 'wpc_setup', 'c_defs', 'c_types', + 'memsafe', 'SML_export', 'SML_file', 'SML_import', 'approximate', + 'bnf_axiomatization', 'cartouche', 'datatype_compat', + 'free_constructors', 'functor', 'nominal_function', + 'nominal_termination', 'permanent_interpretation', + 'binds', 'defining', 'smt2_status', 'term_cartouche', + 'boogie_file', 'text_cartouche', + ) + + keyword_theory_script = ('inductive_cases', 'inductive_simps') + + keyword_theory_goal = ( + 'ax_specification', 'bnf', 'code_pred', 'corollary', 'cpodef', + 'crunch', 'crunch_ignore', + 'enriched_type', 'function', 'instance', 'interpretation', 'lemma', + 'lift_definition', 'nominal_inductive', 'nominal_inductive2', + 'nominal_primrec', 'pcpodef', 'primcorecursive', + 'quotient_definition', 'quotient_type', 'recdef_tc', 'rep_datatype', + 'schematic_corollary', 'schematic_lemma', 'schematic_theorem', + 'spark_vc', 'specification', 'subclass', 'sublocale', 'termination', + 'theorem', 'typedef', 'wrap_free_constructors', + ) + + keyword_qed = ('by', 'done', 'qed') + keyword_abandon_proof = ('sorry', 'oops') + + keyword_proof_goal = ('have', 'hence', 'interpret') + + keyword_proof_block = ('next', 'proof') + + keyword_proof_chain = ( + 'finally', 'from', 'then', 'ultimately', 'with', + ) + + keyword_proof_decl = ( + 'ML_prf', 'also', 'include', 'including', 'let', 'moreover', 'note', + 'txt', 'txt_raw', 'unfolding', 'using', 'write', + ) + + keyword_proof_asm = ('assume', 'case', 'def', 'fix', 'presume') + + keyword_proof_asm_goal = ('guess', 'obtain', 'show', 'thus') + + keyword_proof_script = ( + 'apply', 'apply_end', 'apply_trace', 'back', 'defer', 'prefer', + ) + + operators = ( + '::', ':', '(', ')', '[', ']', '_', '=', ',', '|', + '+', '-', '!', '?', + ) + + proof_operators = ('{', '}', '.', '..') + + tokens = { + 'root': [ + (r'\s+', Whitespace), + (r'\(\*', Comment, 'comment'), + (r'\\', String.Symbol, 'cartouche'), + (r'\{\*|‹', String, 'cartouche'), + + (words(operators), Operator), + (words(proof_operators), Operator.Word), + + (words(keyword_minor, prefix=r'\b', suffix=r'\b'), Keyword.Pseudo), + + (words(keyword_diag, prefix=r'\b', suffix=r'\b'), Keyword.Type), + + (words(keyword_thy, prefix=r'\b', suffix=r'\b'), Keyword), + (words(keyword_theory_decl, prefix=r'\b', suffix=r'\b'), Keyword), + + (words(keyword_section, prefix=r'\b', suffix=r'\b'), Generic.Heading), + (words(keyword_subsection, prefix=r'\b', suffix=r'\b'), Generic.Subheading), + + (words(keyword_theory_goal, prefix=r'\b', suffix=r'\b'), Keyword.Namespace), + (words(keyword_theory_script, prefix=r'\b', suffix=r'\b'), Keyword.Namespace), + + (words(keyword_abandon_proof, prefix=r'\b', suffix=r'\b'), Generic.Error), + + (words(keyword_qed, prefix=r'\b', suffix=r'\b'), Keyword), + (words(keyword_proof_goal, prefix=r'\b', suffix=r'\b'), Keyword), + (words(keyword_proof_block, prefix=r'\b', suffix=r'\b'), Keyword), + (words(keyword_proof_decl, prefix=r'\b', suffix=r'\b'), Keyword), + + (words(keyword_proof_chain, prefix=r'\b', suffix=r'\b'), Keyword), + (words(keyword_proof_asm, prefix=r'\b', suffix=r'\b'), Keyword), + (words(keyword_proof_asm_goal, prefix=r'\b', suffix=r'\b'), Keyword), + + (words(keyword_proof_script, prefix=r'\b', suffix=r'\b'), Keyword.Pseudo), + + (r'\\<(\w|\^)*>', Text.Symbol), + + (r"'[^\W\d][.\w']*", Name.Type), + + (r'0[xX][\da-fA-F][\da-fA-F_]*', Number.Hex), + (r'0[oO][0-7][0-7_]*', Number.Oct), + (r'0[bB][01][01_]*', Number.Bin), + + (r'"', String, 'string'), + (r'`', String.Other, 'fact'), + (r'[^\s:|\[\]\-()=,+!?{}._][^\s:|\[\]\-()=,+!?{}]*', Name), + ], + 'comment': [ + (r'[^(*)]+', Comment), + (r'\(\*', Comment, '#push'), + (r'\*\)', Comment, '#pop'), + (r'[(*)]', Comment), + ], + 'cartouche': [ + (r'[^{*}\\‹›]+', String), + (r'\\', String.Symbol, '#push'), + (r'\{\*|‹', String, '#push'), + (r'\\', String.Symbol, '#pop'), + (r'\*\}|›', String, '#pop'), + (r'\\<(\w|\^)*>', String.Symbol), + (r'[{*}\\]', String), + ], + 'string': [ + (r'[^"\\]+', String), + (r'\\<(\w|\^)*>', String.Symbol), + (r'\\"', String), + (r'\\', String), + (r'"', String, '#pop'), + ], + 'fact': [ + (r'[^`\\]+', String.Other), + (r'\\<(\w|\^)*>', String.Symbol), + (r'\\`', String.Other), + (r'\\', String.Other), + (r'`', String.Other, '#pop'), + ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/tnt.py b/lib/python3.12/site-packages/pygments/lexers/tnt.py new file mode 100644 index 0000000000000000000000000000000000000000..1ae2ed84afdbf0a6cbc9cbb359992d1f4ebfeb73 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/tnt.py @@ -0,0 +1,270 @@ +""" + pygments.lexers.tnt + ~~~~~~~~~~~~~~~~~~~ + + Lexer for Typographic Number Theory. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import Lexer +from pygments.token import Text, Comment, Operator, Keyword, Name, Number, \ + Punctuation, Error + +__all__ = ['TNTLexer'] + + +class TNTLexer(Lexer): + """ + Lexer for Typographic Number Theory, as described in the book + Gödel, Escher, Bach, by Douglas R. Hofstadter + """ + + name = 'Typographic Number Theory' + url = 'https://github.com/Kenny2github/language-tnt' + aliases = ['tnt'] + filenames = ['*.tnt'] + version_added = '2.7' + + cur = [] + + LOGIC = set('⊃→]&∧^|∨Vv') + OPERATORS = set('+.⋅*') + VARIABLES = set('abcde') + PRIMES = set("'′") + NEGATORS = set('~!') + QUANTIFIERS = set('AE∀∃') + NUMBERS = set('0123456789') + WHITESPACE = set('\t \v\n') + + RULES = re.compile('''(?xi) + joining | separation | double-tilde | fantasy\\ rule + | carry[- ]over(?:\\ of)?(?:\\ line)?\\ ([0-9]+) | detachment + | contrapositive | De\\ Morgan | switcheroo + | specification | generalization | interchange + | existence | symmetry | transitivity + | add\\ S | drop\\ S | induction + | axiom\\ ([1-5]) | premise | push | pop + ''') + LINENOS = re.compile(r'(?:[0-9]+)(?:(?:, ?|,? and )(?:[0-9]+))*') + COMMENT = re.compile(r'\[[^\n\]]+\]') + + def __init__(self, *args, **kwargs): + Lexer.__init__(self, *args, **kwargs) + self.cur = [] + + def whitespace(self, start, text, required=False): + """Tokenize whitespace.""" + end = start + try: + while text[end] in self.WHITESPACE: + end += 1 + except IndexError: + end = len(text) + if required and end == start: + raise AssertionError + if end != start: + self.cur.append((start, Text, text[start:end])) + return end + + def variable(self, start, text): + """Tokenize a variable.""" + if text[start] not in self.VARIABLES: + raise AssertionError + end = start+1 + while text[end] in self.PRIMES: + end += 1 + self.cur.append((start, Name.Variable, text[start:end])) + return end + + def term(self, start, text): + """Tokenize a term.""" + if text[start] == 'S': # S...S(...) or S...0 + end = start+1 + while text[end] == 'S': + end += 1 + self.cur.append((start, Number.Integer, text[start:end])) + return self.term(end, text) + if text[start] == '0': # the singleton 0 + self.cur.append((start, Number.Integer, text[start])) + return start+1 + if text[start] in self.VARIABLES: # a''... + return self.variable(start, text) + if text[start] == '(': # (...+...) + self.cur.append((start, Punctuation, text[start])) + start = self.term(start+1, text) + if text[start] not in self.OPERATORS: + raise AssertionError + self.cur.append((start, Operator, text[start])) + start = self.term(start+1, text) + if text[start] != ')': + raise AssertionError + self.cur.append((start, Punctuation, text[start])) + return start+1 + raise AssertionError # no matches + + def formula(self, start, text): + """Tokenize a formula.""" + if text[start] in self.NEGATORS: # ~<...> + end = start+1 + while text[end] in self.NEGATORS: + end += 1 + self.cur.append((start, Operator, text[start:end])) + return self.formula(end, text) + if text[start] in self.QUANTIFIERS: # Aa:<...> + self.cur.append((start, Keyword.Declaration, text[start])) + start = self.variable(start+1, text) + if text[start] != ':': + raise AssertionError + self.cur.append((start, Punctuation, text[start])) + return self.formula(start+1, text) + if text[start] == '<': # <...&...> + self.cur.append((start, Punctuation, text[start])) + start = self.formula(start+1, text) + if text[start] not in self.LOGIC: + raise AssertionError + self.cur.append((start, Operator, text[start])) + start = self.formula(start+1, text) + if text[start] != '>': + raise AssertionError + self.cur.append((start, Punctuation, text[start])) + return start+1 + # ...=... + start = self.term(start, text) + if text[start] != '=': + raise AssertionError + self.cur.append((start, Operator, text[start])) + start = self.term(start+1, text) + return start + + def rule(self, start, text): + """Tokenize a rule.""" + match = self.RULES.match(text, start) + if match is None: + raise AssertionError + groups = sorted(match.regs[1:]) # exclude whole match + for group in groups: + if group[0] >= 0: # this group matched + self.cur.append((start, Keyword, text[start:group[0]])) + self.cur.append((group[0], Number.Integer, + text[group[0]:group[1]])) + if group[1] != match.end(): + self.cur.append((group[1], Keyword, + text[group[1]:match.end()])) + break + else: + self.cur.append((start, Keyword, text[start:match.end()])) + return match.end() + + def lineno(self, start, text): + """Tokenize a line referral.""" + end = start + while text[end] not in self.NUMBERS: + end += 1 + self.cur.append((start, Punctuation, text[start])) + self.cur.append((start+1, Text, text[start+1:end])) + start = end + match = self.LINENOS.match(text, start) + if match is None: + raise AssertionError + if text[match.end()] != ')': + raise AssertionError + self.cur.append((match.start(), Number.Integer, match.group(0))) + self.cur.append((match.end(), Punctuation, text[match.end()])) + return match.end() + 1 + + def error_till_line_end(self, start, text): + """Mark everything from ``start`` to the end of the line as Error.""" + end = start + try: + while text[end] != '\n': # there's whitespace in rules + end += 1 + except IndexError: + end = len(text) + if end != start: + self.cur.append((start, Error, text[start:end])) + end = self.whitespace(end, text) + return end + + def get_tokens_unprocessed(self, text): + """Returns a list of TNT tokens.""" + self.cur = [] + start = end = self.whitespace(0, text) + while start <= end < len(text): + try: + # try line number + while text[end] in self.NUMBERS: + end += 1 + if end != start: # actual number present + self.cur.append((start, Number.Integer, text[start:end])) + # whitespace is required after a line number + orig = len(self.cur) + try: + start = end = self.whitespace(end, text, True) + except AssertionError: + del self.cur[orig:] + start = end = self.error_till_line_end(end, text) + continue + # at this point it could be a comment + match = self.COMMENT.match(text, start) + if match is not None: + self.cur.append((start, Comment, text[start:match.end()])) + start = end = match.end() + # anything after the closing bracket is invalid + start = end = self.error_till_line_end(start, text) + # do not attempt to process the rest + continue + del match + if text[start] in '[]': # fantasy push or pop + self.cur.append((start, Keyword, text[start])) + start += 1 + end += 1 + else: + # one formula, possibly containing subformulae + orig = len(self.cur) + try: + start = end = self.formula(start, text) + except (AssertionError, RecursionError): # not well-formed + del self.cur[orig:] + while text[end] not in self.WHITESPACE: + end += 1 + self.cur.append((start, Error, text[start:end])) + start = end + # skip whitespace after formula + orig = len(self.cur) + try: + start = end = self.whitespace(end, text, True) + except AssertionError: + del self.cur[orig:] + start = end = self.error_till_line_end(start, text) + continue + # rule proving this formula a theorem + orig = len(self.cur) + try: + start = end = self.rule(start, text) + except AssertionError: + del self.cur[orig:] + start = end = self.error_till_line_end(start, text) + continue + # skip whitespace after rule + start = end = self.whitespace(end, text) + # line marker + if text[start] == '(': + orig = len(self.cur) + try: + start = end = self.lineno(start, text) + except AssertionError: + del self.cur[orig:] + start = end = self.error_till_line_end(start, text) + continue + start = end = self.whitespace(start, text) + except IndexError: + try: + del self.cur[orig:] + except NameError: + pass # if orig was never defined, fine + self.error_till_line_end(start, text) + return self.cur diff --git a/lib/python3.12/site-packages/pygments/lexers/trafficscript.py b/lib/python3.12/site-packages/pygments/lexers/trafficscript.py new file mode 100644 index 0000000000000000000000000000000000000000..8c801c4cb094648d9efa4f19d2bbf93482693fbf --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/trafficscript.py @@ -0,0 +1,51 @@ +""" + pygments.lexers.trafficscript + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lexer for RiverBed's TrafficScript (RTS) language. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer +from pygments.token import String, Number, Name, Keyword, Operator, Text, Comment + +__all__ = ['RtsLexer'] + + +class RtsLexer(RegexLexer): + """ + For Riverbed Stingray Traffic Manager + """ + name = 'TrafficScript' + aliases = ['trafficscript', 'rts'] + filenames = ['*.rts'] + url = 'https://riverbed.com' + version_added = '2.1' + + tokens = { + 'root' : [ + (r"'(\\\\|\\[^\\]|[^'\\])*'", String), + (r'"', String, 'escapable-string'), + (r'(0x[0-9a-fA-F]+|\d+)', Number), + (r'\d+\.\d+', Number.Float), + (r'\$[a-zA-Z](\w|_)*', Name.Variable), + (r'(if|else|for(each)?|in|while|do|break|sub|return|import)', Keyword), + (r'[a-zA-Z][\w.]*', Name.Function), + (r'[-+*/%=,;(){}<>^.!~|&\[\]\?\:]', Operator), + (r'(>=|<=|==|!=|' + r'&&|\|\||' + r'\+=|.=|-=|\*=|/=|%=|<<=|>>=|&=|\|=|\^=|' + r'>>|<<|' + r'\+\+|--|=>)', Operator), + (r'[ \t\r]+', Text), + (r'#[^\n]*', Comment), + ], + 'escapable-string' : [ + (r'\\[tsn]', String.Escape), + (r'[^"]', String), + (r'"', String, '#pop'), + ], + + } diff --git a/lib/python3.12/site-packages/pygments/lexers/unicon.py b/lib/python3.12/site-packages/pygments/lexers/unicon.py new file mode 100644 index 0000000000000000000000000000000000000000..1077661a349a67a6fa43d553e8a53f0f4330d129 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/unicon.py @@ -0,0 +1,413 @@ +""" + pygments.lexers.unicon + ~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for the Icon and Unicon languages, including ucode VM. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, include, bygroups, words, using, this +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation + +__all__ = ['IconLexer', 'UcodeLexer', 'UniconLexer'] + + +class UniconLexer(RegexLexer): + """ + For Unicon source code. + """ + + name = 'Unicon' + aliases = ['unicon'] + filenames = ['*.icn'] + mimetypes = ['text/unicon'] + url = 'https://www.unicon.org' + version_added = '2.4' + + flags = re.MULTILINE + + tokens = { + 'root': [ + (r'[^\S\n]+', Text), + (r'#.*?\n', Comment.Single), + (r'[^\S\n]+', Text), + (r'class|method|procedure', Keyword.Declaration, 'subprogram'), + (r'(record)(\s+)(\w+)', + bygroups(Keyword.Declaration, Text, Keyword.Type), 'type_def'), + (r'(#line|\$C|\$Cend|\$define|\$else|\$endif|\$error|\$ifdef|' + r'\$ifndef|\$include|\$line|\$undef)\b', Keyword.PreProc), + (r'(&null|&fail)\b', Keyword.Constant), + (r'&allocated|&ascii|&clock|&collections|&column|&col|&control|' + r'&cset|¤t|&dateline|&date|&digits|&dump|' + r'&errno|&errornumber|&errortext|&errorvalue|&error|&errout|' + r'&eventcode|&eventvalue|&eventsource|&e|' + r'&features|&file|&host|&input|&interval|&lcase|&letters|' + r'&level|&line|&ldrag|&lpress|&lrelease|' + r'&main|&mdrag|&meta|&mpress|&mrelease|&now|&output|' + r'&phi|&pick|&pi|&pos|&progname|' + r'&random|&rdrag|®ions|&resize|&row|&rpress|&rrelease|' + r'&shift|&source|&storage|&subject|' + r'&time|&trace|&ucase|&version|' + r'&window|&x|&y', Keyword.Reserved), + (r'(by|of|not|to)\b', Keyword.Reserved), + (r'(global|local|static|abstract)\b', Keyword.Reserved), + (r'package|link|import', Keyword.Declaration), + (words(( + 'break', 'case', 'create', 'critical', 'default', 'end', 'all', + 'do', 'else', 'every', 'fail', 'if', 'import', 'initial', + 'initially', 'invocable', 'next', + 'repeat', 'return', 'suspend', + 'then', 'thread', 'until', 'while'), prefix=r'\b', suffix=r'\b'), + Keyword.Reserved), + (words(( + 'Abort', 'abs', 'acos', 'Active', 'Alert', 'any', 'Any', 'Arb', + 'Arbno', 'args', 'array', 'asin', 'atan', 'atanh', 'Attrib', + 'Bal', 'bal', 'Bg', 'Break', 'Breakx', + 'callout', 'center', 'char', 'chdir', 'chmod', 'chown', 'chroot', + 'classname', 'Clip', 'Clone', 'close', 'cofail', 'collect', + 'Color', 'ColorValue', 'condvar', 'constructor', 'copy', + 'CopyArea', 'cos', 'Couple', 'crypt', 'cset', 'ctime', + 'dbcolumns', 'dbdriver', 'dbkeys', 'dblimits', 'dbproduct', + 'dbtables', 'delay', 'delete', 'detab', 'display', 'DrawArc', + 'DrawCircle', 'DrawCube', 'DrawCurve', 'DrawCylinder', + 'DrawDisk', 'DrawImage', 'DrawLine', 'DrawPoint', 'DrawPolygon', + 'DrawRectangle', 'DrawSegment', 'DrawSphere', 'DrawString', + 'DrawTorus', 'dtor', + 'entab', 'EraseArea', 'errorclear', 'Event', 'eventmask', + 'EvGet', 'EvSend', 'exec', 'exit', 'exp', 'Eye', + 'Fail', 'fcntl', 'fdup', 'Fence', 'fetch', 'Fg', 'fieldnames', + 'filepair', 'FillArc', 'FillCircle', 'FillPolygon', + 'FillRectangle', 'find', 'flock', 'flush', 'Font', 'fork', + 'FreeColor', 'FreeSpace', 'function', + 'get', 'getch', 'getche', 'getegid', 'getenv', 'geteuid', + 'getgid', 'getgr', 'gethost', 'getpgrp', 'getpid', 'getppid', + 'getpw', 'getrusage', 'getserv', 'GetSpace', 'gettimeofday', + 'getuid', 'globalnames', 'GotoRC', 'GotoXY', 'gtime', 'hardlink', + 'iand', 'icom', 'IdentityMatrix', 'image', 'InPort', 'insert', + 'Int86', 'integer', 'ioctl', 'ior', 'ishift', 'istate', 'ixor', + 'kbhit', 'key', 'keyword', 'kill', + 'left', 'Len', 'list', 'load', 'loadfunc', 'localnames', + 'lock', 'log', 'Lower', 'lstat', + 'many', 'map', 'match', 'MatrixMode', 'max', 'member', + 'membernames', 'methodnames', 'methods', 'min', 'mkdir', 'move', + 'MultMatrix', 'mutex', + 'name', 'NewColor', 'Normals', 'NotAny', 'numeric', + 'open', 'opencl', 'oprec', 'ord', 'OutPort', + 'PaletteChars', 'PaletteColor', 'PaletteKey', 'paramnames', + 'parent', 'Pattern', 'Peek', 'Pending', 'pipe', 'Pixel', + 'PlayAudio', 'Poke', 'pop', 'PopMatrix', 'Pos', 'pos', + 'proc', 'pull', 'push', 'PushMatrix', 'PushRotate', 'PushScale', + 'PushTranslate', 'put', + 'QueryPointer', + 'Raise', 'read', 'ReadImage', 'readlink', 'reads', 'ready', + 'real', 'receive', 'Refresh', 'Rem', 'remove', 'rename', + 'repl', 'reverse', 'right', 'rmdir', 'Rotate', 'Rpos', + 'Rtab', 'rtod', 'runerr', + 'save', 'Scale', 'seek', 'select', 'send', 'seq', + 'serial', 'set', 'setenv', 'setgid', 'setgrent', + 'sethostent', 'setpgrp', 'setpwent', 'setservent', + 'setuid', 'signal', 'sin', 'sort', 'sortf', 'Span', + 'spawn', 'sql', 'sqrt', 'stat', 'staticnames', 'stop', + 'StopAudio', 'string', 'structure', 'Succeed', 'Swi', + 'symlink', 'sys_errstr', 'system', 'syswrite', + 'Tab', 'tab', 'table', 'tan', + 'Texcoord', 'Texture', 'TextWidth', 'Translate', + 'trap', 'trim', 'truncate', 'trylock', 'type', + 'umask', 'Uncouple', 'unlock', 'upto', 'utime', + 'variable', 'VAttrib', + 'wait', 'WAttrib', 'WDefault', 'WFlush', 'where', + 'WinAssociate', 'WinButton', 'WinColorDialog', 'WindowContents', + 'WinEditRegion', 'WinFontDialog', 'WinMenuBar', 'WinOpenDialog', + 'WinPlayMedia', 'WinSaveDialog', 'WinScrollBar', 'WinSelectDialog', + 'write', 'WriteImage', 'writes', 'WSection', + 'WSync'), prefix=r'\b', suffix=r'\b'), + Name.Function), + include('numbers'), + (r'<@|<<@|>@|>>@|\.>|->|===|~===|\*\*|\+\+|--|\.|~==|~=|<=|>=|==|' + r'=|<<=|<<|>>=|>>|:=:|:=|->|<->|\+:=|\|', Operator), + (r'"(?:[^\\"]|\\.)*"', String), + (r"'(?:[^\\']|\\.)*'", String.Character), + (r'[*<>+=/&!?@~\\-]', Operator), + (r'\^', Operator), + (r'(\w+)(\s*|[(,])', bygroups(Name, using(this))), + (r"[\[\]]", Punctuation), + (r"<>|=>|[()|:;,.'`{}%&?]", Punctuation), + (r'\n+', Text), + ], + 'numbers': [ + (r'\b([+-]?([2-9]|[12][0-9]|3[0-6])[rR][0-9a-zA-Z]+)\b', Number.Hex), + (r'[+-]?[0-9]*\.([0-9]*)([Ee][+-]?[0-9]*)?', Number.Float), + (r'\b([+-]?[0-9]+[KMGTPkmgtp]?)\b', Number.Integer), + ], + 'subprogram': [ + (r'\(', Punctuation, ('#pop', 'formal_part')), + (r';', Punctuation, '#pop'), + (r'"[^"]+"|\w+', Name.Function), + include('root'), + ], + 'type_def': [ + (r'\(', Punctuation, 'formal_part'), + ], + 'formal_part': [ + (r'\)', Punctuation, '#pop'), + (r'\w+', Name.Variable), + (r',', Punctuation), + (r'(:string|:integer|:real)\b', Keyword.Reserved), + include('root'), + ], + } + + +class IconLexer(RegexLexer): + """ + Lexer for Icon. + """ + name = 'Icon' + aliases = ['icon'] + filenames = ['*.icon', '*.ICON'] + mimetypes = [] + url = 'https://www2.cs.arizona.edu/icon' + version_added = '1.6' + + flags = re.MULTILINE + + tokens = { + 'root': [ + (r'[^\S\n]+', Text), + (r'#.*?\n', Comment.Single), + (r'[^\S\n]+', Text), + (r'class|method|procedure', Keyword.Declaration, 'subprogram'), + (r'(record)(\s+)(\w+)', + bygroups(Keyword.Declaration, Text, Keyword.Type), 'type_def'), + (r'(#line|\$C|\$Cend|\$define|\$else|\$endif|\$error|\$ifdef|' + r'\$ifndef|\$include|\$line|\$undef)\b', Keyword.PreProc), + (r'(&null|&fail)\b', Keyword.Constant), + (r'&allocated|&ascii|&clock|&collections|&column|&col|&control|' + r'&cset|¤t|&dateline|&date|&digits|&dump|' + r'&errno|&errornumber|&errortext|&errorvalue|&error|&errout|' + r'&eventcode|&eventvalue|&eventsource|&e|' + r'&features|&file|&host|&input|&interval|&lcase|&letters|' + r'&level|&line|&ldrag|&lpress|&lrelease|' + r'&main|&mdrag|&meta|&mpress|&mrelease|&now|&output|' + r'&phi|&pick|&pi|&pos|&progname|' + r'&random|&rdrag|®ions|&resize|&row|&rpress|&rrelease|' + r'&shift|&source|&storage|&subject|' + r'&time|&trace|&ucase|&version|' + r'&window|&x|&y', Keyword.Reserved), + (r'(by|of|not|to)\b', Keyword.Reserved), + (r'(global|local|static)\b', Keyword.Reserved), + (r'link', Keyword.Declaration), + (words(( + 'break', 'case', 'create', 'default', 'end', 'all', + 'do', 'else', 'every', 'fail', 'if', 'initial', + 'invocable', 'next', + 'repeat', 'return', 'suspend', + 'then', 'until', 'while'), prefix=r'\b', suffix=r'\b'), + Keyword.Reserved), + (words(( + 'abs', 'acos', 'Active', 'Alert', 'any', + 'args', 'array', 'asin', 'atan', 'atanh', 'Attrib', + 'bal', 'Bg', + 'callout', 'center', 'char', 'chdir', 'chmod', 'chown', 'chroot', + 'Clip', 'Clone', 'close', 'cofail', 'collect', + 'Color', 'ColorValue', 'condvar', 'copy', + 'CopyArea', 'cos', 'Couple', 'crypt', 'cset', 'ctime', + 'delay', 'delete', 'detab', 'display', 'DrawArc', + 'DrawCircle', 'DrawCube', 'DrawCurve', 'DrawCylinder', + 'DrawDisk', 'DrawImage', 'DrawLine', 'DrawPoint', 'DrawPolygon', + 'DrawRectangle', 'DrawSegment', 'DrawSphere', 'DrawString', + 'DrawTorus', 'dtor', + 'entab', 'EraseArea', 'errorclear', 'Event', 'eventmask', + 'EvGet', 'EvSend', 'exec', 'exit', 'exp', 'Eye', + 'fcntl', 'fdup', 'fetch', 'Fg', 'fieldnames', + 'FillArc', 'FillCircle', 'FillPolygon', + 'FillRectangle', 'find', 'flock', 'flush', 'Font', + 'FreeColor', 'FreeSpace', 'function', + 'get', 'getch', 'getche', 'getenv', + 'GetSpace', 'gettimeofday', + 'getuid', 'globalnames', 'GotoRC', 'GotoXY', 'gtime', 'hardlink', + 'iand', 'icom', 'IdentityMatrix', 'image', 'InPort', 'insert', + 'Int86', 'integer', 'ioctl', 'ior', 'ishift', 'istate', 'ixor', + 'kbhit', 'key', 'keyword', 'kill', + 'left', 'Len', 'list', 'load', 'loadfunc', 'localnames', + 'lock', 'log', 'Lower', 'lstat', + 'many', 'map', 'match', 'MatrixMode', 'max', 'member', + 'membernames', 'methodnames', 'methods', 'min', 'mkdir', 'move', + 'MultMatrix', 'mutex', + 'name', 'NewColor', 'Normals', 'numeric', + 'open', 'opencl', 'oprec', 'ord', 'OutPort', + 'PaletteChars', 'PaletteColor', 'PaletteKey', 'paramnames', + 'parent', 'Pattern', 'Peek', 'Pending', 'pipe', 'Pixel', + 'Poke', 'pop', 'PopMatrix', 'Pos', 'pos', + 'proc', 'pull', 'push', 'PushMatrix', 'PushRotate', 'PushScale', + 'PushTranslate', 'put', + 'QueryPointer', + 'Raise', 'read', 'ReadImage', 'readlink', 'reads', 'ready', + 'real', 'receive', 'Refresh', 'Rem', 'remove', 'rename', + 'repl', 'reverse', 'right', 'rmdir', 'Rotate', 'Rpos', + 'rtod', 'runerr', + 'save', 'Scale', 'seek', 'select', 'send', 'seq', + 'serial', 'set', 'setenv', + 'setuid', 'signal', 'sin', 'sort', 'sortf', + 'spawn', 'sql', 'sqrt', 'stat', 'staticnames', 'stop', + 'string', 'structure', 'Swi', + 'symlink', 'sys_errstr', 'system', 'syswrite', + 'tab', 'table', 'tan', + 'Texcoord', 'Texture', 'TextWidth', 'Translate', + 'trap', 'trim', 'truncate', 'trylock', 'type', + 'umask', 'Uncouple', 'unlock', 'upto', 'utime', + 'variable', + 'wait', 'WAttrib', 'WDefault', 'WFlush', 'where', + 'WinAssociate', 'WinButton', 'WinColorDialog', 'WindowContents', + 'WinEditRegion', 'WinFontDialog', 'WinMenuBar', 'WinOpenDialog', + 'WinPlayMedia', 'WinSaveDialog', 'WinScrollBar', 'WinSelectDialog', + 'write', 'WriteImage', 'writes', 'WSection', + 'WSync'), prefix=r'\b', suffix=r'\b'), + Name.Function), + include('numbers'), + (r'===|~===|\*\*|\+\+|--|\.|==|~==|<=|>=|=|~=|<<=|<<|>>=|>>|' + r':=:|:=|<->|<-|\+:=|\|\||\|', Operator), + (r'"(?:[^\\"]|\\.)*"', String), + (r"'(?:[^\\']|\\.)*'", String.Character), + (r'[*<>+=/&!?@~\\-]', Operator), + (r'(\w+)(\s*|[(,])', bygroups(Name, using(this))), + (r"[\[\]]", Punctuation), + (r"<>|=>|[()|:;,.'`{}%\^&?]", Punctuation), + (r'\n+', Text), + ], + 'numbers': [ + (r'\b([+-]?([2-9]|[12][0-9]|3[0-6])[rR][0-9a-zA-Z]+)\b', Number.Hex), + (r'[+-]?[0-9]*\.([0-9]*)([Ee][+-]?[0-9]*)?', Number.Float), + (r'\b([+-]?[0-9]+[KMGTPkmgtp]?)\b', Number.Integer), + ], + 'subprogram': [ + (r'\(', Punctuation, ('#pop', 'formal_part')), + (r';', Punctuation, '#pop'), + (r'"[^"]+"|\w+', Name.Function), + include('root'), + ], + 'type_def': [ + (r'\(', Punctuation, 'formal_part'), + ], + 'formal_part': [ + (r'\)', Punctuation, '#pop'), + (r'\w+', Name.Variable), + (r',', Punctuation), + (r'(:string|:integer|:real)\b', Keyword.Reserved), + include('root'), + ], + } + + +class UcodeLexer(RegexLexer): + """ + Lexer for Icon ucode files. + """ + name = 'ucode' + aliases = ['ucode'] + filenames = ['*.u', '*.u1', '*.u2'] + mimetypes = [] + url = 'http://www.unicon.org' + version_added = '2.4' + + flags = re.MULTILINE + + tokens = { + 'root': [ + (r'(#.*\n)', Comment), + (words(( + 'con', 'declend', 'end', + 'global', + 'impl', 'invocable', + 'lab', 'link', 'local', + 'record', + 'uid', 'unions', + 'version'), + prefix=r'\b', suffix=r'\b'), + Name.Function), + (words(( + 'colm', 'filen', 'line', 'synt'), + prefix=r'\b', suffix=r'\b'), + Comment), + (words(( + 'asgn', + 'bang', 'bscan', + 'cat', 'ccase', 'chfail', + 'coact', 'cofail', 'compl', + 'coret', 'create', 'cset', + 'diff', 'div', 'dup', + 'efail', 'einit', 'end', 'eqv', 'eret', + 'error', 'escan', 'esusp', + 'field', + 'goto', + 'init', 'int', 'inter', + 'invoke', + 'keywd', + 'lconcat', 'lexeq', 'lexge', + 'lexgt', 'lexle', 'lexlt', 'lexne', + 'limit', 'llist', 'lsusp', + 'mark', 'mark0', 'minus', 'mod', 'mult', + 'neg', 'neqv', 'nonnull', 'noop', 'null', + 'number', 'numeq', 'numge', 'numgt', + 'numle', 'numlt', 'numne', + 'pfail', 'plus', 'pnull', 'pop', 'power', + 'pret', 'proc', 'psusp', 'push1', 'pushn1', + 'random', 'rasgn', 'rcv', 'rcvbk', 'real', + 'refresh', 'rswap', + 'sdup', 'sect', 'size', 'snd', 'sndbk', + 'str', 'subsc', 'swap', + 'tabmat', 'tally', 'toby', 'trace', + 'unmark', + 'value', 'var'), prefix=r'\b', suffix=r'\b'), + Keyword.Declaration), + (words(( + 'any', + 'case', + 'endcase', 'endevery', 'endif', + 'endifelse', 'endrepeat', 'endsuspend', + 'enduntil', 'endwhile', 'every', + 'if', 'ifelse', + 'repeat', + 'suspend', + 'until', + 'while'), + prefix=r'\b', suffix=r'\b'), + Name.Constant), + (r'\d+(\s*|\.$|$)', Number.Integer), + (r'[+-]?\d*\.\d+(E[-+]?\d+)?', Number.Float), + (r'[+-]?\d+\.\d*(E[-+]?\d+)?', Number.Float), + (r"(<>|=>|[()|:;,.'`]|[{}]|[%^]|[&?])", Punctuation), + (r'\s+\b', Text), + (r'[\w-]+', Text), + ], + } + + def analyse_text(text): + """endsuspend and endrepeat are unique to this language, and + \\self, /self doesn't seem to get used anywhere else either.""" + result = 0 + + if 'endsuspend' in text: + result += 0.1 + + if 'endrepeat' in text: + result += 0.1 + + if ':=' in text: + result += 0.01 + + if 'procedure' in text and 'end' in text: + result += 0.01 + + # This seems quite unique to unicon -- doesn't appear in any other + # example source we have (A quick search reveals that \SELF appears in + # Perl/Raku code) + if r'\self' in text and r'/self' in text: + result += 0.5 + + return result diff --git a/lib/python3.12/site-packages/pygments/lexers/urbi.py b/lib/python3.12/site-packages/pygments/lexers/urbi.py new file mode 100644 index 0000000000000000000000000000000000000000..93cfcedc162ebf29af8d23f4e7663e899e1b9d21 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/urbi.py @@ -0,0 +1,145 @@ +""" + pygments.lexers.urbi + ~~~~~~~~~~~~~~~~~~~~ + + Lexers for UrbiScript language. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import ExtendedRegexLexer, words +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation + +__all__ = ['UrbiscriptLexer'] + + +class UrbiscriptLexer(ExtendedRegexLexer): + """ + For UrbiScript source code. + """ + + name = 'UrbiScript' + aliases = ['urbiscript'] + filenames = ['*.u'] + mimetypes = ['application/x-urbiscript'] + url = 'https://github.com/urbiforge/urbi' + version_added = '1.5' + + flags = re.DOTALL + + # TODO + # - handle Experimental and deprecated tags with specific tokens + # - handle Angles and Durations with specific tokens + + def blob_callback(lexer, match, ctx): + text_before_blob = match.group(1) + blob_start = match.group(2) + blob_size_str = match.group(3) + blob_size = int(blob_size_str) + yield match.start(), String, text_before_blob + ctx.pos += len(text_before_blob) + + # if blob size doesn't match blob format (example : "\B(2)(aaa)") + # yield blob as a string + if ctx.text[match.end() + blob_size] != ")": + result = "\\B(" + blob_size_str + ")(" + yield match.start(), String, result + ctx.pos += len(result) + return + + # if blob is well formatted, yield as Escape + blob_text = blob_start + ctx.text[match.end():match.end()+blob_size] + ")" + yield match.start(), String.Escape, blob_text + ctx.pos = match.end() + blob_size + 1 # +1 is the ending ")" + + tokens = { + 'root': [ + (r'\s+', Text), + # comments + (r'//.*?\n', Comment), + (r'/\*', Comment.Multiline, 'comment'), + (r'(every|for|loop|while)(?:;|&|\||,)', Keyword), + (words(( + 'assert', 'at', 'break', 'case', 'catch', 'closure', 'compl', + 'continue', 'default', 'else', 'enum', 'every', 'external', + 'finally', 'for', 'freezeif', 'if', 'new', 'onleave', 'return', + 'stopif', 'switch', 'this', 'throw', 'timeout', 'try', + 'waituntil', 'whenever', 'while'), suffix=r'\b'), + Keyword), + (words(( + 'asm', 'auto', 'bool', 'char', 'const_cast', 'delete', 'double', + 'dynamic_cast', 'explicit', 'export', 'extern', 'float', 'friend', + 'goto', 'inline', 'int', 'long', 'mutable', 'namespace', 'register', + 'reinterpret_cast', 'short', 'signed', 'sizeof', 'static_cast', + 'struct', 'template', 'typedef', 'typeid', 'typename', 'union', + 'unsigned', 'using', 'virtual', 'volatile', 'wchar_t'), suffix=r'\b'), + Keyword.Reserved), + # deprecated keywords, use a meaningful token when available + (r'(emit|foreach|internal|loopn|static)\b', Keyword), + # ignored keywords, use a meaningful token when available + (r'(private|protected|public)\b', Keyword), + (r'(var|do|const|function|class)\b', Keyword.Declaration), + (r'(true|false|nil|void)\b', Keyword.Constant), + (words(( + 'Barrier', 'Binary', 'Boolean', 'CallMessage', 'Channel', 'Code', + 'Comparable', 'Container', 'Control', 'Date', 'Dictionary', 'Directory', + 'Duration', 'Enumeration', 'Event', 'Exception', 'Executable', 'File', + 'Finalizable', 'Float', 'FormatInfo', 'Formatter', 'Global', 'Group', + 'Hash', 'InputStream', 'IoService', 'Job', 'Kernel', 'Lazy', 'List', + 'Loadable', 'Lobby', 'Location', 'Logger', 'Math', 'Mutex', 'nil', + 'Object', 'Orderable', 'OutputStream', 'Pair', 'Path', 'Pattern', + 'Position', 'Primitive', 'Process', 'Profile', 'PseudoLazy', 'PubSub', + 'RangeIterable', 'Regexp', 'Semaphore', 'Server', 'Singleton', 'Socket', + 'StackFrame', 'Stream', 'String', 'System', 'Tag', 'Timeout', + 'Traceable', 'TrajectoryGenerator', 'Triplet', 'Tuple', 'UObject', + 'UValue', 'UVar'), suffix=r'\b'), + Name.Builtin), + (r'(?:this)\b', Name.Builtin.Pseudo), + # don't match single | and & + (r'(?:[-=+*%/<>~^:]+|\.&?|\|\||&&)', Operator), + (r'(?:and_eq|and|bitand|bitor|in|not|not_eq|or_eq|or|xor_eq|xor)\b', + Operator.Word), + (r'[{}\[\]()]+', Punctuation), + (r'(?:;|\||,|&|\?|!)+', Punctuation), + (r'[$a-zA-Z_]\w*', Name.Other), + (r'0x[0-9a-fA-F]+', Number.Hex), + # Float, Integer, Angle and Duration + (r'(?:[0-9]+(?:(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?)?' + r'((?:rad|deg|grad)|(?:ms|s|min|h|d))?)\b', Number.Float), + # handle binary blob in strings + (r'"', String.Double, "string.double"), + (r"'", String.Single, "string.single"), + ], + 'string.double': [ + (r'((?:\\\\|\\"|[^"])*?)(\\B\((\d+)\)\()', blob_callback), + (r'(\\\\|\\[^\\]|[^"\\])*?"', String.Double, '#pop'), + ], + 'string.single': [ + (r"((?:\\\\|\\'|[^'])*?)(\\B\((\d+)\)\()", blob_callback), + (r"(\\\\|\\[^\\]|[^'\\])*?'", String.Single, '#pop'), + ], + # from http://pygments.org/docs/lexerdevelopment/#changing-states + 'comment': [ + (r'[^*/]', Comment.Multiline), + (r'/\*', Comment.Multiline, '#push'), + (r'\*/', Comment.Multiline, '#pop'), + (r'[*/]', Comment.Multiline), + ] + } + + def analyse_text(text): + """This is fairly similar to C and others, but freezeif and + waituntil are unique keywords.""" + result = 0 + + if 'freezeif' in text: + result += 0.05 + + if 'waituntil' in text: + result += 0.05 + + return result diff --git a/lib/python3.12/site-packages/pygments/lexers/usd.py b/lib/python3.12/site-packages/pygments/lexers/usd.py new file mode 100644 index 0000000000000000000000000000000000000000..468a373691c6e0fa229939f33709554c84c0baca --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/usd.py @@ -0,0 +1,85 @@ +""" + pygments.lexers.usd + ~~~~~~~~~~~~~~~~~~~ + + The module that parses Pixar's Universal Scene Description file format. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, bygroups +from pygments.lexer import words as words_ +from pygments.lexers._usd_builtins import COMMON_ATTRIBUTES, KEYWORDS, \ + OPERATORS, SPECIAL_NAMES, TYPES +from pygments.token import Comment, Keyword, Name, Number, Operator, \ + Punctuation, String, Text, Whitespace + +__all__ = ["UsdLexer"] + + +def _keywords(words, type_): + return [(words_(words, prefix=r"\b", suffix=r"\b"), type_)] + + +_TYPE = r"(\w+(?:\[\])?)" +_BASE_ATTRIBUTE = r"(\w+(?:\:\w+)*)(?:(\.)(timeSamples))?" +_WHITESPACE = r"([ \t]+)" + + +class UsdLexer(RegexLexer): + """ + A lexer that parses Pixar's Universal Scene Description file format. + """ + + name = "USD" + url = 'https://graphics.pixar.com/usd/release/index.html' + aliases = ["usd", "usda"] + filenames = ["*.usd", "*.usda"] + version_added = '2.6' + + tokens = { + "root": [ + (rf"(custom){_WHITESPACE}(uniform)(\s+){_TYPE}(\s+){_BASE_ATTRIBUTE}(\s*)(=)", + bygroups(Keyword.Token, Whitespace, Keyword.Token, Whitespace, + Keyword.Type, Whitespace, Name.Attribute, Text, + Name.Keyword.Tokens, Whitespace, Operator)), + (rf"(custom){_WHITESPACE}{_TYPE}(\s+){_BASE_ATTRIBUTE}(\s*)(=)", + bygroups(Keyword.Token, Whitespace, Keyword.Type, Whitespace, + Name.Attribute, Text, Name.Keyword.Tokens, Whitespace, + Operator)), + (rf"(uniform){_WHITESPACE}{_TYPE}(\s+){_BASE_ATTRIBUTE}(\s*)(=)", + bygroups(Keyword.Token, Whitespace, Keyword.Type, Whitespace, + Name.Attribute, Text, Name.Keyword.Tokens, Whitespace, + Operator)), + (rf"{_TYPE}{_WHITESPACE}{_BASE_ATTRIBUTE}(\s*)(=)", + bygroups(Keyword.Type, Whitespace, Name.Attribute, Text, + Name.Keyword.Tokens, Whitespace, Operator)), + ] + + _keywords(KEYWORDS, Keyword.Tokens) + + _keywords(SPECIAL_NAMES, Name.Builtins) + + _keywords(COMMON_ATTRIBUTES, Name.Attribute) + + [(r"\b\w+:[\w:]+\b", Name.Attribute)] + + _keywords(OPERATORS, Operator) + # more attributes + [(type_ + r"\[\]", Keyword.Type) for type_ in TYPES] + + _keywords(TYPES, Keyword.Type) + + [ + (r"[(){}\[\]]", Punctuation), + ("#.*?$", Comment.Single), + (",", Punctuation), + (";", Punctuation), # ";"s are allowed to combine separate metadata lines + ("=", Operator), + (r"[-]*([0-9]*[.])?[0-9]+(?:e[+-]*\d+)?", Number), + (r"'''(?:.|\n)*?'''", String), + (r'"""(?:.|\n)*?"""', String), + (r"'.*?'", String), + (r'".*?"', String), + (r"<(\.\./)*([\w/]+|[\w/]+\.\w+[\w:]*)>", Name.Namespace), + (r"@.*?@", String.Interpol), + (r'\(.*"[.\\n]*".*\)', String.Doc), + (r"\A#usda .+$", Comment.Hashbang), + (r"\s+", Whitespace), + (r"\w+", Text), + (r"[_:.]+", Punctuation), + ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/varnish.py b/lib/python3.12/site-packages/pygments/lexers/varnish.py new file mode 100644 index 0000000000000000000000000000000000000000..5c3de79949165115ee9e103f44c8b28aca9d31a7 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/varnish.py @@ -0,0 +1,189 @@ +""" + pygments.lexers.varnish + ~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for Varnish configuration + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, include, bygroups, using, this, \ + inherit, words +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Literal, Whitespace + +__all__ = ['VCLLexer', 'VCLSnippetLexer'] + + +class VCLLexer(RegexLexer): + """ + For Varnish Configuration Language (VCL). + """ + name = 'VCL' + aliases = ['vcl'] + filenames = ['*.vcl'] + mimetypes = ['text/x-vclsrc'] + url = 'https://www.varnish-software.com/developers/tutorials/varnish-configuration-language-vcl' + version_added = '2.2' + + def analyse_text(text): + # If the very first line is 'vcl 4.0;' it's pretty much guaranteed + # that this is VCL + if text.startswith('vcl 4.0;'): + return 1.0 + # Skip over comments and blank lines + # This is accurate enough that returning 0.9 is reasonable. + # Almost no VCL files start without some comments. + elif '\nvcl 4.0;' in text[:1000]: + return 0.9 + + tokens = { + 'probe': [ + include('whitespace'), + include('comments'), + (r'(\.\w+)(\s*=\s*)([^;]*)(;)', + bygroups(Name.Attribute, Operator, using(this), Punctuation)), + (r'\}', Punctuation, '#pop'), + ], + 'acl': [ + include('whitespace'), + include('comments'), + (r'[!/]+', Operator), + (r';', Punctuation), + (r'\d+', Number), + (r'\}', Punctuation, '#pop'), + ], + 'backend': [ + include('whitespace'), + (r'(\.probe)(\s*=\s*)(\w+)(;)', + bygroups(Name.Attribute, Operator, Name.Variable.Global, Punctuation)), + (r'(\.probe)(\s*=\s*)(\{)', + bygroups(Name.Attribute, Operator, Punctuation), 'probe'), + (r'(\.\w+\b)(\s*=\s*)([^;\s]*)(\s*;)', + bygroups(Name.Attribute, Operator, using(this), Punctuation)), + (r'\{', Punctuation, '#push'), + (r'\}', Punctuation, '#pop'), + ], + 'statements': [ + (r'(\d\.)?\d+[sdwhmy]', Literal.Date), + (r'(\d\.)?\d+ms', Literal.Date), + (r'(vcl_pass|vcl_hash|vcl_hit|vcl_init|vcl_backend_fetch|vcl_pipe|' + r'vcl_backend_response|vcl_synth|vcl_deliver|vcl_backend_error|' + r'vcl_fini|vcl_recv|vcl_purge|vcl_miss)\b', Name.Function), + (r'(pipe|retry|hash|synth|deliver|purge|abandon|lookup|pass|fail|ok|' + r'miss|fetch|restart)\b', Name.Constant), + (r'(beresp|obj|resp|req|req_top|bereq)\.http\.[a-zA-Z_-]+\b', Name.Variable), + (words(( + 'obj.status', 'req.hash_always_miss', 'beresp.backend', 'req.esi_level', + 'req.can_gzip', 'beresp.ttl', 'obj.uncacheable', 'req.ttl', 'obj.hits', + 'client.identity', 'req.hash_ignore_busy', 'obj.reason', 'req.xid', + 'req_top.proto', 'beresp.age', 'obj.proto', 'obj.age', 'local.ip', + 'beresp.uncacheable', 'req.method', 'beresp.backend.ip', 'now', + 'obj.grace', 'req.restarts', 'beresp.keep', 'req.proto', 'resp.proto', + 'bereq.xid', 'bereq.between_bytes_timeout', 'req.esi', + 'bereq.first_byte_timeout', 'bereq.method', 'bereq.connect_timeout', + 'beresp.do_gzip', 'resp.status', 'beresp.do_gunzip', + 'beresp.storage_hint', 'resp.is_streaming', 'beresp.do_stream', + 'req_top.method', 'bereq.backend', 'beresp.backend.name', 'beresp.status', + 'req.url', 'obj.keep', 'obj.ttl', 'beresp.reason', 'bereq.retries', + 'resp.reason', 'bereq.url', 'beresp.do_esi', 'beresp.proto', 'client.ip', + 'bereq.proto', 'server.hostname', 'remote.ip', 'req.backend_hint', + 'server.identity', 'req_top.url', 'beresp.grace', 'beresp.was_304', + 'server.ip', 'bereq.uncacheable'), suffix=r'\b'), + Name.Variable), + (r'[!%&+*\-,/<.}{>=|~]+', Operator), + (r'[();]', Punctuation), + + (r'[,]+', Punctuation), + (words(('hash_data', 'regsub', 'regsuball', 'if', 'else', + 'elsif', 'elif', 'synth', 'synthetic', 'ban', + 'return', 'set', 'unset', 'import', 'include', 'new', + 'rollback', 'call'), suffix=r'\b'), + Keyword), + (r'storage\.\w+\.\w+\b', Name.Variable), + (words(('true', 'false')), Name.Builtin), + (r'\d+\b', Number), + (r'(backend)(\s+\w+)(\s*\{)', + bygroups(Keyword, Name.Variable.Global, Punctuation), 'backend'), + (r'(probe\s)(\s*\w+\s)(\{)', + bygroups(Keyword, Name.Variable.Global, Punctuation), 'probe'), + (r'(acl\s)(\s*\w+\s)(\{)', + bygroups(Keyword, Name.Variable.Global, Punctuation), 'acl'), + (r'(vcl )(4.0)(;)$', + bygroups(Keyword.Reserved, Name.Constant, Punctuation)), + (r'(sub\s+)([a-zA-Z]\w*)(\s*\{)', + bygroups(Keyword, Name.Function, Punctuation)), + (r'([a-zA-Z_]\w*)' + r'(\.)' + r'([a-zA-Z_]\w*)' + r'(\s*\(.*\))', + bygroups(Name.Function, Punctuation, Name.Function, using(this))), + (r'[a-zA-Z_]\w*', Name), + ], + 'comment': [ + (r'[^*/]+', Comment.Multiline), + (r'/\*', Comment.Multiline, '#push'), + (r'\*/', Comment.Multiline, '#pop'), + (r'[*/]', Comment.Multiline), + ], + 'comments': [ + (r'#.*$', Comment), + (r'/\*', Comment.Multiline, 'comment'), + (r'//.*$', Comment), + ], + 'string': [ + (r'"', String, '#pop'), + (r'[^"\n]+', String), # all other characters + ], + 'multistring': [ + (r'[^"}]', String), + (r'"\}', String, '#pop'), + (r'["}]', String), + ], + 'whitespace': [ + (r'L?"', String, 'string'), + (r'\{"', String, 'multistring'), + (r'\n', Whitespace), + (r'\s+', Whitespace), + (r'\\\n', Text), # line continuation + ], + 'root': [ + include('whitespace'), + include('comments'), + include('statements'), + (r'\s+', Whitespace), + ], + } + + +class VCLSnippetLexer(VCLLexer): + """ + For Varnish Configuration Language snippets. + """ + name = 'VCLSnippets' + aliases = ['vclsnippets', 'vclsnippet'] + mimetypes = ['text/x-vclsnippet'] + filenames = [] + url = 'https://www.varnish-software.com/developers/tutorials/varnish-configuration-language-vcl' + version_added = '2.2' + + def analyse_text(text): + # override method inherited from VCLLexer + return 0 + + tokens = { + 'snippetspre': [ + (r'\.\.\.+', Comment), + (r'(bereq|req|req_top|resp|beresp|obj|client|server|local|remote|' + r'storage)($|\.\*)', Name.Variable), + ], + 'snippetspost': [ + (r'(backend)\b', Keyword.Reserved), + ], + 'root': [ + include('snippetspre'), + inherit, + include('snippetspost'), + ], + } diff --git a/lib/python3.12/site-packages/pygments/lexers/web.py b/lib/python3.12/site-packages/pygments/lexers/web.py new file mode 100644 index 0000000000000000000000000000000000000000..3d359662deff91dc9f44cb57bbb84a5961693e78 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/web.py @@ -0,0 +1,24 @@ +""" + pygments.lexers.web + ~~~~~~~~~~~~~~~~~~~ + + Just export previously exported lexers. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +# ruff: noqa: F401 +from pygments.lexers.html import HtmlLexer, DtdLexer, XmlLexer, XsltLexer, \ + HamlLexer, ScamlLexer, JadeLexer +from pygments.lexers.css import CssLexer, SassLexer, ScssLexer +from pygments.lexers.javascript import JavascriptLexer, LiveScriptLexer, \ + DartLexer, TypeScriptLexer, LassoLexer, ObjectiveJLexer, CoffeeScriptLexer +from pygments.lexers.actionscript import ActionScriptLexer, \ + ActionScript3Lexer, MxmlLexer +from pygments.lexers.php import PhpLexer +from pygments.lexers.webmisc import DuelLexer, XQueryLexer, SlimLexer, QmlLexer +from pygments.lexers.data import JsonLexer +JSONLexer = JsonLexer # for backwards compatibility with Pygments 1.5 + +__all__ = [] diff --git a/lib/python3.12/site-packages/pygments/lexers/wowtoc.py b/lib/python3.12/site-packages/pygments/lexers/wowtoc.py new file mode 100644 index 0000000000000000000000000000000000000000..2b18757d7d93537790dd306ca73efba94709d298 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/wowtoc.py @@ -0,0 +1,120 @@ +""" + pygments.lexers.wowtoc + ~~~~~~~~~~~~~~~~~~~~~~ + + Lexer for World of Warcraft TOC files + + TOC files describe game addons. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, bygroups +from pygments.token import Comment, Name, Text, Punctuation, String, Keyword + +__all__ = ["WoWTocLexer"] + +def _create_tag_line_pattern(inner_pattern, ignore_case=False): + return ((r"(?i)" if ignore_case else r"") + + r"^(##)( *)" # groups 1, 2 + + inner_pattern # group 3 + + r"( *)(:)( *)(.*?)( *)$") # groups 4, 5, 6, 7, 8 + + +def _create_tag_line_token(inner_pattern, inner_token, ignore_case=False): + # this function template-izes the tag line for a specific type of tag, which will + # have a different pattern and different token. otherwise, everything about a tag + # line is the same + return ( + _create_tag_line_pattern(inner_pattern, ignore_case=ignore_case), + bygroups( + Keyword.Declaration, + Text.Whitespace, + inner_token, + Text.Whitespace, + Punctuation, + Text.Whitespace, + String, + Text.Whitespace, + ), + ) + + +class WoWTocLexer(RegexLexer): + """ + Lexer for World of Warcraft TOC files. + """ + + name = "World of Warcraft TOC" + aliases = ["wowtoc"] + filenames = ["*.toc"] + url = 'https://wowpedia.fandom.com/wiki/TOC_format' + version_added = '2.14' + + tokens = { + "root": [ + # official localized tags, Notes and Title + # (normal part is insensitive, locale part is sensitive) + _create_tag_line_token( + r"((?:[nN][oO][tT][eE][sS]|[tT][iI][tT][lL][eE])-(?:ptBR|zhCN|" + r"enCN|frFR|deDE|itIT|esMX|ptPT|koKR|ruRU|esES|zhTW|enTW|enGB|enUS))", + Name.Builtin, + ), + # other official tags + _create_tag_line_token( + r"(Interface|Title|Notes|RequiredDeps|Dep[^: ]*|OptionalDeps|" + r"LoadOnDemand|LoadWith|LoadManagers|SavedVariablesPerCharacter|" + r"SavedVariables|DefaultState|Secure|Author|Version)", + Name.Builtin, + ignore_case=True, + ), + # user-defined tags + _create_tag_line_token( + r"(X-[^: ]*)", + Name.Variable, + ignore_case=True, + ), + # non-conforming tags, but still valid + _create_tag_line_token( + r"([^: ]*)", + Name.Other, + ), + + # Comments + (r"^#.*$", Comment), + + # Addon Files + (r"^.+$", Name), + ] + } + + def analyse_text(text): + # at time of writing, this file suffix conflict's with one of Tex's in + # markup.py. Tex's anaylse_text() appears to be definitive (binary) and does not + # share any likeness to WoW TOCs, which means we wont have to compete with it by + # abitrary increments in score. + + result = 0 + + # while not required, an almost certain marker of WoW TOC's is the interface tag + # if this tag is omitted, players will need to opt-in to loading the addon with + # an options change ("Load out of date addons"). the value is also standardized: + # ``, with minor and patch being two-digit zero-padded. + interface_pattern = _create_tag_line_pattern(r"(Interface)", ignore_case=True) + match = re.search(interface_pattern, text) + if match and re.match(r"(\d+)(\d{2})(\d{2})", match.group(7)): + result += 0.8 + + casefolded = text.casefold() + # Lua file listing is good marker too, but probably conflicts with many other + # lexers + if ".lua" in casefolded: + result += 0.1 + # ditto for XML files, but they're less used in WoW TOCs + if ".xml" in casefolded: + result += 0.05 + + return result diff --git a/lib/python3.12/site-packages/pygments/lexers/yang.py b/lib/python3.12/site-packages/pygments/lexers/yang.py new file mode 100644 index 0000000000000000000000000000000000000000..e7f3951256993d74e20c73d735e986cedb6cf997 --- /dev/null +++ b/lib/python3.12/site-packages/pygments/lexers/yang.py @@ -0,0 +1,103 @@ +""" + pygments.lexers.yang + ~~~~~~~~~~~~~~~~~~~~ + + Lexer for the YANG 1.1 modeling language. See :rfc:`7950`. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, bygroups, words +from pygments.token import Text, Token, Name, String, Comment, Number + +__all__ = ['YangLexer'] + + +class YangLexer(RegexLexer): + """ + Lexer for YANG, based on RFC7950. + """ + name = 'YANG' + url = 'https://tools.ietf.org/html/rfc7950/' + aliases = ['yang'] + filenames = ['*.yang'] + mimetypes = ['application/yang'] + version_added = '2.7' + + #Keywords from RFC7950 ; oriented at BNF style + TOP_STMTS_KEYWORDS = ("module", "submodule") + MODULE_HEADER_STMT_KEYWORDS = ("belongs-to", "namespace", "prefix", "yang-version") + META_STMT_KEYWORDS = ("contact", "description", "organization", + "reference", "revision") + LINKAGE_STMTS_KEYWORDS = ("import", "include", "revision-date") + BODY_STMT_KEYWORDS = ("action", "argument", "augment", "deviation", + "extension", "feature", "grouping", "identity", + "if-feature", "input", "notification", "output", + "rpc", "typedef") + DATA_DEF_STMT_KEYWORDS = ("anydata", "anyxml", "case", "choice", + "config", "container", "deviate", "leaf", + "leaf-list", "list", "must", "presence", + "refine", "uses", "when") + TYPE_STMT_KEYWORDS = ("base", "bit", "default", "enum", "error-app-tag", + "error-message", "fraction-digits", "length", + "max-elements", "min-elements", "modifier", + "ordered-by", "path", "pattern", "position", + "range", "require-instance", "status", "type", + "units", "value", "yin-element") + LIST_STMT_KEYWORDS = ("key", "mandatory", "unique") + + #RFC7950 other keywords + CONSTANTS_KEYWORDS = ("add", "current", "delete", "deprecated", "false", + "invert-match", "max", "min", "not-supported", + "obsolete", "replace", "true", "unbounded", "user") + + #RFC7950 Built-In Types + TYPES = ("binary", "bits", "boolean", "decimal64", "empty", "enumeration", + "identityref", "instance-identifier", "int16", "int32", "int64", + "int8", "leafref", "string", "uint16", "uint32", "uint64", + "uint8", "union") + + suffix_re_pattern = r'(?=[^\w\-:])' + + tokens = { + 'comments': [ + (r'[^*/]', Comment), + (r'/\*', Comment, '#push'), + (r'\*/', Comment, '#pop'), + (r'[*/]', Comment), + ], + "root": [ + (r'\s+', Text.Whitespace), + (r'[{};]+', Token.Punctuation), + (r'(?