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