1"""
2 pygments.lexers.macaulay2
3 ~~~~~~~~~~~~~~~~~~~~~~~~~
4
5 Lexer for Macaulay2.
6
7 :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
8 :license: BSD, see LICENSE for details.
9"""
10
11from pygments.lexer import RegexLexer, words
12from pygments.token import Comment, Keyword, Name, String, Text
13
14__all__ = ['Macaulay2Lexer']
15
16# Auto-generated for Macaulay2-1.26.06. Do not modify this file manually.
17
18M2KEYWORDS = (
19 "SPACE",
20 "TEST",
21 "and",
22 "break",
23 "breakpoint",
24 "catch",
25 "continue",
26 "do",
27 "elapsedTime",
28 "elapsedTiming",
29 "else",
30 "except",
31 "finish",
32 "for",
33 "from",
34 "global",
35 "if",
36 "in",
37 "list",
38 "local",
39 "new",
40 "not",
41 "of",
42 "or",
43 "profile",
44 "return",
45 "shield",
46 "step",
47 "symbol",
48 "then",
49 "threadLocal",
50 "threadVariable",
51 "throw",
52 "time",
53 "timing",
54 "to",
55 "trap",
56 "try",
57 "when",
58 "while",
59 "xor"
60 )
61
62M2DATATYPES = (
63 "ANCHOR",
64 "Adjacent",
65 "AffineVariety",
66 "Analyzer",
67 "AngleBarList",
68 "Array",
69 "AssociativeExpression",
70 "AtomicInt",
71 "BLOCKQUOTE",
72 "BODY",
73 "BOLD",
74 "BR",
75 "BUTTON",
76 "Bag",
77 "BasicList",
78 "BettiTally",
79 "BinaryOperation",
80 "Boolean",
81 "CC",
82 "CCi",
83 "CDATA",
84 "CODE",
85 "COMMENT",
86 "CacheTable",
87 "CoherentSheaf",
88 "Command",
89 "CompiledFunction",
90 "CompiledFunctionBody",
91 "CompiledFunctionClosure",
92 "Complex",
93 "ComplexField",
94 "ComplexMap",
95 "Constant",
96 "DD",
97 "DIV",
98 "DL",
99 "DT",
100 "Database",
101 "Descent",
102 "Describe",
103 "Dictionary",
104 "DirectSum",
105 "Divide",
106 "DocumentTag",
107 "EM",
108 "Eliminate",
109 "EngineRing",
110 "Equation",
111 "Error",
112 "ExampleItem",
113 "Expression",
114 "File",
115 "FilePosition",
116 "FractionField",
117 "Function",
118 "FunctionApplication",
119 "FunctionBody",
120 "FunctionClosure",
121 "GaloisField",
122 "GeneralOrderedMonoid",
123 "GlobalDictionary",
124 "GradedModule",
125 "GradedModuleMap",
126 "GroebnerBasis",
127 "GroebnerBasisOptions",
128 "HEAD",
129 "HEADER1",
130 "HEADER2",
131 "HEADER3",
132 "HEADER4",
133 "HEADER5",
134 "HEADER6",
135 "HR",
136 "HREF",
137 "HTML",
138 "HashTable",
139 "HeaderType",
140 "Holder",
141 "Hybrid",
142 "Hypertext",
143 "HypertextContainer",
144 "HypertextParagraph",
145 "HypertextVoid",
146 "IFRAME",
147 "IMG",
148 "INDENT",
149 "INPUT",
150 "ITALIC",
151 "Ideal",
152 "ImmutableType",
153 "IndeterminateNumber",
154 "IndexedVariable",
155 "IndexedVariableTable",
156 "InexactField",
157 "InexactFieldFamily",
158 "InexactNumber",
159 "InfiniteNumber",
160 "IntermediateMarkUpType",
161 "Iterator",
162 "KBD",
163 "Keyword",
164 "LABEL",
165 "LATER",
166 "LI",
167 "LINK",
168 "LITERAL",
169 "List",
170 "LocalDictionary",
171 "LowerBound",
172 "MENU",
173 "META",
174 "Manipulator",
175 "MapExpression",
176 "MarkUpType",
177 "Matrix",
178 "MatrixExpression",
179 "MethodFunction",
180 "MethodFunctionBinary",
181 "MethodFunctionSingle",
182 "MethodFunctionWithOptions",
183 "Minus",
184 "Module",
185 "Monoid",
186 "MonoidElement",
187 "MonomialIdeal",
188 "MultigradedBettiTally",
189 "MutableHashTable",
190 "MutableList",
191 "MutableMatrix",
192 "Mutex",
193 "Net",
194 "NetFile",
195 "Nothing",
196 "Number",
197 "NumberedVerticalList",
198 "OL",
199 "OneExpression",
200 "Option",
201 "OptionTable",
202 "OrderedMonoid",
203 "PARA",
204 "PRE",
205 "Package",
206 "Parenthesize",
207 "Parser",
208 "Partition",
209 "PolynomialRing",
210 "Power",
211 "Product",
212 "ProductOrder",
213 "Program",
214 "ProgramRun",
215 "ProjectiveHilbertPolynomial",
216 "ProjectiveVariety",
217 "Pseudocode",
218 "PseudocodeClosure",
219 "QQ",
220 "QuotientRing",
221 "RR",
222 "RRi",
223 "RealField",
224 "Resolution",
225 "Ring",
226 "RingElement",
227 "RingFamily",
228 "RingMap",
229 "RowExpression",
230 "SAMP",
231 "SCRIPT",
232 "SMALL",
233 "SPAN",
234 "STRONG",
235 "STYLE",
236 "SUB",
237 "SUBSECTION",
238 "SUP",
239 "ScriptedFunctor",
240 "SelfInitializingType",
241 "Sequence",
242 "Set",
243 "SheafExpression",
244 "SheafMap",
245 "SheafOfRings",
246 "SparseMonomialVectorExpression",
247 "SparseVectorExpression",
248 "String",
249 "Subscript",
250 "Sum",
251 "SumOfTwists",
252 "Superscript",
253 "Symbol",
254 "SymbolBody",
255 "TABLE",
256 "TD",
257 "TEX",
258 "TH",
259 "TITLE",
260 "TO",
261 "TO2",
262 "TOH",
263 "TR",
264 "TT",
265 "Table",
266 "Tally",
267 "Task",
268 "TensorProduct",
269 "TestInput",
270 "Thing",
271 "Time",
272 "Type",
273 "UL",
274 "URL",
275 "VAR",
276 "Variety",
277 "Vector",
278 "VectorExpression",
279 "VerticalList",
280 "VirtualTally",
281 "VisibleList",
282 "WrapperType",
283 "ZZ",
284 "ZeroExpression"
285 )
286
287M2FUNCTIONS = (
288 "BesselJ",
289 "BesselY",
290 "Beta",
291 "Digamma",
292 "EXAMPLE",
293 "End",
294 "Fano",
295 "GCstats",
296 "GF",
297 "Gamma",
298 "Grassmannian",
299 "Hom",
300 "LLL",
301 "LUdecomposition",
302 "M2CODE",
303 "NNParser",
304 "Proj",
305 "QQParser",
306 "QRDecomposition",
307 "SVD",
308 "SYNOPSIS",
309 "Schubert",
310 "Spec",
311 "ZZParser",
312 "about",
313 "abs",
314 "accumulate",
315 "acos",
316 "acosh",
317 "acot",
318 "acoth",
319 "addCancelTask",
320 "addDependencyTask",
321 "addEndFunction",
322 "addHook",
323 "addStartTask",
324 "adjoint",
325 "agm",
326 "alarm",
327 "all",
328 "ambient",
329 "analyticSpread",
330 "ancestor",
331 "ancestors",
332 "andP",
333 "ann",
334 "annihilator",
335 "antipode",
336 "any",
337 "append",
338 "applicationDirectory",
339 "apply",
340 "applyKeys",
341 "applyPairs",
342 "applyTable",
343 "applyValues",
344 "apropos",
345 "arXiv",
346 "ascii",
347 "asin",
348 "asinh",
349 "ass",
350 "assert",
351 "associatedGradedRing",
352 "associatedPrimes",
353 "atEndOfFile",
354 "atan",
355 "atan2",
356 "atanh",
357 "augmentationMap",
358 "autoload",
359 "baseFilename",
360 "baseName",
361 "baseRing",
362 "basis",
363 "beginDocumentation",
364 "benchmark",
365 "betti",
366 "between",
367 "binomial",
368 "borel",
369 "cacheValue",
370 "canUseHilbertHint",
371 "cancelTask",
372 "canonicalBundle",
373 "canonicalMap",
374 "canonicalTruncation",
375 "capture",
376 "ceiling",
377 "centerString",
378 "changeBase",
379 "changeDirectory",
380 "char",
381 "charAnalyzer",
382 "characters",
383 "check",
384 "checkDegrees",
385 "chi",
386 "class",
387 "clean",
388 "clearEcho",
389 "code",
390 "codim",
391 "coefficient",
392 "coefficientRing",
393 "coefficients",
394 "cohomology",
395 "coimage",
396 "coker",
397 "cokernel",
398 "collectGarbage",
399 "columnAdd",
400 "columnMult",
401 "columnPermute",
402 "columnRankProfile",
403 "columnSwap",
404 "columnate",
405 "combine",
406 "commandInterpreter",
407 "commonRing",
408 "commonest",
409 "comodule",
410 "compareExchange",
411 "complement",
412 "complete",
413 "complex",
414 "component",
415 "components",
416 "compose",
417 "compositions",
418 "compress",
419 "concatenate",
420 "concentration",
421 "conductor",
422 "cone",
423 "conjugate",
424 "connectingExtMap",
425 "connectingMap",
426 "connectingTorMap",
427 "connectionCount",
428 "constParser",
429 "constantStrand",
430 "content",
431 "contract",
432 "conwayPolynomial",
433 "copy",
434 "copyDirectory",
435 "copyFile",
436 "cos",
437 "cosh",
438 "cot",
439 "cotangentSheaf",
440 "coth",
441 "cover",
442 "coverMap",
443 "cpuTime",
444 "createTask",
445 "csc",
446 "csch",
447 "currentColumnNumber",
448 "currentDirectory",
449 "currentPosition",
450 "currentRowNumber",
451 "currentTime",
452 "cylinder",
453 "deadParser",
454 "debug",
455 "debugError",
456 "decompose",
457 "deepSplice",
458 "default",
459 "degree",
460 "degreeGroup",
461 "degreeLength",
462 "degrees",
463 "degreesMonoid",
464 "degreesRing",
465 "delete",
466 "demark",
467 "denominator",
468 "depth",
469 "describe",
470 "det",
471 "determinant",
472 "diagonalMatrix",
473 "diameter",
474 "dictionary",
475 "diff",
476 "difference",
477 "dim",
478 "directProduct",
479 "directSum",
480 "disassemble",
481 "discriminant",
482 "dismiss",
483 "distinguished",
484 "divideByVariable",
485 "doc",
486 "document",
487 "drop",
488 "dual",
489 "eagonNorthcott",
490 "eagonNorthcottComplex",
491 "echoOff",
492 "echoOn",
493 "eigenvalues",
494 "eigenvectors",
495 "eint",
496 "elements",
497 "eliminate",
498 "endPackage",
499 "entries",
500 "epicResolutionMap",
501 "erase",
502 "erf",
503 "erfc",
504 "error",
505 "euler",
506 "eulers",
507 "even",
508 "examples",
509 "exchange",
510 "exec",
511 "exp",
512 "expectedReesIdeal",
513 "expm1",
514 "exponents",
515 "export",
516 "exportFrom",
517 "exportMutable",
518 "expression",
519 "extend",
520 "exteriorPower",
521 "factor",
522 "fileExecutable",
523 "fileExists",
524 "fileLength",
525 "fileMode",
526 "fileReadable",
527 "fileTime",
528 "fileWritable",
529 "fillMatrix",
530 "findFiles",
531 "findHeft",
532 "findProgram",
533 "findSynonyms",
534 "first",
535 "firstkey",
536 "fittingIdeal",
537 "flagLookup",
538 "flatten",
539 "flattenRing",
540 "flip",
541 "floor",
542 "fold",
543 "forceGB",
544 "fork",
545 "format",
546 "formation",
547 "frac",
548 "fraction",
549 "frames",
550 "freeResolution",
551 "fromDividedPowers",
552 "fromDual",
553 "functionBody",
554 "futureParser",
555 "gb",
556 "gbRemove",
557 "gbSnapshot",
558 "gcd",
559 "gcdCoefficients",
560 "gcdLLL",
561 "genera",
562 "generateAssertions",
563 "generator",
564 "generators",
565 "genericMatrix",
566 "genericSkewMatrix",
567 "genericSymmetricMatrix",
568 "gens",
569 "genus",
570 "get",
571 "getChangeMatrix",
572 "getGlobalSymbol",
573 "getIOThreadMode",
574 "getNetFile",
575 "getNonUnit",
576 "getPrimeWithRootOfUnity",
577 "getSymbol",
578 "getWWW",
579 "getc",
580 "getenv",
581 "globalAssign",
582 "globalAssignFunction",
583 "globalAssignment",
584 "globalReleaseFunction",
585 "gradedModule",
586 "gramm",
587 "graphIdeal",
588 "graphRing",
589 "groebnerBasis",
590 "groupID",
591 "hash",
592 "hashTable",
593 "headlines",
594 "heft",
595 "height",
596 "hermite",
597 "hilbertFunction",
598 "hilbertPolynomial",
599 "hilbertSeries",
600 "hold",
601 "homogenize",
602 "homology",
603 "homomorphism",
604 "homotopyMap",
605 "hooks",
606 "horizontalJoin",
607 "horseshoeResolution",
608 "html",
609 "httpHeaders",
610 "hypertext",
611 "icFracP",
612 "icFractions",
613 "icMap",
614 "icPIdeal",
615 "ideal",
616 "idealSheaf",
617 "idealizer",
618 "identity",
619 "image",
620 "imaginaryPart",
621 "importFrom",
622 "independentSets",
623 "index",
624 "indices",
625 "inducedMap",
626 "inducesWellDefinedMap",
627 "info",
628 "input",
629 "insert",
630 "installAssignmentMethod",
631 "installHilbertFunction",
632 "installMethod",
633 "installPackage",
634 "installedPackages",
635 "instance",
636 "instances",
637 "integralClosure",
638 "integrate",
639 "intersect",
640 "intersectInP",
641 "intersection",
642 "interval",
643 "inverse",
644 "inverseErf",
645 "inversePermutation",
646 "inverseRegularizedBeta",
647 "inverseRegularizedGamma",
648 "inverseSystem",
649 "irreducibleCharacteristicSeries",
650 "irreducibleDecomposition",
651 "isANumber",
652 "isAffineRing",
653 "isBorel",
654 "isCanceled",
655 "isCommutative",
656 "isComplexMorphism",
657 "isConstant",
658 "isDirectSum",
659 "isDirectory",
660 "isEmpty",
661 "isExact",
662 "isField",
663 "isFinite",
664 "isFinitePrimeField",
665 "isFree",
666 "isFreeModule",
667 "isGlobalSymbol",
668 "isHomogeneous",
669 "isIdeal",
670 "isInfinite",
671 "isInjective",
672 "isInputFile",
673 "isIsomorphic",
674 "isIsomorphism",
675 "isLLL",
676 "isLinearType",
677 "isListener",
678 "isLocallyFree",
679 "isMember",
680 "isModule",
681 "isMonomialIdeal",
682 "isMutable",
683 "isNormal",
684 "isNullHomotopic",
685 "isNullHomotopyOf",
686 "isOpen",
687 "isOutputFile",
688 "isPolynomialRing",
689 "isPrimary",
690 "isPrime",
691 "isPrimitive",
692 "isProjective",
693 "isPseudoprime",
694 "isQuasiIsomorphism",
695 "isQuotientModule",
696 "isQuotientOf",
697 "isQuotientRing",
698 "isReady",
699 "isReal",
700 "isReduction",
701 "isRegularFile",
702 "isRing",
703 "isScalar",
704 "isShortExactSequence",
705 "isSkewCommutative",
706 "isSmooth",
707 "isSorted",
708 "isSquareFree",
709 "isStandardGradedPolynomialRing",
710 "isSubmodule",
711 "isSubquotient",
712 "isSubset",
713 "isSupportedInZeroLocus",
714 "isSurjective",
715 "isTable",
716 "isUnit",
717 "isVeryAmple",
718 "isWellDefined",
719 "isWeylAlgebra",
720 "isc",
721 "isomorphism",
722 "iterator",
723 "jacobian",
724 "jacobianDual",
725 "join",
726 "ker",
727 "kernel",
728 "kernelLLL",
729 "kernelOfLocalization",
730 "keys",
731 "kill",
732 "koszul",
733 "koszulComplex",
734 "last",
735 "lcm",
736 "leadCoefficient",
737 "leadComponent",
738 "leadMonomial",
739 "leadTerm",
740 "left",
741 "length",
742 "letterParser",
743 "lift",
744 "liftMapAlongQuasiIsomorphism",
745 "liftable",
746 "limitFiles",
747 "limitProcesses",
748 "lines",
749 "linkFile",
750 "listForm",
751 "listSymbols",
752 "lngamma",
753 "load",
754 "loadPackage",
755 "localDictionaries",
756 "localize",
757 "locate",
758 "lock",
759 "log",
760 "log1p",
761 "longExactSequence",
762 "lookup",
763 "lookupCount",
764 "lowerLeft",
765 "lowerRight",
766 "makeDirectory",
767 "makeDocumentTag",
768 "makePackageIndex",
769 "makeS2",
770 "map",
771 "markedGB",
772 "match",
773 "mathML",
774 "matrix",
775 "max",
776 "maxPosition",
777 "member",
778 "memoize",
779 "memoizeClear",
780 "memoizeValues",
781 "merge",
782 "mergePairs",
783 "method",
784 "methodOptions",
785 "methods",
786 "midpoint",
787 "min",
788 "minPosition",
789 "minPres",
790 "mingens",
791 "mingle",
792 "minimalBetti",
793 "minimalPresentation",
794 "minimalPrimes",
795 "minimalReduction",
796 "minimize",
797 "minimizeFilename",
798 "minors",
799 "minprimes",
800 "minus",
801 "mkdir",
802 "mod",
803 "module",
804 "modulo",
805 "monoid",
806 "monomialCurveIdeal",
807 "monomialIdeal",
808 "monomialSubideal",
809 "monomials",
810 "moveFile",
811 "multidegree",
812 "multidoc",
813 "multigraded",
814 "multiplicity",
815 "mutable",
816 "mutableIdentity",
817 "mutableMatrix",
818 "naiveTruncation",
819 "nanosleep",
820 "needs",
821 "needsPackage",
822 "net",
823 "netList",
824 "newClass",
825 "newCoordinateSystem",
826 "newNetFile",
827 "newPackage",
828 "newRing",
829 "next",
830 "nextPrime",
831 "nextkey",
832 "nonspaceAnalyzer",
833 "norm",
834 "normalCone",
835 "notImplemented",
836 "nullHomotopy",
837 "nullParser",
838 "nullSpace",
839 "nullhomotopy",
840 "numColumns",
841 "numRows",
842 "number",
843 "numcols",
844 "numerator",
845 "numeric",
846 "numericInterval",
847 "numgens",
848 "numrows",
849 "odd",
850 "oeis",
851 "ofClass",
852 "on",
853 "openDatabase",
854 "openDatabaseOut",
855 "openFiles",
856 "openIn",
857 "openInOut",
858 "openListener",
859 "openOut",
860 "openOutAppend",
861 "optP",
862 "optionalSignParser",
863 "options",
864 "orP",
865 "override",
866 "pack",
867 "package",
868 "packageTemplate",
869 "pad",
870 "pager",
871 "pairs",
872 "parallelApply",
873 "parent",
874 "parse",
875 "part",
876 "partition",
877 "partitions",
878 "parts",
879 "pdim",
880 "peek",
881 "permanents",
882 "permutations",
883 "pfaffian",
884 "pfaffians",
885 "pivots",
886 "plus",
887 "poincare",
888 "poincareN",
889 "polarize",
890 "poly",
891 "polylog",
892 "position",
893 "positions",
894 "power",
895 "powermod",
896 "precision",
897 "preimage",
898 "prepend",
899 "presentation",
900 "pretty",
901 "primaryComponent",
902 "primaryDecomposition",
903 "print",
904 "printString",
905 "printerr",
906 "processID",
907 "product",
908 "projectiveHilbertPolynomial",
909 "promote",
910 "protect",
911 "prune",
912 "pruneComplex",
913 "pruneDiff",
914 "pruneUnit",
915 "pseudoRemainder",
916 "pseudocode",
917 "pullback",
918 "pushForward",
919 "pushout",
920 "quotient",
921 "quotientRemainder",
922 "radical",
923 "radicalContainment",
924 "random",
925 "randomComplexMap",
926 "randomElement",
927 "randomKRationalPoint",
928 "randomMutableMatrix",
929 "randomSubset",
930 "rank",
931 "rays",
932 "read",
933 "readDirectory",
934 "readPackage",
935 "readlink",
936 "realPart",
937 "realpath",
938 "recursionDepth",
939 "reduceHilbert",
940 "reducedRowEchelonForm",
941 "reductionNumber",
942 "reesAlgebra",
943 "reesAlgebraIdeal",
944 "reesIdeal",
945 "regSeqInIdeal",
946 "regex",
947 "regexQuote",
948 "registerFinalizer",
949 "regularity",
950 "regularizedBeta",
951 "regularizedGamma",
952 "relations",
953 "relativizeFilename",
954 "remainder",
955 "remove",
956 "removeDirectory",
957 "removeFile",
958 "removeLowestDimension",
959 "reorganize",
960 "replace",
961 "res",
962 "reshape",
963 "resolution",
964 "resolutionMap",
965 "resultant",
966 "reverse",
967 "right",
968 "ring",
969 "ringFromFractions",
970 "roots",
971 "rotate",
972 "round",
973 "rowAdd",
974 "rowMult",
975 "rowPermute",
976 "rowRankProfile",
977 "rowSwap",
978 "rsort",
979 "run",
980 "runHooks",
981 "runLengthEncode",
982 "runProgram",
983 "same",
984 "saturate",
985 "scan",
986 "scanKeys",
987 "scanLines",
988 "scanPairs",
989 "scanValues",
990 "schedule",
991 "schreyerOrder",
992 "searchPath",
993 "sec",
994 "sech",
995 "seeParsing",
996 "select",
997 "selectInSubring",
998 "selectKeys",
999 "selectPairs",
1000 "selectValues",
1001 "selectVariables",
1002 "separate",
1003 "separateRegexp",
1004 "sequence",
1005 "serialNumber",
1006 "set",
1007 "setEcho",
1008 "setGroupID",
1009 "setIOExclusive",
1010 "setIOSynchronized",
1011 "setIOUnSynchronized",
1012 "setRandomSeed",
1013 "setup",
1014 "setupEmacs",
1015 "setupLift",
1016 "setupPromote",
1017 "sheaf",
1018 "sheafHom",
1019 "show",
1020 "showHtml",
1021 "showTex",
1022 "shuffle",
1023 "sign",
1024 "simpleDocFrob",
1025 "sin",
1026 "singularLocus",
1027 "sinh",
1028 "size",
1029 "size2",
1030 "sleep",
1031 "smithNormalForm",
1032 "solve",
1033 "someTerms",
1034 "sort",
1035 "sortColumns",
1036 "source",
1037 "span",
1038 "specialFiber",
1039 "specialFiberIdeal",
1040 "splice",
1041 "splitWWW",
1042 "sqrt",
1043 "stack",
1044 "stacksProject",
1045 "stacktrace",
1046 "standardForm",
1047 "standardPairs",
1048 "stashValue",
1049 "status",
1050 "store",
1051 "style",
1052 "sub",
1053 "sublists",
1054 "submatrix",
1055 "submatrixByDegrees",
1056 "subquotient",
1057 "subsets",
1058 "substitute",
1059 "substring",
1060 "subtable",
1061 "sum",
1062 "super",
1063 "support",
1064 "switch",
1065 "sylvesterMatrix",
1066 "symbolBody",
1067 "symlinkDirectory",
1068 "symlinkFile",
1069 "symmetricAlgebra",
1070 "symmetricAlgebraIdeal",
1071 "symmetricKernel",
1072 "symmetricPower",
1073 "synonym",
1074 "syz",
1075 "table",
1076 "take",
1077 "tally",
1078 "tan",
1079 "tangentCone",
1080 "tangentSheaf",
1081 "tanh",
1082 "target",
1083 "taskResult",
1084 "temporaryFileName",
1085 "tensor",
1086 "tensorAssociativity",
1087 "tensorCommutativity",
1088 "terminalParser",
1089 "terms",
1090 "testHunekeQuestion",
1091 "tests",
1092 "tex",
1093 "texMath",
1094 "times",
1095 "toAbsolutePath",
1096 "toCC",
1097 "toCCi",
1098 "toChainComplex",
1099 "toDividedPowers",
1100 "toDual",
1101 "toExternalString",
1102 "toField",
1103 "toList",
1104 "toLower",
1105 "toMutableComplex",
1106 "toRR",
1107 "toRRi",
1108 "toSequence",
1109 "toString",
1110 "toUpper",
1111 "top",
1112 "topCoefficients",
1113 "topComponents",
1114 "torSymmetry",
1115 "trace",
1116 "transpose",
1117 "trim",
1118 "truncate",
1119 "truncateOutput",
1120 "tryLock",
1121 "tutorial",
1122 "ultimate",
1123 "unbag",
1124 "uncurry",
1125 "undocumented",
1126 "uniform",
1127 "uninstallAllPackages",
1128 "uninstallPackage",
1129 "union",
1130 "unique",
1131 "uniquePermutations",
1132 "unlock",
1133 "unsequence",
1134 "unstack",
1135 "upperLeft",
1136 "upperRight",
1137 "urlEncode",
1138 "use",
1139 "userSymbols",
1140 "utf8",
1141 "utf8check",
1142 "utf8substring",
1143 "validate",
1144 "value",
1145 "values",
1146 "variety",
1147 "vars",
1148 "vector",
1149 "versalEmbedding",
1150 "wait",
1151 "wedgeProduct",
1152 "weightRange",
1153 "whichGm",
1154 "width",
1155 "wikipedia",
1156 "wrap",
1157 "yonedaExtension",
1158 "yonedaMap",
1159 "yonedaProduct",
1160 "youngest",
1161 "zero",
1162 "zeta"
1163 )
1164
1165M2CONSTANTS = (
1166 "A1BrouwerDegrees",
1167 "AbstractSimplicialComplexes",
1168 "AbstractToricVarieties",
1169 "Acknowledgement",
1170 "AdditionalPaths",
1171 "AdjointIdeal",
1172 "AdjunctionForSurfaces",
1173 "AfterEval",
1174 "AfterNoPrint",
1175 "AfterPrint",
1176 "AInfinity",
1177 "AlgebraicSplines",
1178 "Algorithm",
1179 "Alignment",
1180 "AllCodimensions",
1181 "AllMarkovBases",
1182 "allowableThreads",
1183 "AnalyzeSheafOnP1",
1184 "applicationDirectorySuffix",
1185 "argument",
1186 "Ascending",
1187 "AssociativeAlgebras",
1188 "Authors",
1189 "AuxiliaryFiles",
1190 "backtrace",
1191 "Bareiss",
1192 "Base",
1193 "BaseFunction",
1194 "baseRings",
1195 "BaseRow",
1196 "BasisElementLimit",
1197 "Bayer",
1198 "BeforePrint",
1199 "BeginningMacaulay2",
1200 "Benchmark",
1201 "BernsteinSato",
1202 "Bertini",
1203 "BettiCharacters",
1204 "BGG",
1205 "BIBasis",
1206 "Binary",
1207 "Binomial",
1208 "BinomialEdgeIdeals",
1209 "Binomials",
1210 "BKZ",
1211 "blockMatrixForm",
1212 "Body",
1213 "BoijSoederberg",
1214 "Book3264Examples",
1215 "BooleanGB",
1216 "Boundary",
1217 "Boxes",
1218 "Brackets",
1219 "Browse",
1220 "Bruns",
1221 "cache",
1222 "CacheExampleOutput",
1223 "CallLimit",
1224 "CannedExample",
1225 "CatalanConstant",
1226 "Caveat",
1227 "CellularResolutions",
1228 "Center",
1229 "Certification",
1230 "ChainComplexExtras",
1231 "ChainComplexOperations",
1232 "ChangeMatrix",
1233 "CharacteristicClasses",
1234 "CheckDocumentation",
1235 "Chordal",
1236 "Citation",
1237 "cite",
1238 "Classic",
1239 "clearAll",
1240 "clearOutput",
1241 "close",
1242 "closeIn",
1243 "closeOut",
1244 "ClosestFit",
1245 "Code",
1246 "CodimensionLimit",
1247 "CodingTheory",
1248 "CoefficientRing",
1249 "Cofactor",
1250 "CohenEngine",
1251 "CohenTopLevel",
1252 "CohomCalg",
1253 "CoincidentRootLoci",
1254 "commandLine",
1255 "compactMatrixForm",
1256 "Complement",
1257 "CompleteIntersection",
1258 "CompleteIntersectionResolutions",
1259 "Complexes",
1260 "Concentration",
1261 "ConductorElement",
1262 "Configuration",
1263 "ConformalBlocks",
1264 "ConnectionMatrices",
1265 "Consequences",
1266 "Constants",
1267 "Contributors",
1268 "ConvexInterface",
1269 "ConwayPolynomials",
1270 "copyright",
1271 "Core",
1272 "CorrespondenceScrolls",
1273 "CotangentSchubert",
1274 "coverageSummary",
1275 "CpMackeyFunctors",
1276 "Cremona",
1277 "currentFileDirectory",
1278 "currentFileName",
1279 "currentLayout",
1280 "currentPackage",
1281 "Cycle",
1282 "Cyclotomic",
1283 "Date",
1284 "dd",
1285 "DebuggingMode",
1286 "debuggingMode",
1287 "debugLevel",
1288 "DecomposableSparseSystems",
1289 "Decompose",
1290 "Default",
1291 "defaultPrecision",
1292 "Degree",
1293 "DegreeGroup",
1294 "DegreeLift",
1295 "DegreeLimit",
1296 "DegreeMap",
1297 "DegreeOrder",
1298 "DegreeRank",
1299 "Degrees",
1300 "Dense",
1301 "Density",
1302 "Depth",
1303 "Descending",
1304 "Description",
1305 "DeterminantalRepresentations",
1306 "DGAlgebras",
1307 "dictionaryPath",
1308 "DiffAlg",
1309 "Direction",
1310 "DirectSummands",
1311 "Dispatch",
1312 "DivideConquer",
1313 "DividedPowers",
1314 "Dmodules",
1315 "docExample",
1316 "docTemplate",
1317 "Down",
1318 "Dynamic",
1319 "EagonResolution",
1320 "EdgeIdeals",
1321 "edit",
1322 "EigenSolver",
1323 "EisenbudHunekeVasconcelos",
1324 "Elimination",
1325 "EliminationMatrices",
1326 "EliminationTemplates",
1327 "EllipticCurves",
1328 "EllipticIntegrals",
1329 "Email",
1330 "end",
1331 "endl",
1332 "Engine",
1333 "engineDebugLevel",
1334 "EngineTests",
1335 "EnumerationCurves",
1336 "environment",
1337 "EquivariantGB",
1338 "errorDepth",
1339 "EuclideanDistanceDegree",
1340 "EulerConstant",
1341 "Example",
1342 "ExampleFiles",
1343 "ExampleSystems",
1344 "Exclude",
1345 "exit",
1346 "Ext",
1347 "ExteriorExtensions",
1348 "ExteriorIdeals",
1349 "ExteriorModules",
1350 "false",
1351 "FastMinors",
1352 "FastNonminimal",
1353 "FGLM",
1354 "fileDictionaries",
1355 "fileExitHooks",
1356 "FileName",
1357 "FindOne",
1358 "FiniteFittingIdeals",
1359 "First",
1360 "FirstPackage",
1361 "FlatMonoid",
1362 "Flexible",
1363 "flush",
1364 "FollowLinks",
1365 "ForeignFunctions",
1366 "FormalGroupLaws",
1367 "Format",
1368 "FourierMotzkin",
1369 "FourTiTwo",
1370 "fpLLL",
1371 "FreeToExact",
1372 "FrobeniusThresholds",
1373 "FunctionFieldDesingularization",
1374 "GameTheory",
1375 "GBDegrees",
1376 "gbTrace",
1377 "GenerateAssertions",
1378 "Generic",
1379 "GenericInitialIdeal",
1380 "GeometricDecomposability",
1381 "gfanInterface",
1382 "Givens",
1383 "GKMVarieties",
1384 "GLex",
1385 "Global",
1386 "GlobalAssignHook",
1387 "globalAssignmentHooks",
1388 "GlobalHookStore",
1389 "GlobalReleaseHook",
1390 "GlobalSectionLimit",
1391 "Gorenstein",
1392 "GradedLieAlgebras",
1393 "GraphicalModels",
1394 "GraphicalModelsMLE",
1395 "Graphics",
1396 "Graphs",
1397 "GRevLex",
1398 "GroebnerStrata",
1399 "GroebnerWalk",
1400 "GroupLex",
1401 "GroupRevLex",
1402 "GTZ",
1403 "Hadamard",
1404 "handleInterrupts",
1405 "HardDegreeLimit",
1406 "Heading",
1407 "Headline",
1408 "Heft",
1409 "Height",
1410 "help",
1411 "Hermite",
1412 "Hermitian",
1413 "HH",
1414 "hh",
1415 "HigherCIOperators",
1416 "HighestWeights",
1417 "Hilbert",
1418 "HodgeIntegrals",
1419 "HolonomicSystems",
1420 "homeDirectory",
1421 "HomePage",
1422 "Homogeneous",
1423 "Homogeneous2",
1424 "Homogenization",
1425 "HomologicalAlgebraPackage",
1426 "HomotopyLieAlgebra",
1427 "HorizontalSpace",
1428 "HyperplaneArrangements",
1429 "id",
1430 "IgnoreExampleErrors",
1431 "ii",
1432 "IncidenceCorrespondenceCohomology",
1433 "incomparable",
1434 "Increment",
1435 "indeterminate",
1436 "Index",
1437 "indexComponents",
1438 "infinity",
1439 "InfoDirSection",
1440 "infoHelp",
1441 "Inhomogeneous",
1442 "Inputs",
1443 "InstallPrefix",
1444 "IntegerProgramming",
1445 "IntegralClosure",
1446 "InternalDegree",
1447 "interpreterDepth",
1448 "Intersection",
1449 "InvariantRing",
1450 "InverseMethod",
1451 "Inverses",
1452 "InverseSystems",
1453 "Invertible",
1454 "InvolutiveBases",
1455 "Isomorphism",
1456 "Item",
1457 "Iterate",
1458 "Jacobian",
1459 "Jets",
1460 "Join",
1461 "JSON",
1462 "JSONRPC",
1463 "K3Carpets",
1464 "K3Surfaces",
1465 "Keep",
1466 "KeepFiles",
1467 "KeepZeroes",
1468 "Key",
1469 "Keywords",
1470 "Kronecker",
1471 "KustinMiller",
1472 "LanguageServer",
1473 "lastMatch",
1474 "LatticePolytopes",
1475 "Layout",
1476 "Left",
1477 "LengthLimit",
1478 "Lex",
1479 "LexIdeals",
1480 "LieAlgebraRepresentations",
1481 "Limit",
1482 "Linear",
1483 "LinearAlgebra",
1484 "LinearTruncations",
1485 "lineNumber",
1486 "listLocalSymbols",
1487 "listUserSymbols",
1488 "LLLBases",
1489 "loadDepth",
1490 "LoadDocumentation",
1491 "loadedFiles",
1492 "loadedPackages",
1493 "Local",
1494 "LocalRings",
1495 "LongPolynomial",
1496 "M0nbar",
1497 "Macaulay2Doc",
1498 "MacaulayPosets",
1499 "Maintainer",
1500 "MakeDocumentation",
1501 "MakeHTML",
1502 "MakeInfo",
1503 "MakePDF",
1504 "MapleInterface",
1505 "Markov",
1506 "MatchingFields",
1507 "MatrixFactorizations",
1508 "MatrixSchubert",
1509 "Matroids",
1510 "maxAllowableThreads",
1511 "maxExponent",
1512 "MaximalRank",
1513 "MaxReductionCount",
1514 "MCMApproximations",
1515 "MergeTeX",
1516 "minExponent",
1517 "MinimalGenerators",
1518 "MinimalMatrix",
1519 "minimalPresentationMap",
1520 "minimalPresentationMapInv",
1521 "MinimalPrimes",
1522 "Minimize",
1523 "minimizingMap",
1524 "MinimumVersion",
1525 "Miura",
1526 "MixedMultiplicity",
1527 "ModuleDeformations",
1528 "MonodromySolver",
1529 "Monomial",
1530 "MonomialAlgebras",
1531 "MonomialIntegerPrograms",
1532 "MonomialOrbits",
1533 "MonomialOrder",
1534 "Monomials",
1535 "MonomialSize",
1536 "MRDI",
1537 "Msolve",
1538 "MultigradedBGG",
1539 "MultigradedImplicitization",
1540 "MultiGradedRationalMap",
1541 "MultiplicitySequence",
1542 "MultiplierIdeals",
1543 "MultiplierIdealsDim2",
1544 "MultiprojectiveVarieties",
1545 "NAGtypes",
1546 "Name",
1547 "Nauty",
1548 "NautyGraphs",
1549 "NCAlgebra",
1550 "NCLex",
1551 "NeuralIdeals",
1552 "NewFromMethod",
1553 "newline",
1554 "NewMethod",
1555 "NewOfFromMethod",
1556 "NewOfMethod",
1557 "nil",
1558 "Node",
1559 "NoetherianOperators",
1560 "NoetherNormalization",
1561 "Nonminimal",
1562 "NonminimalWithGB",
1563 "NonPrincipalTestIdeals",
1564 "NoPrint",
1565 "Normaliz",
1566 "NormalToricVarieties",
1567 "NotANumber",
1568 "notify",
1569 "NTL",
1570 "null",
1571 "nullaryMethods",
1572 "NumericalAlgebraicGeometry",
1573 "NumericalCertification",
1574 "NumericalImplicitization",
1575 "NumericalLinearAlgebra",
1576 "NumericalSchubertCalculus",
1577 "NumericalSemigroups",
1578 "NumericSolutions",
1579 "numTBBThreads",
1580 "OIGroebnerBases",
1581 "OldChainComplexes",
1582 "OnlineLookup",
1583 "OO",
1584 "oo",
1585 "ooo",
1586 "oooo",
1587 "OpenMath",
1588 "operatorAttributes",
1589 "OptionalComponentsPresent",
1590 "Options",
1591 "Order",
1592 "order",
1593 "Oscillators",
1594 "OutputDictionary",
1595 "Outputs",
1596 "OverField",
1597 "OverZZ",
1598 "PackageCitations",
1599 "PackageDictionary",
1600 "PackageExports",
1601 "PackageImports",
1602 "PackageTemplate",
1603 "Padic",
1604 "PairLimit",
1605 "PairsRemaining",
1606 "ParallelF4",
1607 "ParallelizeByDegree",
1608 "Parametrization",
1609 "Parsing",
1610 "path",
1611 "PathSignatures",
1612 "PencilsOfQuadrics",
1613 "Permanents",
1614 "Permutations",
1615 "PHCpack",
1616 "PhylogeneticTrees",
1617 "pi",
1618 "PieriMaps",
1619 "PlaneCurveLinearSeries",
1620 "PlaneCurveSingularities",
1621 "Points",
1622 "Polyhedra",
1623 "Polymake",
1624 "PolyominoIdeals",
1625 "Posets",
1626 "Position",
1627 "PositivityToricBundles",
1628 "POSIX",
1629 "Postfix",
1630 "Pre",
1631 "Precision",
1632 "Prefix",
1633 "prefixDirectory",
1634 "prefixPath",
1635 "PrimaryDecomposition",
1636 "PrimaryTag",
1637 "PrimitiveElement",
1638 "Print",
1639 "printingAccuracy",
1640 "printingLeadLimit",
1641 "printingPrecision",
1642 "printingSeparator",
1643 "printingTimeLimit",
1644 "printingTrailLimit",
1645 "printWidth",
1646 "Probability",
1647 "profileSummary",
1648 "programPaths",
1649 "Projective",
1650 "Prune",
1651 "PruningMap",
1652 "pruningMap",
1653 "PseudomonomialPrimaryDecomposition",
1654 "Pullback",
1655 "pullbackMaps",
1656 "PushForward",
1657 "pushoutMaps",
1658 "Python",
1659 "QthPower",
1660 "QuadraticIdealExamplesByRoos",
1661 "Quasidegrees",
1662 "QuaternaryQuartics",
1663 "QuillenSuslin",
1664 "quit",
1665 "Quotient",
1666 "Radical",
1667 "RadicalCodim1",
1668 "RaiseError",
1669 "RandomComplexes",
1670 "RandomCurves",
1671 "RandomCurvesOverVerySmallFiniteFields",
1672 "RandomIdeals",
1673 "RandomMonomialIdeals",
1674 "RandomObjects",
1675 "RandomPoints",
1676 "Range",
1677 "RationalMaps",
1678 "RationalPoints",
1679 "RationalPoints2",
1680 "ReactionNetworks",
1681 "RealFP",
1682 "RealQP",
1683 "RealQP1",
1684 "RealRoots",
1685 "RealRR",
1686 "RealXD",
1687 "recursionLimit",
1688 "Reduce",
1689 "ReesAlgebra",
1690 "References",
1691 "ReflexivePolytopesDB",
1692 "Regularity",
1693 "RelativeCanonicalResolution",
1694 "Reload",
1695 "RemakeAllDocumentation",
1696 "RerunExamples",
1697 "ResidualIntersections",
1698 "ResLengthThree",
1699 "ResolutionsOfStanleyReisnerRings",
1700 "restart",
1701 "Result",
1702 "ResultantComplexes",
1703 "Resultants",
1704 "returnCode",
1705 "Reverse",
1706 "RevLex",
1707 "Right",
1708 "RInterface",
1709 "rootPath",
1710 "rootURI",
1711 "RunDirectory",
1712 "RunExamples",
1713 "RunExternalM2",
1714 "SagbiGbDetection",
1715 "Saturation",
1716 "SaturationMap",
1717 "Schubert2",
1718 "SchurComplexes",
1719 "SchurFunctors",
1720 "SchurRings",
1721 "SchurVeronese",
1722 "SCMAlgebras",
1723 "scriptCommandLine",
1724 "SCSCP",
1725 "SectionRing",
1726 "SeeAlso",
1727 "SegreClasses",
1728 "SemidefiniteProgramming",
1729 "Seminormalization",
1730 "SeparateExec",
1731 "Serialization",
1732 "sheafExt",
1733 "ShimoyamaYokoyama",
1734 "showClassStructure",
1735 "showStructure",
1736 "showUserStructure",
1737 "SimpleDoc",
1738 "SimplicialComplexes",
1739 "SimplicialDecomposability",
1740 "SimplicialModules",
1741 "SimplicialPosets",
1742 "SimplifyFractions",
1743 "SizeLimit",
1744 "SkewCommutative",
1745 "SlackIdeals",
1746 "SLnEquivariantMatrices",
1747 "SLPexpressions",
1748 "Sort",
1749 "SortStrategy",
1750 "SourceCode",
1751 "SourceRing",
1752 "SpaceCurves",
1753 "SparseResultants",
1754 "SpechtModule",
1755 "SpecialFanoFourfolds",
1756 "SpectralSequences",
1757 "SRdeformations",
1758 "Standard",
1759 "StartWithOneMinor",
1760 "StatePolytope",
1761 "StatGraphs",
1762 "stderr",
1763 "stdio",
1764 "StopBeforeComputation",
1765 "stopIfError",
1766 "StopIteration",
1767 "StopWithMinimalGenerators",
1768 "Strategy",
1769 "Strict",
1770 "StronglyStableIdeals",
1771 "Style",
1772 "SubalgebraBases",
1773 "Subnodes",
1774 "SubringLimit",
1775 "subscript",
1776 "Sugarless",
1777 "SumsOfSquares",
1778 "SuperLinearAlgebra",
1779 "superscript",
1780 "SVDComplexes",
1781 "SwitchingFields",
1782 "SymbolicPowers",
1783 "SymmetricPolynomials",
1784 "Synopsis",
1785 "Syzygies",
1786 "SyzygyLimit",
1787 "SyzygyMatrix",
1788 "SyzygyRows",
1789 "Tableaux",
1790 "TangentCone",
1791 "TateOnProducts",
1792 "TensorComplexes",
1793 "TerraciniLoci",
1794 "Test",
1795 "TestAudit",
1796 "testExample",
1797 "TestIdeals",
1798 "TeXmacs",
1799 "Text",
1800 "ThinSincereQuivers",
1801 "ThreadedGB",
1802 "Threads",
1803 "Threshold",
1804 "Topcom",
1805 "topLevelMode",
1806 "Tor",
1807 "TorAlgebra",
1808 "Toric",
1809 "ToricHigherDirectImages",
1810 "ToricInvariants",
1811 "ToricTopology",
1812 "ToricVectorBundles",
1813 "Torsion",
1814 "TorsionFree",
1815 "TotalPairs",
1816 "Tree",
1817 "TriangularSets",
1818 "Triangulations",
1819 "Tries",
1820 "Trim",
1821 "Triplets",
1822 "Tropical",
1823 "TropicalToric",
1824 "true",
1825 "Truncate",
1826 "Truncations",
1827 "TSpreadIdeals",
1828 "TypicalValue",
1829 "typicalValues",
1830 "Undo",
1831 "Unique",
1832 "Units",
1833 "UnitTest",
1834 "Unmixed",
1835 "Up",
1836 "UpdateOnly",
1837 "UpperTriangular",
1838 "Usage",
1839 "UseCachedExampleOutput",
1840 "UseHilbertFunction",
1841 "UserMode",
1842 "UseSyzygies",
1843 "UseTarget",
1844 "Valuations",
1845 "Variable",
1846 "VariableBaseName",
1847 "Variables",
1848 "Varieties",
1849 "Vasconcelos",
1850 "VectorFields",
1851 "VectorGraphics",
1852 "Verbose",
1853 "Verbosity",
1854 "Verify",
1855 "VersalDeformations",
1856 "Version",
1857 "version",
1858 "VerticalSpace",
1859 "viewHelp",
1860 "VirtualResolutions",
1861 "Visualize",
1862 "VNumber",
1863 "WebApp",
1864 "WeierstrassSemigroups",
1865 "Weights",
1866 "WeilDivisors",
1867 "WeylAlgebra",
1868 "WeylAlgebras",
1869 "WeylGroups",
1870 "WhitneyStratifications",
1871 "WittVectors",
1872 "Wrap",
1873 "XML"
1874 )
1875
1876class Macaulay2Lexer(RegexLexer):
1877 """Lexer for Macaulay2, a software system for research in algebraic geometry."""
1878
1879 name = 'Macaulay2'
1880 url = 'https://macaulay2.com/'
1881 aliases = ['macaulay2']
1882 filenames = ['*.m2']
1883 version_added = '2.12'
1884
1885 tokens = {
1886 'root': [
1887 (r'--.*$', Comment.Single),
1888 (r'-\*', Comment.Multiline, 'block comment'),
1889 (r'"', String, 'quote string'),
1890 (r'///', String, 'slash string'),
1891 (words(M2KEYWORDS, prefix=r'\b', suffix=r'\b'), Keyword),
1892 (words(M2DATATYPES, prefix=r'\b', suffix=r'\b'), Name.Builtin),
1893 (words(M2FUNCTIONS, prefix=r'\b', suffix=r'\b'), Name.Function),
1894 (words(M2CONSTANTS, prefix=r'\b', suffix=r'\b'), Name.Constant),
1895 (r'\s+', Text.Whitespace),
1896 (r'.', Text)
1897 ],
1898 'block comment' : [
1899 (r'[^*-]+', Comment.Multiline),
1900 (r'\*-', Comment.Multiline, '#pop'),
1901 (r'[*-]', Comment.Multiline)
1902 ],
1903 'quote string' : [
1904 (r'[^\\"]+', String),
1905 (r'"', String, '#pop'),
1906 (r'\\"?', String),
1907 ],
1908 'slash string' : [
1909 (r'[^/]+', String),
1910 (r'(//)+(?!/)', String),
1911 (r'/(//)+(?!/)', String, '#pop'),
1912 (r'/', String)
1913 ]
1914 }