diff --git a/.gitattributes b/.gitattributes index 80bde7c9402a215f773ac5764ccb9df8f9f13a7c..a9300747ff9b2c97e66123c1e8a84df4a4b02a8a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -857,3 +857,5 @@ evalkit_eagle/lib/python3.10/site-packages/scipy/special/tests/__pycache__/test_ evalkit_eagle/lib/python3.10/site-packages/scipy/sparse/csgraph/_tools.cpython-310-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text evalkit_eagle/lib/python3.10/site-packages/scipy/sparse/tests/__pycache__/test_base.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text infer_4_47_1/bin/unxz filter=lfs diff=lfs merge=lfs -text +janus/lib/python3.10/site-packages/nvidia/nccl/lib/libnccl.so.2 filter=lfs diff=lfs merge=lfs -text +infer_4_33_0/lib/python3.10/site-packages/nvidia/nccl/lib/libnccl.so.2 filter=lfs diff=lfs merge=lfs -text diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/__init__.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..328e072c919026a88ecd1b4b38a7c99163680332 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/__init__.py @@ -0,0 +1,329 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers + ~~~~~~~~~~~~~~~ + + Pygments lexers. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re +import sys +import types +import fnmatch +from os.path import basename + +from pygments.lexers._mapping import LEXERS +from pygments.modeline import get_filetype_from_buffer +from pygments.plugin import find_plugin_lexers +from pygments.util import ClassNotFound, itervalues, guess_decode + + +__all__ = ['get_lexer_by_name', 'get_lexer_for_filename', 'find_lexer_class', + 'guess_lexer', 'load_lexer_from_file'] + list(LEXERS) + +_lexer_cache = {} +_pattern_cache = {} + + +def _fn_matches(fn, glob): + """Return whether the supplied file name fn matches pattern filename.""" + if glob not in _pattern_cache: + pattern = _pattern_cache[glob] = re.compile(fnmatch.translate(glob)) + return pattern.match(fn) + return _pattern_cache[glob].match(fn) + + +def _load_lexers(module_name): + """Load a lexer (and all others in the module too).""" + mod = __import__(module_name, None, None, ['__all__']) + for lexer_name in mod.__all__: + cls = getattr(mod, lexer_name) + _lexer_cache[cls.name] = cls + + +def get_all_lexers(): + """Return a generator of tuples in the form ``(name, aliases, + filenames, mimetypes)`` of all know lexers. + """ + for item in itervalues(LEXERS): + yield item[1:] + for lexer in find_plugin_lexers(): + yield lexer.name, lexer.aliases, lexer.filenames, lexer.mimetypes + + +def find_lexer_class(name): + """Lookup a lexer class by name. + + Return None if not found. + """ + if name in _lexer_cache: + return _lexer_cache[name] + # lookup builtin lexers + for module_name, lname, aliases, _, _ in itervalues(LEXERS): + if name == lname: + _load_lexers(module_name) + return _lexer_cache[name] + # continue with lexers from setuptools entrypoints + for cls in find_plugin_lexers(): + if cls.name == name: + return cls + + +def find_lexer_class_by_name(_alias): + """Lookup a lexer class by alias. + + Like `get_lexer_by_name`, but does not instantiate the class. + + .. versionadded:: 2.2 + """ + if not _alias: + raise ClassNotFound('no lexer for alias %r found' % _alias) + # lookup builtin lexers + for module_name, name, aliases, _, _ in itervalues(LEXERS): + if _alias.lower() in aliases: + if name not in _lexer_cache: + _load_lexers(module_name) + return _lexer_cache[name] + # continue with lexers from setuptools entrypoints + for cls in find_plugin_lexers(): + if _alias.lower() in cls.aliases: + return cls + raise ClassNotFound('no lexer for alias %r found' % _alias) + + +def get_lexer_by_name(_alias, **options): + """Get a lexer by an alias. + + Raises ClassNotFound if not found. + """ + if not _alias: + raise ClassNotFound('no lexer for alias %r found' % _alias) + + # lookup builtin lexers + for module_name, name, aliases, _, _ in itervalues(LEXERS): + if _alias.lower() in aliases: + if name not in _lexer_cache: + _load_lexers(module_name) + return _lexer_cache[name](**options) + # continue with lexers from setuptools entrypoints + for cls in find_plugin_lexers(): + if _alias.lower() in cls.aliases: + return cls(**options) + raise ClassNotFound('no lexer for alias %r found' % _alias) + + +def load_lexer_from_file(filename, lexername="CustomLexer", **options): + """Load a lexer from a file. + + This method expects a file located relative to the current working + directory, which contains a Lexer class. By default, it expects the + Lexer to be name CustomLexer; you can specify your own class name + as the second argument to this function. + + Users should be very careful with the input, because this method + is equivalent to running eval on the input file. + + Raises ClassNotFound if there are any problems importing the Lexer. + + .. versionadded:: 2.2 + """ + try: + # This empty dict will contain the namespace for the exec'd file + custom_namespace = {} + exec(open(filename, 'rb').read(), custom_namespace) + # Retrieve the class `lexername` from that namespace + if lexername not in custom_namespace: + raise ClassNotFound('no valid %s class found in %s' % + (lexername, filename)) + lexer_class = custom_namespace[lexername] + # And finally instantiate it with the options + return lexer_class(**options) + except IOError as err: + raise ClassNotFound('cannot read %s' % filename) + except ClassNotFound as err: + raise + except Exception as err: + raise ClassNotFound('error when loading custom lexer: %s' % err) + + +def find_lexer_class_for_filename(_fn, code=None): + """Get a lexer for a filename. + + If multiple lexers match the filename pattern, use ``analyse_text()`` to + figure out which one is more appropriate. + + Returns None if not found. + """ + matches = [] + fn = basename(_fn) + for modname, name, _, filenames, _ in itervalues(LEXERS): + for filename in filenames: + if _fn_matches(fn, filename): + if name not in _lexer_cache: + _load_lexers(modname) + matches.append((_lexer_cache[name], filename)) + for cls in find_plugin_lexers(): + for filename in cls.filenames: + if _fn_matches(fn, filename): + matches.append((cls, filename)) + + if sys.version_info > (3,) and isinstance(code, bytes): + # decode it, since all analyse_text functions expect unicode + code = guess_decode(code) + + def get_rating(info): + cls, filename = info + # explicit patterns get a bonus + bonus = '*' not in filename and 0.5 or 0 + # The class _always_ defines analyse_text because it's included in + # the Lexer class. The default implementation returns None which + # gets turned into 0.0. Run scripts/detect_missing_analyse_text.py + # to find lexers which need it overridden. + if code: + return cls.analyse_text(code) + bonus, cls.__name__ + return cls.priority + bonus, cls.__name__ + + if matches: + matches.sort(key=get_rating) + # print "Possible lexers, after sort:", matches + return matches[-1][0] + + +def get_lexer_for_filename(_fn, code=None, **options): + """Get a lexer for a filename. + + If multiple lexers match the filename pattern, use ``analyse_text()`` to + figure out which one is more appropriate. + + Raises ClassNotFound if not found. + """ + res = find_lexer_class_for_filename(_fn, code) + if not res: + raise ClassNotFound('no lexer for filename %r found' % _fn) + return res(**options) + + +def get_lexer_for_mimetype(_mime, **options): + """Get a lexer for a mimetype. + + Raises ClassNotFound if not found. + """ + for modname, name, _, _, mimetypes in itervalues(LEXERS): + if _mime in mimetypes: + if name not in _lexer_cache: + _load_lexers(modname) + return _lexer_cache[name](**options) + for cls in find_plugin_lexers(): + if _mime in cls.mimetypes: + return cls(**options) + raise ClassNotFound('no lexer for mimetype %r found' % _mime) + + +def _iter_lexerclasses(plugins=True): + """Return an iterator over all lexer classes.""" + for key in sorted(LEXERS): + module_name, name = LEXERS[key][:2] + if name not in _lexer_cache: + _load_lexers(module_name) + yield _lexer_cache[name] + if plugins: + for lexer in find_plugin_lexers(): + yield lexer + + +def guess_lexer_for_filename(_fn, _text, **options): + """ + Lookup all lexers that handle those filenames primary (``filenames``) + or secondary (``alias_filenames``). Then run a text analysis for those + lexers and choose the best result. + + usage:: + + >>> from pygments.lexers import guess_lexer_for_filename + >>> guess_lexer_for_filename('hello.html', '<%= @foo %>') + + >>> guess_lexer_for_filename('hello.html', '

{{ title|e }}

') + + >>> guess_lexer_for_filename('style.css', 'a { color: }') + + """ + fn = basename(_fn) + primary = {} + matching_lexers = set() + for lexer in _iter_lexerclasses(): + for filename in lexer.filenames: + if _fn_matches(fn, filename): + matching_lexers.add(lexer) + primary[lexer] = True + for filename in lexer.alias_filenames: + if _fn_matches(fn, filename): + matching_lexers.add(lexer) + primary[lexer] = False + if not matching_lexers: + raise ClassNotFound('no lexer for filename %r found' % fn) + if len(matching_lexers) == 1: + return matching_lexers.pop()(**options) + result = [] + for lexer in matching_lexers: + rv = lexer.analyse_text(_text) + if rv == 1.0: + return lexer(**options) + result.append((rv, lexer)) + + def type_sort(t): + # sort by: + # - analyse score + # - is primary filename pattern? + # - priority + # - last resort: class name + return (t[0], primary[t[1]], t[1].priority, t[1].__name__) + result.sort(key=type_sort) + + return result[-1][1](**options) + + +def guess_lexer(_text, **options): + """Guess a lexer by strong distinctions in the text (eg, shebang).""" + + # try to get a vim modeline first + ft = get_filetype_from_buffer(_text) + + if ft is not None: + try: + return get_lexer_by_name(ft, **options) + except ClassNotFound: + pass + + best_lexer = [0.0, None] + for lexer in _iter_lexerclasses(): + rv = lexer.analyse_text(_text) + if rv == 1.0: + return lexer(**options) + if rv > best_lexer[0]: + best_lexer[:] = (rv, lexer) + if not best_lexer[0] or best_lexer[1] is None: + raise ClassNotFound('no lexer matching the text found') + return best_lexer[1](**options) + + +class _automodule(types.ModuleType): + """Automatically import lexers.""" + + def __getattr__(self, name): + info = LEXERS.get(name) + if info: + _load_lexers(info[0]) + cls = _lexer_cache[info[1]] + setattr(self, name, cls) + return cls + raise AttributeError(name) + + +oldmod = sys.modules[__name__] +newmod = _automodule(__name__) +newmod.__dict__.update(oldmod.__dict__) +sys.modules[__name__] = newmod +del newmod.newmod, newmod.oldmod, newmod.sys, newmod.types diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/_cl_builtins.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/_cl_builtins.py new file mode 100644 index 0000000000000000000000000000000000000000..ce5ad48e2c2f8db0254db89668191f1e0e0e6dcf --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/_cl_builtins.py @@ -0,0 +1,232 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers._cl_builtins + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + ANSI Common Lisp builtins. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +BUILTIN_FUNCTIONS = set(( # 638 functions + '<', '<=', '=', '>', '>=', '-', '/', '/=', '*', '+', '1-', '1+', + 'abort', 'abs', 'acons', 'acos', 'acosh', 'add-method', 'adjoin', + 'adjustable-array-p', 'adjust-array', 'allocate-instance', + 'alpha-char-p', 'alphanumericp', 'append', 'apply', 'apropos', + 'apropos-list', 'aref', 'arithmetic-error-operands', + 'arithmetic-error-operation', 'array-dimension', 'array-dimensions', + 'array-displacement', 'array-element-type', 'array-has-fill-pointer-p', + 'array-in-bounds-p', 'arrayp', 'array-rank', 'array-row-major-index', + 'array-total-size', 'ash', 'asin', 'asinh', 'assoc', 'assoc-if', + 'assoc-if-not', 'atan', 'atanh', 'atom', 'bit', 'bit-and', 'bit-andc1', + 'bit-andc2', 'bit-eqv', 'bit-ior', 'bit-nand', 'bit-nor', 'bit-not', + 'bit-orc1', 'bit-orc2', 'bit-vector-p', 'bit-xor', 'boole', + 'both-case-p', 'boundp', 'break', 'broadcast-stream-streams', + 'butlast', 'byte', 'byte-position', 'byte-size', 'caaaar', 'caaadr', + 'caaar', 'caadar', 'caaddr', 'caadr', 'caar', 'cadaar', 'cadadr', + 'cadar', 'caddar', 'cadddr', 'caddr', 'cadr', 'call-next-method', 'car', + 'cdaaar', 'cdaadr', 'cdaar', 'cdadar', 'cdaddr', 'cdadr', 'cdar', + 'cddaar', 'cddadr', 'cddar', 'cdddar', 'cddddr', 'cdddr', 'cddr', 'cdr', + 'ceiling', 'cell-error-name', 'cerror', 'change-class', 'char', 'char<', + 'char<=', 'char=', 'char>', 'char>=', 'char/=', 'character', + 'characterp', 'char-code', 'char-downcase', 'char-equal', + 'char-greaterp', 'char-int', 'char-lessp', 'char-name', + 'char-not-equal', 'char-not-greaterp', 'char-not-lessp', 'char-upcase', + 'cis', 'class-name', 'class-of', 'clear-input', 'clear-output', + 'close', 'clrhash', 'code-char', 'coerce', 'compile', + 'compiled-function-p', 'compile-file', 'compile-file-pathname', + 'compiler-macro-function', 'complement', 'complex', 'complexp', + 'compute-applicable-methods', 'compute-restarts', 'concatenate', + 'concatenated-stream-streams', 'conjugate', 'cons', 'consp', + 'constantly', 'constantp', 'continue', 'copy-alist', 'copy-list', + 'copy-pprint-dispatch', 'copy-readtable', 'copy-seq', 'copy-structure', + 'copy-symbol', 'copy-tree', 'cos', 'cosh', 'count', 'count-if', + 'count-if-not', 'decode-float', 'decode-universal-time', 'delete', + 'delete-duplicates', 'delete-file', 'delete-if', 'delete-if-not', + 'delete-package', 'denominator', 'deposit-field', 'describe', + 'describe-object', 'digit-char', 'digit-char-p', 'directory', + 'directory-namestring', 'disassemble', 'documentation', 'dpb', + 'dribble', 'echo-stream-input-stream', 'echo-stream-output-stream', + 'ed', 'eighth', 'elt', 'encode-universal-time', 'endp', + 'enough-namestring', 'ensure-directories-exist', + 'ensure-generic-function', 'eq', 'eql', 'equal', 'equalp', 'error', + 'eval', 'evenp', 'every', 'exp', 'export', 'expt', 'fboundp', + 'fceiling', 'fdefinition', 'ffloor', 'fifth', 'file-author', + 'file-error-pathname', 'file-length', 'file-namestring', + 'file-position', 'file-string-length', 'file-write-date', + 'fill', 'fill-pointer', 'find', 'find-all-symbols', 'find-class', + 'find-if', 'find-if-not', 'find-method', 'find-package', 'find-restart', + 'find-symbol', 'finish-output', 'first', 'float', 'float-digits', + 'floatp', 'float-precision', 'float-radix', 'float-sign', 'floor', + 'fmakunbound', 'force-output', 'format', 'fourth', 'fresh-line', + 'fround', 'ftruncate', 'funcall', 'function-keywords', + 'function-lambda-expression', 'functionp', 'gcd', 'gensym', 'gentemp', + 'get', 'get-decoded-time', 'get-dispatch-macro-character', 'getf', + 'gethash', 'get-internal-real-time', 'get-internal-run-time', + 'get-macro-character', 'get-output-stream-string', 'get-properties', + 'get-setf-expansion', 'get-universal-time', 'graphic-char-p', + 'hash-table-count', 'hash-table-p', 'hash-table-rehash-size', + 'hash-table-rehash-threshold', 'hash-table-size', 'hash-table-test', + 'host-namestring', 'identity', 'imagpart', 'import', + 'initialize-instance', 'input-stream-p', 'inspect', + 'integer-decode-float', 'integer-length', 'integerp', + 'interactive-stream-p', 'intern', 'intersection', + 'invalid-method-error', 'invoke-debugger', 'invoke-restart', + 'invoke-restart-interactively', 'isqrt', 'keywordp', 'last', 'lcm', + 'ldb', 'ldb-test', 'ldiff', 'length', 'lisp-implementation-type', + 'lisp-implementation-version', 'list', 'list*', 'list-all-packages', + 'listen', 'list-length', 'listp', 'load', + 'load-logical-pathname-translations', 'log', 'logand', 'logandc1', + 'logandc2', 'logbitp', 'logcount', 'logeqv', 'logical-pathname', + 'logical-pathname-translations', 'logior', 'lognand', 'lognor', + 'lognot', 'logorc1', 'logorc2', 'logtest', 'logxor', 'long-site-name', + 'lower-case-p', 'machine-instance', 'machine-type', 'machine-version', + 'macroexpand', 'macroexpand-1', 'macro-function', 'make-array', + 'make-broadcast-stream', 'make-concatenated-stream', 'make-condition', + 'make-dispatch-macro-character', 'make-echo-stream', 'make-hash-table', + 'make-instance', 'make-instances-obsolete', 'make-list', + 'make-load-form', 'make-load-form-saving-slots', 'make-package', + 'make-pathname', 'make-random-state', 'make-sequence', 'make-string', + 'make-string-input-stream', 'make-string-output-stream', 'make-symbol', + 'make-synonym-stream', 'make-two-way-stream', 'makunbound', 'map', + 'mapc', 'mapcan', 'mapcar', 'mapcon', 'maphash', 'map-into', 'mapl', + 'maplist', 'mask-field', 'max', 'member', 'member-if', 'member-if-not', + 'merge', 'merge-pathnames', 'method-combination-error', + 'method-qualifiers', 'min', 'minusp', 'mismatch', 'mod', + 'muffle-warning', 'name-char', 'namestring', 'nbutlast', 'nconc', + 'next-method-p', 'nintersection', 'ninth', 'no-applicable-method', + 'no-next-method', 'not', 'notany', 'notevery', 'nreconc', 'nreverse', + 'nset-difference', 'nset-exclusive-or', 'nstring-capitalize', + 'nstring-downcase', 'nstring-upcase', 'nsublis', 'nsubst', 'nsubst-if', + 'nsubst-if-not', 'nsubstitute', 'nsubstitute-if', 'nsubstitute-if-not', + 'nth', 'nthcdr', 'null', 'numberp', 'numerator', 'nunion', 'oddp', + 'open', 'open-stream-p', 'output-stream-p', 'package-error-package', + 'package-name', 'package-nicknames', 'packagep', + 'package-shadowing-symbols', 'package-used-by-list', 'package-use-list', + 'pairlis', 'parse-integer', 'parse-namestring', 'pathname', + 'pathname-device', 'pathname-directory', 'pathname-host', + 'pathname-match-p', 'pathname-name', 'pathnamep', 'pathname-type', + 'pathname-version', 'peek-char', 'phase', 'plusp', 'position', + 'position-if', 'position-if-not', 'pprint', 'pprint-dispatch', + 'pprint-fill', 'pprint-indent', 'pprint-linear', 'pprint-newline', + 'pprint-tab', 'pprint-tabular', 'prin1', 'prin1-to-string', 'princ', + 'princ-to-string', 'print', 'print-object', 'probe-file', 'proclaim', + 'provide', 'random', 'random-state-p', 'rassoc', 'rassoc-if', + 'rassoc-if-not', 'rational', 'rationalize', 'rationalp', 'read', + 'read-byte', 'read-char', 'read-char-no-hang', 'read-delimited-list', + 'read-from-string', 'read-line', 'read-preserving-whitespace', + 'read-sequence', 'readtable-case', 'readtablep', 'realp', 'realpart', + 'reduce', 'reinitialize-instance', 'rem', 'remhash', 'remove', + 'remove-duplicates', 'remove-if', 'remove-if-not', 'remove-method', + 'remprop', 'rename-file', 'rename-package', 'replace', 'require', + 'rest', 'restart-name', 'revappend', 'reverse', 'room', 'round', + 'row-major-aref', 'rplaca', 'rplacd', 'sbit', 'scale-float', 'schar', + 'search', 'second', 'set', 'set-difference', + 'set-dispatch-macro-character', 'set-exclusive-or', + 'set-macro-character', 'set-pprint-dispatch', 'set-syntax-from-char', + 'seventh', 'shadow', 'shadowing-import', 'shared-initialize', + 'short-site-name', 'signal', 'signum', 'simple-bit-vector-p', + 'simple-condition-format-arguments', 'simple-condition-format-control', + 'simple-string-p', 'simple-vector-p', 'sin', 'sinh', 'sixth', 'sleep', + 'slot-boundp', 'slot-exists-p', 'slot-makunbound', 'slot-missing', + 'slot-unbound', 'slot-value', 'software-type', 'software-version', + 'some', 'sort', 'special-operator-p', 'sqrt', 'stable-sort', + 'standard-char-p', 'store-value', 'stream-element-type', + 'stream-error-stream', 'stream-external-format', 'streamp', 'string', + 'string<', 'string<=', 'string=', 'string>', 'string>=', 'string/=', + 'string-capitalize', 'string-downcase', 'string-equal', + 'string-greaterp', 'string-left-trim', 'string-lessp', + 'string-not-equal', 'string-not-greaterp', 'string-not-lessp', + 'stringp', 'string-right-trim', 'string-trim', 'string-upcase', + 'sublis', 'subseq', 'subsetp', 'subst', 'subst-if', 'subst-if-not', + 'substitute', 'substitute-if', 'substitute-if-not', 'subtypep','svref', + 'sxhash', 'symbol-function', 'symbol-name', 'symbolp', 'symbol-package', + 'symbol-plist', 'symbol-value', 'synonym-stream-symbol', 'syntax:', + 'tailp', 'tan', 'tanh', 'tenth', 'terpri', 'third', + 'translate-logical-pathname', 'translate-pathname', 'tree-equal', + 'truename', 'truncate', 'two-way-stream-input-stream', + 'two-way-stream-output-stream', 'type-error-datum', + 'type-error-expected-type', 'type-of', 'typep', 'unbound-slot-instance', + 'unexport', 'unintern', 'union', 'unread-char', 'unuse-package', + 'update-instance-for-different-class', + 'update-instance-for-redefined-class', 'upgraded-array-element-type', + 'upgraded-complex-part-type', 'upper-case-p', 'use-package', + 'user-homedir-pathname', 'use-value', 'values', 'values-list', 'vector', + 'vectorp', 'vector-pop', 'vector-push', 'vector-push-extend', 'warn', + 'wild-pathname-p', 'write', 'write-byte', 'write-char', 'write-line', + 'write-sequence', 'write-string', 'write-to-string', 'yes-or-no-p', + 'y-or-n-p', 'zerop', +)) + +SPECIAL_FORMS = set(( + 'block', 'catch', 'declare', 'eval-when', 'flet', 'function', 'go', 'if', + 'labels', 'lambda', 'let', 'let*', 'load-time-value', 'locally', 'macrolet', + 'multiple-value-call', 'multiple-value-prog1', 'progn', 'progv', 'quote', + 'return-from', 'setq', 'symbol-macrolet', 'tagbody', 'the', 'throw', + 'unwind-protect', +)) + +MACROS = set(( + 'and', 'assert', 'call-method', 'case', 'ccase', 'check-type', 'cond', + 'ctypecase', 'decf', 'declaim', 'defclass', 'defconstant', 'defgeneric', + 'define-compiler-macro', 'define-condition', 'define-method-combination', + 'define-modify-macro', 'define-setf-expander', 'define-symbol-macro', + 'defmacro', 'defmethod', 'defpackage', 'defparameter', 'defsetf', + 'defstruct', 'deftype', 'defun', 'defvar', 'destructuring-bind', 'do', + 'do*', 'do-all-symbols', 'do-external-symbols', 'dolist', 'do-symbols', + 'dotimes', 'ecase', 'etypecase', 'formatter', 'handler-bind', + 'handler-case', 'ignore-errors', 'incf', 'in-package', 'lambda', 'loop', + 'loop-finish', 'make-method', 'multiple-value-bind', 'multiple-value-list', + 'multiple-value-setq', 'nth-value', 'or', 'pop', + 'pprint-exit-if-list-exhausted', 'pprint-logical-block', 'pprint-pop', + 'print-unreadable-object', 'prog', 'prog*', 'prog1', 'prog2', 'psetf', + 'psetq', 'push', 'pushnew', 'remf', 'restart-bind', 'restart-case', + 'return', 'rotatef', 'setf', 'shiftf', 'step', 'time', 'trace', 'typecase', + 'unless', 'untrace', 'when', 'with-accessors', 'with-compilation-unit', + 'with-condition-restarts', 'with-hash-table-iterator', + 'with-input-from-string', 'with-open-file', 'with-open-stream', + 'with-output-to-string', 'with-package-iterator', 'with-simple-restart', + 'with-slots', 'with-standard-io-syntax', +)) + +LAMBDA_LIST_KEYWORDS = set(( + '&allow-other-keys', '&aux', '&body', '&environment', '&key', '&optional', + '&rest', '&whole', +)) + +DECLARATIONS = set(( + 'dynamic-extent', 'ignore', 'optimize', 'ftype', 'inline', 'special', + 'ignorable', 'notinline', 'type', +)) + +BUILTIN_TYPES = set(( + 'atom', 'boolean', 'base-char', 'base-string', 'bignum', 'bit', + 'compiled-function', 'extended-char', 'fixnum', 'keyword', 'nil', + 'signed-byte', 'short-float', 'single-float', 'double-float', 'long-float', + 'simple-array', 'simple-base-string', 'simple-bit-vector', 'simple-string', + 'simple-vector', 'standard-char', 'unsigned-byte', + + # Condition Types + 'arithmetic-error', 'cell-error', 'condition', 'control-error', + 'division-by-zero', 'end-of-file', 'error', 'file-error', + 'floating-point-inexact', 'floating-point-overflow', + 'floating-point-underflow', 'floating-point-invalid-operation', + 'parse-error', 'package-error', 'print-not-readable', 'program-error', + 'reader-error', 'serious-condition', 'simple-condition', 'simple-error', + 'simple-type-error', 'simple-warning', 'stream-error', 'storage-condition', + 'style-warning', 'type-error', 'unbound-variable', 'unbound-slot', + 'undefined-function', 'warning', +)) + +BUILTIN_CLASSES = set(( + 'array', 'broadcast-stream', 'bit-vector', 'built-in-class', 'character', + 'class', 'complex', 'concatenated-stream', 'cons', 'echo-stream', + 'file-stream', 'float', 'function', 'generic-function', 'hash-table', + 'integer', 'list', 'logical-pathname', 'method-combination', 'method', + 'null', 'number', 'package', 'pathname', 'ratio', 'rational', 'readtable', + 'real', 'random-state', 'restart', 'sequence', 'standard-class', + 'standard-generic-function', 'standard-method', 'standard-object', + 'string-stream', 'stream', 'string', 'structure-class', 'structure-object', + 'symbol', 'synonym-stream', 't', 'two-way-stream', 'vector', +)) diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/_cocoa_builtins.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/_cocoa_builtins.py new file mode 100644 index 0000000000000000000000000000000000000000..064167ffd4f4a0d30111106cade6ec67876d6032 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/_cocoa_builtins.py @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers._cocoa_builtins + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + This file defines a set of types used across Cocoa frameworks from Apple. + There is a list of @interfaces, @protocols and some other (structs, unions) + + File may be also used as standalone generator for aboves. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from __future__ import print_function + +COCOA_INTERFACES = set(['UITableViewCell', 'HKCorrelationQuery', 'NSURLSessionDataTask', 'PHFetchOptions', 'NSLinguisticTagger', 'NSStream', 'AVAudioUnitDelay', 'GCMotion', 'SKPhysicsWorld', 'NSString', 'CMAttitude', 'AVAudioEnvironmentDistanceAttenuationParameters', 'HKStatisticsCollection', 'SCNPlane', 'CBPeer', 'JSContext', 'SCNTransaction', 'SCNTorus', 'AVAudioUnitEffect', 'UICollectionReusableView', 'MTLSamplerDescriptor', 'AVAssetReaderSampleReferenceOutput', 'AVMutableCompositionTrack', 'GKLeaderboard', 'NSFetchedResultsController', 'SKRange', 'MKTileOverlayRenderer', 'MIDINetworkSession', 'UIVisualEffectView', 'CIWarpKernel', 'PKObject', 'MKRoute', 'MPVolumeView', 'UIPrintInfo', 'SCNText', 'ADClient', 'PKPayment', 'AVMutableAudioMix', 'GLKEffectPropertyLight', 'WKScriptMessage', 'AVMIDIPlayer', 'PHCollectionListChangeRequest', 'UICollectionViewLayout', 'NSMutableCharacterSet', 'SKPaymentTransaction', 'NEOnDemandRuleConnect', 'NSShadow', 'SCNView', 'NSURLSessionConfiguration', 'MTLVertexAttributeDescriptor', 'CBCharacteristic', 'HKQuantityType', 'CKLocationSortDescriptor', 'NEVPNIKEv2SecurityAssociationParameters', 'CMStepCounter', 'NSNetService', 'AVAssetWriterInputMetadataAdaptor', 'UICollectionView', 'UIViewPrintFormatter', 'SCNLevelOfDetail', 'CAShapeLayer', 'MCPeerID', 'MPRatingCommand', 'WKNavigation', 'NSDictionary', 'NSFileVersion', 'CMGyroData', 'AVAudioUnitDistortion', 'CKFetchRecordsOperation', 'SKPhysicsJointSpring', 'SCNHitTestResult', 'AVAudioTime', 'CIFilter', 'UIView', 'SCNConstraint', 'CAPropertyAnimation', 'MKMapItem', 'MPRemoteCommandCenter', 'PKPaymentSummaryItem', 'UICollectionViewFlowLayoutInvalidationContext', 'UIInputViewController', 'PKPass', 'SCNPhysicsBehavior', 'MTLRenderPassColorAttachmentDescriptor', 'MKPolygonRenderer', 'CKNotification', 'JSValue', 'PHCollectionList', 'CLGeocoder', 'NSByteCountFormatter', 'AVCaptureScreenInput', 'MPFeedbackCommand', 'CAAnimation', 'MKOverlayPathView', 'UIActionSheet', 'UIMotionEffectGroup', 'NSLengthFormatter', 'UIBarItem', 'SKProduct', 'AVAssetExportSession', 'NSKeyedUnarchiver', 'NSMutableSet', 'SCNPyramid', 'PHAssetCollection', 'MKMapView', 'HMHomeManager', 'CATransition', 'MTLCompileOptions', 'UIVibrancyEffect', 'CLCircularRegion', 'MKTileOverlay', 'SCNShape', 'ACAccountCredential', 'SKPhysicsJointLimit', 'MKMapSnapshotter', 'AVMediaSelectionGroup', 'NSIndexSet', 'CBPeripheralManager', 'CKRecordZone', 'AVAudioRecorder', 'NSURL', 'CBCentral', 'NSNumber', 'AVAudioOutputNode', 'MTLVertexAttributeDescriptorArray', 'MKETAResponse', 'SKTransition', 'SSReadingList', 'HKSourceQuery', 'UITableViewRowAction', 'UITableView', 'SCNParticlePropertyController', 'AVCaptureStillImageOutput', 'GCController', 'AVAudioPlayerNode', 'AVAudioSessionPortDescription', 'NSHTTPURLResponse', 'NEOnDemandRuleEvaluateConnection', 'SKEffectNode', 'HKQuantity', 'GCControllerElement', 'AVPlayerItemAccessLogEvent', 'SCNBox', 'NSExtensionContext', 'MKOverlayRenderer', 'SCNPhysicsVehicle', 'NSDecimalNumber', 'EKReminder', 'MKPolylineView', 'CKQuery', 'AVAudioMixerNode', 'GKAchievementDescription', 'EKParticipant', 'NSBlockOperation', 'UIActivityItemProvider', 'CLLocation', 'NSBatchUpdateRequest', 'PHContentEditingOutput', 'PHObjectChangeDetails', 'HKWorkoutType', 'MPMoviePlayerController', 'AVAudioFormat', 'HMTrigger', 'MTLRenderPassDepthAttachmentDescriptor', 'SCNRenderer', 'GKScore', 'UISplitViewController', 'HKSource', 'NSURLConnection', 'ABUnknownPersonViewController', 'SCNTechnique', 'UIMenuController', 'NSEvent', 'SKTextureAtlas', 'NSKeyedArchiver', 'GKLeaderboardSet', 'NSSimpleCString', 'AVAudioPCMBuffer', 'CBATTRequest', 'GKMatchRequest', 'AVMetadataObject', 'SKProductsRequest', 'UIAlertView', 'NSIncrementalStore', 'MFMailComposeViewController', 'SCNFloor', 'NSSortDescriptor', 'CKFetchNotificationChangesOperation', 'MPMovieAccessLog', 'NSManagedObjectContext', 'AVAudioUnitGenerator', 'WKBackForwardList', 'SKMutableTexture', 'AVCaptureAudioDataOutput', 'ACAccount', 'AVMetadataItem', 'MPRatingCommandEvent', 'AVCaptureDeviceInputSource', 'CLLocationManager', 'MPRemoteCommand', 'AVCaptureSession', 'UIStepper', 'UIRefreshControl', 'NEEvaluateConnectionRule', 'CKModifyRecordsOperation', 'UICollectionViewTransitionLayout', 'CBCentralManager', 'NSPurgeableData', 'PKShippingMethod', 'SLComposeViewController', 'NSHashTable', 'MKUserTrackingBarButtonItem', 'UILexiconEntry', 'CMMotionActivity', 'SKAction', 'SKShader', 'AVPlayerItemOutput', 'MTLRenderPassAttachmentDescriptor', 'UIDocumentInteractionController', 'UIDynamicItemBehavior', 'NSMutableDictionary', 'UILabel', 'AVCaptureInputPort', 'NSExpression', 'CAInterAppAudioTransportView', 'SKMutablePayment', 'UIImage', 'PHCachingImageManager', 'SCNTransformConstraint', 'HKCorrelationType', 'UIColor', 'SCNGeometrySource', 'AVCaptureAutoExposureBracketedStillImageSettings', 'UIPopoverBackgroundView', 'UIToolbar', 'NSNotificationCenter', 'UICollectionViewLayoutAttributes', 'AVAssetReaderOutputMetadataAdaptor', 'NSEntityMigrationPolicy', 'HMUser', 'NSLocale', 'NSURLSession', 'SCNCamera', 'NSTimeZone', 'UIManagedDocument', 'AVMutableVideoCompositionLayerInstruction', 'AVAssetTrackGroup', 'NSInvocationOperation', 'ALAssetRepresentation', 'AVQueuePlayer', 'HMServiceGroup', 'UIPasteboard', 'PHContentEditingInput', 'NSLayoutManager', 'EKCalendarChooser', 'EKObject', 'CATiledLayer', 'GLKReflectionMapEffect', 'NSManagedObjectID', 'NSEnergyFormatter', 'SLRequest', 'HMCharacteristic', 'AVPlayerLayer', 'MTLRenderPassDescriptor', 'SKPayment', 'NSPointerArray', 'AVAudioMix', 'SCNLight', 'MCAdvertiserAssistant', 'MKMapSnapshotOptions', 'HKCategorySample', 'AVAudioEnvironmentReverbParameters', 'SCNMorpher', 'AVTimedMetadataGroup', 'CBMutableCharacteristic', 'NSFetchRequest', 'UIDevice', 'NSManagedObject', 'NKAssetDownload', 'AVOutputSettingsAssistant', 'SKPhysicsJointPin', 'UITabBar', 'UITextInputMode', 'NSFetchRequestExpression', 'HMActionSet', 'CTSubscriber', 'PHAssetChangeRequest', 'NSPersistentStoreRequest', 'UITabBarController', 'HKQuantitySample', 'AVPlayerItem', 'AVSynchronizedLayer', 'MKDirectionsRequest', 'NSMetadataItem', 'UIPresentationController', 'UINavigationItem', 'PHFetchResultChangeDetails', 'PHImageManager', 'AVCaptureManualExposureBracketedStillImageSettings', 'UIStoryboardPopoverSegue', 'SCNLookAtConstraint', 'UIGravityBehavior', 'UIWindow', 'CBMutableDescriptor', 'NEOnDemandRuleDisconnect', 'UIBezierPath', 'UINavigationController', 'ABPeoplePickerNavigationController', 'EKSource', 'AVAssetWriterInput', 'AVPlayerItemTrack', 'GLKEffectPropertyTexture', 'NSHTTPCookie', 'NSURLResponse', 'SKPaymentQueue', 'NSAssertionHandler', 'MKReverseGeocoder', 'GCControllerAxisInput', 'NSArray', 'NSOrthography', 'NSURLSessionUploadTask', 'NSCharacterSet', 'AVMutableVideoCompositionInstruction', 'AVAssetReaderOutput', 'EAGLContext', 'WKFrameInfo', 'CMPedometer', 'MyClass', 'CKModifyBadgeOperation', 'AVCaptureAudioFileOutput', 'SKEmitterNode', 'NSMachPort', 'AVVideoCompositionCoreAnimationTool', 'PHCollection', 'SCNPhysicsWorld', 'NSURLRequest', 'CMAccelerometerData', 'NSNetServiceBrowser', 'CLFloor', 'AVAsynchronousVideoCompositionRequest', 'SCNGeometry', 'SCNIKConstraint', 'CIKernel', 'CAGradientLayer', 'HKCharacteristicType', 'NSFormatter', 'SCNAction', 'CATransaction', 'CBUUID', 'UIStoryboard', 'MPMediaLibrary', 'UITapGestureRecognizer', 'MPMediaItemArtwork', 'NSURLSessionTask', 'AVAudioUnit', 'MCBrowserViewController', 'UIFontDescriptor', 'NSRelationshipDescription', 'HKSample', 'WKWebView', 'NSMutableAttributedString', 'NSPersistentStoreAsynchronousResult', 'MPNowPlayingInfoCenter', 'MKLocalSearch', 'EAAccessory', 'HKCorrelation', 'CATextLayer', 'NSNotificationQueue', 'UINib', 'GLKTextureLoader', 'HKObjectType', 'NSValue', 'NSMutableIndexSet', 'SKPhysicsContact', 'NSProgress', 'AVPlayerViewController', 'CAScrollLayer', 'GKSavedGame', 'NSTextCheckingResult', 'PHObjectPlaceholder', 'SKConstraint', 'EKEventEditViewController', 'NSEntityDescription', 'NSURLCredentialStorage', 'UIApplication', 'SKDownload', 'SCNNode', 'MKLocalSearchRequest', 'SKScene', 'UISearchDisplayController', 'NEOnDemandRule', 'MTLRenderPassStencilAttachmentDescriptor', 'CAReplicatorLayer', 'UIPrintPageRenderer', 'EKCalendarItem', 'NSUUID', 'EAAccessoryManager', 'NEOnDemandRuleIgnore', 'SKRegion', 'AVAssetResourceLoader', 'EAWiFiUnconfiguredAccessoryBrowser', 'NSUserActivity', 'CTCall', 'UIPrinterPickerController', 'CIVector', 'UINavigationBar', 'UIPanGestureRecognizer', 'MPMediaQuery', 'ABNewPersonViewController', 'CKRecordZoneID', 'HKAnchoredObjectQuery', 'CKFetchRecordZonesOperation', 'UIStoryboardSegue', 'ACAccountType', 'GKSession', 'SKVideoNode', 'PHChange', 'SKReceiptRefreshRequest', 'GCExtendedGamepadSnapshot', 'MPSeekCommandEvent', 'GCExtendedGamepad', 'CAValueFunction', 'SCNCylinder', 'NSNotification', 'NSBatchUpdateResult', 'PKPushCredentials', 'SCNPhysicsSliderJoint', 'AVCaptureDeviceFormat', 'AVPlayerItemErrorLog', 'NSMapTable', 'NSSet', 'CMMotionManager', 'GKVoiceChatService', 'UIPageControl', 'UILexicon', 'MTLArrayType', 'AVAudioUnitReverb', 'MKGeodesicPolyline', 'AVMutableComposition', 'NSLayoutConstraint', 'UIPrinter', 'NSOrderedSet', 'CBAttribute', 'PKPushPayload', 'NSIncrementalStoreNode', 'EKEventStore', 'MPRemoteCommandEvent', 'UISlider', 'UIBlurEffect', 'CKAsset', 'AVCaptureInput', 'AVAudioEngine', 'MTLVertexDescriptor', 'SKPhysicsBody', 'NSOperation', 'PKPaymentPass', 'UIImageAsset', 'MKMapCamera', 'SKProductsResponse', 'GLKEffectPropertyMaterial', 'AVCaptureDevice', 'CTCallCenter', 'CABTMIDILocalPeripheralViewController', 'NEVPNManager', 'HKQuery', 'SCNPhysicsContact', 'CBMutableService', 'AVSampleBufferDisplayLayer', 'SCNSceneSource', 'SKLightNode', 'CKDiscoveredUserInfo', 'NSMutableArray', 'MTLDepthStencilDescriptor', 'MTLArgument', 'NSMassFormatter', 'CIRectangleFeature', 'PKPushRegistry', 'NEVPNConnection', 'MCNearbyServiceBrowser', 'NSOperationQueue', 'MKPolylineRenderer', 'HKWorkout', 'NSValueTransformer', 'UICollectionViewFlowLayout', 'MPChangePlaybackRateCommandEvent', 'NSEntityMapping', 'SKTexture', 'NSMergePolicy', 'UITextInputStringTokenizer', 'NSRecursiveLock', 'AVAsset', 'NSUndoManager', 'AVAudioUnitSampler', 'NSItemProvider', 'SKUniform', 'MPMediaPickerController', 'CKOperation', 'MTLRenderPipelineDescriptor', 'EAWiFiUnconfiguredAccessory', 'NSFileCoordinator', 'SKRequest', 'NSFileHandle', 'NSConditionLock', 'UISegmentedControl', 'NSManagedObjectModel', 'UITabBarItem', 'SCNCone', 'MPMediaItem', 'SCNMaterial', 'EKRecurrenceRule', 'UIEvent', 'UITouch', 'UIPrintInteractionController', 'CMDeviceMotion', 'NEVPNProtocol', 'NSCompoundPredicate', 'HKHealthStore', 'MKMultiPoint', 'HKSampleType', 'UIPrintFormatter', 'AVAudioUnitEQFilterParameters', 'SKView', 'NSConstantString', 'UIPopoverController', 'CKDatabase', 'AVMetadataFaceObject', 'UIAccelerometer', 'EKEventViewController', 'CMAltitudeData', 'MTLStencilDescriptor', 'UISwipeGestureRecognizer', 'NSPort', 'MKCircleRenderer', 'AVCompositionTrack', 'NSAsynchronousFetchRequest', 'NSUbiquitousKeyValueStore', 'NSMetadataQueryResultGroup', 'AVAssetResourceLoadingDataRequest', 'UITableViewHeaderFooterView', 'CKNotificationID', 'AVAudioSession', 'HKUnit', 'NSNull', 'NSPersistentStoreResult', 'MKCircleView', 'AVAudioChannelLayout', 'NEVPNProtocolIKEv2', 'WKProcessPool', 'UIAttachmentBehavior', 'CLBeacon', 'NSInputStream', 'NSURLCache', 'GKPlayer', 'NSMappingModel', 'CIQRCodeFeature', 'AVMutableVideoComposition', 'PHFetchResult', 'NSAttributeDescription', 'AVPlayer', 'MKAnnotationView', 'PKPaymentRequest', 'NSTimer', 'CBDescriptor', 'MKOverlayView', 'AVAudioUnitTimePitch', 'NSSaveChangesRequest', 'UIReferenceLibraryViewController', 'SKPhysicsJointFixed', 'UILocalizedIndexedCollation', 'UIInterpolatingMotionEffect', 'UIDocumentPickerViewController', 'AVAssetWriter', 'NSBundle', 'SKStoreProductViewController', 'GLKViewController', 'NSMetadataQueryAttributeValueTuple', 'GKTurnBasedMatch', 'AVAudioFile', 'UIActivity', 'NSPipe', 'MKShape', 'NSMergeConflict', 'CIImage', 'HKObject', 'UIRotationGestureRecognizer', 'AVPlayerItemLegibleOutput', 'AVAssetImageGenerator', 'GCControllerButtonInput', 'CKMarkNotificationsReadOperation', 'CKSubscription', 'MPTimedMetadata', 'NKIssue', 'UIScreenMode', 'HMAccessoryBrowser', 'GKTurnBasedEventHandler', 'UIWebView', 'MKPolyline', 'JSVirtualMachine', 'AVAssetReader', 'NSAttributedString', 'GKMatchmakerViewController', 'NSCountedSet', 'UIButton', 'WKNavigationResponse', 'GKLocalPlayer', 'MPMovieErrorLog', 'AVSpeechUtterance', 'HKStatistics', 'UILocalNotification', 'HKBiologicalSexObject', 'AVURLAsset', 'CBPeripheral', 'NSDateComponentsFormatter', 'SKSpriteNode', 'UIAccessibilityElement', 'AVAssetWriterInputGroup', 'HMZone', 'AVAssetReaderAudioMixOutput', 'NSEnumerator', 'UIDocument', 'MKLocalSearchResponse', 'UISimpleTextPrintFormatter', 'PHPhotoLibrary', 'CBService', 'UIDocumentMenuViewController', 'MCSession', 'QLPreviewController', 'CAMediaTimingFunction', 'UITextPosition', 'ASIdentifierManager', 'AVAssetResourceLoadingRequest', 'SLComposeServiceViewController', 'UIPinchGestureRecognizer', 'PHObject', 'NSExtensionItem', 'HKSampleQuery', 'MTLRenderPipelineColorAttachmentDescriptorArray', 'MKRouteStep', 'SCNCapsule', 'NSMetadataQuery', 'AVAssetResourceLoadingContentInformationRequest', 'UITraitCollection', 'CTCarrier', 'NSFileSecurity', 'UIAcceleration', 'UIMotionEffect', 'MTLRenderPipelineReflection', 'CLHeading', 'CLVisit', 'MKDirectionsResponse', 'HMAccessory', 'MTLStructType', 'UITextView', 'CMMagnetometerData', 'UICollisionBehavior', 'UIProgressView', 'CKServerChangeToken', 'UISearchBar', 'MKPlacemark', 'AVCaptureConnection', 'NSPropertyMapping', 'ALAssetsFilter', 'SK3DNode', 'AVPlayerItemErrorLogEvent', 'NSJSONSerialization', 'AVAssetReaderVideoCompositionOutput', 'ABPersonViewController', 'CIDetector', 'GKTurnBasedMatchmakerViewController', 'MPMediaItemCollection', 'SCNSphere', 'NSCondition', 'NSURLCredential', 'MIDINetworkConnection', 'NSFileProviderExtension', 'NSDecimalNumberHandler', 'NSAtomicStoreCacheNode', 'NSAtomicStore', 'EKAlarm', 'CKNotificationInfo', 'AVAudioUnitEQ', 'UIPercentDrivenInteractiveTransition', 'MKPolygon', 'AVAssetTrackSegment', 'MTLVertexAttribute', 'NSExpressionDescription', 'HKStatisticsCollectionQuery', 'NSURLAuthenticationChallenge', 'NSDirectoryEnumerator', 'MKDistanceFormatter', 'UIAlertAction', 'NSPropertyListSerialization', 'GKPeerPickerController', 'UIUserNotificationSettings', 'UITableViewController', 'GKNotificationBanner', 'MKPointAnnotation', 'MTLRenderPassColorAttachmentDescriptorArray', 'NSCache', 'SKPhysicsJoint', 'NSXMLParser', 'UIViewController', 'PKPaymentToken', 'MFMessageComposeViewController', 'AVAudioInputNode', 'NSDataDetector', 'CABTMIDICentralViewController', 'AVAudioUnitMIDIInstrument', 'AVCaptureVideoPreviewLayer', 'AVAssetWriterInputPassDescription', 'MPChangePlaybackRateCommand', 'NSURLComponents', 'CAMetalLayer', 'UISnapBehavior', 'AVMetadataMachineReadableCodeObject', 'CKDiscoverUserInfosOperation', 'NSTextAttachment', 'NSException', 'UIMenuItem', 'CMMotionActivityManager', 'SCNGeometryElement', 'NCWidgetController', 'CAEmitterLayer', 'MKUserLocation', 'UIImagePickerController', 'CIFeature', 'AVCaptureDeviceInput', 'ALAsset', 'NSURLSessionDownloadTask', 'SCNPhysicsHingeJoint', 'MPMoviePlayerViewController', 'NSMutableOrderedSet', 'SCNMaterialProperty', 'UIFont', 'AVCaptureVideoDataOutput', 'NSCachedURLResponse', 'ALAssetsLibrary', 'NSInvocation', 'UILongPressGestureRecognizer', 'NSTextStorage', 'WKWebViewConfiguration', 'CIFaceFeature', 'MKMapSnapshot', 'GLKEffectPropertyFog', 'AVComposition', 'CKDiscoverAllContactsOperation', 'AVAudioMixInputParameters', 'CAEmitterBehavior', 'PKPassLibrary', 'UIMutableUserNotificationCategory', 'NSLock', 'NEVPNProtocolIPSec', 'ADBannerView', 'UIDocumentPickerExtensionViewController', 'UIActivityIndicatorView', 'AVPlayerMediaSelectionCriteria', 'CALayer', 'UIAccessibilityCustomAction', 'UIBarButtonItem', 'AVAudioSessionRouteDescription', 'CLBeaconRegion', 'HKBloodTypeObject', 'MTLVertexBufferLayoutDescriptorArray', 'CABasicAnimation', 'AVVideoCompositionInstruction', 'AVMutableTimedMetadataGroup', 'EKRecurrenceEnd', 'NSTextContainer', 'TWTweetComposeViewController', 'PKPaymentAuthorizationViewController', 'UIScrollView', 'WKNavigationAction', 'AVPlayerItemMetadataOutput', 'EKRecurrenceDayOfWeek', 'NSNumberFormatter', 'MTLComputePipelineReflection', 'UIScreen', 'CLRegion', 'NSProcessInfo', 'GLKTextureInfo', 'SCNSkinner', 'AVCaptureMetadataOutput', 'SCNAnimationEvent', 'NSTextTab', 'JSManagedValue', 'NSDate', 'UITextChecker', 'WKBackForwardListItem', 'NSData', 'NSParagraphStyle', 'AVMutableMetadataItem', 'EKCalendar', 'HKWorkoutEvent', 'NSMutableURLRequest', 'UIVideoEditorController', 'HMTimerTrigger', 'AVAudioUnitVarispeed', 'UIDynamicAnimator', 'AVCompositionTrackSegment', 'GCGamepadSnapshot', 'MPMediaEntity', 'GLKSkyboxEffect', 'UISwitch', 'EKStructuredLocation', 'UIGestureRecognizer', 'NSProxy', 'GLKBaseEffect', 'UIPushBehavior', 'GKScoreChallenge', 'NSCoder', 'MPMediaPlaylist', 'NSDateComponents', 'WKUserScript', 'EKEvent', 'NSDateFormatter', 'NSAsynchronousFetchResult', 'AVAssetWriterInputPixelBufferAdaptor', 'UIVisualEffect', 'UICollectionViewCell', 'UITextField', 'CLPlacemark', 'MPPlayableContentManager', 'AVCaptureOutput', 'HMCharacteristicWriteAction', 'CKModifySubscriptionsOperation', 'NSPropertyDescription', 'GCGamepad', 'UIMarkupTextPrintFormatter', 'SCNTube', 'NSPersistentStoreCoordinator', 'AVAudioEnvironmentNode', 'GKMatchmaker', 'CIContext', 'NSThread', 'SLComposeSheetConfigurationItem', 'SKPhysicsJointSliding', 'NSPredicate', 'GKVoiceChat', 'SKCropNode', 'AVCaptureAudioPreviewOutput', 'NSStringDrawingContext', 'GKGameCenterViewController', 'UIPrintPaper', 'SCNPhysicsBallSocketJoint', 'UICollectionViewLayoutInvalidationContext', 'GLKEffectPropertyTransform', 'AVAudioIONode', 'UIDatePicker', 'MKDirections', 'ALAssetsGroup', 'CKRecordZoneNotification', 'SCNScene', 'MPMovieAccessLogEvent', 'CKFetchSubscriptionsOperation', 'CAEmitterCell', 'AVAudioUnitTimeEffect', 'HMCharacteristicMetadata', 'MKPinAnnotationView', 'UIPickerView', 'UIImageView', 'UIUserNotificationCategory', 'SCNPhysicsVehicleWheel', 'HKCategoryType', 'MPMediaQuerySection', 'GKFriendRequestComposeViewController', 'NSError', 'MTLRenderPipelineColorAttachmentDescriptor', 'SCNPhysicsShape', 'UISearchController', 'SCNPhysicsBody', 'CTSubscriberInfo', 'AVPlayerItemAccessLog', 'MPMediaPropertyPredicate', 'CMLogItem', 'NSAutoreleasePool', 'NSSocketPort', 'AVAssetReaderTrackOutput', 'SKNode', 'UIMutableUserNotificationAction', 'SCNProgram', 'AVSpeechSynthesisVoice', 'CMAltimeter', 'AVCaptureAudioChannel', 'GKTurnBasedExchangeReply', 'AVVideoCompositionLayerInstruction', 'AVSpeechSynthesizer', 'GKChallengeEventHandler', 'AVCaptureFileOutput', 'UIControl', 'SCNPhysicsField', 'CKReference', 'LAContext', 'CKRecordID', 'ADInterstitialAd', 'AVAudioSessionDataSourceDescription', 'AVAudioBuffer', 'CIColorKernel', 'GCControllerDirectionPad', 'NSFileManager', 'AVMutableAudioMixInputParameters', 'UIScreenEdgePanGestureRecognizer', 'CAKeyframeAnimation', 'CKQueryNotification', 'PHAdjustmentData', 'EASession', 'AVAssetResourceRenewalRequest', 'UIInputView', 'NSFileWrapper', 'UIResponder', 'NSPointerFunctions', 'UIKeyCommand', 'NSHTTPCookieStorage', 'AVMediaSelectionOption', 'NSRunLoop', 'NSFileAccessIntent', 'CAAnimationGroup', 'MKCircle', 'UIAlertController', 'NSMigrationManager', 'NSDateIntervalFormatter', 'UICollectionViewUpdateItem', 'CKDatabaseOperation', 'PHImageRequestOptions', 'SKReachConstraints', 'CKRecord', 'CAInterAppAudioSwitcherView', 'WKWindowFeatures', 'GKInvite', 'NSMutableData', 'PHAssetCollectionChangeRequest', 'NSMutableParagraphStyle', 'UIDynamicBehavior', 'GLKEffectProperty', 'CKFetchRecordChangesOperation', 'SKShapeNode', 'MPMovieErrorLogEvent', 'MKPolygonView', 'MPContentItem', 'HMAction', 'NSScanner', 'GKAchievementChallenge', 'AVAudioPlayer', 'CKContainer', 'AVVideoComposition', 'NKLibrary', 'NSPersistentStore', 'AVCaptureMovieFileOutput', 'HMRoom', 'GKChallenge', 'UITextRange', 'NSURLProtectionSpace', 'ACAccountStore', 'MPSkipIntervalCommand', 'NSComparisonPredicate', 'HMHome', 'PHVideoRequestOptions', 'NSOutputStream', 'MPSkipIntervalCommandEvent', 'PKAddPassesViewController', 'UITextSelectionRect', 'CTTelephonyNetworkInfo', 'AVTextStyleRule', 'NSFetchedPropertyDescription', 'UIPageViewController', 'CATransformLayer', 'UICollectionViewController', 'AVAudioNode', 'MCNearbyServiceAdvertiser', 'NSObject', 'PHAsset', 'GKLeaderboardViewController', 'CKQueryCursor', 'MPMusicPlayerController', 'MKOverlayPathRenderer', 'CMPedometerData', 'HMService', 'SKFieldNode', 'GKAchievement', 'WKUserContentController', 'AVAssetTrack', 'TWRequest', 'SKLabelNode', 'AVCaptureBracketedStillImageSettings', 'MIDINetworkHost', 'MPMediaPredicate', 'AVFrameRateRange', 'MTLTextureDescriptor', 'MTLVertexBufferLayoutDescriptor', 'MPFeedbackCommandEvent', 'UIUserNotificationAction', 'HKStatisticsQuery', 'SCNParticleSystem', 'NSIndexPath', 'AVVideoCompositionRenderContext', 'CADisplayLink', 'HKObserverQuery', 'UIPopoverPresentationController', 'CKQueryOperation', 'CAEAGLLayer', 'NSMutableString', 'NSMessagePort', 'NSURLQueryItem', 'MTLStructMember', 'AVAudioSessionChannelDescription', 'GLKView', 'UIActivityViewController', 'GKAchievementViewController', 'GKTurnBasedParticipant', 'NSURLProtocol', 'NSUserDefaults', 'NSCalendar', 'SKKeyframeSequence', 'AVMetadataItemFilter', 'CKModifyRecordZonesOperation', 'WKPreferences', 'NSMethodSignature', 'NSRegularExpression', 'EAGLSharegroup', 'AVPlayerItemVideoOutput', 'PHContentEditingInputRequestOptions', 'GKMatch', 'CIColor', 'UIDictationPhrase']) +COCOA_PROTOCOLS = set(['SKStoreProductViewControllerDelegate', 'AVVideoCompositionInstruction', 'AVAudioSessionDelegate', 'GKMatchDelegate', 'NSFileManagerDelegate', 'UILayoutSupport', 'NSCopying', 'UIPrintInteractionControllerDelegate', 'QLPreviewControllerDataSource', 'SKProductsRequestDelegate', 'NSTextStorageDelegate', 'MCBrowserViewControllerDelegate', 'MTLComputeCommandEncoder', 'SCNSceneExportDelegate', 'UISearchResultsUpdating', 'MFMailComposeViewControllerDelegate', 'MTLBlitCommandEncoder', 'NSDecimalNumberBehaviors', 'PHContentEditingController', 'NSMutableCopying', 'UIActionSheetDelegate', 'UIViewControllerTransitioningDelegate', 'UIAlertViewDelegate', 'AVAudioPlayerDelegate', 'MKReverseGeocoderDelegate', 'NSCoding', 'UITextInputTokenizer', 'GKFriendRequestComposeViewControllerDelegate', 'UIActivityItemSource', 'NSCacheDelegate', 'UIAdaptivePresentationControllerDelegate', 'GKAchievementViewControllerDelegate', 'UIViewControllerTransitionCoordinator', 'EKEventEditViewDelegate', 'NSURLConnectionDelegate', 'UITableViewDelegate', 'GKPeerPickerControllerDelegate', 'UIGuidedAccessRestrictionDelegate', 'AVSpeechSynthesizerDelegate', 'AVAudio3DMixing', 'AVPlayerItemLegibleOutputPushDelegate', 'ADInterstitialAdDelegate', 'HMAccessoryBrowserDelegate', 'AVAssetResourceLoaderDelegate', 'UITabBarControllerDelegate', 'CKRecordValue', 'SKPaymentTransactionObserver', 'AVCaptureAudioDataOutputSampleBufferDelegate', 'UIInputViewAudioFeedback', 'GKChallengeListener', 'SKSceneDelegate', 'UIPickerViewDelegate', 'UIWebViewDelegate', 'UIApplicationDelegate', 'GKInviteEventListener', 'MPMediaPlayback', 'MyClassJavaScriptMethods', 'AVAsynchronousKeyValueLoading', 'QLPreviewItem', 'SCNBoundingVolume', 'NSPortDelegate', 'UIContentContainer', 'SCNNodeRendererDelegate', 'SKRequestDelegate', 'SKPhysicsContactDelegate', 'HMAccessoryDelegate', 'UIPageViewControllerDataSource', 'SCNSceneRendererDelegate', 'SCNPhysicsContactDelegate', 'MKMapViewDelegate', 'AVPlayerItemOutputPushDelegate', 'UICollectionViewDelegate', 'UIImagePickerControllerDelegate', 'MTLRenderCommandEncoder', 'PKPaymentAuthorizationViewControllerDelegate', 'UIToolbarDelegate', 'WKUIDelegate', 'SCNActionable', 'NSURLConnectionDataDelegate', 'MKOverlay', 'CBCentralManagerDelegate', 'JSExport', 'NSTextLayoutOrientationProvider', 'UIPickerViewDataSource', 'PKPushRegistryDelegate', 'UIViewControllerTransitionCoordinatorContext', 'NSLayoutManagerDelegate', 'MTLLibrary', 'NSFetchedResultsControllerDelegate', 'ABPeoplePickerNavigationControllerDelegate', 'MTLResource', 'NSDiscardableContent', 'UITextFieldDelegate', 'MTLBuffer', 'MTLSamplerState', 'GKGameCenterControllerDelegate', 'MPMediaPickerControllerDelegate', 'UISplitViewControllerDelegate', 'UIAppearance', 'UIPickerViewAccessibilityDelegate', 'UITraitEnvironment', 'UIScrollViewAccessibilityDelegate', 'ADBannerViewDelegate', 'MPPlayableContentDataSource', 'MTLComputePipelineState', 'NSURLSessionDelegate', 'MTLCommandBuffer', 'NSXMLParserDelegate', 'UIViewControllerRestoration', 'UISearchBarDelegate', 'UIBarPositioning', 'CBPeripheralDelegate', 'UISearchDisplayDelegate', 'CAAction', 'PKAddPassesViewControllerDelegate', 'MCNearbyServiceAdvertiserDelegate', 'MTLDepthStencilState', 'GKTurnBasedMatchmakerViewControllerDelegate', 'MPPlayableContentDelegate', 'AVCaptureVideoDataOutputSampleBufferDelegate', 'UIAppearanceContainer', 'UIStateRestoring', 'UITextDocumentProxy', 'MTLDrawable', 'NSURLSessionTaskDelegate', 'NSFilePresenter', 'AVAudioStereoMixing', 'UIViewControllerContextTransitioning', 'UITextInput', 'CBPeripheralManagerDelegate', 'UITextInputDelegate', 'NSFastEnumeration', 'NSURLAuthenticationChallengeSender', 'SCNProgramDelegate', 'AVVideoCompositing', 'SCNAnimatable', 'NSSecureCoding', 'MCAdvertiserAssistantDelegate', 'GKLocalPlayerListener', 'GLKNamedEffect', 'UIPopoverControllerDelegate', 'AVCaptureMetadataOutputObjectsDelegate', 'NSExtensionRequestHandling', 'UITextSelecting', 'UIPrinterPickerControllerDelegate', 'NCWidgetProviding', 'MTLCommandEncoder', 'NSURLProtocolClient', 'MFMessageComposeViewControllerDelegate', 'UIVideoEditorControllerDelegate', 'WKNavigationDelegate', 'GKSavedGameListener', 'UITableViewDataSource', 'MTLFunction', 'EKCalendarChooserDelegate', 'NSUserActivityDelegate', 'UICollisionBehaviorDelegate', 'NSStreamDelegate', 'MCNearbyServiceBrowserDelegate', 'HMHomeDelegate', 'UINavigationControllerDelegate', 'MCSessionDelegate', 'UIDocumentPickerDelegate', 'UIViewControllerInteractiveTransitioning', 'GKTurnBasedEventListener', 'SCNSceneRenderer', 'MTLTexture', 'GLKViewDelegate', 'EAAccessoryDelegate', 'WKScriptMessageHandler', 'PHPhotoLibraryChangeObserver', 'NSKeyedUnarchiverDelegate', 'AVPlayerItemMetadataOutputPushDelegate', 'NSMachPortDelegate', 'SCNShadable', 'UIPopoverBackgroundViewMethods', 'UIDocumentMenuDelegate', 'UIBarPositioningDelegate', 'ABPersonViewControllerDelegate', 'NSNetServiceBrowserDelegate', 'EKEventViewDelegate', 'UIScrollViewDelegate', 'NSURLConnectionDownloadDelegate', 'UIGestureRecognizerDelegate', 'UINavigationBarDelegate', 'AVAudioMixing', 'NSFetchedResultsSectionInfo', 'UIDocumentInteractionControllerDelegate', 'MTLParallelRenderCommandEncoder', 'QLPreviewControllerDelegate', 'UIAccessibilityReadingContent', 'ABUnknownPersonViewControllerDelegate', 'GLKViewControllerDelegate', 'UICollectionViewDelegateFlowLayout', 'UIPopoverPresentationControllerDelegate', 'UIDynamicAnimatorDelegate', 'NSTextAttachmentContainer', 'MKAnnotation', 'UIAccessibilityIdentification', 'UICoordinateSpace', 'ABNewPersonViewControllerDelegate', 'MTLDevice', 'CAMediaTiming', 'AVCaptureFileOutputRecordingDelegate', 'HMHomeManagerDelegate', 'UITextViewDelegate', 'UITabBarDelegate', 'GKLeaderboardViewControllerDelegate', 'UISearchControllerDelegate', 'EAWiFiUnconfiguredAccessoryBrowserDelegate', 'UITextInputTraits', 'MTLRenderPipelineState', 'GKVoiceChatClient', 'UIKeyInput', 'UICollectionViewDataSource', 'SCNTechniqueSupport', 'NSLocking', 'AVCaptureFileOutputDelegate', 'GKChallengeEventHandlerDelegate', 'UIObjectRestoration', 'CIFilterConstructor', 'AVPlayerItemOutputPullDelegate', 'EAGLDrawable', 'AVVideoCompositionValidationHandling', 'UIViewControllerAnimatedTransitioning', 'NSURLSessionDownloadDelegate', 'UIAccelerometerDelegate', 'UIPageViewControllerDelegate', 'MTLCommandQueue', 'UIDataSourceModelAssociation', 'AVAudioRecorderDelegate', 'GKSessionDelegate', 'NSKeyedArchiverDelegate', 'CAMetalDrawable', 'UIDynamicItem', 'CLLocationManagerDelegate', 'NSMetadataQueryDelegate', 'NSNetServiceDelegate', 'GKMatchmakerViewControllerDelegate', 'NSURLSessionDataDelegate']) +COCOA_PRIMITIVES = set(['ROTAHeader', '__CFBundle', 'MortSubtable', 'AudioFilePacketTableInfo', 'CGPDFOperatorTable', 'KerxStateEntry', 'ExtendedTempoEvent', 'CTParagraphStyleSetting', 'OpaqueMIDIPort', '_GLKMatrix3', '_GLKMatrix2', '_GLKMatrix4', 'ExtendedControlEvent', 'CAFAudioDescription', 'OpaqueCMBlockBuffer', 'CGTextDrawingMode', 'EKErrorCode', 'gss_buffer_desc_struct', 'AudioUnitParameterInfo', '__SCPreferences', '__CTFrame', '__CTLine', 'AudioFile_SMPTE_Time', 'gss_krb5_lucid_context_v1', 'OpaqueJSValue', 'TrakTableEntry', 'AudioFramePacketTranslation', 'CGImageSource', 'OpaqueJSPropertyNameAccumulator', 'JustPCGlyphRepeatAddAction', '__CFBinaryHeap', 'OpaqueMIDIThruConnection', 'opaqueCMBufferQueue', 'OpaqueMusicSequence', 'MortRearrangementSubtable', 'MixerDistanceParams', 'MorxSubtable', 'MIDIObjectPropertyChangeNotification', 'SFNTLookupSegment', 'CGImageMetadataErrors', 'CGPath', 'OpaqueMIDIEndpoint', 'AudioComponentPlugInInterface', 'gss_ctx_id_t_desc_struct', 'sfntFontFeatureSetting', 'OpaqueJSContextGroup', '__SCNetworkConnection', 'AudioUnitParameterValueTranslation', 'CGImageMetadataType', 'CGPattern', 'AudioFileTypeAndFormatID', 'CGContext', 'AUNodeInteraction', 'SFNTLookupTable', 'JustPCDecompositionAction', 'KerxControlPointHeader', 'AudioStreamPacketDescription', 'KernSubtableHeader', '__SecCertificate', 'AUMIDIOutputCallbackStruct', 'MIDIMetaEvent', 'AudioQueueChannelAssignment', 'AnchorPoint', 'JustTable', '__CFNetService', 'CF_BRIDGED_TYPE', 'gss_krb5_lucid_key', 'CGPDFDictionary', 'KerxSubtableHeader', 'CAF_UUID_ChunkHeader', 'gss_krb5_cfx_keydata', 'OpaqueJSClass', 'CGGradient', 'OpaqueMIDISetup', 'JustPostcompTable', '__CTParagraphStyle', 'AudioUnitParameterHistoryInfo', 'OpaqueJSContext', 'CGShading', 'MIDIThruConnectionParams', 'BslnFormat0Part', 'SFNTLookupSingle', '__CFHost', '__SecRandom', '__CTFontDescriptor', '_NSRange', 'sfntDirectory', 'AudioQueueLevelMeterState', 'CAFPositionPeak', 'PropLookupSegment', '__CVOpenGLESTextureCache', 'sfntInstance', '_GLKQuaternion', 'AnkrTable', '__SCNetworkProtocol', 'CAFFileHeader', 'KerxOrderedListHeader', 'CGBlendMode', 'STXEntryOne', 'CAFRegion', 'SFNTLookupTrimmedArrayHeader', 'SCNMatrix4', 'KerxControlPointEntry', 'OpaqueMusicTrack', '_GLKVector4', 'gss_OID_set_desc_struct', 'OpaqueMusicPlayer', '_CFHTTPAuthentication', 'CGAffineTransform', 'CAFMarkerChunk', 'AUHostIdentifier', 'ROTAGlyphEntry', 'BslnTable', 'gss_krb5_lucid_context_version', '_GLKMatrixStack', 'CGImage', 'KernStateEntry', 'SFNTLookupSingleHeader', 'MortLigatureSubtable', 'CAFUMIDChunk', 'SMPTETime', 'CAFDataChunk', 'CGPDFStream', 'AudioFileRegionList', 'STEntryTwo', 'SFNTLookupBinarySearchHeader', 'OpbdTable', '__CTGlyphInfo', 'BslnFormat2Part', 'KerxIndexArrayHeader', 'TrakTable', 'KerxKerningPair', '__CFBitVector', 'KernVersion0SubtableHeader', 'OpaqueAudioComponentInstance', 'AudioChannelLayout', '__CFUUID', 'MIDISysexSendRequest', '__CFNumberFormatter', 'CGImageSourceStatus', 'AudioFileMarkerList', 'AUSamplerBankPresetData', 'CGDataProvider', 'AudioFormatInfo', '__SecIdentity', 'sfntCMapExtendedSubHeader', 'MIDIChannelMessage', 'KernOffsetTable', 'CGColorSpaceModel', 'MFMailComposeErrorCode', 'CGFunction', '__SecTrust', 'AVAudio3DAngularOrientation', 'CGFontPostScriptFormat', 'KernStateHeader', 'AudioUnitCocoaViewInfo', 'CGDataConsumer', 'OpaqueMIDIDevice', 'KernVersion0Header', 'AnchorPointTable', 'CGImageDestination', 'CAFInstrumentChunk', 'AudioUnitMeterClipping', 'MorxChain', '__CTFontCollection', 'STEntryOne', 'STXEntryTwo', 'ExtendedNoteOnEvent', 'CGColorRenderingIntent', 'KerxSimpleArrayHeader', 'MorxTable', '_GLKVector3', '_GLKVector2', 'MortTable', 'CGPDFBox', 'AudioUnitParameterValueFromString', '__CFSocket', 'ALCdevice_struct', 'MIDINoteMessage', 'sfntFeatureHeader', 'CGRect', '__SCNetworkInterface', '__CFTree', 'MusicEventUserData', 'TrakTableData', 'GCQuaternion', 'MortContextualSubtable', '__CTRun', 'AudioUnitFrequencyResponseBin', 'MortChain', 'MorxInsertionSubtable', 'CGImageMetadata', 'gss_auth_identity', 'AudioUnitMIDIControlMapping', 'CAFChunkHeader', 'CGImagePropertyOrientation', 'CGPDFScanner', 'OpaqueMusicEventIterator', 'sfntDescriptorHeader', 'AudioUnitNodeConnection', 'OpaqueMIDIDeviceList', 'ExtendedAudioFormatInfo', 'BslnFormat1Part', 'sfntFontDescriptor', 'KernSimpleArrayHeader', '__CFRunLoopObserver', 'CGPatternTiling', 'MIDINotification', 'MorxLigatureSubtable', 'MessageComposeResult', 'MIDIThruConnectionEndpoint', 'MusicDeviceStdNoteParams', 'opaqueCMSimpleQueue', 'ALCcontext_struct', 'OpaqueAudioQueue', 'PropLookupSingle', 'CGInterpolationQuality', 'CGColor', 'AudioOutputUnitStartAtTimeParams', 'gss_name_t_desc_struct', 'CGFunctionCallbacks', 'CAFPacketTableHeader', 'AudioChannelDescription', 'sfntFeatureName', 'MorxContextualSubtable', 'CVSMPTETime', 'AudioValueRange', 'CGTextEncoding', 'AudioStreamBasicDescription', 'AUNodeRenderCallback', 'AudioPanningInfo', 'KerxOrderedListEntry', '__CFAllocator', 'OpaqueJSPropertyNameArray', '__SCDynamicStore', 'OpaqueMIDIEntity', '__CTRubyAnnotation', 'SCNVector4', 'CFHostClientContext', 'CFNetServiceClientContext', 'AudioUnitPresetMAS_SettingData', 'opaqueCMBufferQueueTriggerToken', 'AudioUnitProperty', 'CAFRegionChunk', 'CGPDFString', '__GLsync', '__CFStringTokenizer', 'JustWidthDeltaEntry', 'sfntVariationAxis', '__CFNetDiagnostic', 'CAFOverviewSample', 'sfntCMapEncoding', 'CGVector', '__SCNetworkService', 'opaqueCMSampleBuffer', 'AUHostVersionIdentifier', 'AudioBalanceFade', 'sfntFontRunFeature', 'KerxCoordinateAction', 'sfntCMapSubHeader', 'CVPlanarPixelBufferInfo', 'AUNumVersion', 'AUSamplerInstrumentData', 'AUPreset', '__CTRunDelegate', 'OpaqueAudioQueueProcessingTap', 'KerxTableHeader', '_NSZone', 'OpaqueExtAudioFile', '__CFRunLoopSource', '__CVMetalTextureCache', 'KerxAnchorPointAction', 'OpaqueJSString', 'AudioQueueParameterEvent', '__CFHTTPMessage', 'OpaqueCMClock', 'ScheduledAudioFileRegion', 'STEntryZero', 'AVAudio3DPoint', 'gss_channel_bindings_struct', 'sfntVariationHeader', 'AUChannelInfo', 'UIOffset', 'GLKEffectPropertyPrv', 'KerxStateHeader', 'CGLineJoin', 'CGPDFDocument', '__CFBag', 'KernOrderedListHeader', '__SCNetworkSet', '__SecKey', 'MIDIObjectAddRemoveNotification', 'AudioUnitParameter', 'JustPCActionSubrecord', 'AudioComponentDescription', 'AudioUnitParameterValueName', 'AudioUnitParameterEvent', 'KerxControlPointAction', 'AudioTimeStamp', 'KernKerningPair', 'gss_buffer_set_desc_struct', 'MortFeatureEntry', 'FontVariation', 'CAFStringID', 'LcarCaretClassEntry', 'AudioUnitParameterStringFromValue', 'ACErrorCode', 'ALMXGlyphEntry', 'LtagTable', '__CTTypesetter', 'AuthorizationOpaqueRef', 'UIEdgeInsets', 'CGPathElement', 'CAFMarker', 'KernTableHeader', 'NoteParamsControlValue', 'SSLContext', 'gss_cred_id_t_desc_struct', 'AudioUnitParameterNameInfo', 'CGDataConsumerCallbacks', 'ALMXHeader', 'CGLineCap', 'MIDIControlTransform', 'CGPDFArray', '__SecPolicy', 'AudioConverterPrimeInfo', '__CTTextTab', '__CFNetServiceMonitor', 'AUInputSamplesInOutputCallbackStruct', '__CTFramesetter', 'CGPDFDataFormat', 'STHeader', 'CVPlanarPixelBufferInfo_YCbCrPlanar', 'MIDIValueMap', 'JustDirectionTable', '__SCBondStatus', 'SFNTLookupSegmentHeader', 'OpaqueCMMemoryPool', 'CGPathDrawingMode', 'CGFont', '__SCNetworkReachability', 'AudioClassDescription', 'CGPoint', 'AVAudio3DVectorOrientation', 'CAFStrings', '__CFNetServiceBrowser', 'opaqueMTAudioProcessingTap', 'sfntNameRecord', 'CGPDFPage', 'CGLayer', 'ComponentInstanceRecord', 'CAFInfoStrings', 'HostCallbackInfo', 'MusicDeviceNoteParams', 'OpaqueVTCompressionSession', 'KernIndexArrayHeader', 'CVPlanarPixelBufferInfo_YCbCrBiPlanar', 'MusicTrackLoopInfo', 'opaqueCMFormatDescription', 'STClassTable', 'sfntDirectoryEntry', 'OpaqueCMTimebase', 'CGDataProviderDirectCallbacks', 'MIDIPacketList', 'CAFOverviewChunk', 'MIDIPacket', 'ScheduledAudioSlice', 'CGDataProviderSequentialCallbacks', 'AudioBuffer', 'MorxRearrangementSubtable', 'CGPatternCallbacks', 'AUDistanceAttenuationData', 'MIDIIOErrorNotification', 'CGPDFContentStream', 'IUnknownVTbl', 'MIDITransform', 'MortInsertionSubtable', 'CABarBeatTime', 'AudioBufferList', '__CVBuffer', 'AURenderCallbackStruct', 'STXEntryZero', 'JustPCDuctilityAction', 'OpaqueAudioQueueTimeline', 'VTDecompressionOutputCallbackRecord', 'OpaqueMIDIClient', '__CFPlugInInstance', 'AudioQueueBuffer', '__CFFileDescriptor', 'AudioUnitConnection', '_GKTurnBasedExchangeStatus', 'LcarCaretTable', 'CVPlanarComponentInfo', 'JustWidthDeltaGroup', 'OpaqueAudioComponent', 'ParameterEvent', '__CVPixelBufferPool', '__CTFont', 'CGColorSpace', 'CGSize', 'AUDependentParameter', 'MIDIDriverInterface', 'gss_krb5_rfc1964_keydata', '__CFDateFormatter', 'LtagStringRange', 'OpaqueVTDecompressionSession', 'gss_iov_buffer_desc_struct', 'AUPresetEvent', 'PropTable', 'KernOrderedListEntry', 'CF_BRIDGED_MUTABLE_TYPE', 'gss_OID_desc_struct', 'AudioUnitPresetMAS_Settings', 'AudioFileMarker', 'JustPCConditionalAddAction', 'BslnFormat3Part', '__CFNotificationCenter', 'MortSwashSubtable', 'AUParameterMIDIMapping', 'SCNVector3', 'OpaqueAudioConverter', 'MIDIRawData', 'sfntNameHeader', '__CFRunLoop', 'MFMailComposeResult', 'CATransform3D', 'OpbdSideValues', 'CAF_SMPTE_Time', '__SecAccessControl', 'JustPCAction', 'OpaqueVTFrameSilo', 'OpaqueVTMultiPassStorage', 'CGPathElementType', 'AudioFormatListItem', 'AudioUnitExternalBuffer', 'AudioFileRegion', 'AudioValueTranslation', 'CGImageMetadataTag', 'CAFPeakChunk', 'AudioBytePacketTranslation', 'sfntCMapHeader', '__CFURLEnumerator', 'STXHeader', 'CGPDFObjectType', 'SFNTLookupArrayHeader']) + +if __name__ == '__main__': # pragma: no cover + import os + import re + + FRAMEWORKS_PATH = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/' + frameworks = os.listdir(FRAMEWORKS_PATH) + + all_interfaces = set() + all_protocols = set() + all_primitives = set() + for framework in frameworks: + frameworkHeadersDir = FRAMEWORKS_PATH + framework + '/Headers/' + if not os.path.exists(frameworkHeadersDir): + continue + + headerFilenames = os.listdir(frameworkHeadersDir) + + for f in headerFilenames: + if not f.endswith('.h'): + continue + + headerFilePath = frameworkHeadersDir + f + content = open(headerFilePath).read() + res = re.findall('(?<=@interface )\w+', content) + for r in res: + all_interfaces.add(r) + + res = re.findall('(?<=@protocol )\w+', content) + for r in res: + all_protocols.add(r) + + res = re.findall('(?<=typedef enum )\w+', content) + for r in res: + all_primitives.add(r) + + res = re.findall('(?<=typedef struct )\w+', content) + for r in res: + all_primitives.add(r) + + res = re.findall('(?<=typedef const struct )\w+', content) + for r in res: + all_primitives.add(r) + + + print("ALL interfaces: \n") + print(all_interfaces) + + print("\nALL protocols: \n") + print(all_protocols) + + print("\nALL primitives: \n") + print(all_primitives) diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/_openedge_builtins.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/_openedge_builtins.py new file mode 100644 index 0000000000000000000000000000000000000000..0fa7d1b244ca9e2d5c7c724011bb467796cb8541 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/_openedge_builtins.py @@ -0,0 +1,2547 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers._openedge_builtins + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Builtin list for the OpenEdgeLexer. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +OPENEDGEKEYWORDS = ( + 'ABSOLUTE', + 'ABS', + 'ABSO', + 'ABSOL', + 'ABSOLU', + 'ABSOLUT', + 'ACCELERATOR', + 'ACCUMULATE', + 'ACCUM', + 'ACCUMU', + 'ACCUMUL', + 'ACCUMULA', + 'ACCUMULAT', + 'ACTIVE-FORM', + 'ACTIVE-WINDOW', + 'ADD', + 'ADD-BUFFER', + 'ADD-CALC-COLUMN', + 'ADD-COLUMNS-FROM', + 'ADD-EVENTS-PROCEDURE', + 'ADD-FIELDS-FROM', + 'ADD-FIRST', + 'ADD-INDEX-FIELD', + 'ADD-LAST', + 'ADD-LIKE-COLUMN', + 'ADD-LIKE-FIELD', + 'ADD-LIKE-INDEX', + 'ADD-NEW-FIELD', + 'ADD-NEW-INDEX', + 'ADD-SCHEMA-LOCATION', + 'ADD-SUPER-PROCEDURE', + 'ADM-DATA', + 'ADVISE', + 'ALERT-BOX', + 'ALIAS', + 'ALL', + 'ALLOW-COLUMN-SEARCHING', + 'ALLOW-REPLICATION', + 'ALTER', + 'ALWAYS-ON-TOP', + 'AMBIGUOUS', + 'AMBIG', + 'AMBIGU', + 'AMBIGUO', + 'AMBIGUOU', + 'ANALYZE', + 'ANALYZ', + 'AND', + 'ANSI-ONLY', + 'ANY', + 'ANYWHERE', + 'APPEND', + 'APPL-ALERT-BOXES', + 'APPL-ALERT', + 'APPL-ALERT-', + 'APPL-ALERT-B', + 'APPL-ALERT-BO', + 'APPL-ALERT-BOX', + 'APPL-ALERT-BOXE', + 'APPL-CONTEXT-ID', + 'APPLICATION', + 'APPLY', + 'APPSERVER-INFO', + 'APPSERVER-PASSWORD', + 'APPSERVER-USERID', + 'ARRAY-MESSAGE', + 'AS', + 'ASC', + 'ASCENDING', + 'ASCE', + 'ASCEN', + 'ASCEND', + 'ASCENDI', + 'ASCENDIN', + 'ASK-OVERWRITE', + 'ASSEMBLY', + 'ASSIGN', + 'ASYNCHRONOUS', + 'ASYNC-REQUEST-COUNT', + 'ASYNC-REQUEST-HANDLE', + 'AT', + 'ATTACHED-PAIRLIST', + 'ATTR-SPACE', + 'ATTR', + 'ATTRI', + 'ATTRIB', + 'ATTRIBU', + 'ATTRIBUT', + 'AUDIT-CONTROL', + 'AUDIT-ENABLED', + 'AUDIT-EVENT-CONTEXT', + 'AUDIT-POLICY', + 'AUTHENTICATION-FAILED', + 'AUTHORIZATION', + 'AUTO-COMPLETION', + 'AUTO-COMP', + 'AUTO-COMPL', + 'AUTO-COMPLE', + 'AUTO-COMPLET', + 'AUTO-COMPLETI', + 'AUTO-COMPLETIO', + 'AUTO-ENDKEY', + 'AUTO-END-KEY', + 'AUTO-GO', + 'AUTO-INDENT', + 'AUTO-IND', + 'AUTO-INDE', + 'AUTO-INDEN', + 'AUTOMATIC', + 'AUTO-RESIZE', + 'AUTO-RETURN', + 'AUTO-RET', + 'AUTO-RETU', + 'AUTO-RETUR', + 'AUTO-SYNCHRONIZE', + 'AUTO-ZAP', + 'AUTO-Z', + 'AUTO-ZA', + 'AVAILABLE', + 'AVAIL', + 'AVAILA', + 'AVAILAB', + 'AVAILABL', + 'AVAILABLE-FORMATS', + 'AVERAGE', + 'AVE', + 'AVER', + 'AVERA', + 'AVERAG', + 'AVG', + 'BACKGROUND', + 'BACK', + 'BACKG', + 'BACKGR', + 'BACKGRO', + 'BACKGROU', + 'BACKGROUN', + 'BACKWARDS', + 'BACKWARD', + 'BASE64-DECODE', + 'BASE64-ENCODE', + 'BASE-ADE', + 'BASE-KEY', + 'BATCH-MODE', + 'BATCH', + 'BATCH-', + 'BATCH-M', + 'BATCH-MO', + 'BATCH-MOD', + 'BATCH-SIZE', + 'BEFORE-HIDE', + 'BEFORE-H', + 'BEFORE-HI', + 'BEFORE-HID', + 'BEGIN-EVENT-GROUP', + 'BEGINS', + 'BELL', + 'BETWEEN', + 'BGCOLOR', + 'BGC', + 'BGCO', + 'BGCOL', + 'BGCOLO', + 'BIG-ENDIAN', + 'BINARY', + 'BIND', + 'BIND-WHERE', + 'BLANK', + 'BLOCK-ITERATION-DISPLAY', + 'BORDER-BOTTOM-CHARS', + 'BORDER-B', + 'BORDER-BO', + 'BORDER-BOT', + 'BORDER-BOTT', + 'BORDER-BOTTO', + 'BORDER-BOTTOM-PIXELS', + 'BORDER-BOTTOM-P', + 'BORDER-BOTTOM-PI', + 'BORDER-BOTTOM-PIX', + 'BORDER-BOTTOM-PIXE', + 'BORDER-BOTTOM-PIXEL', + 'BORDER-LEFT-CHARS', + 'BORDER-L', + 'BORDER-LE', + 'BORDER-LEF', + 'BORDER-LEFT', + 'BORDER-LEFT-', + 'BORDER-LEFT-C', + 'BORDER-LEFT-CH', + 'BORDER-LEFT-CHA', + 'BORDER-LEFT-CHAR', + 'BORDER-LEFT-PIXELS', + 'BORDER-LEFT-P', + 'BORDER-LEFT-PI', + 'BORDER-LEFT-PIX', + 'BORDER-LEFT-PIXE', + 'BORDER-LEFT-PIXEL', + 'BORDER-RIGHT-CHARS', + 'BORDER-R', + 'BORDER-RI', + 'BORDER-RIG', + 'BORDER-RIGH', + 'BORDER-RIGHT', + 'BORDER-RIGHT-', + 'BORDER-RIGHT-C', + 'BORDER-RIGHT-CH', + 'BORDER-RIGHT-CHA', + 'BORDER-RIGHT-CHAR', + 'BORDER-RIGHT-PIXELS', + 'BORDER-RIGHT-P', + 'BORDER-RIGHT-PI', + 'BORDER-RIGHT-PIX', + 'BORDER-RIGHT-PIXE', + 'BORDER-RIGHT-PIXEL', + 'BORDER-TOP-CHARS', + 'BORDER-T', + 'BORDER-TO', + 'BORDER-TOP', + 'BORDER-TOP-', + 'BORDER-TOP-C', + 'BORDER-TOP-CH', + 'BORDER-TOP-CHA', + 'BORDER-TOP-CHAR', + 'BORDER-TOP-PIXELS', + 'BORDER-TOP-P', + 'BORDER-TOP-PI', + 'BORDER-TOP-PIX', + 'BORDER-TOP-PIXE', + 'BORDER-TOP-PIXEL', + 'BOX', + 'BOX-SELECTABLE', + 'BOX-SELECT', + 'BOX-SELECTA', + 'BOX-SELECTAB', + 'BOX-SELECTABL', + 'BREAK', + 'BROWSE', + 'BUFFER', + 'BUFFER-CHARS', + 'BUFFER-COMPARE', + 'BUFFER-COPY', + 'BUFFER-CREATE', + 'BUFFER-DELETE', + 'BUFFER-FIELD', + 'BUFFER-HANDLE', + 'BUFFER-LINES', + 'BUFFER-NAME', + 'BUFFER-RELEASE', + 'BUFFER-VALUE', + 'BUTTON', + 'BUTTONS', + 'BY', + 'BY-POINTER', + 'BY-VARIANT-POINTER', + 'CACHE', + 'CACHE-SIZE', + 'CALL', + 'CALL-NAME', + 'CALL-TYPE', + 'CANCEL-BREAK', + 'CANCEL-BUTTON', + 'CAN-CREATE', + 'CAN-DELETE', + 'CAN-DO', + 'CAN-FIND', + 'CAN-QUERY', + 'CAN-READ', + 'CAN-SET', + 'CAN-WRITE', + 'CAPS', + 'CAREFUL-PAINT', + 'CASE', + 'CASE-SENSITIVE', + 'CASE-SEN', + 'CASE-SENS', + 'CASE-SENSI', + 'CASE-SENSIT', + 'CASE-SENSITI', + 'CASE-SENSITIV', + 'CAST', + 'CATCH', + 'CDECL', + 'CENTERED', + 'CENTER', + 'CENTERE', + 'CHAINED', + 'CHARACTER_LENGTH', + 'CHARSET', + 'CHECK', + 'CHECKED', + 'CHOOSE', + 'CHR', + 'CLASS', + 'CLASS-TYPE', + 'CLEAR', + 'CLEAR-APPL-CONTEXT', + 'CLEAR-LOG', + 'CLEAR-SELECTION', + 'CLEAR-SELECT', + 'CLEAR-SELECTI', + 'CLEAR-SELECTIO', + 'CLEAR-SORT-ARROWS', + 'CLEAR-SORT-ARROW', + 'CLIENT-CONNECTION-ID', + 'CLIENT-PRINCIPAL', + 'CLIENT-TTY', + 'CLIENT-TYPE', + 'CLIENT-WORKSTATION', + 'CLIPBOARD', + 'CLOSE', + 'CLOSE-LOG', + 'CODE', + 'CODEBASE-LOCATOR', + 'CODEPAGE', + 'CODEPAGE-CONVERT', + 'COLLATE', + 'COL-OF', + 'COLON', + 'COLON-ALIGNED', + 'COLON-ALIGN', + 'COLON-ALIGNE', + 'COLOR', + 'COLOR-TABLE', + 'COLUMN', + 'COL', + 'COLU', + 'COLUM', + 'COLUMN-BGCOLOR', + 'COLUMN-DCOLOR', + 'COLUMN-FGCOLOR', + 'COLUMN-FONT', + 'COLUMN-LABEL', + 'COLUMN-LAB', + 'COLUMN-LABE', + 'COLUMN-MOVABLE', + 'COLUMN-OF', + 'COLUMN-PFCOLOR', + 'COLUMN-READ-ONLY', + 'COLUMN-RESIZABLE', + 'COLUMNS', + 'COLUMN-SCROLLING', + 'COMBO-BOX', + 'COMMAND', + 'COMPARES', + 'COMPILE', + 'COMPILER', + 'COMPLETE', + 'COM-SELF', + 'CONFIG-NAME', + 'CONNECT', + 'CONNECTED', + 'CONSTRUCTOR', + 'CONTAINS', + 'CONTENTS', + 'CONTEXT', + 'CONTEXT-HELP', + 'CONTEXT-HELP-FILE', + 'CONTEXT-HELP-ID', + 'CONTEXT-POPUP', + 'CONTROL', + 'CONTROL-BOX', + 'CONTROL-FRAME', + 'CONVERT', + 'CONVERT-3D-COLORS', + 'CONVERT-TO-OFFSET', + 'CONVERT-TO-OFFS', + 'CONVERT-TO-OFFSE', + 'COPY-DATASET', + 'COPY-LOB', + 'COPY-SAX-ATTRIBUTES', + 'COPY-TEMP-TABLE', + 'COUNT', + 'COUNT-OF', + 'CPCASE', + 'CPCOLL', + 'CPINTERNAL', + 'CPLOG', + 'CPPRINT', + 'CPRCODEIN', + 'CPRCODEOUT', + 'CPSTREAM', + 'CPTERM', + 'CRC-VALUE', + 'CREATE', + 'CREATE-LIKE', + 'CREATE-LIKE-SEQUENTIAL', + 'CREATE-NODE-NAMESPACE', + 'CREATE-RESULT-LIST-ENTRY', + 'CREATE-TEST-FILE', + 'CURRENT', + 'CURRENT_DATE', + 'CURRENT-CHANGED', + 'CURRENT-COLUMN', + 'CURRENT-ENVIRONMENT', + 'CURRENT-ENV', + 'CURRENT-ENVI', + 'CURRENT-ENVIR', + 'CURRENT-ENVIRO', + 'CURRENT-ENVIRON', + 'CURRENT-ENVIRONM', + 'CURRENT-ENVIRONME', + 'CURRENT-ENVIRONMEN', + 'CURRENT-ITERATION', + 'CURRENT-LANGUAGE', + 'CURRENT-LANG', + 'CURRENT-LANGU', + 'CURRENT-LANGUA', + 'CURRENT-LANGUAG', + 'CURRENT-QUERY', + 'CURRENT-RESULT-ROW', + 'CURRENT-ROW-MODIFIED', + 'CURRENT-VALUE', + 'CURRENT-WINDOW', + 'CURSOR', + 'CURS', + 'CURSO', + 'CURSOR-CHAR', + 'CURSOR-LINE', + 'CURSOR-OFFSET', + 'DATABASE', + 'DATA-BIND', + 'DATA-ENTRY-RETURN', + 'DATA-ENTRY-RET', + 'DATA-ENTRY-RETU', + 'DATA-ENTRY-RETUR', + 'DATA-RELATION', + 'DATA-REL', + 'DATA-RELA', + 'DATA-RELAT', + 'DATA-RELATI', + 'DATA-RELATIO', + 'DATASERVERS', + 'DATASET', + 'DATASET-HANDLE', + 'DATA-SOURCE', + 'DATA-SOURCE-COMPLETE-MAP', + 'DATA-SOURCE-MODIFIED', + 'DATA-SOURCE-ROWID', + 'DATA-TYPE', + 'DATA-T', + 'DATA-TY', + 'DATA-TYP', + 'DATE-FORMAT', + 'DATE-F', + 'DATE-FO', + 'DATE-FOR', + 'DATE-FORM', + 'DATE-FORMA', + 'DAY', + 'DBCODEPAGE', + 'DBCOLLATION', + 'DBNAME', + 'DBPARAM', + 'DB-REFERENCES', + 'DBRESTRICTIONS', + 'DBREST', + 'DBRESTR', + 'DBRESTRI', + 'DBRESTRIC', + 'DBRESTRICT', + 'DBRESTRICTI', + 'DBRESTRICTIO', + 'DBRESTRICTION', + 'DBTASKID', + 'DBTYPE', + 'DBVERSION', + 'DBVERS', + 'DBVERSI', + 'DBVERSIO', + 'DCOLOR', + 'DDE', + 'DDE-ERROR', + 'DDE-ID', + 'DDE-I', + 'DDE-ITEM', + 'DDE-NAME', + 'DDE-TOPIC', + 'DEBLANK', + 'DEBUG', + 'DEBU', + 'DEBUG-ALERT', + 'DEBUGGER', + 'DEBUG-LIST', + 'DECIMALS', + 'DECLARE', + 'DECLARE-NAMESPACE', + 'DECRYPT', + 'DEFAULT', + 'DEFAULT-BUFFER-HANDLE', + 'DEFAULT-BUTTON', + 'DEFAUT-B', + 'DEFAUT-BU', + 'DEFAUT-BUT', + 'DEFAUT-BUTT', + 'DEFAUT-BUTTO', + 'DEFAULT-COMMIT', + 'DEFAULT-EXTENSION', + 'DEFAULT-EX', + 'DEFAULT-EXT', + 'DEFAULT-EXTE', + 'DEFAULT-EXTEN', + 'DEFAULT-EXTENS', + 'DEFAULT-EXTENSI', + 'DEFAULT-EXTENSIO', + 'DEFAULT-NOXLATE', + 'DEFAULT-NOXL', + 'DEFAULT-NOXLA', + 'DEFAULT-NOXLAT', + 'DEFAULT-VALUE', + 'DEFAULT-WINDOW', + 'DEFINED', + 'DEFINE-USER-EVENT-MANAGER', + 'DELETE', + 'DEL', + 'DELE', + 'DELET', + 'DELETE-CHARACTER', + 'DELETE-CHAR', + 'DELETE-CHARA', + 'DELETE-CHARAC', + 'DELETE-CHARACT', + 'DELETE-CHARACTE', + 'DELETE-CURRENT-ROW', + 'DELETE-LINE', + 'DELETE-RESULT-LIST-ENTRY', + 'DELETE-SELECTED-ROW', + 'DELETE-SELECTED-ROWS', + 'DELIMITER', + 'DESC', + 'DESCENDING', + 'DESCE', + 'DESCEN', + 'DESCEND', + 'DESCENDI', + 'DESCENDIN', + 'DESELECT-FOCUSED-ROW', + 'DESELECTION', + 'DESELECT-ROWS', + 'DESELECT-SELECTED-ROW', + 'DESTRUCTOR', + 'DIALOG-BOX', + 'DICTIONARY', + 'DICT', + 'DICTI', + 'DICTIO', + 'DICTION', + 'DICTIONA', + 'DICTIONAR', + 'DIR', + 'DISABLE', + 'DISABLE-AUTO-ZAP', + 'DISABLED', + 'DISABLE-DUMP-TRIGGERS', + 'DISABLE-LOAD-TRIGGERS', + 'DISCONNECT', + 'DISCON', + 'DISCONN', + 'DISCONNE', + 'DISCONNEC', + 'DISP', + 'DISPLAY', + 'DISPL', + 'DISPLA', + 'DISPLAY-MESSAGE', + 'DISPLAY-TYPE', + 'DISPLAY-T', + 'DISPLAY-TY', + 'DISPLAY-TYP', + 'DISTINCT', + 'DO', + 'DOMAIN-DESCRIPTION', + 'DOMAIN-NAME', + 'DOMAIN-TYPE', + 'DOS', + 'DOUBLE', + 'DOWN', + 'DRAG-ENABLED', + 'DROP', + 'DROP-DOWN', + 'DROP-DOWN-LIST', + 'DROP-FILE-NOTIFY', + 'DROP-TARGET', + 'DUMP', + 'DYNAMIC', + 'DYNAMIC-FUNCTION', + 'EACH', + 'ECHO', + 'EDGE-CHARS', + 'EDGE', + 'EDGE-', + 'EDGE-C', + 'EDGE-CH', + 'EDGE-CHA', + 'EDGE-CHAR', + 'EDGE-PIXELS', + 'EDGE-P', + 'EDGE-PI', + 'EDGE-PIX', + 'EDGE-PIXE', + 'EDGE-PIXEL', + 'EDIT-CAN-PASTE', + 'EDIT-CAN-UNDO', + 'EDIT-CLEAR', + 'EDIT-COPY', + 'EDIT-CUT', + 'EDITING', + 'EDITOR', + 'EDIT-PASTE', + 'EDIT-UNDO', + 'ELSE', + 'EMPTY', + 'EMPTY-TEMP-TABLE', + 'ENABLE', + 'ENABLED-FIELDS', + 'ENCODE', + 'ENCRYPT', + 'ENCRYPT-AUDIT-MAC-KEY', + 'ENCRYPTION-SALT', + 'END', + 'END-DOCUMENT', + 'END-ELEMENT', + 'END-EVENT-GROUP', + 'END-FILE-DROP', + 'ENDKEY', + 'END-KEY', + 'END-MOVE', + 'END-RESIZE', + 'END-ROW-RESIZE', + 'END-USER-PROMPT', + 'ENTERED', + 'ENTRY', + 'EQ', + 'ERROR', + 'ERROR-COLUMN', + 'ERROR-COL', + 'ERROR-COLU', + 'ERROR-COLUM', + 'ERROR-ROW', + 'ERROR-STACK-TRACE', + 'ERROR-STATUS', + 'ERROR-STAT', + 'ERROR-STATU', + 'ESCAPE', + 'ETIME', + 'EVENT-GROUP-ID', + 'EVENT-PROCEDURE', + 'EVENT-PROCEDURE-CONTEXT', + 'EVENTS', + 'EVENT', + 'EVENT-TYPE', + 'EVENT-T', + 'EVENT-TY', + 'EVENT-TYP', + 'EXCEPT', + 'EXCLUSIVE-ID', + 'EXCLUSIVE-LOCK', + 'EXCLUSIVE', + 'EXCLUSIVE-', + 'EXCLUSIVE-L', + 'EXCLUSIVE-LO', + 'EXCLUSIVE-LOC', + 'EXCLUSIVE-WEB-USER', + 'EXECUTE', + 'EXISTS', + 'EXP', + 'EXPAND', + 'EXPANDABLE', + 'EXPLICIT', + 'EXPORT', + 'EXPORT-PRINCIPAL', + 'EXTENDED', + 'EXTENT', + 'EXTERNAL', + 'FALSE', + 'FETCH', + 'FETCH-SELECTED-ROW', + 'FGCOLOR', + 'FGC', + 'FGCO', + 'FGCOL', + 'FGCOLO', + 'FIELD', + 'FIELDS', + 'FILE', + 'FILE-CREATE-DATE', + 'FILE-CREATE-TIME', + 'FILE-INFORMATION', + 'FILE-INFO', + 'FILE-INFOR', + 'FILE-INFORM', + 'FILE-INFORMA', + 'FILE-INFORMAT', + 'FILE-INFORMATI', + 'FILE-INFORMATIO', + 'FILE-MOD-DATE', + 'FILE-MOD-TIME', + 'FILENAME', + 'FILE-NAME', + 'FILE-OFFSET', + 'FILE-OFF', + 'FILE-OFFS', + 'FILE-OFFSE', + 'FILE-SIZE', + 'FILE-TYPE', + 'FILL', + 'FILLED', + 'FILL-IN', + 'FILTERS', + 'FINAL', + 'FINALLY', + 'FIND', + 'FIND-BY-ROWID', + 'FIND-CASE-SENSITIVE', + 'FIND-CURRENT', + 'FINDER', + 'FIND-FIRST', + 'FIND-GLOBAL', + 'FIND-LAST', + 'FIND-NEXT-OCCURRENCE', + 'FIND-PREV-OCCURRENCE', + 'FIND-SELECT', + 'FIND-UNIQUE', + 'FIND-WRAP-AROUND', + 'FIRST', + 'FIRST-ASYNCH-REQUEST', + 'FIRST-CHILD', + 'FIRST-COLUMN', + 'FIRST-FORM', + 'FIRST-OBJECT', + 'FIRST-OF', + 'FIRST-PROCEDURE', + 'FIRST-PROC', + 'FIRST-PROCE', + 'FIRST-PROCED', + 'FIRST-PROCEDU', + 'FIRST-PROCEDUR', + 'FIRST-SERVER', + 'FIRST-TAB-ITEM', + 'FIRST-TAB-I', + 'FIRST-TAB-IT', + 'FIRST-TAB-ITE', + 'FIT-LAST-COLUMN', + 'FIXED-ONLY', + 'FLAT-BUTTON', + 'FLOAT', + 'FOCUS', + 'FOCUSED-ROW', + 'FOCUSED-ROW-SELECTED', + 'FONT', + 'FONT-TABLE', + 'FOR', + 'FORCE-FILE', + 'FOREGROUND', + 'FORE', + 'FOREG', + 'FOREGR', + 'FOREGRO', + 'FOREGROU', + 'FOREGROUN', + 'FORM', + 'FORMAT', + 'FORMA', + 'FORMATTED', + 'FORMATTE', + 'FORM-LONG-INPUT', + 'FORWARD', + 'FORWARDS', + 'FRAGMENT', + 'FRAGMEN', + 'FRAME', + 'FRAM', + 'FRAME-COL', + 'FRAME-DB', + 'FRAME-DOWN', + 'FRAME-FIELD', + 'FRAME-FILE', + 'FRAME-INDEX', + 'FRAME-INDE', + 'FRAME-LINE', + 'FRAME-NAME', + 'FRAME-ROW', + 'FRAME-SPACING', + 'FRAME-SPA', + 'FRAME-SPAC', + 'FRAME-SPACI', + 'FRAME-SPACIN', + 'FRAME-VALUE', + 'FRAME-VAL', + 'FRAME-VALU', + 'FRAME-X', + 'FRAME-Y', + 'FREQUENCY', + 'FROM', + 'FROM-CHARS', + 'FROM-C', + 'FROM-CH', + 'FROM-CHA', + 'FROM-CHAR', + 'FROM-CURRENT', + 'FROM-CUR', + 'FROM-CURR', + 'FROM-CURRE', + 'FROM-CURREN', + 'FROM-PIXELS', + 'FROM-P', + 'FROM-PI', + 'FROM-PIX', + 'FROM-PIXE', + 'FROM-PIXEL', + 'FULL-HEIGHT-CHARS', + 'FULL-HEIGHT', + 'FULL-HEIGHT-', + 'FULL-HEIGHT-C', + 'FULL-HEIGHT-CH', + 'FULL-HEIGHT-CHA', + 'FULL-HEIGHT-CHAR', + 'FULL-HEIGHT-PIXELS', + 'FULL-HEIGHT-P', + 'FULL-HEIGHT-PI', + 'FULL-HEIGHT-PIX', + 'FULL-HEIGHT-PIXE', + 'FULL-HEIGHT-PIXEL', + 'FULL-PATHNAME', + 'FULL-PATHN', + 'FULL-PATHNA', + 'FULL-PATHNAM', + 'FULL-WIDTH-CHARS', + 'FULL-WIDTH', + 'FULL-WIDTH-', + 'FULL-WIDTH-C', + 'FULL-WIDTH-CH', + 'FULL-WIDTH-CHA', + 'FULL-WIDTH-CHAR', + 'FULL-WIDTH-PIXELS', + 'FULL-WIDTH-P', + 'FULL-WIDTH-PI', + 'FULL-WIDTH-PIX', + 'FULL-WIDTH-PIXE', + 'FULL-WIDTH-PIXEL', + 'FUNCTION', + 'FUNCTION-CALL-TYPE', + 'GATEWAYS', + 'GATEWAY', + 'GE', + 'GENERATE-MD5', + 'GENERATE-PBE-KEY', + 'GENERATE-PBE-SALT', + 'GENERATE-RANDOM-KEY', + 'GENERATE-UUID', + 'GET', + 'GET-ATTR-CALL-TYPE', + 'GET-ATTRIBUTE-NODE', + 'GET-BINARY-DATA', + 'GET-BLUE-VALUE', + 'GET-BLUE', + 'GET-BLUE-', + 'GET-BLUE-V', + 'GET-BLUE-VA', + 'GET-BLUE-VAL', + 'GET-BLUE-VALU', + 'GET-BROWSE-COLUMN', + 'GET-BUFFER-HANDLEGETBYTE', + 'GET-BYTE', + 'GET-CALLBACK-PROC-CONTEXT', + 'GET-CALLBACK-PROC-NAME', + 'GET-CGI-LIST', + 'GET-CGI-LONG-VALUE', + 'GET-CGI-VALUE', + 'GET-CODEPAGES', + 'GET-COLLATIONS', + 'GET-CONFIG-VALUE', + 'GET-CURRENT', + 'GET-DOUBLE', + 'GET-DROPPED-FILE', + 'GET-DYNAMIC', + 'GET-ERROR-COLUMN', + 'GET-ERROR-ROW', + 'GET-FILE', + 'GET-FILE-NAME', + 'GET-FILE-OFFSET', + 'GET-FILE-OFFSE', + 'GET-FIRST', + 'GET-FLOAT', + 'GET-GREEN-VALUE', + 'GET-GREEN', + 'GET-GREEN-', + 'GET-GREEN-V', + 'GET-GREEN-VA', + 'GET-GREEN-VAL', + 'GET-GREEN-VALU', + 'GET-INDEX-BY-NAMESPACE-NAME', + 'GET-INDEX-BY-QNAME', + 'GET-INT64', + 'GET-ITERATION', + 'GET-KEY-VALUE', + 'GET-KEY-VAL', + 'GET-KEY-VALU', + 'GET-LAST', + 'GET-LOCALNAME-BY-INDEX', + 'GET-LONG', + 'GET-MESSAGE', + 'GET-NEXT', + 'GET-NUMBER', + 'GET-POINTER-VALUE', + 'GET-PREV', + 'GET-PRINTERS', + 'GET-PROPERTY', + 'GET-QNAME-BY-INDEX', + 'GET-RED-VALUE', + 'GET-RED', + 'GET-RED-', + 'GET-RED-V', + 'GET-RED-VA', + 'GET-RED-VAL', + 'GET-RED-VALU', + 'GET-REPOSITIONED-ROW', + 'GET-RGB-VALUE', + 'GET-SELECTED-WIDGET', + 'GET-SELECTED', + 'GET-SELECTED-', + 'GET-SELECTED-W', + 'GET-SELECTED-WI', + 'GET-SELECTED-WID', + 'GET-SELECTED-WIDG', + 'GET-SELECTED-WIDGE', + 'GET-SHORT', + 'GET-SIGNATURE', + 'GET-SIZE', + 'GET-STRING', + 'GET-TAB-ITEM', + 'GET-TEXT-HEIGHT-CHARS', + 'GET-TEXT-HEIGHT', + 'GET-TEXT-HEIGHT-', + 'GET-TEXT-HEIGHT-C', + 'GET-TEXT-HEIGHT-CH', + 'GET-TEXT-HEIGHT-CHA', + 'GET-TEXT-HEIGHT-CHAR', + 'GET-TEXT-HEIGHT-PIXELS', + 'GET-TEXT-HEIGHT-P', + 'GET-TEXT-HEIGHT-PI', + 'GET-TEXT-HEIGHT-PIX', + 'GET-TEXT-HEIGHT-PIXE', + 'GET-TEXT-HEIGHT-PIXEL', + 'GET-TEXT-WIDTH-CHARS', + 'GET-TEXT-WIDTH', + 'GET-TEXT-WIDTH-', + 'GET-TEXT-WIDTH-C', + 'GET-TEXT-WIDTH-CH', + 'GET-TEXT-WIDTH-CHA', + 'GET-TEXT-WIDTH-CHAR', + 'GET-TEXT-WIDTH-PIXELS', + 'GET-TEXT-WIDTH-P', + 'GET-TEXT-WIDTH-PI', + 'GET-TEXT-WIDTH-PIX', + 'GET-TEXT-WIDTH-PIXE', + 'GET-TEXT-WIDTH-PIXEL', + 'GET-TYPE-BY-INDEX', + 'GET-TYPE-BY-NAMESPACE-NAME', + 'GET-TYPE-BY-QNAME', + 'GET-UNSIGNED-LONG', + 'GET-UNSIGNED-SHORT', + 'GET-URI-BY-INDEX', + 'GET-VALUE-BY-INDEX', + 'GET-VALUE-BY-NAMESPACE-NAME', + 'GET-VALUE-BY-QNAME', + 'GET-WAIT-STATE', + 'GLOBAL', + 'GO-ON', + 'GO-PENDING', + 'GO-PEND', + 'GO-PENDI', + 'GO-PENDIN', + 'GRANT', + 'GRAPHIC-EDGE', + 'GRAPHIC-E', + 'GRAPHIC-ED', + 'GRAPHIC-EDG', + 'GRID-FACTOR-HORIZONTAL', + 'GRID-FACTOR-H', + 'GRID-FACTOR-HO', + 'GRID-FACTOR-HOR', + 'GRID-FACTOR-HORI', + 'GRID-FACTOR-HORIZ', + 'GRID-FACTOR-HORIZO', + 'GRID-FACTOR-HORIZON', + 'GRID-FACTOR-HORIZONT', + 'GRID-FACTOR-HORIZONTA', + 'GRID-FACTOR-VERTICAL', + 'GRID-FACTOR-V', + 'GRID-FACTOR-VE', + 'GRID-FACTOR-VER', + 'GRID-FACTOR-VERT', + 'GRID-FACTOR-VERTI', + 'GRID-FACTOR-VERTIC', + 'GRID-FACTOR-VERTICA', + 'GRID-SNAP', + 'GRID-UNIT-HEIGHT-CHARS', + 'GRID-UNIT-HEIGHT', + 'GRID-UNIT-HEIGHT-', + 'GRID-UNIT-HEIGHT-C', + 'GRID-UNIT-HEIGHT-CH', + 'GRID-UNIT-HEIGHT-CHA', + 'GRID-UNIT-HEIGHT-PIXELS', + 'GRID-UNIT-HEIGHT-P', + 'GRID-UNIT-HEIGHT-PI', + 'GRID-UNIT-HEIGHT-PIX', + 'GRID-UNIT-HEIGHT-PIXE', + 'GRID-UNIT-HEIGHT-PIXEL', + 'GRID-UNIT-WIDTH-CHARS', + 'GRID-UNIT-WIDTH', + 'GRID-UNIT-WIDTH-', + 'GRID-UNIT-WIDTH-C', + 'GRID-UNIT-WIDTH-CH', + 'GRID-UNIT-WIDTH-CHA', + 'GRID-UNIT-WIDTH-CHAR', + 'GRID-UNIT-WIDTH-PIXELS', + 'GRID-UNIT-WIDTH-P', + 'GRID-UNIT-WIDTH-PI', + 'GRID-UNIT-WIDTH-PIX', + 'GRID-UNIT-WIDTH-PIXE', + 'GRID-UNIT-WIDTH-PIXEL', + 'GRID-VISIBLE', + 'GROUP', + 'GT', + 'GUID', + 'HANDLER', + 'HAS-RECORDS', + 'HAVING', + 'HEADER', + 'HEIGHT-CHARS', + 'HEIGHT', + 'HEIGHT-', + 'HEIGHT-C', + 'HEIGHT-CH', + 'HEIGHT-CHA', + 'HEIGHT-CHAR', + 'HEIGHT-PIXELS', + 'HEIGHT-P', + 'HEIGHT-PI', + 'HEIGHT-PIX', + 'HEIGHT-PIXE', + 'HEIGHT-PIXEL', + 'HELP', + 'HEX-DECODE', + 'HEX-ENCODE', + 'HIDDEN', + 'HIDE', + 'HORIZONTAL', + 'HORI', + 'HORIZ', + 'HORIZO', + 'HORIZON', + 'HORIZONT', + 'HORIZONTA', + 'HOST-BYTE-ORDER', + 'HTML-CHARSET', + 'HTML-END-OF-LINE', + 'HTML-END-OF-PAGE', + 'HTML-FRAME-BEGIN', + 'HTML-FRAME-END', + 'HTML-HEADER-BEGIN', + 'HTML-HEADER-END', + 'HTML-TITLE-BEGIN', + 'HTML-TITLE-END', + 'HWND', + 'ICON', + 'IF', + 'IMAGE', + 'IMAGE-DOWN', + 'IMAGE-INSENSITIVE', + 'IMAGE-SIZE', + 'IMAGE-SIZE-CHARS', + 'IMAGE-SIZE-C', + 'IMAGE-SIZE-CH', + 'IMAGE-SIZE-CHA', + 'IMAGE-SIZE-CHAR', + 'IMAGE-SIZE-PIXELS', + 'IMAGE-SIZE-P', + 'IMAGE-SIZE-PI', + 'IMAGE-SIZE-PIX', + 'IMAGE-SIZE-PIXE', + 'IMAGE-SIZE-PIXEL', + 'IMAGE-UP', + 'IMMEDIATE-DISPLAY', + 'IMPLEMENTS', + 'IMPORT', + 'IMPORT-PRINCIPAL', + 'IN', + 'INCREMENT-EXCLUSIVE-ID', + 'INDEX', + 'INDEXED-REPOSITION', + 'INDEX-HINT', + 'INDEX-INFORMATION', + 'INDICATOR', + 'INFORMATION', + 'INFO', + 'INFOR', + 'INFORM', + 'INFORMA', + 'INFORMAT', + 'INFORMATI', + 'INFORMATIO', + 'IN-HANDLE', + 'INHERIT-BGCOLOR', + 'INHERIT-BGC', + 'INHERIT-BGCO', + 'INHERIT-BGCOL', + 'INHERIT-BGCOLO', + 'INHERIT-FGCOLOR', + 'INHERIT-FGC', + 'INHERIT-FGCO', + 'INHERIT-FGCOL', + 'INHERIT-FGCOLO', + 'INHERITS', + 'INITIAL', + 'INIT', + 'INITI', + 'INITIA', + 'INITIAL-DIR', + 'INITIAL-FILTER', + 'INITIALIZE-DOCUMENT-TYPE', + 'INITIATE', + 'INNER-CHARS', + 'INNER-LINES', + 'INPUT', + 'INPUT-OUTPUT', + 'INPUT-O', + 'INPUT-OU', + 'INPUT-OUT', + 'INPUT-OUTP', + 'INPUT-OUTPU', + 'INPUT-VALUE', + 'INSERT', + 'INSERT-ATTRIBUTE', + 'INSERT-BACKTAB', + 'INSERT-B', + 'INSERT-BA', + 'INSERT-BAC', + 'INSERT-BACK', + 'INSERT-BACKT', + 'INSERT-BACKTA', + 'INSERT-FILE', + 'INSERT-ROW', + 'INSERT-STRING', + 'INSERT-TAB', + 'INSERT-T', + 'INSERT-TA', + 'INTERFACE', + 'INTERNAL-ENTRIES', + 'INTO', + 'INVOKE', + 'IS', + 'IS-ATTR-SPACE', + 'IS-ATTR', + 'IS-ATTR-', + 'IS-ATTR-S', + 'IS-ATTR-SP', + 'IS-ATTR-SPA', + 'IS-ATTR-SPAC', + 'IS-CLASS', + 'IS-CLAS', + 'IS-LEAD-BYTE', + 'IS-OPEN', + 'IS-PARAMETER-SET', + 'IS-ROW-SELECTED', + 'IS-SELECTED', + 'ITEM', + 'ITEMS-PER-ROW', + 'JOIN', + 'JOIN-BY-SQLDB', + 'KBLABEL', + 'KEEP-CONNECTION-OPEN', + 'KEEP-FRAME-Z-ORDER', + 'KEEP-FRAME-Z', + 'KEEP-FRAME-Z-', + 'KEEP-FRAME-Z-O', + 'KEEP-FRAME-Z-OR', + 'KEEP-FRAME-Z-ORD', + 'KEEP-FRAME-Z-ORDE', + 'KEEP-MESSAGES', + 'KEEP-SECURITY-CACHE', + 'KEEP-TAB-ORDER', + 'KEY', + 'KEYCODE', + 'KEY-CODE', + 'KEYFUNCTION', + 'KEYFUNC', + 'KEYFUNCT', + 'KEYFUNCTI', + 'KEYFUNCTIO', + 'KEY-FUNCTION', + 'KEY-FUNC', + 'KEY-FUNCT', + 'KEY-FUNCTI', + 'KEY-FUNCTIO', + 'KEYLABEL', + 'KEY-LABEL', + 'KEYS', + 'KEYWORD', + 'KEYWORD-ALL', + 'LABEL', + 'LABEL-BGCOLOR', + 'LABEL-BGC', + 'LABEL-BGCO', + 'LABEL-BGCOL', + 'LABEL-BGCOLO', + 'LABEL-DCOLOR', + 'LABEL-DC', + 'LABEL-DCO', + 'LABEL-DCOL', + 'LABEL-DCOLO', + 'LABEL-FGCOLOR', + 'LABEL-FGC', + 'LABEL-FGCO', + 'LABEL-FGCOL', + 'LABEL-FGCOLO', + 'LABEL-FONT', + 'LABEL-PFCOLOR', + 'LABEL-PFC', + 'LABEL-PFCO', + 'LABEL-PFCOL', + 'LABEL-PFCOLO', + 'LABELS', + 'LANDSCAPE', + 'LANGUAGES', + 'LANGUAGE', + 'LARGE', + 'LARGE-TO-SMALL', + 'LAST', + 'LAST-ASYNCH-REQUEST', + 'LAST-BATCH', + 'LAST-CHILD', + 'LAST-EVENT', + 'LAST-EVEN', + 'LAST-FORM', + 'LASTKEY', + 'LAST-KEY', + 'LAST-OBJECT', + 'LAST-OF', + 'LAST-PROCEDURE', + 'LAST-PROCE', + 'LAST-PROCED', + 'LAST-PROCEDU', + 'LAST-PROCEDUR', + 'LAST-SERVER', + 'LAST-TAB-ITEM', + 'LAST-TAB-I', + 'LAST-TAB-IT', + 'LAST-TAB-ITE', + 'LC', + 'LDBNAME', + 'LE', + 'LEAVE', + 'LEFT-ALIGNED', + 'LEFT-ALIGN', + 'LEFT-ALIGNE', + 'LEFT-TRIM', + 'LENGTH', + 'LIBRARY', + 'LIKE', + 'LIKE-SEQUENTIAL', + 'LINE', + 'LINE-COUNTER', + 'LINE-COUNT', + 'LINE-COUNTE', + 'LIST-EVENTS', + 'LISTING', + 'LISTI', + 'LISTIN', + 'LIST-ITEM-PAIRS', + 'LIST-ITEMS', + 'LIST-PROPERTY-NAMES', + 'LIST-QUERY-ATTRS', + 'LIST-SET-ATTRS', + 'LIST-WIDGETS', + 'LITERAL-QUESTION', + 'LITTLE-ENDIAN', + 'LOAD', + 'LOAD-DOMAINS', + 'LOAD-ICON', + 'LOAD-IMAGE', + 'LOAD-IMAGE-DOWN', + 'LOAD-IMAGE-INSENSITIVE', + 'LOAD-IMAGE-UP', + 'LOAD-MOUSE-POINTER', + 'LOAD-MOUSE-P', + 'LOAD-MOUSE-PO', + 'LOAD-MOUSE-POI', + 'LOAD-MOUSE-POIN', + 'LOAD-MOUSE-POINT', + 'LOAD-MOUSE-POINTE', + 'LOAD-PICTURE', + 'LOAD-SMALL-ICON', + 'LOCAL-NAME', + 'LOCATOR-COLUMN-NUMBER', + 'LOCATOR-LINE-NUMBER', + 'LOCATOR-PUBLIC-ID', + 'LOCATOR-SYSTEM-ID', + 'LOCATOR-TYPE', + 'LOCKED', + 'LOCK-REGISTRATION', + 'LOG', + 'LOG-AUDIT-EVENT', + 'LOGIN-EXPIRATION-TIMESTAMP', + 'LOGIN-HOST', + 'LOGIN-STATE', + 'LOG-MANAGER', + 'LOGOUT', + 'LOOKAHEAD', + 'LOOKUP', + 'LT', + 'MACHINE-CLASS', + 'MANDATORY', + 'MANUAL-HIGHLIGHT', + 'MAP', + 'MARGIN-EXTRA', + 'MARGIN-HEIGHT-CHARS', + 'MARGIN-HEIGHT', + 'MARGIN-HEIGHT-', + 'MARGIN-HEIGHT-C', + 'MARGIN-HEIGHT-CH', + 'MARGIN-HEIGHT-CHA', + 'MARGIN-HEIGHT-CHAR', + 'MARGIN-HEIGHT-PIXELS', + 'MARGIN-HEIGHT-P', + 'MARGIN-HEIGHT-PI', + 'MARGIN-HEIGHT-PIX', + 'MARGIN-HEIGHT-PIXE', + 'MARGIN-HEIGHT-PIXEL', + 'MARGIN-WIDTH-CHARS', + 'MARGIN-WIDTH', + 'MARGIN-WIDTH-', + 'MARGIN-WIDTH-C', + 'MARGIN-WIDTH-CH', + 'MARGIN-WIDTH-CHA', + 'MARGIN-WIDTH-CHAR', + 'MARGIN-WIDTH-PIXELS', + 'MARGIN-WIDTH-P', + 'MARGIN-WIDTH-PI', + 'MARGIN-WIDTH-PIX', + 'MARGIN-WIDTH-PIXE', + 'MARGIN-WIDTH-PIXEL', + 'MARK-NEW', + 'MARK-ROW-STATE', + 'MATCHES', + 'MAX-BUTTON', + 'MAX-CHARS', + 'MAX-DATA-GUESS', + 'MAX-HEIGHT', + 'MAX-HEIGHT-CHARS', + 'MAX-HEIGHT-C', + 'MAX-HEIGHT-CH', + 'MAX-HEIGHT-CHA', + 'MAX-HEIGHT-CHAR', + 'MAX-HEIGHT-PIXELS', + 'MAX-HEIGHT-P', + 'MAX-HEIGHT-PI', + 'MAX-HEIGHT-PIX', + 'MAX-HEIGHT-PIXE', + 'MAX-HEIGHT-PIXEL', + 'MAXIMIZE', + 'MAXIMUM', + 'MAX', + 'MAXI', + 'MAXIM', + 'MAXIMU', + 'MAXIMUM-LEVEL', + 'MAX-ROWS', + 'MAX-SIZE', + 'MAX-VALUE', + 'MAX-VAL', + 'MAX-VALU', + 'MAX-WIDTH-CHARS', + 'MAX-WIDTH', + 'MAX-WIDTH-', + 'MAX-WIDTH-C', + 'MAX-WIDTH-CH', + 'MAX-WIDTH-CHA', + 'MAX-WIDTH-CHAR', + 'MAX-WIDTH-PIXELS', + 'MAX-WIDTH-P', + 'MAX-WIDTH-PI', + 'MAX-WIDTH-PIX', + 'MAX-WIDTH-PIXE', + 'MAX-WIDTH-PIXEL', + 'MD5-DIGEST', + 'MEMBER', + 'MEMPTR-TO-NODE-VALUE', + 'MENU', + 'MENUBAR', + 'MENU-BAR', + 'MENU-ITEM', + 'MENU-KEY', + 'MENU-K', + 'MENU-KE', + 'MENU-MOUSE', + 'MENU-M', + 'MENU-MO', + 'MENU-MOU', + 'MENU-MOUS', + 'MERGE-BY-FIELD', + 'MESSAGE', + 'MESSAGE-AREA', + 'MESSAGE-AREA-FONT', + 'MESSAGE-LINES', + 'METHOD', + 'MIN-BUTTON', + 'MIN-COLUMN-WIDTH-CHARS', + 'MIN-COLUMN-WIDTH-C', + 'MIN-COLUMN-WIDTH-CH', + 'MIN-COLUMN-WIDTH-CHA', + 'MIN-COLUMN-WIDTH-CHAR', + 'MIN-COLUMN-WIDTH-PIXELS', + 'MIN-COLUMN-WIDTH-P', + 'MIN-COLUMN-WIDTH-PI', + 'MIN-COLUMN-WIDTH-PIX', + 'MIN-COLUMN-WIDTH-PIXE', + 'MIN-COLUMN-WIDTH-PIXEL', + 'MIN-HEIGHT-CHARS', + 'MIN-HEIGHT', + 'MIN-HEIGHT-', + 'MIN-HEIGHT-C', + 'MIN-HEIGHT-CH', + 'MIN-HEIGHT-CHA', + 'MIN-HEIGHT-CHAR', + 'MIN-HEIGHT-PIXELS', + 'MIN-HEIGHT-P', + 'MIN-HEIGHT-PI', + 'MIN-HEIGHT-PIX', + 'MIN-HEIGHT-PIXE', + 'MIN-HEIGHT-PIXEL', + 'MINIMUM', + 'MIN', + 'MINI', + 'MINIM', + 'MINIMU', + 'MIN-SIZE', + 'MIN-VALUE', + 'MIN-VAL', + 'MIN-VALU', + 'MIN-WIDTH-CHARS', + 'MIN-WIDTH', + 'MIN-WIDTH-', + 'MIN-WIDTH-C', + 'MIN-WIDTH-CH', + 'MIN-WIDTH-CHA', + 'MIN-WIDTH-CHAR', + 'MIN-WIDTH-PIXELS', + 'MIN-WIDTH-P', + 'MIN-WIDTH-PI', + 'MIN-WIDTH-PIX', + 'MIN-WIDTH-PIXE', + 'MIN-WIDTH-PIXEL', + 'MODIFIED', + 'MODULO', + 'MOD', + 'MODU', + 'MODUL', + 'MONTH', + 'MOUSE', + 'MOUSE-POINTER', + 'MOUSE-P', + 'MOUSE-PO', + 'MOUSE-POI', + 'MOUSE-POIN', + 'MOUSE-POINT', + 'MOUSE-POINTE', + 'MOVABLE', + 'MOVE-AFTER-TAB-ITEM', + 'MOVE-AFTER', + 'MOVE-AFTER-', + 'MOVE-AFTER-T', + 'MOVE-AFTER-TA', + 'MOVE-AFTER-TAB', + 'MOVE-AFTER-TAB-', + 'MOVE-AFTER-TAB-I', + 'MOVE-AFTER-TAB-IT', + 'MOVE-AFTER-TAB-ITE', + 'MOVE-BEFORE-TAB-ITEM', + 'MOVE-BEFOR', + 'MOVE-BEFORE', + 'MOVE-BEFORE-', + 'MOVE-BEFORE-T', + 'MOVE-BEFORE-TA', + 'MOVE-BEFORE-TAB', + 'MOVE-BEFORE-TAB-', + 'MOVE-BEFORE-TAB-I', + 'MOVE-BEFORE-TAB-IT', + 'MOVE-BEFORE-TAB-ITE', + 'MOVE-COLUMN', + 'MOVE-COL', + 'MOVE-COLU', + 'MOVE-COLUM', + 'MOVE-TO-BOTTOM', + 'MOVE-TO-B', + 'MOVE-TO-BO', + 'MOVE-TO-BOT', + 'MOVE-TO-BOTT', + 'MOVE-TO-BOTTO', + 'MOVE-TO-EOF', + 'MOVE-TO-TOP', + 'MOVE-TO-T', + 'MOVE-TO-TO', + 'MPE', + 'MULTI-COMPILE', + 'MULTIPLE', + 'MULTIPLE-KEY', + 'MULTITASKING-INTERVAL', + 'MUST-EXIST', + 'NAME', + 'NAMESPACE-PREFIX', + 'NAMESPACE-URI', + 'NATIVE', + 'NE', + 'NEEDS-APPSERVER-PROMPT', + 'NEEDS-PROMPT', + 'NEW', + 'NEW-INSTANCE', + 'NEW-ROW', + 'NEXT', + 'NEXT-COLUMN', + 'NEXT-PROMPT', + 'NEXT-ROWID', + 'NEXT-SIBLING', + 'NEXT-TAB-ITEM', + 'NEXT-TAB-I', + 'NEXT-TAB-IT', + 'NEXT-TAB-ITE', + 'NEXT-VALUE', + 'NO', + 'NO-APPLY', + 'NO-ARRAY-MESSAGE', + 'NO-ASSIGN', + 'NO-ATTR-LIST', + 'NO-ATTR', + 'NO-ATTR-', + 'NO-ATTR-L', + 'NO-ATTR-LI', + 'NO-ATTR-LIS', + 'NO-ATTR-SPACE', + 'NO-ATTR-S', + 'NO-ATTR-SP', + 'NO-ATTR-SPA', + 'NO-ATTR-SPAC', + 'NO-AUTO-VALIDATE', + 'NO-BIND-WHERE', + 'NO-BOX', + 'NO-CONSOLE', + 'NO-CONVERT', + 'NO-CONVERT-3D-COLORS', + 'NO-CURRENT-VALUE', + 'NO-DEBUG', + 'NODE-VALUE-TO-MEMPTR', + 'NO-DRAG', + 'NO-ECHO', + 'NO-EMPTY-SPACE', + 'NO-ERROR', + 'NO-FILL', + 'NO-F', + 'NO-FI', + 'NO-FIL', + 'NO-FOCUS', + 'NO-HELP', + 'NO-HIDE', + 'NO-INDEX-HINT', + 'NO-INHERIT-BGCOLOR', + 'NO-INHERIT-BGC', + 'NO-INHERIT-BGCO', + 'NO-INHERIT-FGCOLOR', + 'NO-INHERIT-FGC', + 'NO-INHERIT-FGCO', + 'NO-INHERIT-FGCOL', + 'NO-INHERIT-FGCOLO', + 'NO-JOIN-BY-SQLDB', + 'NO-LABELS', + 'NO-LABE', + 'NO-LOBS', + 'NO-LOCK', + 'NO-LOOKAHEAD', + 'NO-MAP', + 'NO-MESSAGE', + 'NO-MES', + 'NO-MESS', + 'NO-MESSA', + 'NO-MESSAG', + 'NONAMESPACE-SCHEMA-LOCATION', + 'NONE', + 'NO-PAUSE', + 'NO-PREFETCH', + 'NO-PREFE', + 'NO-PREFET', + 'NO-PREFETC', + 'NORMALIZE', + 'NO-ROW-MARKERS', + 'NO-SCROLLBAR-VERTICAL', + 'NO-SEPARATE-CONNECTION', + 'NO-SEPARATORS', + 'NOT', + 'NO-TAB-STOP', + 'NOT-ACTIVE', + 'NO-UNDERLINE', + 'NO-UND', + 'NO-UNDE', + 'NO-UNDER', + 'NO-UNDERL', + 'NO-UNDERLI', + 'NO-UNDERLIN', + 'NO-UNDO', + 'NO-VALIDATE', + 'NO-VAL', + 'NO-VALI', + 'NO-VALID', + 'NO-VALIDA', + 'NO-VALIDAT', + 'NOW', + 'NO-WAIT', + 'NO-WORD-WRAP', + 'NULL', + 'NUM-ALIASES', + 'NUM-ALI', + 'NUM-ALIA', + 'NUM-ALIAS', + 'NUM-ALIASE', + 'NUM-BUFFERS', + 'NUM-BUTTONS', + 'NUM-BUT', + 'NUM-BUTT', + 'NUM-BUTTO', + 'NUM-BUTTON', + 'NUM-COLUMNS', + 'NUM-COL', + 'NUM-COLU', + 'NUM-COLUM', + 'NUM-COLUMN', + 'NUM-COPIES', + 'NUM-DBS', + 'NUM-DROPPED-FILES', + 'NUM-ENTRIES', + 'NUMERIC', + 'NUMERIC-FORMAT', + 'NUMERIC-F', + 'NUMERIC-FO', + 'NUMERIC-FOR', + 'NUMERIC-FORM', + 'NUMERIC-FORMA', + 'NUM-FIELDS', + 'NUM-FORMATS', + 'NUM-ITEMS', + 'NUM-ITERATIONS', + 'NUM-LINES', + 'NUM-LOCKED-COLUMNS', + 'NUM-LOCKED-COL', + 'NUM-LOCKED-COLU', + 'NUM-LOCKED-COLUM', + 'NUM-LOCKED-COLUMN', + 'NUM-MESSAGES', + 'NUM-PARAMETERS', + 'NUM-REFERENCES', + 'NUM-REPLACED', + 'NUM-RESULTS', + 'NUM-SELECTED-ROWS', + 'NUM-SELECTED-WIDGETS', + 'NUM-SELECTED', + 'NUM-SELECTED-', + 'NUM-SELECTED-W', + 'NUM-SELECTED-WI', + 'NUM-SELECTED-WID', + 'NUM-SELECTED-WIDG', + 'NUM-SELECTED-WIDGE', + 'NUM-SELECTED-WIDGET', + 'NUM-TABS', + 'NUM-TO-RETAIN', + 'NUM-VISIBLE-COLUMNS', + 'OCTET-LENGTH', + 'OF', + 'OFF', + 'OK', + 'OK-CANCEL', + 'OLD', + 'ON', + 'ON-FRAME-BORDER', + 'ON-FRAME', + 'ON-FRAME-', + 'ON-FRAME-B', + 'ON-FRAME-BO', + 'ON-FRAME-BOR', + 'ON-FRAME-BORD', + 'ON-FRAME-BORDE', + 'OPEN', + 'OPSYS', + 'OPTION', + 'OR', + 'ORDERED-JOIN', + 'ORDINAL', + 'OS-APPEND', + 'OS-COMMAND', + 'OS-COPY', + 'OS-CREATE-DIR', + 'OS-DELETE', + 'OS-DIR', + 'OS-DRIVES', + 'OS-DRIVE', + 'OS-ERROR', + 'OS-GETENV', + 'OS-RENAME', + 'OTHERWISE', + 'OUTPUT', + 'OVERLAY', + 'OVERRIDE', + 'OWNER', + 'PAGE', + 'PAGE-BOTTOM', + 'PAGE-BOT', + 'PAGE-BOTT', + 'PAGE-BOTTO', + 'PAGED', + 'PAGE-NUMBER', + 'PAGE-NUM', + 'PAGE-NUMB', + 'PAGE-NUMBE', + 'PAGE-SIZE', + 'PAGE-TOP', + 'PAGE-WIDTH', + 'PAGE-WID', + 'PAGE-WIDT', + 'PARAMETER', + 'PARAM', + 'PARAME', + 'PARAMET', + 'PARAMETE', + 'PARENT', + 'PARSE-STATUS', + 'PARTIAL-KEY', + 'PASCAL', + 'PASSWORD-FIELD', + 'PATHNAME', + 'PAUSE', + 'PBE-HASH-ALGORITHM', + 'PBE-HASH-ALG', + 'PBE-HASH-ALGO', + 'PBE-HASH-ALGOR', + 'PBE-HASH-ALGORI', + 'PBE-HASH-ALGORIT', + 'PBE-HASH-ALGORITH', + 'PBE-KEY-ROUNDS', + 'PDBNAME', + 'PERSISTENT', + 'PERSIST', + 'PERSISTE', + 'PERSISTEN', + 'PERSISTENT-CACHE-DISABLED', + 'PFCOLOR', + 'PFC', + 'PFCO', + 'PFCOL', + 'PFCOLO', + 'PIXELS', + 'PIXELS-PER-COLUMN', + 'PIXELS-PER-COL', + 'PIXELS-PER-COLU', + 'PIXELS-PER-COLUM', + 'PIXELS-PER-ROW', + 'POPUP-MENU', + 'POPUP-M', + 'POPUP-ME', + 'POPUP-MEN', + 'POPUP-ONLY', + 'POPUP-O', + 'POPUP-ON', + 'POPUP-ONL', + 'PORTRAIT', + 'POSITION', + 'PRECISION', + 'PREFER-DATASET', + 'PREPARED', + 'PREPARE-STRING', + 'PREPROCESS', + 'PREPROC', + 'PREPROCE', + 'PREPROCES', + 'PRESELECT', + 'PRESEL', + 'PRESELE', + 'PRESELEC', + 'PREV', + 'PREV-COLUMN', + 'PREV-SIBLING', + 'PREV-TAB-ITEM', + 'PREV-TAB-I', + 'PREV-TAB-IT', + 'PREV-TAB-ITE', + 'PRIMARY', + 'PRINTER', + 'PRINTER-CONTROL-HANDLE', + 'PRINTER-HDC', + 'PRINTER-NAME', + 'PRINTER-PORT', + 'PRINTER-SETUP', + 'PRIVATE', + 'PRIVATE-DATA', + 'PRIVATE-D', + 'PRIVATE-DA', + 'PRIVATE-DAT', + 'PRIVILEGES', + 'PROCEDURE', + 'PROCE', + 'PROCED', + 'PROCEDU', + 'PROCEDUR', + 'PROCEDURE-CALL-TYPE', + 'PROCESS', + 'PROC-HANDLE', + 'PROC-HA', + 'PROC-HAN', + 'PROC-HAND', + 'PROC-HANDL', + 'PROC-STATUS', + 'PROC-ST', + 'PROC-STA', + 'PROC-STAT', + 'PROC-STATU', + 'proc-text', + 'proc-text-buffe', + 'PROFILER', + 'PROGRAM-NAME', + 'PROGRESS', + 'PROGRESS-SOURCE', + 'PROGRESS-S', + 'PROGRESS-SO', + 'PROGRESS-SOU', + 'PROGRESS-SOUR', + 'PROGRESS-SOURC', + 'PROMPT', + 'PROMPT-FOR', + 'PROMPT-F', + 'PROMPT-FO', + 'PROMSGS', + 'PROPATH', + 'PROPERTY', + 'PROTECTED', + 'PROVERSION', + 'PROVERS', + 'PROVERSI', + 'PROVERSIO', + 'PROXY', + 'PROXY-PASSWORD', + 'PROXY-USERID', + 'PUBLIC', + 'PUBLIC-ID', + 'PUBLISH', + 'PUBLISHED-EVENTS', + 'PUT', + 'PUTBYTE', + 'PUT-BYTE', + 'PUT-DOUBLE', + 'PUT-FLOAT', + 'PUT-INT64', + 'PUT-KEY-VALUE', + 'PUT-KEY-VAL', + 'PUT-KEY-VALU', + 'PUT-LONG', + 'PUT-SHORT', + 'PUT-STRING', + 'PUT-UNSIGNED-LONG', + 'QUERY', + 'QUERY-CLOSE', + 'QUERY-OFF-END', + 'QUERY-OPEN', + 'QUERY-PREPARE', + 'QUERY-TUNING', + 'QUESTION', + 'QUIT', + 'QUOTER', + 'RADIO-BUTTONS', + 'RADIO-SET', + 'RANDOM', + 'RAW-TRANSFER', + 'RCODE-INFORMATION', + 'RCODE-INFO', + 'RCODE-INFOR', + 'RCODE-INFORM', + 'RCODE-INFORMA', + 'RCODE-INFORMAT', + 'RCODE-INFORMATI', + 'RCODE-INFORMATIO', + 'READ-AVAILABLE', + 'READ-EXACT-NUM', + 'READ-FILE', + 'READKEY', + 'READ-ONLY', + 'READ-XML', + 'READ-XMLSCHEMA', + 'REAL', + 'RECORD-LENGTH', + 'RECTANGLE', + 'RECT', + 'RECTA', + 'RECTAN', + 'RECTANG', + 'RECTANGL', + 'RECURSIVE', + 'REFERENCE-ONLY', + 'REFRESH', + 'REFRESHABLE', + 'REFRESH-AUDIT-POLICY', + 'REGISTER-DOMAIN', + 'RELEASE', + 'REMOTE', + 'REMOVE-EVENTS-PROCEDURE', + 'REMOVE-SUPER-PROCEDURE', + 'REPEAT', + 'REPLACE', + 'REPLACE-SELECTION-TEXT', + 'REPOSITION', + 'REPOSITION-BACKWARD', + 'REPOSITION-FORWARD', + 'REPOSITION-MODE', + 'REPOSITION-TO-ROW', + 'REPOSITION-TO-ROWID', + 'REQUEST', + 'RESET', + 'RESIZABLE', + 'RESIZA', + 'RESIZAB', + 'RESIZABL', + 'RESIZE', + 'RESTART-ROW', + 'RESTART-ROWID', + 'RETAIN', + 'RETAIN-SHAPE', + 'RETRY', + 'RETRY-CANCEL', + 'RETURN', + 'RETURN-INSERTED', + 'RETURN-INS', + 'RETURN-INSE', + 'RETURN-INSER', + 'RETURN-INSERT', + 'RETURN-INSERTE', + 'RETURNS', + 'RETURN-TO-START-DIR', + 'RETURN-TO-START-DI', + 'RETURN-VALUE', + 'RETURN-VAL', + 'RETURN-VALU', + 'RETURN-VALUE-DATA-TYPE', + 'REVERSE-FROM', + 'REVERT', + 'REVOKE', + 'RGB-VALUE', + 'RIGHT-ALIGNED', + 'RETURN-ALIGN', + 'RETURN-ALIGNE', + 'RIGHT-TRIM', + 'R-INDEX', + 'ROLES', + 'ROUND', + 'ROUTINE-LEVEL', + 'ROW', + 'ROW-HEIGHT-CHARS', + 'ROW-HEIGHT-PIXELS', + 'ROW-MARKERS', + 'ROW-OF', + 'ROW-RESIZABLE', + 'RULE', + 'RUN', + 'RUN-PROCEDURE', + 'SAVE', + 'SAVE-AS', + 'SAVE-FILE', + 'SAX-COMPLETE', + 'SAX-COMPLE', + 'SAX-COMPLET', + 'SAX-PARSE', + 'SAX-PARSE-FIRST', + 'SAX-PARSE-NEXT', + 'SAX-PARSER-ERROR', + 'SAX-RUNNING', + 'SAX-UNINITIALIZED', + 'SAX-WRITE-BEGIN', + 'SAX-WRITE-COMPLETE', + 'SAX-WRITE-CONTENT', + 'SAX-WRITE-ELEMENT', + 'SAX-WRITE-ERROR', + 'SAX-WRITE-IDLE', + 'SAX-WRITER', + 'SAX-WRITE-TAG', + 'SCHEMA', + 'SCHEMA-LOCATION', + 'SCHEMA-MARSHAL', + 'SCHEMA-PATH', + 'SCREEN', + 'SCREEN-IO', + 'SCREEN-LINES', + 'SCREEN-VALUE', + 'SCREEN-VAL', + 'SCREEN-VALU', + 'SCROLL', + 'SCROLLABLE', + 'SCROLLBAR-HORIZONTAL', + 'SCROLLBAR-H', + 'SCROLLBAR-HO', + 'SCROLLBAR-HOR', + 'SCROLLBAR-HORI', + 'SCROLLBAR-HORIZ', + 'SCROLLBAR-HORIZO', + 'SCROLLBAR-HORIZON', + 'SCROLLBAR-HORIZONT', + 'SCROLLBAR-HORIZONTA', + 'SCROLL-BARS', + 'SCROLLBAR-VERTICAL', + 'SCROLLBAR-V', + 'SCROLLBAR-VE', + 'SCROLLBAR-VER', + 'SCROLLBAR-VERT', + 'SCROLLBAR-VERTI', + 'SCROLLBAR-VERTIC', + 'SCROLLBAR-VERTICA', + 'SCROLL-DELTA', + 'SCROLLED-ROW-POSITION', + 'SCROLLED-ROW-POS', + 'SCROLLED-ROW-POSI', + 'SCROLLED-ROW-POSIT', + 'SCROLLED-ROW-POSITI', + 'SCROLLED-ROW-POSITIO', + 'SCROLLING', + 'SCROLL-OFFSET', + 'SCROLL-TO-CURRENT-ROW', + 'SCROLL-TO-ITEM', + 'SCROLL-TO-I', + 'SCROLL-TO-IT', + 'SCROLL-TO-ITE', + 'SCROLL-TO-SELECTED-ROW', + 'SDBNAME', + 'SEAL', + 'SEAL-TIMESTAMP', + 'SEARCH', + 'SEARCH-SELF', + 'SEARCH-TARGET', + 'SECTION', + 'SECURITY-POLICY', + 'SEEK', + 'SELECT', + 'SELECTABLE', + 'SELECT-ALL', + 'SELECTED', + 'SELECT-FOCUSED-ROW', + 'SELECTION', + 'SELECTION-END', + 'SELECTION-LIST', + 'SELECTION-START', + 'SELECTION-TEXT', + 'SELECT-NEXT-ROW', + 'SELECT-PREV-ROW', + 'SELECT-ROW', + 'SELF', + 'SEND', + 'send-sql-statement', + 'send-sql', + 'SENSITIVE', + 'SEPARATE-CONNECTION', + 'SEPARATOR-FGCOLOR', + 'SEPARATORS', + 'SERVER', + 'SERVER-CONNECTION-BOUND', + 'SERVER-CONNECTION-BOUND-REQUEST', + 'SERVER-CONNECTION-CONTEXT', + 'SERVER-CONNECTION-ID', + 'SERVER-OPERATING-MODE', + 'SESSION', + 'SESSION-ID', + 'SET', + 'SET-APPL-CONTEXT', + 'SET-ATTR-CALL-TYPE', + 'SET-ATTRIBUTE-NODE', + 'SET-BLUE-VALUE', + 'SET-BLUE', + 'SET-BLUE-', + 'SET-BLUE-V', + 'SET-BLUE-VA', + 'SET-BLUE-VAL', + 'SET-BLUE-VALU', + 'SET-BREAK', + 'SET-BUFFERS', + 'SET-CALLBACK', + 'SET-CLIENT', + 'SET-COMMIT', + 'SET-CONTENTS', + 'SET-CURRENT-VALUE', + 'SET-DB-CLIENT', + 'SET-DYNAMIC', + 'SET-EVENT-MANAGER-OPTION', + 'SET-GREEN-VALUE', + 'SET-GREEN', + 'SET-GREEN-', + 'SET-GREEN-V', + 'SET-GREEN-VA', + 'SET-GREEN-VAL', + 'SET-GREEN-VALU', + 'SET-INPUT-SOURCE', + 'SET-OPTION', + 'SET-OUTPUT-DESTINATION', + 'SET-PARAMETER', + 'SET-POINTER-VALUE', + 'SET-PROPERTY', + 'SET-RED-VALUE', + 'SET-RED', + 'SET-RED-', + 'SET-RED-V', + 'SET-RED-VA', + 'SET-RED-VAL', + 'SET-RED-VALU', + 'SET-REPOSITIONED-ROW', + 'SET-RGB-VALUE', + 'SET-ROLLBACK', + 'SET-SELECTION', + 'SET-SIZE', + 'SET-SORT-ARROW', + 'SETUSERID', + 'SETUSER', + 'SETUSERI', + 'SET-WAIT-STATE', + 'SHA1-DIGEST', + 'SHARED', + 'SHARE-LOCK', + 'SHARE', + 'SHARE-', + 'SHARE-L', + 'SHARE-LO', + 'SHARE-LOC', + 'SHOW-IN-TASKBAR', + 'SHOW-STATS', + 'SHOW-STAT', + 'SIDE-LABEL-HANDLE', + 'SIDE-LABEL-H', + 'SIDE-LABEL-HA', + 'SIDE-LABEL-HAN', + 'SIDE-LABEL-HAND', + 'SIDE-LABEL-HANDL', + 'SIDE-LABELS', + 'SIDE-LAB', + 'SIDE-LABE', + 'SIDE-LABEL', + 'SILENT', + 'SIMPLE', + 'SINGLE', + 'SIZE', + 'SIZE-CHARS', + 'SIZE-C', + 'SIZE-CH', + 'SIZE-CHA', + 'SIZE-CHAR', + 'SIZE-PIXELS', + 'SIZE-P', + 'SIZE-PI', + 'SIZE-PIX', + 'SIZE-PIXE', + 'SIZE-PIXEL', + 'SKIP', + 'SKIP-DELETED-RECORD', + 'SLIDER', + 'SMALL-ICON', + 'SMALLINT', + 'SMALL-TITLE', + 'SOME', + 'SORT', + 'SORT-ASCENDING', + 'SORT-NUMBER', + 'SOURCE', + 'SOURCE-PROCEDURE', + 'SPACE', + 'SQL', + 'SQRT', + 'SSL-SERVER-NAME', + 'STANDALONE', + 'START', + 'START-DOCUMENT', + 'START-ELEMENT', + 'START-MOVE', + 'START-RESIZE', + 'START-ROW-RESIZE', + 'STATE-DETAIL', + 'STATIC', + 'STATUS', + 'STATUS-AREA', + 'STATUS-AREA-FONT', + 'STDCALL', + 'STOP', + 'STOP-PARSING', + 'STOPPED', + 'STOPPE', + 'STORED-PROCEDURE', + 'STORED-PROC', + 'STORED-PROCE', + 'STORED-PROCED', + 'STORED-PROCEDU', + 'STORED-PROCEDUR', + 'STREAM', + 'STREAM-HANDLE', + 'STREAM-IO', + 'STRETCH-TO-FIT', + 'STRICT', + 'STRING', + 'STRING-VALUE', + 'STRING-XREF', + 'SUB-AVERAGE', + 'SUB-AVE', + 'SUB-AVER', + 'SUB-AVERA', + 'SUB-AVERAG', + 'SUB-COUNT', + 'SUB-MAXIMUM', + 'SUM-MAX', + 'SUM-MAXI', + 'SUM-MAXIM', + 'SUM-MAXIMU', + 'SUB-MENU', + 'SUBSUB-', + 'SUB-MIN', + 'SUBSCRIBE', + 'SUBSTITUTE', + 'SUBST', + 'SUBSTI', + 'SUBSTIT', + 'SUBSTITU', + 'SUBSTITUT', + 'SUBSTRING', + 'SUBSTR', + 'SUBSTRI', + 'SUBSTRIN', + 'SUB-TOTAL', + 'SUBTYPE', + 'SUM', + 'SUPER', + 'SUPER-PROCEDURES', + 'SUPPRESS-NAMESPACE-PROCESSING', + 'SUPPRESS-WARNINGS', + 'SUPPRESS-W', + 'SUPPRESS-WA', + 'SUPPRESS-WAR', + 'SUPPRESS-WARN', + 'SUPPRESS-WARNI', + 'SUPPRESS-WARNIN', + 'SUPPRESS-WARNING', + 'SYMMETRIC-ENCRYPTION-ALGORITHM', + 'SYMMETRIC-ENCRYPTION-IV', + 'SYMMETRIC-ENCRYPTION-KEY', + 'SYMMETRIC-SUPPORT', + 'SYSTEM-ALERT-BOXES', + 'SYSTEM-ALERT', + 'SYSTEM-ALERT-', + 'SYSTEM-ALERT-B', + 'SYSTEM-ALERT-BO', + 'SYSTEM-ALERT-BOX', + 'SYSTEM-ALERT-BOXE', + 'SYSTEM-DIALOG', + 'SYSTEM-HELP', + 'SYSTEM-ID', + 'TABLE', + 'TABLE-HANDLE', + 'TABLE-NUMBER', + 'TAB-POSITION', + 'TAB-STOP', + 'TARGET', + 'TARGET-PROCEDURE', + 'TEMP-DIRECTORY', + 'TEMP-DIR', + 'TEMP-DIRE', + 'TEMP-DIREC', + 'TEMP-DIRECT', + 'TEMP-DIRECTO', + 'TEMP-DIRECTOR', + 'TEMP-TABLE', + 'TEMP-TABLE-PREPARE', + 'TERM', + 'TERMINAL', + 'TERMI', + 'TERMIN', + 'TERMINA', + 'TERMINATE', + 'TEXT', + 'TEXT-CURSOR', + 'TEXT-SEG-GROW', + 'TEXT-SELECTED', + 'THEN', + 'THIS-OBJECT', + 'THIS-PROCEDURE', + 'THREE-D', + 'THROW', + 'THROUGH', + 'THRU', + 'TIC-MARKS', + 'TIME', + 'TIME-SOURCE', + 'TITLE', + 'TITLE-BGCOLOR', + 'TITLE-BGC', + 'TITLE-BGCO', + 'TITLE-BGCOL', + 'TITLE-BGCOLO', + 'TITLE-DCOLOR', + 'TITLE-DC', + 'TITLE-DCO', + 'TITLE-DCOL', + 'TITLE-DCOLO', + 'TITLE-FGCOLOR', + 'TITLE-FGC', + 'TITLE-FGCO', + 'TITLE-FGCOL', + 'TITLE-FGCOLO', + 'TITLE-FONT', + 'TITLE-FO', + 'TITLE-FON', + 'TO', + 'TODAY', + 'TOGGLE-BOX', + 'TOOLTIP', + 'TOOLTIPS', + 'TOPIC', + 'TOP-NAV-QUERY', + 'TOP-ONLY', + 'TO-ROWID', + 'TOTAL', + 'TRAILING', + 'TRANS', + 'TRANSACTION', + 'TRANSACTION-MODE', + 'TRANS-INIT-PROCEDURE', + 'TRANSPARENT', + 'TRIGGER', + 'TRIGGERS', + 'TRIM', + 'TRUE', + 'TRUNCATE', + 'TRUNC', + 'TRUNCA', + 'TRUNCAT', + 'TYPE', + 'TYPE-OF', + 'UNBOX', + 'UNBUFFERED', + 'UNBUFF', + 'UNBUFFE', + 'UNBUFFER', + 'UNBUFFERE', + 'UNDERLINE', + 'UNDERL', + 'UNDERLI', + 'UNDERLIN', + 'UNDO', + 'UNFORMATTED', + 'UNFORM', + 'UNFORMA', + 'UNFORMAT', + 'UNFORMATT', + 'UNFORMATTE', + 'UNION', + 'UNIQUE', + 'UNIQUE-ID', + 'UNIQUE-MATCH', + 'UNIX', + 'UNLESS-HIDDEN', + 'UNLOAD', + 'UNSIGNED-LONG', + 'UNSUBSCRIBE', + 'UP', + 'UPDATE', + 'UPDATE-ATTRIBUTE', + 'URL', + 'URL-DECODE', + 'URL-ENCODE', + 'URL-PASSWORD', + 'URL-USERID', + 'USE', + 'USE-DICT-EXPS', + 'USE-FILENAME', + 'USE-INDEX', + 'USER', + 'USE-REVVIDEO', + 'USERID', + 'USER-ID', + 'USE-TEXT', + 'USE-UNDERLINE', + 'USE-WIDGET-POOL', + 'USING', + 'V6DISPLAY', + 'V6FRAME', + 'VALIDATE', + 'VALIDATE-EXPRESSION', + 'VALIDATE-MESSAGE', + 'VALIDATE-SEAL', + 'VALIDATION-ENABLED', + 'VALID-EVENT', + 'VALID-HANDLE', + 'VALID-OBJECT', + 'VALUE', + 'VALUE-CHANGED', + 'VALUES', + 'VARIABLE', + 'VAR', + 'VARI', + 'VARIA', + 'VARIAB', + 'VARIABL', + 'VERBOSE', + 'VERSION', + 'VERTICAL', + 'VERT', + 'VERTI', + 'VERTIC', + 'VERTICA', + 'VIEW', + 'VIEW-AS', + 'VIEW-FIRST-COLUMN-ON-REOPEN', + 'VIRTUAL-HEIGHT-CHARS', + 'VIRTUAL-HEIGHT', + 'VIRTUAL-HEIGHT-', + 'VIRTUAL-HEIGHT-C', + 'VIRTUAL-HEIGHT-CH', + 'VIRTUAL-HEIGHT-CHA', + 'VIRTUAL-HEIGHT-CHAR', + 'VIRTUAL-HEIGHT-PIXELS', + 'VIRTUAL-HEIGHT-P', + 'VIRTUAL-HEIGHT-PI', + 'VIRTUAL-HEIGHT-PIX', + 'VIRTUAL-HEIGHT-PIXE', + 'VIRTUAL-HEIGHT-PIXEL', + 'VIRTUAL-WIDTH-CHARS', + 'VIRTUAL-WIDTH', + 'VIRTUAL-WIDTH-', + 'VIRTUAL-WIDTH-C', + 'VIRTUAL-WIDTH-CH', + 'VIRTUAL-WIDTH-CHA', + 'VIRTUAL-WIDTH-CHAR', + 'VIRTUAL-WIDTH-PIXELS', + 'VIRTUAL-WIDTH-P', + 'VIRTUAL-WIDTH-PI', + 'VIRTUAL-WIDTH-PIX', + 'VIRTUAL-WIDTH-PIXE', + 'VIRTUAL-WIDTH-PIXEL', + 'VISIBLE', + 'VOID', + 'WAIT', + 'WAIT-FOR', + 'WARNING', + 'WEB-CONTEXT', + 'WEEKDAY', + 'WHEN', + 'WHERE', + 'WHILE', + 'WIDGET', + 'WIDGET-ENTER', + 'WIDGET-E', + 'WIDGET-EN', + 'WIDGET-ENT', + 'WIDGET-ENTE', + 'WIDGET-ID', + 'WIDGET-LEAVE', + 'WIDGET-L', + 'WIDGET-LE', + 'WIDGET-LEA', + 'WIDGET-LEAV', + 'WIDGET-POOL', + 'WIDTH-CHARS', + 'WIDTH', + 'WIDTH-', + 'WIDTH-C', + 'WIDTH-CH', + 'WIDTH-CHA', + 'WIDTH-CHAR', + 'WIDTH-PIXELS', + 'WIDTH-P', + 'WIDTH-PI', + 'WIDTH-PIX', + 'WIDTH-PIXE', + 'WIDTH-PIXEL', + 'WINDOW', + 'WINDOW-MAXIMIZED', + 'WINDOW-MAXIM', + 'WINDOW-MAXIMI', + 'WINDOW-MAXIMIZ', + 'WINDOW-MAXIMIZE', + 'WINDOW-MINIMIZED', + 'WINDOW-MINIM', + 'WINDOW-MINIMI', + 'WINDOW-MINIMIZ', + 'WINDOW-MINIMIZE', + 'WINDOW-NAME', + 'WINDOW-NORMAL', + 'WINDOW-STATE', + 'WINDOW-STA', + 'WINDOW-STAT', + 'WINDOW-SYSTEM', + 'WITH', + 'WORD-INDEX', + 'WORD-WRAP', + 'WORK-AREA-HEIGHT-PIXELS', + 'WORK-AREA-WIDTH-PIXELS', + 'WORK-AREA-X', + 'WORK-AREA-Y', + 'WORKFILE', + 'WORK-TABLE', + 'WORK-TAB', + 'WORK-TABL', + 'WRITE', + 'WRITE-CDATA', + 'WRITE-CHARACTERS', + 'WRITE-COMMENT', + 'WRITE-DATA-ELEMENT', + 'WRITE-EMPTY-ELEMENT', + 'WRITE-ENTITY-REF', + 'WRITE-EXTERNAL-DTD', + 'WRITE-FRAGMENT', + 'WRITE-MESSAGE', + 'WRITE-PROCESSING-INSTRUCTION', + 'WRITE-STATUS', + 'WRITE-XML', + 'WRITE-XMLSCHEMA', + 'X', + 'XCODE', + 'XML-DATA-TYPE', + 'XML-NODE-TYPE', + 'XML-SCHEMA-PATH', + 'XML-SUPPRESS-NAMESPACE-PROCESSING', + 'X-OF', + 'XREF', + 'XREF-XML', + 'Y', + 'YEAR', + 'YEAR-OFFSET', + 'YES', + 'YES-NO', + 'YES-NO-CANCEL', + 'Y-OF' +) diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/_sourcemod_builtins.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/_sourcemod_builtins.py new file mode 100644 index 0000000000000000000000000000000000000000..f08ea4817c9047dd5fc11c181ffc8cea7ae49522 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/_sourcemod_builtins.py @@ -0,0 +1,1163 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers._sourcemod_builtins + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + This file contains the names of SourceMod functions. + It is able to re-generate itself. + + Do not edit the FUNCTIONS list by hand. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from __future__ import print_function + +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 + import sys + try: + from urllib import FancyURLopener + except ImportError: + from urllib.request import FancyURLopener + + from pygments.util import format_lines + + # urllib ends up wanting to import a module called 'math' -- if + # pygments/lexers is in the path, this ends badly. + for i in range(len(sys.path)-1, -1, -1): + if sys.path[i].endswith('/lexers'): + del sys.path[i] + + 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) + 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) + if m is not None: + functions.append(m.groups()[0]) + return functions + + def regenerate(filename, natives): + with open(filename) as fp: + content = fp.read() + + header = content[:content.find('FUNCTIONS = (')] + footer = content[content.find("if __name__ == '__main__':")-1:] + + + with open(filename, 'w') as fp: + fp.write(header) + fp.write(format_lines('FUNCTIONS', natives)) + fp.write(footer) + + def run(): + version = get_version() + print('> Downloading function index for SourceMod %s' % version) + functions = get_sm_functions() + print('> %d functions found:' % len(functions)) + + functionlist = [] + for full_function_name in functions: + print('>> %s' % full_function_name) + functionlist.append(full_function_name) + + regenerate(__file__, functionlist) + + + run() diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/_stan_builtins.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/_stan_builtins.py new file mode 100644 index 0000000000000000000000000000000000000000..a189647aab513e423aede97330b2a275de8dd63d --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/_stan_builtins.py @@ -0,0 +1,532 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers._stan_builtins + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + This file contains the names of functions for Stan used by + ``pygments.lexers.math.StanLexer. This is for Stan language version 2.8.0. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +KEYWORDS = ( + 'else', + 'for', + 'if', + 'in', + 'increment_log_prob', + 'integrate_ode', + 'lp__', + 'print', + 'reject', + 'return', + 'while' +) + +TYPES = ( + 'cholesky_factor_corr', + 'cholesky_factor_cov', + 'corr_matrix', + 'cov_matrix', + 'int', + 'matrix', + 'ordered', + 'positive_ordered', + 'real', + 'row_vector', + 'row_vectormatrix', + 'simplex', + 'unit_vector', + 'vector', + 'void') + +FUNCTIONS = ( + 'Phi', + 'Phi_approx', + 'abs', + 'acos', + 'acosh', + 'append_col', + 'append_row', + 'asin', + 'asinh', + 'atan', + 'atan2', + 'atanh', + 'bernoulli_ccdf_log', + 'bernoulli_cdf', + 'bernoulli_cdf_log', + 'bernoulli_log', + 'bernoulli_logit_log', + 'bernoulli_rng', + 'bessel_first_kind', + 'bessel_second_kind', + 'beta_binomial_ccdf_log', + 'beta_binomial_cdf', + 'beta_binomial_cdf_log', + 'beta_binomial_log', + 'beta_binomial_rng', + 'beta_ccdf_log', + 'beta_cdf', + 'beta_cdf_log', + 'beta_log', + 'beta_rng', + 'binary_log_loss', + 'binomial_ccdf_log', + 'binomial_cdf', + 'binomial_cdf_log', + 'binomial_coefficient_log', + 'binomial_log', + 'binomial_logit_log', + 'binomial_rng', + 'block', + 'categorical_log', + 'categorical_logit_log', + 'categorical_rng', + 'cauchy_ccdf_log', + 'cauchy_cdf', + 'cauchy_cdf_log', + 'cauchy_log', + 'cauchy_rng', + 'cbrt', + 'ceil', + 'chi_square_ccdf_log', + 'chi_square_cdf', + 'chi_square_cdf_log', + 'chi_square_log', + 'chi_square_rng', + 'cholesky_decompose', + 'col', + 'cols', + 'columns_dot_product', + 'columns_dot_self', + 'cos', + 'cosh', + 'crossprod', + 'csr_extract_u', + 'csr_extract_v', + 'csr_extract_w', + 'csr_matrix_times_vector', + 'csr_to_dense_matrix', + 'cumulative_sum', + 'determinant', + 'diag_matrix', + 'diag_post_multiply', + 'diag_pre_multiply', + 'diagonal', + 'digamma', + 'dims', + 'dirichlet_log', + 'dirichlet_rng', + 'distance', + 'dot_product', + 'dot_self', + 'double_exponential_ccdf_log', + 'double_exponential_cdf', + 'double_exponential_cdf_log', + 'double_exponential_log', + 'double_exponential_rng', + 'e', + 'eigenvalues_sym', + 'eigenvectors_sym', + 'erf', + 'erfc', + 'exp', + 'exp2', + 'exp_mod_normal_ccdf_log', + 'exp_mod_normal_cdf', + 'exp_mod_normal_cdf_log', + 'exp_mod_normal_log', + 'exp_mod_normal_rng', + 'expm1', + 'exponential_ccdf_log', + 'exponential_cdf', + 'exponential_cdf_log', + 'exponential_log', + 'exponential_rng', + 'fabs', + 'falling_factorial', + 'fdim', + 'floor', + 'fma', + 'fmax', + 'fmin', + 'fmod', + 'frechet_ccdf_log', + 'frechet_cdf', + 'frechet_cdf_log', + 'frechet_log', + 'frechet_rng', + 'gamma_ccdf_log', + 'gamma_cdf', + 'gamma_cdf_log', + 'gamma_log', + 'gamma_p', + 'gamma_q', + 'gamma_rng', + 'gaussian_dlm_obs_log', + 'get_lp', + 'gumbel_ccdf_log', + 'gumbel_cdf', + 'gumbel_cdf_log', + 'gumbel_log', + 'gumbel_rng', + 'head', + 'hypergeometric_log', + 'hypergeometric_rng', + 'hypot', + 'if_else', + 'int_step', + 'inv', + 'inv_chi_square_ccdf_log', + 'inv_chi_square_cdf', + 'inv_chi_square_cdf_log', + 'inv_chi_square_log', + 'inv_chi_square_rng', + 'inv_cloglog', + 'inv_gamma_ccdf_log', + 'inv_gamma_cdf', + 'inv_gamma_cdf_log', + 'inv_gamma_log', + 'inv_gamma_rng', + 'inv_logit', + 'inv_phi', + 'inv_sqrt', + 'inv_square', + 'inv_wishart_log', + 'inv_wishart_rng', + 'inverse', + 'inverse_spd', + 'is_inf', + 'is_nan', + 'lbeta', + 'lgamma', + 'lkj_corr_cholesky_log', + 'lkj_corr_cholesky_rng', + 'lkj_corr_log', + 'lkj_corr_rng', + 'lmgamma', + 'log', + 'log10', + 'log1m', + 'log1m_exp', + 'log1m_inv_logit', + 'log1p', + 'log1p_exp', + 'log2', + 'log_determinant', + 'log_diff_exp', + 'log_falling_factorial', + 'log_inv_logit', + 'log_mix', + 'log_rising_factorial', + 'log_softmax', + 'log_sum_exp', + 'logistic_ccdf_log', + 'logistic_cdf', + 'logistic_cdf_log', + 'logistic_log', + 'logistic_rng', + 'logit', + 'lognormal_ccdf_log', + 'lognormal_cdf', + 'lognormal_cdf_log', + 'lognormal_log', + 'lognormal_rng', + 'machine_precision', + 'max', + 'mdivide_left_tri_low', + 'mdivide_right_tri_low', + 'mean', + 'min', + 'modified_bessel_first_kind', + 'modified_bessel_second_kind', + 'multi_gp_cholesky_log', + 'multi_gp_log', + 'multi_normal_cholesky_log', + 'multi_normal_cholesky_rng', + 'multi_normal_log', + 'multi_normal_prec_log', + 'multi_normal_rng', + 'multi_student_t_log', + 'multi_student_t_rng', + 'multinomial_log', + 'multinomial_rng', + 'multiply_log', + 'multiply_lower_tri_self_transpose', + 'neg_binomial_2_ccdf_log', + 'neg_binomial_2_cdf', + 'neg_binomial_2_cdf_log', + 'neg_binomial_2_log', + 'neg_binomial_2_log_log', + 'neg_binomial_2_log_rng', + 'neg_binomial_2_rng', + 'neg_binomial_ccdf_log', + 'neg_binomial_cdf', + 'neg_binomial_cdf_log', + 'neg_binomial_log', + 'neg_binomial_rng', + 'negative_infinity', + 'normal_ccdf_log', + 'normal_cdf', + 'normal_cdf_log', + 'normal_log', + 'normal_rng', + 'not_a_number', + 'num_elements', + 'ordered_logistic_log', + 'ordered_logistic_rng', + 'owens_t', + 'pareto_ccdf_log', + 'pareto_cdf', + 'pareto_cdf_log', + 'pareto_log', + 'pareto_rng', + 'pareto_type_2_ccdf_log', + 'pareto_type_2_cdf', + 'pareto_type_2_cdf_log', + 'pareto_type_2_log', + 'pareto_type_2_rng', + 'pi', + 'poisson_ccdf_log', + 'poisson_cdf', + 'poisson_cdf_log', + 'poisson_log', + 'poisson_log_log', + 'poisson_log_rng', + 'poisson_rng', + 'positive_infinity', + 'pow', + 'prod', + 'qr_Q', + 'qr_R', + 'quad_form', + 'quad_form_diag', + 'quad_form_sym', + 'rank', + 'rayleigh_ccdf_log', + 'rayleigh_cdf', + 'rayleigh_cdf_log', + 'rayleigh_log', + 'rayleigh_rng', + 'rep_array', + 'rep_matrix', + 'rep_row_vector', + 'rep_vector', + 'rising_factorial', + 'round', + 'row', + 'rows', + 'rows_dot_product', + 'rows_dot_self', + 'scaled_inv_chi_square_ccdf_log', + 'scaled_inv_chi_square_cdf', + 'scaled_inv_chi_square_cdf_log', + 'scaled_inv_chi_square_log', + 'scaled_inv_chi_square_rng', + 'sd', + 'segment', + 'sin', + 'singular_values', + 'sinh', + 'size', + 'skew_normal_ccdf_log', + 'skew_normal_cdf', + 'skew_normal_cdf_log', + 'skew_normal_log', + 'skew_normal_rng', + 'softmax', + 'sort_asc', + 'sort_desc', + 'sort_indices_asc', + 'sort_indices_desc', + 'sqrt', + 'sqrt2', + 'square', + 'squared_distance', + 'step', + 'student_t_ccdf_log', + 'student_t_cdf', + 'student_t_cdf_log', + 'student_t_log', + 'student_t_rng', + 'sub_col', + 'sub_row', + 'sum', + 'tail', + 'tan', + 'tanh', + 'tcrossprod', + 'tgamma', + 'to_array_1d', + 'to_array_2d', + 'to_matrix', + 'to_row_vector', + 'to_vector', + 'trace', + 'trace_gen_quad_form', + 'trace_quad_form', + 'trigamma', + 'trunc', + 'uniform_ccdf_log', + 'uniform_cdf', + 'uniform_cdf_log', + 'uniform_log', + 'uniform_rng', + 'variance', + 'von_mises_log', + 'von_mises_rng', + 'weibull_ccdf_log', + 'weibull_cdf', + 'weibull_cdf_log', + 'weibull_log', + 'weibull_rng', + 'wiener_log', + 'wishart_log', + 'wishart_rng' +) + +DISTRIBUTIONS = ( + 'bernoulli', + 'bernoulli_logit', + 'beta', + 'beta_binomial', + 'binomial', + 'binomial_logit', + 'categorical', + 'categorical_logit', + 'cauchy', + 'chi_square', + 'dirichlet', + 'double_exponential', + 'exp_mod_normal', + 'exponential', + 'frechet', + 'gamma', + 'gaussian_dlm_obs', + 'gumbel', + 'hypergeometric', + 'inv_chi_square', + 'inv_gamma', + 'inv_wishart', + 'lkj_corr', + 'lkj_corr_cholesky', + 'logistic', + 'lognormal', + 'multi_gp', + 'multi_gp_cholesky', + 'multi_normal', + 'multi_normal_cholesky', + 'multi_normal_prec', + 'multi_student_t', + 'multinomial', + 'neg_binomial', + 'neg_binomial_2', + 'neg_binomial_2_log', + 'normal', + 'ordered_logistic', + 'pareto', + 'pareto_type_2', + 'poisson', + 'poisson_log', + 'rayleigh', + 'scaled_inv_chi_square', + 'skew_normal', + 'student_t', + 'uniform', + 'von_mises', + 'weibull', + 'wiener', + 'wishart' +) + +RESERVED = ( + 'alignas', + 'alignof', + 'and', + 'and_eq', + 'asm', + 'auto', + 'bitand', + 'bitor', + 'bool', + 'break', + 'case', + 'catch', + 'char', + 'char16_t', + 'char32_t', + 'class', + 'compl', + 'const', + 'const_cast', + 'constexpr', + 'continue', + 'decltype', + 'default', + 'delete', + 'do', + 'double', + 'dynamic_cast', + 'enum', + 'explicit', + 'export', + 'extern', + 'false', + 'false', + 'float', + 'friend', + 'fvar', + 'goto', + 'inline', + 'int', + 'long', + 'mutable', + 'namespace', + 'new', + 'noexcept', + 'not', + 'not_eq', + 'nullptr', + 'operator', + 'or', + 'or_eq', + 'private', + 'protected', + 'public', + 'register', + 'reinterpret_cast', + 'repeat', + 'short', + 'signed', + 'sizeof', + 'static', + 'static_assert', + 'static_cast', + 'struct', + 'switch', + 'template', + 'then', + 'this', + 'thread_local', + 'throw', + 'true', + 'true', + 'try', + 'typedef', + 'typeid', + 'typename', + 'union', + 'unsigned', + 'until', + 'using', + 'var', + 'virtual', + 'void', + 'volatile', + 'wchar_t', + 'xor', + 'xor_eq' +) + diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/_tsql_builtins.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/_tsql_builtins.py new file mode 100644 index 0000000000000000000000000000000000000000..e29ed34bacc45ccbf41363abe5bbb248bc6bf434 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/_tsql_builtins.py @@ -0,0 +1,1004 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers._tsql_builtins + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + These are manually translated lists from https://msdn.microsoft.com. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +# See https://msdn.microsoft.com/en-us/library/ms174986.aspx. +OPERATORS = ( + '!<', + '!=', + '!>', + '<', + '<=', + '<>', + '=', + '>', + '>=', + '+', + '+=', + '-', + '-=', + '*', + '*=', + '/', + '/=', + '%', + '%=', + '&', + '&=', + '|', + '|=', + '^', + '^=', + '~', + '::', +) + +OPERATOR_WORDS = ( + 'all', + 'and', + 'any', + 'between', + 'except', + 'exists', + 'in', + 'intersect', + 'like', + 'not', + 'or', + 'some', + 'union', +) + +_KEYWORDS_SERVER = ( + 'add', + 'all', + 'alter', + 'and', + 'any', + 'as', + 'asc', + 'authorization', + 'backup', + 'begin', + 'between', + 'break', + 'browse', + 'bulk', + 'by', + 'cascade', + 'case', + 'catch', + 'check', + 'checkpoint', + 'close', + 'clustered', + 'coalesce', + 'collate', + 'column', + 'commit', + 'compute', + 'constraint', + 'contains', + 'containstable', + 'continue', + 'convert', + 'create', + 'cross', + 'current', + 'current_date', + 'current_time', + 'current_timestamp', + 'current_user', + 'cursor', + 'database', + 'dbcc', + 'deallocate', + 'declare', + 'default', + 'delete', + 'deny', + 'desc', + 'disk', + 'distinct', + 'distributed', + 'double', + 'drop', + 'dump', + 'else', + 'end', + 'errlvl', + 'escape', + 'except', + 'exec', + 'execute', + 'exists', + 'exit', + 'external', + 'fetch', + 'file', + 'fillfactor', + 'for', + 'foreign', + 'freetext', + 'freetexttable', + 'from', + 'full', + 'function', + 'goto', + 'grant', + 'group', + 'having', + 'holdlock', + 'identity', + 'identity_insert', + 'identitycol', + 'if', + 'in', + 'index', + 'inner', + 'insert', + 'intersect', + 'into', + 'is', + 'join', + 'key', + 'kill', + 'left', + 'like', + 'lineno', + 'load', + 'merge', + 'national', + 'nocheck', + 'nonclustered', + 'not', + 'null', + 'nullif', + 'of', + 'off', + 'offsets', + 'on', + 'open', + 'opendatasource', + 'openquery', + 'openrowset', + 'openxml', + 'option', + 'or', + 'order', + 'outer', + 'over', + 'percent', + 'pivot', + 'plan', + 'precision', + 'primary', + 'print', + 'proc', + 'procedure', + 'public', + 'raiserror', + 'read', + 'readtext', + 'reconfigure', + 'references', + 'replication', + 'restore', + 'restrict', + 'return', + 'revert', + 'revoke', + 'right', + 'rollback', + 'rowcount', + 'rowguidcol', + 'rule', + 'save', + 'schema', + 'securityaudit', + 'select', + 'semantickeyphrasetable', + 'semanticsimilaritydetailstable', + 'semanticsimilaritytable', + 'session_user', + 'set', + 'setuser', + 'shutdown', + 'some', + 'statistics', + 'system_user', + 'table', + 'tablesample', + 'textsize', + 'then', + 'throw', + 'to', + 'top', + 'tran', + 'transaction', + 'trigger', + 'truncate', + 'try', + 'try_convert', + 'tsequal', + 'union', + 'unique', + 'unpivot', + 'update', + 'updatetext', + 'use', + 'user', + 'values', + 'varying', + 'view', + 'waitfor', + 'when', + 'where', + 'while', + 'with', + 'within', + 'writetext', +) + +_KEYWORDS_FUTURE = ( + 'absolute', + 'action', + 'admin', + 'after', + 'aggregate', + 'alias', + 'allocate', + 'are', + 'array', + 'asensitive', + 'assertion', + 'asymmetric', + 'at', + 'atomic', + 'before', + 'binary', + 'bit', + 'blob', + 'boolean', + 'both', + 'breadth', + 'call', + 'called', + 'cardinality', + 'cascaded', + 'cast', + 'catalog', + 'char', + 'character', + 'class', + 'clob', + 'collation', + 'collect', + 'completion', + 'condition', + 'connect', + 'connection', + 'constraints', + 'constructor', + 'corr', + 'corresponding', + 'covar_pop', + 'covar_samp', + 'cube', + 'cume_dist', + 'current_catalog', + 'current_default_transform_group', + 'current_path', + 'current_role', + 'current_schema', + 'current_transform_group_for_type', + 'cycle', + 'data', + 'date', + 'day', + 'dec', + 'decimal', + 'deferrable', + 'deferred', + 'depth', + 'deref', + 'describe', + 'descriptor', + 'destroy', + 'destructor', + 'deterministic', + 'diagnostics', + 'dictionary', + 'disconnect', + 'domain', + 'dynamic', + 'each', + 'element', + 'end-exec', + 'equals', + 'every', + 'exception', + 'false', + 'filter', + 'first', + 'float', + 'found', + 'free', + 'fulltexttable', + 'fusion', + 'general', + 'get', + 'global', + 'go', + 'grouping', + 'hold', + 'host', + 'hour', + 'ignore', + 'immediate', + 'indicator', + 'initialize', + 'initially', + 'inout', + 'input', + 'int', + 'integer', + 'intersection', + 'interval', + 'isolation', + 'iterate', + 'language', + 'large', + 'last', + 'lateral', + 'leading', + 'less', + 'level', + 'like_regex', + 'limit', + 'ln', + 'local', + 'localtime', + 'localtimestamp', + 'locator', + 'map', + 'match', + 'member', + 'method', + 'minute', + 'mod', + 'modifies', + 'modify', + 'module', + 'month', + 'multiset', + 'names', + 'natural', + 'nchar', + 'nclob', + 'new', + 'next', + 'no', + 'none', + 'normalize', + 'numeric', + 'object', + 'occurrences_regex', + 'old', + 'only', + 'operation', + 'ordinality', + 'out', + 'output', + 'overlay', + 'pad', + 'parameter', + 'parameters', + 'partial', + 'partition', + 'path', + 'percent_rank', + 'percentile_cont', + 'percentile_disc', + 'position_regex', + 'postfix', + 'prefix', + 'preorder', + 'prepare', + 'preserve', + 'prior', + 'privileges', + 'range', + 'reads', + 'real', + 'recursive', + 'ref', + 'referencing', + 'regr_avgx', + 'regr_avgy', + 'regr_count', + 'regr_intercept', + 'regr_r2', + 'regr_slope', + 'regr_sxx', + 'regr_sxy', + 'regr_syy', + 'relative', + 'release', + 'result', + 'returns', + 'role', + 'rollup', + 'routine', + 'row', + 'rows', + 'savepoint', + 'scope', + 'scroll', + 'search', + 'second', + 'section', + 'sensitive', + 'sequence', + 'session', + 'sets', + 'similar', + 'size', + 'smallint', + 'space', + 'specific', + 'specifictype', + 'sql', + 'sqlexception', + 'sqlstate', + 'sqlwarning', + 'start', + 'state', + 'statement', + 'static', + 'stddev_pop', + 'stddev_samp', + 'structure', + 'submultiset', + 'substring_regex', + 'symmetric', + 'system', + 'temporary', + 'terminate', + 'than', + 'time', + 'timestamp', + 'timezone_hour', + 'timezone_minute', + 'trailing', + 'translate_regex', + 'translation', + 'treat', + 'true', + 'uescape', + 'under', + 'unknown', + 'unnest', + 'usage', + 'using', + 'value', + 'var_pop', + 'var_samp', + 'varchar', + 'variable', + 'whenever', + 'width_bucket', + 'window', + 'within', + 'without', + 'work', + 'write', + 'xmlagg', + 'xmlattributes', + 'xmlbinary', + 'xmlcast', + 'xmlcomment', + 'xmlconcat', + 'xmldocument', + 'xmlelement', + 'xmlexists', + 'xmlforest', + 'xmliterate', + 'xmlnamespaces', + 'xmlparse', + 'xmlpi', + 'xmlquery', + 'xmlserialize', + 'xmltable', + 'xmltext', + 'xmlvalidate', + 'year', + 'zone', +) + +_KEYWORDS_ODBC = ( + 'absolute', + 'action', + 'ada', + 'add', + 'all', + 'allocate', + 'alter', + 'and', + 'any', + 'are', + 'as', + 'asc', + 'assertion', + 'at', + 'authorization', + 'avg', + 'begin', + 'between', + 'bit', + 'bit_length', + 'both', + 'by', + 'cascade', + 'cascaded', + 'case', + 'cast', + 'catalog', + 'char', + 'char_length', + 'character', + 'character_length', + 'check', + 'close', + 'coalesce', + 'collate', + 'collation', + 'column', + 'commit', + 'connect', + 'connection', + 'constraint', + 'constraints', + 'continue', + 'convert', + 'corresponding', + 'count', + 'create', + 'cross', + 'current', + 'current_date', + 'current_time', + 'current_timestamp', + 'current_user', + 'cursor', + 'date', + 'day', + 'deallocate', + 'dec', + 'decimal', + 'declare', + 'default', + 'deferrable', + 'deferred', + 'delete', + 'desc', + 'describe', + 'descriptor', + 'diagnostics', + 'disconnect', + 'distinct', + 'domain', + 'double', + 'drop', + 'else', + 'end', + 'end-exec', + 'escape', + 'except', + 'exception', + 'exec', + 'execute', + 'exists', + 'external', + 'extract', + 'false', + 'fetch', + 'first', + 'float', + 'for', + 'foreign', + 'fortran', + 'found', + 'from', + 'full', + 'get', + 'global', + 'go', + 'goto', + 'grant', + 'group', + 'having', + 'hour', + 'identity', + 'immediate', + 'in', + 'include', + 'index', + 'indicator', + 'initially', + 'inner', + 'input', + 'insensitive', + 'insert', + 'int', + 'integer', + 'intersect', + 'interval', + 'into', + 'is', + 'isolation', + 'join', + 'key', + 'language', + 'last', + 'leading', + 'left', + 'level', + 'like', + 'local', + 'lower', + 'match', + 'max', + 'min', + 'minute', + 'module', + 'month', + 'names', + 'national', + 'natural', + 'nchar', + 'next', + 'no', + 'none', + 'not', + 'null', + 'nullif', + 'numeric', + 'octet_length', + 'of', + 'on', + 'only', + 'open', + 'option', + 'or', + 'order', + 'outer', + 'output', + 'overlaps', + 'pad', + 'partial', + 'pascal', + 'position', + 'precision', + 'prepare', + 'preserve', + 'primary', + 'prior', + 'privileges', + 'procedure', + 'public', + 'read', + 'real', + 'references', + 'relative', + 'restrict', + 'revoke', + 'right', + 'rollback', + 'rows', + 'schema', + 'scroll', + 'second', + 'section', + 'select', + 'session', + 'session_user', + 'set', + 'size', + 'smallint', + 'some', + 'space', + 'sql', + 'sqlca', + 'sqlcode', + 'sqlerror', + 'sqlstate', + 'sqlwarning', + 'substring', + 'sum', + 'system_user', + 'table', + 'temporary', + 'then', + 'time', + 'timestamp', + 'timezone_hour', + 'timezone_minute', + 'to', + 'trailing', + 'transaction', + 'translate', + 'translation', + 'trim', + 'true', + 'union', + 'unique', + 'unknown', + 'update', + 'upper', + 'usage', + 'user', + 'using', + 'value', + 'values', + 'varchar', + 'varying', + 'view', + 'when', + 'whenever', + 'where', + 'with', + 'work', + 'write', + 'year', + 'zone', +) + +# See https://msdn.microsoft.com/en-us/library/ms189822.aspx. +KEYWORDS = sorted(set(_KEYWORDS_FUTURE + _KEYWORDS_ODBC + _KEYWORDS_SERVER)) + +# See https://msdn.microsoft.com/en-us/library/ms187752.aspx. +TYPES = ( + 'bigint', + 'binary', + 'bit', + 'char', + 'cursor', + 'date', + 'datetime', + 'datetime2', + 'datetimeoffset', + 'decimal', + 'float', + 'hierarchyid', + 'image', + 'int', + 'money', + 'nchar', + 'ntext', + 'numeric', + 'nvarchar', + 'real', + 'smalldatetime', + 'smallint', + 'smallmoney', + 'sql_variant', + 'table', + 'text', + 'time', + 'timestamp', + 'tinyint', + 'uniqueidentifier', + 'varbinary', + 'varchar', + 'xml', +) + +# See https://msdn.microsoft.com/en-us/library/ms174318.aspx. +FUNCTIONS = ( + '$partition', + 'abs', + 'acos', + 'app_name', + 'applock_mode', + 'applock_test', + 'ascii', + 'asin', + 'assemblyproperty', + 'atan', + 'atn2', + 'avg', + 'binary_checksum', + 'cast', + 'ceiling', + 'certencoded', + 'certprivatekey', + 'char', + 'charindex', + 'checksum', + 'checksum_agg', + 'choose', + 'col_length', + 'col_name', + 'columnproperty', + 'compress', + 'concat', + 'connectionproperty', + 'context_info', + 'convert', + 'cos', + 'cot', + 'count', + 'count_big', + 'current_request_id', + 'current_timestamp', + 'current_transaction_id', + 'current_user', + 'cursor_status', + 'database_principal_id', + 'databasepropertyex', + 'dateadd', + 'datediff', + 'datediff_big', + 'datefromparts', + 'datename', + 'datepart', + 'datetime2fromparts', + 'datetimefromparts', + 'datetimeoffsetfromparts', + 'day', + 'db_id', + 'db_name', + 'decompress', + 'degrees', + 'dense_rank', + 'difference', + 'eomonth', + 'error_line', + 'error_message', + 'error_number', + 'error_procedure', + 'error_severity', + 'error_state', + 'exp', + 'file_id', + 'file_idex', + 'file_name', + 'filegroup_id', + 'filegroup_name', + 'filegroupproperty', + 'fileproperty', + 'floor', + 'format', + 'formatmessage', + 'fulltextcatalogproperty', + 'fulltextserviceproperty', + 'get_filestream_transaction_context', + 'getansinull', + 'getdate', + 'getutcdate', + 'grouping', + 'grouping_id', + 'has_perms_by_name', + 'host_id', + 'host_name', + 'iif', + 'index_col', + 'indexkey_property', + 'indexproperty', + 'is_member', + 'is_rolemember', + 'is_srvrolemember', + 'isdate', + 'isjson', + 'isnull', + 'isnumeric', + 'json_modify', + 'json_query', + 'json_value', + 'left', + 'len', + 'log', + 'log10', + 'lower', + 'ltrim', + 'max', + 'min', + 'min_active_rowversion', + 'month', + 'nchar', + 'newid', + 'newsequentialid', + 'ntile', + 'object_definition', + 'object_id', + 'object_name', + 'object_schema_name', + 'objectproperty', + 'objectpropertyex', + 'opendatasource', + 'openjson', + 'openquery', + 'openrowset', + 'openxml', + 'original_db_name', + 'original_login', + 'parse', + 'parsename', + 'patindex', + 'permissions', + 'pi', + 'power', + 'pwdcompare', + 'pwdencrypt', + 'quotename', + 'radians', + 'rand', + 'rank', + 'replace', + 'replicate', + 'reverse', + 'right', + 'round', + 'row_number', + 'rowcount_big', + 'rtrim', + 'schema_id', + 'schema_name', + 'scope_identity', + 'serverproperty', + 'session_context', + 'session_user', + 'sign', + 'sin', + 'smalldatetimefromparts', + 'soundex', + 'sp_helplanguage', + 'space', + 'sqrt', + 'square', + 'stats_date', + 'stdev', + 'stdevp', + 'str', + 'string_escape', + 'string_split', + 'stuff', + 'substring', + 'sum', + 'suser_id', + 'suser_name', + 'suser_sid', + 'suser_sname', + 'switchoffset', + 'sysdatetime', + 'sysdatetimeoffset', + 'system_user', + 'sysutcdatetime', + 'tan', + 'textptr', + 'textvalid', + 'timefromparts', + 'todatetimeoffset', + 'try_cast', + 'try_convert', + 'try_parse', + 'type_id', + 'type_name', + 'typeproperty', + 'unicode', + 'upper', + 'user_id', + 'user_name', + 'var', + 'varp', + 'xact_state', + 'year', +) diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/_vim_builtins.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/_vim_builtins.py new file mode 100644 index 0000000000000000000000000000000000000000..8258628995bb95fca551f879d9126f9afd6a1607 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/_vim_builtins.py @@ -0,0 +1,1939 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers._vim_builtins + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + This file is autogenerated by scripts/get_vimkw.py + + :copyright: Copyright 2006-2017 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/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/algebra.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/algebra.py new file mode 100644 index 0000000000000000000000000000000000000000..15d688422426c91e47effa07de02e005de094fd7 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/algebra.py @@ -0,0 +1,221 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.algebra + ~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for computer algebra systems. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, bygroups, words +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation + +__all__ = ['GAPLexer', 'MathematicaLexer', 'MuPADLexer', 'BCLexer'] + + +class GAPLexer(RegexLexer): + """ + For `GAP `_ source code. + + .. versionadded:: 2.0 + """ + name = 'GAP' + aliases = ['gap'] + filenames = ['*.g', '*.gd', '*.gi', '*.gap'] + + tokens = { + 'root': [ + (r'#.*$', Comment.Single), + (r'"(?:[^"\\]|\\.)*"', String), + (r'\(|\)|\[|\]|\{|\}', Punctuation), + (r'''(?x)\b(?: + if|then|elif|else|fi| + for|while|do|od| + repeat|until| + break|continue| + function|local|return|end| + rec| + quit|QUIT| + IsBound|Unbind| + TryNextMethod| + Info|Assert + )\b''', Keyword), + (r'''(?x)\b(?: + true|false|fail|infinity + )\b''', + Name.Constant), + (r'''(?x)\b(?: + (Declare|Install)([A-Z][A-Za-z]+)| + BindGlobal|BIND_GLOBAL + )\b''', + Name.Builtin), + (r'\.|,|:=|;|=|\+|-|\*|/|\^|>|<', Operator), + (r'''(?x)\b(?: + and|or|not|mod|in + )\b''', + Operator.Word), + (r'''(?x) + (?:\w+|`[^`]*`) + (?:::\w+|`[^`]*`)*''', Name.Variable), + (r'[0-9]+(?:\.[0-9]*)?(?:e[0-9]+)?', Number), + (r'\.[0-9]+(?:e[0-9]+)?', Number), + (r'.', Text) + ], + } + + +class MathematicaLexer(RegexLexer): + """ + Lexer for `Mathematica `_ source code. + + .. versionadded:: 2.0 + """ + name = 'Mathematica' + aliases = ['mathematica', 'mma', 'nb'] + filenames = ['*.nb', '*.cdf', '*.nbp', '*.ma'] + mimetypes = ['application/mathematica', + 'application/vnd.wolfram.mathematica', + 'application/vnd.wolfram.mathematica.package', + 'application/vnd.wolfram.cdf'] + + # http://reference.wolfram.com/mathematica/guide/Syntax.html + operators = ( + ";;", "=", "=.", "!=" "==", ":=", "->", ":>", "/.", "+", "-", "*", "/", + "^", "&&", "||", "!", "<>", "|", "/;", "?", "@", "//", "/@", "@@", + "@@@", "~~", "===", "&", "<", ">", "<=", ">=", + ) + + punctuation = (",", ";", "(", ")", "[", "]", "{", "}") + + def _multi_escape(entries): + return '(%s)' % ('|'.join(re.escape(entry) for entry in entries)) + + tokens = { + 'root': [ + (r'(?s)\(\*.*?\*\)', Comment), + + (r'([a-zA-Z]+[A-Za-z0-9]*`)', Name.Namespace), + (r'([A-Za-z0-9]*_+[A-Za-z0-9]*)', Name.Variable), + (r'#\d*', Name.Variable), + (r'([a-zA-Z]+[a-zA-Z0-9]*)', Name), + + (r'-?\d+\.\d*', Number.Float), + (r'-?\d*\.\d+', Number.Float), + (r'-?\d+', Number.Integer), + + (words(operators), Operator), + (words(punctuation), Punctuation), + (r'".*?"', String), + (r'\s+', Text.Whitespace), + ], + } + + +class MuPADLexer(RegexLexer): + """ + A `MuPAD `_ lexer. + Contributed by Christopher Creutzig . + + .. versionadded:: 0.8 + """ + name = 'MuPAD' + aliases = ['mupad'] + filenames = ['*.mu'] + + tokens = { + 'root': [ + (r'//.*?$', Comment.Single), + (r'/\*', Comment.Multiline, 'comment'), + (r'"(?:[^"\\]|\\.)*"', String), + (r'\(|\)|\[|\]|\{|\}', Punctuation), + (r'''(?x)\b(?: + next|break|end| + axiom|end_axiom|category|end_category|domain|end_domain|inherits| + if|%if|then|elif|else|end_if| + case|of|do|otherwise|end_case| + while|end_while| + repeat|until|end_repeat| + for|from|to|downto|step|end_for| + proc|local|option|save|begin|end_proc| + delete|frame + )\b''', Keyword), + (r'''(?x)\b(?: + DOM_ARRAY|DOM_BOOL|DOM_COMPLEX|DOM_DOMAIN|DOM_EXEC|DOM_EXPR| + DOM_FAIL|DOM_FLOAT|DOM_FRAME|DOM_FUNC_ENV|DOM_HFARRAY|DOM_IDENT| + DOM_INT|DOM_INTERVAL|DOM_LIST|DOM_NIL|DOM_NULL|DOM_POLY|DOM_PROC| + DOM_PROC_ENV|DOM_RAT|DOM_SET|DOM_STRING|DOM_TABLE|DOM_VAR + )\b''', Name.Class), + (r'''(?x)\b(?: + PI|EULER|E|CATALAN| + NIL|FAIL|undefined|infinity| + TRUE|FALSE|UNKNOWN + )\b''', + Name.Constant), + (r'\b(?:dom|procname)\b', Name.Builtin.Pseudo), + (r'\.|,|:|;|=|\+|-|\*|/|\^|@|>|<|\$|\||!|\'|%|~=', Operator), + (r'''(?x)\b(?: + and|or|not|xor| + assuming| + div|mod| + union|minus|intersect|in|subset + )\b''', + Operator.Word), + (r'\b(?:I|RDN_INF|RD_NINF|RD_NAN)\b', Number), + # (r'\b(?:adt|linalg|newDomain|hold)\b', Name.Builtin), + (r'''(?x) + ((?:[a-zA-Z_#][\w#]*|`[^`]*`) + (?:::[a-zA-Z_#][\w#]*|`[^`]*`)*)(\s*)([(])''', + bygroups(Name.Function, Text, Punctuation)), + (r'''(?x) + (?:[a-zA-Z_#][\w#]*|`[^`]*`) + (?:::[a-zA-Z_#][\w#]*|`[^`]*`)*''', Name.Variable), + (r'[0-9]+(?:\.[0-9]*)?(?:e[0-9]+)?', Number), + (r'\.[0-9]+(?:e[0-9]+)?', Number), + (r'.', Text) + ], + 'comment': [ + (r'[^*/]', Comment.Multiline), + (r'/\*', Comment.Multiline, '#push'), + (r'\*/', Comment.Multiline, '#pop'), + (r'[*/]', Comment.Multiline) + ], + } + + +class BCLexer(RegexLexer): + """ + A `BC `_ lexer. + + .. versionadded:: 2.1 + """ + name = 'BC' + aliases = ['bc'] + filenames = ['*.bc'] + + tokens = { + 'root': [ + (r'/\*', Comment.Multiline, 'comment'), + (r'"(?:[^"\\]|\\.)*"', String), + (r'[{}();,]', Punctuation), + (words(('if', 'else', 'while', 'for', 'break', 'continue', + 'halt', 'return', 'define', 'auto', 'print', 'read', + 'length', 'scale', 'sqrt', 'limits', 'quit', + 'warranty'), suffix=r'\b'), Keyword), + (r'\+\+|--|\|\||&&|' + r'([-<>+*%\^/!=])=?', Operator), + # bc doesn't support exponential + (r'[0-9]+(\.[0-9]*)?', Number), + (r'\.[0-9]+', Number), + (r'.', Text) + ], + 'comment': [ + (r'[^*/]+', Comment.Multiline), + (r'\*/', Comment.Multiline, '#pop'), + (r'[*/]', Comment.Multiline) + ], + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/ambient.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/ambient.py new file mode 100644 index 0000000000000000000000000000000000000000..53f3a5e127aa3eb6de27d8da22ae741ad123533b --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/ambient.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.ambient + ~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for AmbientTalk language. + + :copyright: Copyright 2006-2017 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__ = ['AmbientTalkLexer'] + + +class AmbientTalkLexer(RegexLexer): + """ + Lexer for `AmbientTalk `_ source code. + + .. versionadded:: 2.0 + """ + name = 'AmbientTalk' + filenames = ['*.at'] + aliases = ['at', 'ambienttalk', 'ambienttalk/2'] + mimetypes = ['text/x-ambienttalk'] + + flags = re.MULTILINE | re.DOTALL + + builtin = words(('if:', 'then:', 'else:', 'when:', 'whenever:', 'discovered:', + 'disconnected:', 'reconnected:', 'takenOffline:', 'becomes:', + 'export:', 'as:', 'object:', 'actor:', 'mirror:', 'taggedAs:', + 'mirroredBy:', 'is:')) + tokens = { + 'root': [ + (r'\s+', Text), + (r'//.*?\n', Comment.Single), + (r'/\*.*?\*/', Comment.Multiline), + (r'(def|deftype|import|alias|exclude)\b', Keyword), + (builtin, Name.Builtin), + (r'(true|false|nil)\b', Keyword.Constant), + (r'(~|lobby|jlobby|/)\.', Keyword.Constant, 'namespace'), + (r'"(\\\\|\\"|[^"])*"', String), + (r'\|', Punctuation, 'arglist'), + (r'<:|[*^!%&<>+=,./?-]|:=', Operator), + (r"`[a-zA-Z_]\w*", String.Symbol), + (r"[a-zA-Z_]\w*:", Name.Function), + (r"[{}()\[\];`]", Punctuation), + (r'(self|super)\b', Name.Variable.Instance), + (r"[a-zA-Z_]\w*", Name.Variable), + (r"@[a-zA-Z_]\w*", Name.Class), + (r"@\[", Name.Class, 'annotations'), + include('numbers'), + ], + 'numbers': [ + (r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float), + (r'\d+', Number.Integer) + ], + 'namespace': [ + (r'[a-zA-Z_]\w*\.', Name.Namespace), + (r'[a-zA-Z_]\w*:', Name.Function, '#pop'), + (r'[a-zA-Z_]\w*(?!\.)', Name.Function, '#pop') + ], + 'annotations': [ + (r"(.*?)\]", Name.Class, '#pop') + ], + 'arglist': [ + (r'\|', Punctuation, '#pop'), + (r'\s*(,)\s*', Punctuation), + (r'[a-zA-Z_]\w*', Name.Variable), + ], + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/ampl.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/ampl.py new file mode 100644 index 0000000000000000000000000000000000000000..d439cb19c55a822f6ff976012000f3a630fae472 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/ampl.py @@ -0,0 +1,87 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.ampl + ~~~~~~~~~~~~~~~~~~~~ + + Lexers for the ampl language. + + :copyright: Copyright 2006-2017 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 + +__all__ = ['AmplLexer'] + + +class AmplLexer(RegexLexer): + """ + For AMPL source code. + + .. versionadded:: 2.2 + """ + name = 'Ampl' + aliases = ['ampl'] + filenames = ['*.run'] + + tokens = { + 'root': [ + (r'\n', Text), + (r'\s+', Text.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, Text, Name.Variable)), + (r'(param)(\s*)(:)(\s*)(\w+)(\s*)(:)(\s*)((\w|\s)+)', + bygroups(Keyword.Declaration, Text, Punctuation, Text, + Name.Variable, Text, Punctuation, Text, Name.Variable)), + (r'(let|fix|unfix)(\s*)((?:\{.*\})?)(\s*)(\w+)', + bygroups(Keyword.Declaration, Text, using(this), Text, 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/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/apl.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/apl.py new file mode 100644 index 0000000000000000000000000000000000000000..b3414cc05ee6e9328e46e6e494b19ae58619c1ea --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/apl.py @@ -0,0 +1,101 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.apl + ~~~~~~~~~~~~~~~~~~~ + + Lexers for APL. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation + +__all__ = ['APLLexer'] + + +class APLLexer(RegexLexer): + """ + A simple APL lexer. + + .. versionadded:: 2.0 + """ + name = 'APL' + aliases = ['apl'] + filenames = ['*.apl'] + + tokens = { + 'root': [ + # Whitespace + # ========== + (r'\s+', Text), + # + # Comment + # ======= + # '⍝' is traditional; '#' is supported by GNU APL and NGN (but not Dyalog) + (u'[⍝#].*$', Comment.Single), + # + # Strings + # ======= + (r'\'((\'\')|[^\'])*\'', String.Single), + (r'"(("")|[^"])*"', String.Double), # supported by NGN APL + # + # Punctuation + # =========== + # This token type is used for diamond and parenthesis + # but not for bracket and ; (see below) + (u'[⋄◇()]', Punctuation), + # + # Array indexing + # ============== + # Since this token type is very important in APL, it is not included in + # the punctuation token type but rather in the following one + (r'[\[\];]', String.Regex), + # + # Distinguished names + # =================== + # following IBM APL2 standard + (u'⎕[A-Za-zΔ∆⍙][A-Za-zΔ∆⍙_¯0-9]*', Name.Function), + # + # Labels + # ====== + # following IBM APL2 standard + # (u'[A-Za-zΔ∆⍙][A-Za-zΔ∆⍙_¯0-9]*:', Name.Label), + # + # Variables + # ========= + # following IBM APL2 standard + (u'[A-Za-zΔ∆⍙][A-Za-zΔ∆⍙_¯0-9]*', Name.Variable), + # + # Numbers + # ======= + (u'¯?(0[Xx][0-9A-Fa-f]+|[0-9]*\.?[0-9]+([Ee][+¯]?[0-9]+)?|¯|∞)' + u'([Jj]¯?(0[Xx][0-9A-Fa-f]+|[0-9]*\.?[0-9]+([Ee][+¯]?[0-9]+)?|¯|∞))?', + Number), + # + # Operators + # ========== + (u'[\.\\\/⌿⍀¨⍣⍨⍠⍤∘]', Name.Attribute), # closest token type + (u'[+\-×÷⌈⌊∣|⍳?*⍟○!⌹<≤=>≥≠≡≢∊⍷∪∩~∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢⍁⍂≈⌸⍯↗]', + Operator), + # + # Constant + # ======== + (u'⍬', Name.Constant), + # + # Quad symbol + # =========== + (u'[⎕⍞]', Name.Variable.Global), + # + # Arrows left/right + # ================= + (u'[←→]', Keyword.Declaration), + # + # D-Fn + # ==== + (u'[⍺⍵⍶⍹∇:]', Name.Builtin.Pseudo), + (r'[{}]', Keyword.Type), + ], + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/bibtex.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/bibtex.py new file mode 100644 index 0000000000000000000000000000000000000000..a6159f8137f5dfcc2335486ea79ede52ebdd5774 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/bibtex.py @@ -0,0 +1,160 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.bibtex + ~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for BibTeX bibliography data and styles + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, ExtendedRegexLexer, include, default, \ + words +from pygments.token import Name, Comment, String, Error, Number, Text, \ + Keyword, Punctuation + +__all__ = ['BibTeXLexer', 'BSTLexer'] + + +class BibTeXLexer(ExtendedRegexLexer): + """ + A lexer for BibTeX bibliography data format. + + .. versionadded:: 2.2 + """ + + name = 'BibTeX' + aliases = ['bib', 'bibtex'] + filenames = ['*.bib'] + mimetypes = ["text/x-bibtex"] + flags = re.IGNORECASE + + ALLOWED_CHARS = r'@!$&*+\-./:;<>?\[\\\]^`|~' + IDENTIFIER = '[{0}][{1}]*'.format('a-z_' + ALLOWED_CHARS, r'\w' + ALLOWED_CHARS) + + def open_brace_callback(self, match, ctx): + opening_brace = match.group() + ctx.opening_brace = opening_brace + yield match.start(), Punctuation, opening_brace + ctx.pos = match.end() + + def close_brace_callback(self, match, ctx): + closing_brace = match.group() + if ( + ctx.opening_brace == '{' and closing_brace != '}' or + ctx.opening_brace == '(' and closing_brace != ')' + ): + yield match.start(), Error, closing_brace + else: + yield match.start(), Punctuation, closing_brace + del ctx.opening_brace + ctx.pos = match.end() + + tokens = { + 'root': [ + include('whitespace'), + ('@comment', Comment), + ('@preamble', Name.Class, ('closing-brace', 'value', 'opening-brace')), + ('@string', Name.Class, ('closing-brace', 'field', 'opening-brace')), + ('@' + IDENTIFIER, Name.Class, + ('closing-brace', 'command-body', 'opening-brace')), + ('.+', Comment), + ], + 'opening-brace': [ + include('whitespace'), + (r'[{(]', open_brace_callback, '#pop'), + ], + 'closing-brace': [ + include('whitespace'), + (r'[})]', close_brace_callback, '#pop'), + ], + 'command-body': [ + include('whitespace'), + (r'[^\s\,\}]+', Name.Label, ('#pop', 'fields')), + ], + 'fields': [ + include('whitespace'), + (',', Punctuation, 'field'), + default('#pop'), + ], + 'field': [ + include('whitespace'), + (IDENTIFIER, Name.Attribute, ('value', '=')), + default('#pop'), + ], + '=': [ + include('whitespace'), + ('=', Punctuation, '#pop'), + ], + 'value': [ + include('whitespace'), + (IDENTIFIER, Name.Variable), + ('"', String, 'quoted-string'), + (r'\{', String, 'braced-string'), + (r'[\d]+', Number), + ('#', Punctuation), + default('#pop'), + ], + 'quoted-string': [ + (r'\{', String, 'braced-string'), + ('"', String, '#pop'), + ('[^\{\"]+', String), + ], + 'braced-string': [ + (r'\{', String, '#push'), + (r'\}', String, '#pop'), + ('[^\{\}]+', String), + ], + 'whitespace': [ + (r'\s+', Text), + ], + } + + +class BSTLexer(RegexLexer): + """ + A lexer for BibTeX bibliography styles. + + .. versionadded:: 2.2 + """ + + name = 'BST' + aliases = ['bst', 'bst-pybtex'] + filenames = ['*.bst'] + flags = re.IGNORECASE | re.MULTILINE + + tokens = { + 'root': [ + include('whitespace'), + (words(['read', 'sort']), Keyword), + (words(['execute', 'integers', 'iterate', 'reverse', 'strings']), + Keyword, ('group')), + (words(['function', 'macro']), Keyword, ('group', 'group')), + (words(['entry']), Keyword, ('group', 'group', 'group')), + ], + 'group': [ + include('whitespace'), + (r'\{', Punctuation, ('#pop', 'group-end', 'body')), + ], + 'group-end': [ + include('whitespace'), + (r'\}', Punctuation, '#pop'), + ], + 'body': [ + include('whitespace'), + (r"\'[^#\"\{\}\s]+", Name.Function), + (r'[^#\"\{\}\s]+\$', Name.Builtin), + (r'[^#\"\{\}\s]+', Name.Variable), + (r'"[^\"]*"', String), + (r'#-?\d+', Number), + (r'\{', Punctuation, ('group-end', 'body')), + default('#pop'), + ], + 'whitespace': [ + ('\s+', Text), + ('%.*?$', Comment.SingleLine), + ], + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/c_like.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/c_like.py new file mode 100644 index 0000000000000000000000000000000000000000..f7ba7e8f841f3f81ed2bcf8ba7c70ec9fab3d798 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/c_like.py @@ -0,0 +1,541 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.c_like + ~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for other C-like languages. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, include, bygroups, inherit, words, \ + default +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation + +from pygments.lexers.c_cpp import CLexer, CppLexer +from pygments.lexers import _mql_builtins + +__all__ = ['PikeLexer', 'NesCLexer', 'ClayLexer', 'ECLexer', 'ValaLexer', + 'CudaLexer', 'SwigLexer', 'MqlLexer', 'ArduinoLexer'] + + +class PikeLexer(CppLexer): + """ + For `Pike `_ source code. + + .. versionadded:: 2.0 + """ + name = 'Pike' + aliases = ['pike'] + filenames = ['*.pike', '*.pmod'] + mimetypes = ['text/x-pike'] + + tokens = { + 'statements': [ + (words(( + 'catch', 'new', 'private', 'protected', 'public', 'gauge', + 'throw', 'throws', 'class', 'interface', 'implement', 'abstract', 'extends', 'from', + 'this', 'super', 'constant', 'final', 'static', 'import', 'use', 'extern', + 'inline', 'proto', 'break', 'continue', 'if', 'else', 'for', + 'while', 'do', 'switch', 'case', 'as', 'in', 'version', 'return', 'true', 'false', 'null', + '__VERSION__', '__MAJOR__', '__MINOR__', '__BUILD__', '__REAL_VERSION__', + '__REAL_MAJOR__', '__REAL_MINOR__', '__REAL_BUILD__', '__DATE__', '__TIME__', + '__FILE__', '__DIR__', '__LINE__', '__AUTO_BIGNUM__', '__NT__', '__PIKE__', + '__amigaos__', '_Pragma', 'static_assert', 'defined', 'sscanf'), suffix=r'\b'), + Keyword), + (r'(bool|int|long|float|short|double|char|string|object|void|mapping|' + r'array|multiset|program|function|lambda|mixed|' + r'[a-z_][a-z0-9_]*_t)\b', + Keyword.Type), + (r'(class)(\s+)', bygroups(Keyword, Text), 'classname'), + (r'[~!%^&*+=|?:<>/@-]', Operator), + inherit, + ], + 'classname': [ + (r'[a-zA-Z_]\w*', Name.Class, '#pop'), + # template specification + (r'\s*(?=>)', Text, '#pop'), + ], + } + + +class NesCLexer(CLexer): + """ + For `nesC `_ source code with preprocessor + directives. + + .. versionadded:: 2.0 + """ + name = 'nesC' + aliases = ['nesc'] + filenames = ['*.nc'] + mimetypes = ['text/x-nescsrc'] + + tokens = { + 'statements': [ + (words(( + 'abstract', 'as', 'async', 'atomic', 'call', 'command', 'component', + 'components', 'configuration', 'event', 'extends', 'generic', + 'implementation', 'includes', 'interface', 'module', 'new', 'norace', + 'post', 'provides', 'signal', 'task', 'uses'), suffix=r'\b'), + Keyword), + (words(('nx_struct', 'nx_union', 'nx_int8_t', 'nx_int16_t', 'nx_int32_t', + 'nx_int64_t', 'nx_uint8_t', 'nx_uint16_t', 'nx_uint32_t', + 'nx_uint64_t'), suffix=r'\b'), + Keyword.Type), + inherit, + ], + } + + +class ClayLexer(RegexLexer): + """ + For `Clay `_ source. + + .. versionadded:: 2.0 + """ + name = 'Clay' + filenames = ['*.clay'] + aliases = ['clay'] + mimetypes = ['text/x-clay'] + tokens = { + 'root': [ + (r'\s', Text), + (r'//.*?$', Comment.Singleline), + (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline), + (r'\b(public|private|import|as|record|variant|instance' + r'|define|overload|default|external|alias' + r'|rvalue|ref|forward|inline|noinline|forceinline' + r'|enum|var|and|or|not|if|else|goto|return|while' + r'|switch|case|break|continue|for|in|true|false|try|catch|throw' + r'|finally|onerror|staticassert|eval|when|newtype' + r'|__FILE__|__LINE__|__COLUMN__|__ARG__' + r')\b', Keyword), + (r'[~!%^&*+=|:<>/-]', Operator), + (r'[#(){}\[\],;.]', Punctuation), + (r'0x[0-9a-fA-F]+[LlUu]*', Number.Hex), + (r'\d+[LlUu]*', Number.Integer), + (r'\b(true|false)\b', Name.Builtin), + (r'(?i)[a-z_?][\w?]*', Name), + (r'"""', String, 'tdqs'), + (r'"', String, 'dqs'), + ], + 'strings': [ + (r'(?i)\\(x[0-9a-f]{2}|.)', String.Escape), + (r'.', String), + ], + 'nl': [ + (r'\n', String), + ], + 'dqs': [ + (r'"', String, '#pop'), + include('strings'), + ], + 'tdqs': [ + (r'"""', String, '#pop'), + include('strings'), + include('nl'), + ], + } + + +class ECLexer(CLexer): + """ + For eC source code with preprocessor directives. + + .. versionadded:: 1.5 + """ + name = 'eC' + aliases = ['ec'] + filenames = ['*.ec', '*.eh'] + mimetypes = ['text/x-echdr', 'text/x-ecsrc'] + + tokens = { + 'statements': [ + (words(( + 'virtual', 'class', 'private', 'public', 'property', 'import', + 'delete', 'new', 'new0', 'renew', 'renew0', 'define', 'get', + 'set', 'remote', 'dllexport', 'dllimport', 'stdcall', 'subclass', + '__on_register_module', 'namespace', 'using', 'typed_object', + 'any_object', 'incref', 'register', 'watch', 'stopwatching', 'firewatchers', + 'watchable', 'class_designer', 'class_fixed', 'class_no_expansion', 'isset', + 'class_default_property', 'property_category', 'class_data', + 'class_property', 'thisclass', 'dbtable', 'dbindex', + 'database_open', 'dbfield'), suffix=r'\b'), Keyword), + (words(('uint', 'uint16', 'uint32', 'uint64', 'bool', 'byte', + 'unichar', 'int64'), suffix=r'\b'), + Keyword.Type), + (r'(class)(\s+)', bygroups(Keyword, Text), 'classname'), + (r'(null|value|this)\b', Name.Builtin), + inherit, + ], + 'classname': [ + (r'[a-zA-Z_]\w*', Name.Class, '#pop'), + # template specification + (r'\s*(?=>)', Text, '#pop'), + ], + } + + +class ValaLexer(RegexLexer): + """ + For Vala source code with preprocessor directives. + + .. versionadded:: 1.1 + """ + name = 'Vala' + aliases = ['vala', 'vapi'] + filenames = ['*.vala', '*.vapi'] + mimetypes = ['text/x-vala'] + + tokens = { + 'whitespace': [ + (r'^\s*#if\s+0', Comment.Preproc, 'if0'), + (r'\n', Text), + (r'\s+', Text), + (r'\\\n', Text), # line continuation + (r'//(\n|(.|\n)*?[^\\]\n)', Comment.Single), + (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline), + ], + 'statements': [ + (r'[L@]?"', String, 'string'), + (r"L?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'", + String.Char), + (r'(?s)""".*?"""', String), # verbatim strings + (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'(\[)(Compact|Immutable|(?:Boolean|Simple)Type)(\])', + bygroups(Punctuation, Name.Decorator, Punctuation)), + # TODO: "correctly" parse complex code attributes + (r'(\[)(CCode|(?:Integer|Floating)Type)', + bygroups(Punctuation, Name.Decorator)), + (r'[()\[\],.]', Punctuation), + (words(( + 'as', 'base', 'break', 'case', 'catch', 'construct', 'continue', + 'default', 'delete', 'do', 'else', 'enum', 'finally', 'for', + 'foreach', 'get', 'if', 'in', 'is', 'lock', 'new', 'out', 'params', + 'return', 'set', 'sizeof', 'switch', 'this', 'throw', 'try', + 'typeof', 'while', 'yield'), suffix=r'\b'), + Keyword), + (words(( + 'abstract', 'const', 'delegate', 'dynamic', 'ensures', 'extern', + 'inline', 'internal', 'override', 'owned', 'private', 'protected', + 'public', 'ref', 'requires', 'signal', 'static', 'throws', 'unowned', + 'var', 'virtual', 'volatile', 'weak', 'yields'), suffix=r'\b'), + Keyword.Declaration), + (r'(namespace|using)(\s+)', bygroups(Keyword.Namespace, Text), + 'namespace'), + (r'(class|errordomain|interface|struct)(\s+)', + bygroups(Keyword.Declaration, Text), 'class'), + (r'(\.)([a-zA-Z_]\w*)', + bygroups(Operator, Name.Attribute)), + # void is an actual keyword, others are in glib-2.0.vapi + (words(( + 'void', 'bool', 'char', 'double', 'float', 'int', 'int8', 'int16', + 'int32', 'int64', 'long', 'short', 'size_t', 'ssize_t', 'string', + 'time_t', 'uchar', 'uint', 'uint8', 'uint16', 'uint32', 'uint64', + 'ulong', 'unichar', 'ushort'), suffix=r'\b'), + Keyword.Type), + (r'(true|false|null)\b', Name.Builtin), + ('[a-zA-Z_]\w*', Name), + ], + 'root': [ + include('whitespace'), + default('statement'), + ], + 'statement': [ + include('whitespace'), + include('statements'), + ('[{}]', Punctuation), + (';', Punctuation, '#pop'), + ], + 'string': [ + (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 + ], + 'if0': [ + (r'^\s*#if.*?(?`_ + source. + + .. versionadded:: 1.6 + """ + name = 'CUDA' + filenames = ['*.cu', '*.cuh'] + aliases = ['cuda', 'cu'] + mimetypes = ['text/x-cuda'] + + function_qualifiers = set(('__device__', '__global__', '__host__', + '__noinline__', '__forceinline__')) + variable_qualifiers = set(('__device__', '__constant__', '__shared__', + '__restrict__')) + vector_types = set(('char1', 'uchar1', 'char2', 'uchar2', 'char3', 'uchar3', + 'char4', 'uchar4', 'short1', 'ushort1', 'short2', 'ushort2', + 'short3', 'ushort3', 'short4', 'ushort4', 'int1', 'uint1', + 'int2', 'uint2', 'int3', 'uint3', 'int4', 'uint4', 'long1', + 'ulong1', 'long2', 'ulong2', 'long3', 'ulong3', 'long4', + 'ulong4', 'longlong1', 'ulonglong1', 'longlong2', + 'ulonglong2', 'float1', 'float2', 'float3', 'float4', + 'double1', 'double2', 'dim3')) + variables = set(('gridDim', 'blockIdx', 'blockDim', 'threadIdx', 'warpSize')) + functions = set(('__threadfence_block', '__threadfence', '__threadfence_system', + '__syncthreads', '__syncthreads_count', '__syncthreads_and', + '__syncthreads_or')) + execution_confs = set(('<<<', '>>>')) + + def get_tokens_unprocessed(self, text): + for index, token, value in CLexer.get_tokens_unprocessed(self, text): + if token is Name: + if value in self.variable_qualifiers: + token = Keyword.Type + elif value in self.vector_types: + token = Keyword.Type + elif value in self.variables: + token = Name.Builtin + elif value in self.execution_confs: + token = Keyword.Pseudo + elif value in self.function_qualifiers: + token = Keyword.Reserved + elif value in self.functions: + token = Name.Function + yield index, token, value + + +class SwigLexer(CppLexer): + """ + For `SWIG `_ source code. + + .. versionadded:: 2.0 + """ + name = 'SWIG' + aliases = ['swig'] + filenames = ['*.swg', '*.i'] + mimetypes = ['text/swig'] + priority = 0.04 # Lower than C/C++ and Objective C/C++ + + tokens = { + 'statements': [ + # SWIG directives + (r'(%[a-z_][a-z0-9_]*)', Name.Function), + # Special variables + ('\$\**\&?\w+', Name), + # Stringification / additional preprocessor directives + (r'##*[a-zA-Z_]\w*', Comment.Preproc), + inherit, + ], + } + + # This is a far from complete set of SWIG directives + swig_directives = set(( + # Most common directives + '%apply', '%define', '%director', '%enddef', '%exception', '%extend', + '%feature', '%fragment', '%ignore', '%immutable', '%import', '%include', + '%inline', '%insert', '%module', '%newobject', '%nspace', '%pragma', + '%rename', '%shared_ptr', '%template', '%typecheck', '%typemap', + # Less common directives + '%arg', '%attribute', '%bang', '%begin', '%callback', '%catches', '%clear', + '%constant', '%copyctor', '%csconst', '%csconstvalue', '%csenum', + '%csmethodmodifiers', '%csnothrowexception', '%default', '%defaultctor', + '%defaultdtor', '%defined', '%delete', '%delobject', '%descriptor', + '%exceptionclass', '%exceptionvar', '%extend_smart_pointer', '%fragments', + '%header', '%ifcplusplus', '%ignorewarn', '%implicit', '%implicitconv', + '%init', '%javaconst', '%javaconstvalue', '%javaenum', '%javaexception', + '%javamethodmodifiers', '%kwargs', '%luacode', '%mutable', '%naturalvar', + '%nestedworkaround', '%perlcode', '%pythonabc', '%pythonappend', + '%pythoncallback', '%pythoncode', '%pythondynamic', '%pythonmaybecall', + '%pythonnondynamic', '%pythonprepend', '%refobject', '%shadow', '%sizeof', + '%trackobjects', '%types', '%unrefobject', '%varargs', '%warn', + '%warnfilter')) + + def analyse_text(text): + rv = 0 + # Search for SWIG directives, which are conventionally at the beginning of + # a line. The probability of them being within a line is low, so let another + # lexer win in this case. + matches = re.findall(r'^\s*(%[a-z_][a-z0-9_]*)', text, re.M) + for m in matches: + if m in SwigLexer.swig_directives: + rv = 0.98 + break + else: + rv = 0.91 # Fraction higher than MatlabLexer + return rv + + +class MqlLexer(CppLexer): + """ + For `MQL4 `_ and + `MQL5 `_ source code. + + .. versionadded:: 2.0 + """ + name = 'MQL' + aliases = ['mql', 'mq4', 'mq5', 'mql4', 'mql5'] + filenames = ['*.mq4', '*.mq5', '*.mqh'] + mimetypes = ['text/x-mql'] + + tokens = { + 'statements': [ + (words(_mql_builtins.keywords, suffix=r'\b'), Keyword), + (words(_mql_builtins.c_types, suffix=r'\b'), Keyword.Type), + (words(_mql_builtins.types, suffix=r'\b'), Name.Function), + (words(_mql_builtins.constants, suffix=r'\b'), Name.Constant), + (words(_mql_builtins.colors, prefix='(clr)?', suffix=r'\b'), + Name.Constant), + inherit, + ], + } + +class ArduinoLexer(CppLexer): + """ + For `Arduino(tm) `_ source. + + This is an extension of the CppLexer, as the Arduino® Language is a superset + of C++ + + .. versionadded:: 2.1 + """ + + name = 'Arduino' + aliases = ['arduino'] + filenames = ['*.ino'] + mimetypes = ['text/x-arduino'] + + # Language sketch main structure functions + structure = set(('setup', 'loop')) + + # Language operators + operators = set(('not', 'or', 'and', 'xor')) + + # Language 'variables' + variables = set(( + 'DIGITAL_MESSAGE', 'FIRMATA_STRING', 'ANALOG_MESSAGE', 'REPORT_DIGITAL', + 'REPORT_ANALOG', 'INPUT_PULLUP', 'SET_PIN_MODE', 'INTERNAL2V56', 'SYSTEM_RESET', + 'LED_BUILTIN', 'INTERNAL1V1', 'SYSEX_START', 'INTERNAL', 'EXTERNAL', 'HIGH', + 'LOW', 'INPUT', 'OUTPUT', 'INPUT_PULLUP', 'LED_BUILTIN', 'true', 'false', + 'void', 'boolean', 'char', 'unsigned char', 'byte', 'int', 'unsigned int', + 'word', 'long', 'unsigned long', 'short', 'float', 'double', 'string', 'String', + 'array', 'static', 'volatile', 'const', 'boolean', 'byte', 'word', 'string', + 'String', 'array', 'int', 'float', 'private', 'char', 'virtual', 'operator', + 'sizeof', 'uint8_t', 'uint16_t', 'uint32_t', 'uint64_t', 'int8_t', 'int16_t', + 'int32_t', 'int64_t', 'dynamic_cast', 'typedef', 'const_cast', 'const', + 'struct', 'static_cast', 'union', 'unsigned', 'long', 'volatile', 'static', + 'protected', 'bool', 'public', 'friend', 'auto', 'void', 'enum', 'extern', + 'class', 'short', 'reinterpret_cast', 'double', 'register', 'explicit', + 'signed', 'inline', 'delete', '_Bool', 'complex', '_Complex', '_Imaginary', + 'atomic_bool', 'atomic_char', 'atomic_schar', 'atomic_uchar', 'atomic_short', + 'atomic_ushort', 'atomic_int', 'atomic_uint', 'atomic_long', 'atomic_ulong', + 'atomic_llong', 'atomic_ullong', 'PROGMEM')) + + # Language shipped functions and class ( ) + functions = set(( + 'KeyboardController', 'MouseController', 'SoftwareSerial', 'EthernetServer', + 'EthernetClient', 'LiquidCrystal', 'RobotControl', 'GSMVoiceCall', + 'EthernetUDP', 'EsploraTFT', 'HttpClient', 'RobotMotor', 'WiFiClient', + 'GSMScanner', 'FileSystem', 'Scheduler', 'GSMServer', 'YunClient', 'YunServer', + 'IPAddress', 'GSMClient', 'GSMModem', 'Keyboard', 'Ethernet', 'Console', + 'GSMBand', 'Esplora', 'Stepper', 'Process', 'WiFiUDP', 'GSM_SMS', 'Mailbox', + 'USBHost', 'Firmata', 'PImage', 'Client', 'Server', 'GSMPIN', 'FileIO', + 'Bridge', 'Serial', 'EEPROM', 'Stream', 'Mouse', 'Audio', 'Servo', 'File', + 'Task', 'GPRS', 'WiFi', 'Wire', 'TFT', 'GSM', 'SPI', 'SD', + 'runShellCommandAsynchronously', 'analogWriteResolution', + 'retrieveCallingNumber', 'printFirmwareVersion', 'analogReadResolution', + 'sendDigitalPortPair', 'noListenOnLocalhost', 'readJoystickButton', + 'setFirmwareVersion', 'readJoystickSwitch', 'scrollDisplayRight', + 'getVoiceCallStatus', 'scrollDisplayLeft', 'writeMicroseconds', + 'delayMicroseconds', 'beginTransmission', 'getSignalStrength', + 'runAsynchronously', 'getAsynchronously', 'listenOnLocalhost', + 'getCurrentCarrier', 'readAccelerometer', 'messageAvailable', + 'sendDigitalPorts', 'lineFollowConfig', 'countryNameWrite', 'runShellCommand', + 'readStringUntil', 'rewindDirectory', 'readTemperature', 'setClockDivider', + 'readLightSensor', 'endTransmission', 'analogReference', 'detachInterrupt', + 'countryNameRead', 'attachInterrupt', 'encryptionType', 'readBytesUntil', + 'robotNameWrite', 'readMicrophone', 'robotNameRead', 'cityNameWrite', + 'userNameWrite', 'readJoystickY', 'readJoystickX', 'mouseReleased', + 'openNextFile', 'scanNetworks', 'noInterrupts', 'digitalWrite', 'beginSpeaker', + 'mousePressed', 'isActionDone', 'mouseDragged', 'displayLogos', 'noAutoscroll', + 'addParameter', 'remoteNumber', 'getModifiers', 'keyboardRead', 'userNameRead', + 'waitContinue', 'processInput', 'parseCommand', 'printVersion', 'readNetworks', + 'writeMessage', 'blinkVersion', 'cityNameRead', 'readMessage', 'setDataMode', + 'parsePacket', 'isListening', 'setBitOrder', 'beginPacket', 'isDirectory', + 'motorsWrite', 'drawCompass', 'digitalRead', 'clearScreen', 'serialEvent', + 'rightToLeft', 'setTextSize', 'leftToRight', 'requestFrom', 'keyReleased', + 'compassRead', 'analogWrite', 'interrupts', 'WiFiServer', 'disconnect', + 'playMelody', 'parseFloat', 'autoscroll', 'getPINUsed', 'setPINUsed', + 'setTimeout', 'sendAnalog', 'readSlider', 'analogRead', 'beginWrite', + 'createChar', 'motorsStop', 'keyPressed', 'tempoWrite', 'readButton', + 'subnetMask', 'debugPrint', 'macAddress', 'writeGreen', 'randomSeed', + 'attachGPRS', 'readString', 'sendString', 'remotePort', 'releaseAll', + 'mouseMoved', 'background', 'getXChange', 'getYChange', 'answerCall', + 'getResult', 'voiceCall', 'endPacket', 'constrain', 'getSocket', 'writeJSON', + 'getButton', 'available', 'connected', 'findUntil', 'readBytes', 'exitValue', + 'readGreen', 'writeBlue', 'startLoop', 'IPAddress', 'isPressed', 'sendSysex', + 'pauseMode', 'gatewayIP', 'setCursor', 'getOemKey', 'tuneWrite', 'noDisplay', + 'loadImage', 'switchPIN', 'onRequest', 'onReceive', 'changePIN', 'playFile', + 'noBuffer', 'parseInt', 'overflow', 'checkPIN', 'knobRead', 'beginTFT', + 'bitClear', 'updateIR', 'bitWrite', 'position', 'writeRGB', 'highByte', + 'writeRed', 'setSpeed', 'readBlue', 'noStroke', 'remoteIP', 'transfer', + 'shutdown', 'hangCall', 'beginSMS', 'endWrite', 'attached', 'maintain', + 'noCursor', 'checkReg', 'checkPUK', 'shiftOut', 'isValid', 'shiftIn', 'pulseIn', + 'connect', 'println', 'localIP', 'pinMode', 'getIMEI', 'display', 'noBlink', + 'process', 'getBand', 'running', 'beginSD', 'drawBMP', 'lowByte', 'setBand', + 'release', 'bitRead', 'prepare', 'pointTo', 'readRed', 'setMode', 'noFill', + 'remove', 'listen', 'stroke', 'detach', 'attach', 'noTone', 'exists', 'buffer', + 'height', 'bitSet', 'circle', 'config', 'cursor', 'random', 'IRread', 'setDNS', + 'endSMS', 'getKey', 'micros', 'millis', 'begin', 'print', 'write', 'ready', + 'flush', 'width', 'isPIN', 'blink', 'clear', 'press', 'mkdir', 'rmdir', 'close', + 'point', 'yield', 'image', 'BSSID', 'click', 'delay', 'read', 'text', 'move', + 'peek', 'beep', 'rect', 'line', 'open', 'seek', 'fill', 'size', 'turn', 'stop', + 'home', 'find', 'step', 'tone', 'sqrt', 'RSSI', 'SSID', 'end', 'bit', 'tan', + 'cos', 'sin', 'pow', 'map', 'abs', 'max', 'min', 'get', 'run', 'put', + 'isAlphaNumeric', 'isAlpha', 'isAscii', 'isWhitespace', 'isControl', 'isDigit', + 'isGraph', 'isLowerCase', 'isPrintable', 'isPunct', 'isSpace', 'isUpperCase', + 'isHexadecimalDigit')) + + # do not highlight + suppress_highlight = set(( + 'namespace', 'template', 'mutable', 'using', 'asm', 'typeid', + 'typename', 'this', 'alignof', 'constexpr', 'decltype', 'noexcept', + 'static_assert', 'thread_local', 'restrict')) + + + def get_tokens_unprocessed(self, text): + for index, token, value in CppLexer.get_tokens_unprocessed(self, text): + if value in self.structure: + yield index, Name.Builtin, value + elif value in self.operators: + yield index, Operator, value + elif value in self.variables: + yield index, Keyword.Reserved, value + elif value in self.suppress_highlight: + yield index, Name, value + elif value in self.functions: + yield index, Name.Function, value + else: + yield index, token, value diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/capnproto.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/capnproto.py new file mode 100644 index 0000000000000000000000000000000000000000..203523a1adf126b3394768e418ba7a32921a26f7 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/capnproto.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.capnproto + ~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for the Cap'n Proto schema language. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, default +from pygments.token import Text, Comment, Keyword, Name, Literal + +__all__ = ['CapnProtoLexer'] + + +class CapnProtoLexer(RegexLexer): + """ + For `Cap'n Proto `_ source. + + .. versionadded:: 2.2 + """ + name = 'Cap\'n Proto' + filenames = ['*.capnp'] + aliases = ['capnp'] + + flags = re.MULTILINE | re.UNICODE + + tokens = { + 'root': [ + (r'#.*?$', Comment.Single), + (r'@[0-9a-zA-Z]*', Name.Decorator), + (r'=', Literal, 'expression'), + (r':', Name.Class, 'type'), + (r'\$', Name.Attribute, 'annotation'), + (r'(struct|enum|interface|union|import|using|const|annotation|' + r'extends|in|of|on|as|with|from|fixed)\b', + Keyword), + (r'[\w.]+', Name), + (r'[^#@=:$\w]+', Text), + ], + 'type': [ + (r'[^][=;,(){}$]+', Name.Class), + (r'[[(]', Name.Class, 'parentype'), + default('#pop'), + ], + 'parentype': [ + (r'[^][;()]+', Name.Class), + (r'[[(]', Name.Class, '#push'), + (r'[])]', Name.Class, '#pop'), + default('#pop'), + ], + 'expression': [ + (r'[^][;,(){}$]+', Literal), + (r'[[(]', Literal, 'parenexp'), + default('#pop'), + ], + 'parenexp': [ + (r'[^][;()]+', Literal), + (r'[[(]', Literal, '#push'), + (r'[])]', Literal, '#pop'), + default('#pop'), + ], + 'annotation': [ + (r'[^][;,(){}=:]+', Name.Attribute), + (r'[[(]', Name.Attribute, 'annexp'), + default('#pop'), + ], + 'annexp': [ + (r'[^][;()]+', Name.Attribute), + (r'[[(]', Name.Attribute, '#push'), + (r'[])]', Name.Attribute, '#pop'), + default('#pop'), + ], + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/chapel.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/chapel.py new file mode 100644 index 0000000000000000000000000000000000000000..55bf0e1ed39f25cc863e38656e8b889511deda68 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/chapel.py @@ -0,0 +1,102 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.chapel + ~~~~~~~~~~~~~~~~~~~~~~ + + Lexer for the Chapel language. + + :copyright: Copyright 2006-2017 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__ = ['ChapelLexer'] + + +class ChapelLexer(RegexLexer): + """ + For `Chapel `_ source. + + .. versionadded:: 2.0 + """ + name = 'Chapel' + filenames = ['*.chpl'] + aliases = ['chapel', 'chpl'] + # mimetypes = ['text/x-chapel'] + + tokens = { + 'root': [ + (r'\n', Text), + (r'\s+', Text), + (r'\\\n', Text), + + (r'//(.*?)\n', Comment.Single), + (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline), + + (r'(config|const|in|inout|out|param|ref|type|var)\b', + Keyword.Declaration), + (r'(false|nil|true)\b', Keyword.Constant), + (r'(bool|complex|imag|int|opaque|range|real|string|uint)\b', + Keyword.Type), + (words(( + 'align', 'as', 'atomic', 'begin', 'break', 'by', 'cobegin', + 'coforall', 'continue', 'delete', 'dmapped', 'do', 'domain', + 'else', 'enum', 'except', 'export', 'extern', 'for', 'forall', + 'if', 'index', 'inline', 'iter', 'label', 'lambda', 'let', + 'local', 'new', 'noinit', 'on', 'only', 'otherwise', 'pragma', + 'private', 'public', 'reduce', 'require', 'return', 'scan', + 'select', 'serial', 'single', 'sparse', 'subdomain', 'sync', + 'then', 'use', 'when', 'where', 'while', 'with', 'yield', + 'zip'), suffix=r'\b'), + Keyword), + (r'(proc)((?:\s)+)', bygroups(Keyword, Text), 'procname'), + (r'(class|module|record|union)(\s+)', bygroups(Keyword, Text), + '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$]+|\~[a-zA-Z_][\w$]+|[+*/!~%<>=&^|\-]{1,2})', + Name.Function, '#pop'), + ], + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/clean.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/clean.py new file mode 100644 index 0000000000000000000000000000000000000000..ba2569f6e173442f64a7e5585a716adef182241d --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/clean.py @@ -0,0 +1,288 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.clean + ~~~~~~~~~~~~~~~~~~~~~ + + Lexer for the Clean language. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import ExtendedRegexLexer, LexerContext, \ + bygroups, words, include, default +from pygments.token import Comment, Keyword, Literal, Name, Number, Operator, \ + Punctuation, String, Text, Whitespace + +__all__ = ['CleanLexer'] + + +class CleanLexer(ExtendedRegexLexer): + """ + Lexer for the general purpose, state-of-the-art, pure and lazy functional + programming language Clean (http://clean.cs.ru.nl/Clean). + + .. versionadded: 2.2 + """ + name = 'Clean' + aliases = ['clean'] + filenames = ['*.icl', '*.dcl'] + + def get_tokens_unprocessed(self, text=None, context=None): + ctx = LexerContext(text, 0) + ctx.indent = 0 + return ExtendedRegexLexer.get_tokens_unprocessed(self, text, context=ctx) + + def check_class_not_import(lexer, match, ctx): + if match.group(0) == 'import': + yield match.start(), Keyword.Namespace, match.group(0) + ctx.stack = ctx.stack[:-1] + ['fromimportfunc'] + else: + yield match.start(), Name.Class, match.group(0) + ctx.pos = match.end() + + def check_instance_class(lexer, match, ctx): + if match.group(0) == 'instance' or match.group(0) == 'class': + yield match.start(), Keyword, match.group(0) + else: + yield match.start(), Name.Function, match.group(0) + ctx.stack = ctx.stack + ['fromimportfunctype'] + ctx.pos = match.end() + + @staticmethod + def indent_len(text): + # Tabs are four spaces: + # https://svn.cs.ru.nl/repos/clean-platform/trunk/doc/STANDARDS.txt + text = text.replace('\n', '') + return len(text.replace('\t', ' ')), len(text) + + def store_indent(lexer, match, ctx): + ctx.indent, _ = CleanLexer.indent_len(match.group(0)) + ctx.pos = match.end() + yield match.start(), Text, match.group(0) + + def check_indent1(lexer, match, ctx): + indent, reallen = CleanLexer.indent_len(match.group(0)) + if indent > ctx.indent: + yield match.start(), Whitespace, match.group(0) + ctx.pos = match.start() + reallen + 1 + else: + ctx.indent = 0 + ctx.pos = match.start() + ctx.stack = ctx.stack[:-1] + yield match.start(), Whitespace, match.group(0)[1:] + + def check_indent2(lexer, match, ctx): + indent, reallen = CleanLexer.indent_len(match.group(0)) + if indent > ctx.indent: + yield match.start(), Whitespace, match.group(0) + ctx.pos = match.start() + reallen + 1 + else: + ctx.indent = 0 + ctx.pos = match.start() + ctx.stack = ctx.stack[:-2] + + def check_indent3(lexer, match, ctx): + indent, reallen = CleanLexer.indent_len(match.group(0)) + if indent > ctx.indent: + yield match.start(), Whitespace, match.group(0) + ctx.pos = match.start() + reallen + 1 + else: + ctx.indent = 0 + ctx.pos = match.start() + ctx.stack = ctx.stack[:-3] + yield match.start(), Whitespace, match.group(0)[1:] + if match.group(0) == '\n\n': + ctx.pos = ctx.pos + 1 + + def skip(lexer, match, ctx): + ctx.stack = ctx.stack[:-1] + ctx.pos = match.end() + yield match.start(), Comment, match.group(0) + + keywords = ('class', 'instance', 'where', 'with', 'let', 'let!', + 'in', 'case', 'of', 'infix', 'infixr', 'infixl', 'generic', + 'derive', 'otherwise', 'code', 'inline') + + tokens = { + 'common': [ + (r';', Punctuation, '#pop'), + (r'//', Comment, 'singlecomment'), + ], + 'root': [ + # Comments + (r'//.*\n', Comment.Single), + (r'(?s)/\*\*.*?\*/', Comment.Special), + (r'(?s)/\*.*?\*/', Comment.Multi), + + # Modules, imports, etc. + (r'\b((?:implementation|definition|system)\s+)?(module)(\s+)([\w`.]+)', + bygroups(Keyword.Namespace, Keyword.Namespace, Text, Name.Class)), + (r'(?<=\n)import(?=\s)', Keyword.Namespace, 'import'), + (r'(?<=\n)from(?=\s)', Keyword.Namespace, 'fromimport'), + + # Keywords + # We cannot use (?s)^|(?<=\s) as prefix, so need to repeat this + (words(keywords, prefix=r'(?<=\s)', suffix=r'(?=\s)'), Keyword), + (words(keywords, prefix=r'^', suffix=r'(?=\s)'), Keyword), + + # Function definitions + (r'(?=\{\|)', Whitespace, 'genericfunction'), + (r'(?<=\n)([ \t]*)([\w`$()=\-<>~*\^|+&%]+)((?:\s+\w)*)(\s*)(::)', + bygroups(store_indent, Name.Function, Keyword.Type, Whitespace, + Punctuation), + 'functiondefargs'), + + # Type definitions + (r'(?<=\n)([ \t]*)(::)', bygroups(store_indent, Punctuation), 'typedef'), + (r'^([ \t]*)(::)', bygroups(store_indent, Punctuation), 'typedef'), + + # Literals + (r'\'\\?.(?|&~*\^/]', Operator), + (r'\\\\', Operator), + + # Lambda expressions + (r'\\.*?(->|\.|=)', Name.Function), + + # Whitespace + (r'\s', Whitespace), + + include('common'), + ], + 'fromimport': [ + include('common'), + (r'([\w`.]+)', check_class_not_import), + (r'\n', Whitespace, '#pop'), + (r'\s', Whitespace), + ], + 'fromimportfunc': [ + include('common'), + (r'(::)(\s+)([^,\s]+)', bygroups(Punctuation, Text, Keyword.Type)), + (r'([\w`$()=\-<>~*\^|+&%/]+)', check_instance_class), + (r',', Punctuation), + (r'\n', Whitespace, '#pop'), + (r'\s', Whitespace), + ], + 'fromimportfunctype': [ + include('common'), + (r'[{(\[]', Punctuation, 'combtype'), + (r',', Punctuation, '#pop'), + (r'[:;.#]', Punctuation), + (r'\n', Whitespace, '#pop:2'), + (r'[^\S\n]+', Whitespace), + (r'\S+', Keyword.Type), + ], + 'combtype': [ + include('common'), + (r'[})\]]', Punctuation, '#pop'), + (r'[{(\[]', Punctuation, '#pop'), + (r'[,:;.#]', Punctuation), + (r'\s+', Whitespace), + (r'\S+', Keyword.Type), + ], + 'import': [ + include('common'), + (words(('from', 'import', 'as', 'qualified'), + prefix='(?<=\s)', suffix='(?=\s)'), Keyword.Namespace), + (r'[\w`.]+', Name.Class), + (r'\n', Whitespace, '#pop'), + (r',', Punctuation), + (r'[^\S\n]+', Whitespace), + ], + 'singlecomment': [ + (r'(.)(?=\n)', skip), + (r'.+(?!\n)', Comment), + ], + 'doubleqstring': [ + (r'[^\\"]+', String.Double), + (r'"', String.Double, '#pop'), + (r'\\.', String.Double), + ], + 'typedef': [ + include('common'), + (r'[\w`]+', Keyword.Type), + (r'[:=|(),\[\]{}!*]', Punctuation), + (r'->', Punctuation), + (r'\n(?=[^\s|])', Whitespace, '#pop'), + (r'\s', Whitespace), + (r'.', Keyword.Type), + ], + 'genericfunction': [ + include('common'), + (r'\{\|', Punctuation), + (r'\|\}', Punctuation, '#pop'), + (r',', Punctuation), + (r'->', Punctuation), + (r'(\s+of\s+)(\{)', bygroups(Keyword, Punctuation), 'genericftypes'), + (r'\s', Whitespace), + (r'[\w`\[\]{}!]+', Keyword.Type), + (r'[*()]', Punctuation), + ], + 'genericftypes': [ + include('common'), + (r'[\w`]+', Keyword.Type), + (r',', Punctuation), + (r'\s', Whitespace), + (r'\}', Punctuation, '#pop'), + ], + 'functiondefargs': [ + include('common'), + (r'\n(\s*)', check_indent1), + (r'[!{}()\[\],:;.#]', Punctuation), + (r'->', Punctuation, 'functiondefres'), + (r'^(?=\S)', Whitespace, '#pop'), + (r'\S', Keyword.Type), + (r'\s', Whitespace), + ], + 'functiondefres': [ + include('common'), + (r'\n(\s*)', check_indent2), + (r'^(?=\S)', Whitespace, '#pop:2'), + (r'[!{}()\[\],:;.#]', Punctuation), + (r'\|', Punctuation, 'functiondefclasses'), + (r'\S', Keyword.Type), + (r'\s', Whitespace), + ], + 'functiondefclasses': [ + include('common'), + (r'\n(\s*)', check_indent3), + (r'^(?=\S)', Whitespace, '#pop:3'), + (r'[,&]', Punctuation), + (r'\[', Punctuation, 'functiondefuniquneq'), + (r'[\w`$()=\-<>~*\^|+&%/{}\[\]@]', Name.Function, 'functionname'), + (r'\s+', Whitespace), + ], + 'functiondefuniquneq': [ + include('common'), + (r'[a-z]+', Keyword.Type), + (r'\s+', Whitespace), + (r'<=|,', Punctuation), + (r'\]', Punctuation, '#pop') + ], + 'functionname': [ + include('common'), + (r'[\w`$()=\-<>~*\^|+&%/]+', Name.Function), + (r'(?=\{\|)', Punctuation, 'genericfunction'), + default('#pop'), + ] + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/configs.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/configs.py new file mode 100644 index 0000000000000000000000000000000000000000..1717a563abec828d39326ba4f12fb448f43fa9ae --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/configs.py @@ -0,0 +1,833 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.configs + ~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for configuration file formats. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, default, words, bygroups, include, using +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Whitespace, Literal +from pygments.lexers.shell import BashLexer + +__all__ = ['IniLexer', 'RegeditLexer', 'PropertiesLexer', 'KconfigLexer', + 'Cfengine3Lexer', 'ApacheConfLexer', 'SquidConfLexer', + 'NginxConfLexer', 'LighttpdConfLexer', 'DockerLexer', + 'TerraformLexer', 'TermcapLexer', 'TerminfoLexer', + 'PkgConfigLexer', 'PacmanConfLexer'] + + +class IniLexer(RegexLexer): + """ + Lexer for configuration files in INI style. + """ + + name = 'INI' + aliases = ['ini', 'cfg', 'dosini'] + filenames = ['*.ini', '*.cfg', '*.inf'] + mimetypes = ['text/x-ini', 'text/inf'] + + tokens = { + 'root': [ + (r'\s+', Text), + (r'[;#].*', Comment.Single), + (r'\[.*?\]$', Keyword), + (r'(.*?)([ \t]*)(=)([ \t]*)(.*(?:\n[ \t].+)*)', + bygroups(Name.Attribute, Text, Operator, Text, String)), + # standalone option, supported by some INI parsers + (r'(.+?)$', Name.Attribute), + ], + } + + def analyse_text(text): + npos = text.find('\n') + if npos < 3: + return False + return text[0] == '[' and text[npos-1] == ']' + + +class RegeditLexer(RegexLexer): + """ + Lexer for `Windows Registry + `_ files produced + by regedit. + + .. versionadded:: 1.6 + """ + + name = 'reg' + aliases = ['registry'] + filenames = ['*.reg'] + mimetypes = ['text/x-windows-registry'] + + tokens = { + 'root': [ + (r'Windows Registry Editor.*', Text), + (r'\s+', Text), + (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, Text, Operator, Text), + 'value'), + # Bare keys (includes @) + (r'(.*?)([ \t]*)(=)([ \t]*)', + bygroups(Name.Attribute, Text, Operator, Text), + '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 + + .. versionadded:: 1.4 + """ + + name = 'Properties' + aliases = ['properties', 'jproperties'] + filenames = ['*.properties'] + mimetypes = ['text/x-java-properties'] + + tokens = { + 'root': [ + (r'^(\w+)([ \t])(\w+\s*)$', bygroups(Name.Attribute, Text, String)), + (r'^\w+(\\[ \t]\w*)*$', Name.Attribute), + (r'(^ *)([#!].*)', bygroups(Text, Comment)), + # More controversial comments + (r'(^ *)((?:;|//).*)', bygroups(Text, Comment)), + (r'(.*?)([ \t]*)([=:])([ \t]*)(.*(?:(?<=\\)\n.*)*)', + bygroups(Name.Attribute, Text, Operator, Text, String)), + (r'\s', Text), + ], + } + + +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 = '{%s}' % level + return r'(?:\t| %s\t| {%s})%s.*\n' % (space_repeat, tab_width, level_repeat) + + +class KconfigLexer(RegexLexer): + """ + For Linux-style Kconfig files. + + .. versionadded:: 1.6 + """ + + name = 'Kconfig' + aliases = ['kconfig', 'menuconfig', 'linux-config', 'kernel-config'] + # Adjust this if new kconfig file names appear in your environment + filenames = ['Kconfig', '*Config.in*', 'external.in*', + 'standard-modules.in'] + mimetypes = ['text/x-kconfig'] + # 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, 'indent%s' % 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+', Text), + (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. + + .. versionadded:: 1.5 + """ + + name = 'CFEngine3' + aliases = ['cfengine3', 'cf3'] + filenames = ['*.cf'] + mimetypes = [] + + tokens = { + 'root': [ + (r'#.*?\n', Comment), + (r'(body)(\s+)(\S+)(\s+)(control)', + bygroups(Keyword, Text, Keyword, Text, Keyword)), + (r'(body|bundle)(\s+)(\S+)(\s+)(\w+)(\()', + bygroups(Keyword, Text, Keyword, Text, Name.Function, Punctuation), + 'arglist'), + (r'(body|bundle)(\s+)(\S+)(\s+)(\w+)', + bygroups(Keyword, Text, Keyword, Text, Name.Function)), + (r'(")([^"]+)(")(\s+)(string|slist|int|real)(\s*)(=>)(\s*)', + bygroups(Punctuation, Name.Variable, Punctuation, + Text, Keyword.Type, Text, Operator, Text)), + (r'(\S+)(\s*)(=>)(\s*)', + bygroups(Keyword.Reserved, Text, 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+', Text), + ], + '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+', Text), + ], + } + + +class ApacheConfLexer(RegexLexer): + """ + Lexer for configuration files following the Apache config file + format. + + .. versionadded:: 0.6 + """ + + name = 'ApacheConf' + aliases = ['apacheconf', 'aconf', 'apache'] + filenames = ['.htaccess', 'apache.conf', 'apache2.conf'] + mimetypes = ['text/x-apacheconf'] + flags = re.MULTILINE | re.IGNORECASE + + tokens = { + 'root': [ + (r'\s+', Text), + (r'(#.*?)$', Comment), + (r'(<[^\s>]+)(?:(\s+)(.*?))?(>)', + bygroups(Name.Tag, Text, String, Name.Tag)), + (r'([a-z]\w*)(\s+)', + bygroups(Name.Builtin, Text), 'value'), + (r'\.+', Text), + ], + 'value': [ + (r'\\\n', Text), + (r'$', Text, '#pop'), + (r'\\', Text), + (r'[^\S\n]+', Text), + (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'"([^"\\]*(?:\\.[^"\\]*)*)"', String.Double), + (r'[^\s"\\]+', Text) + ], + } + + +class SquidConfLexer(RegexLexer): + """ + Lexer for `squid `_ configuration files. + + .. versionadded:: 0.9 + """ + + name = 'SquidConf' + aliases = ['squidconf', 'squid.conf', 'squid'] + filenames = ['squid.conf'] + mimetypes = ['text/x-squidconf'] + 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", "cahce_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", + ) + + ip_re = ( + r'(?:(?:(?:[3-9]\d?|2(?:5[0-5]|[0-4]?\d)?|1\d{0,2}|0x0*[0-9a-f]{1,2}|' + r'0+[1-3]?[0-7]{0,2})(?:\.(?:[3-9]\d?|2(?:5[0-5]|[0-4]?\d)?|1\d{0,2}|' + r'0x0*[0-9a-f]{1,2}|0+[1-3]?[0-7]{0,2})){3})|(?!.*::.*::)(?:(?!:)|' + r':(?=:))(?:[0-9a-f]{0,4}(?:(?<=::)|(?`_ configuration files. + + .. versionadded:: 0.11 + """ + name = 'Nginx configuration file' + aliases = ['nginx'] + filenames = ['nginx.conf'] + mimetypes = ['text/x-nginx-conf'] + + tokens = { + 'root': [ + (r'(include)(\s+)([^\s;]+)', bygroups(Keyword, Text, 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, Text, String.Regex)), + (r'[:=~]', Punctuation), + (r'[^\s;#{}$]+', String), # catch all + (r'/[^\s;#]*', Name), # pathname + (r'\s+', Text), + (r'[$;]', Text), # leftover characters + ], + } + + +class LighttpdConfLexer(RegexLexer): + """ + Lexer for `Lighttpd `_ configuration files. + + .. versionadded:: 0.11 + """ + name = 'Lighttpd configuration file' + aliases = ['lighty', 'lighttpd'] + filenames = [] + mimetypes = ['text/x-lighttpd-conf'] + + 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+', Text), + ], + + } + + +class DockerLexer(RegexLexer): + """ + Lexer for `Docker `_ configuration files. + + .. versionadded:: 2.0 + """ + name = 'Docker' + aliases = ['docker', 'dockerfile'] + filenames = ['Dockerfile', '*.docker'] + mimetypes = ['text/x-dockerfile-config'] + + _keywords = (r'(?:FROM|MAINTAINER|CMD|EXPOSE|ENV|ADD|ENTRYPOINT|' + r'VOLUME|WORKDIR)') + + flags = re.IGNORECASE | re.MULTILINE + + tokens = { + 'root': [ + (r'^(ONBUILD)(\s+)(%s)\b' % (_keywords,), + bygroups(Name.Keyword, Whitespace, Keyword)), + (r'^(%s)\b(.*)' % (_keywords,), bygroups(Keyword, String)), + (r'#.*', Comment), + (r'RUN', Keyword), # Rest of line falls through + (r'(.*\\\n)*.+', using(BashLexer)), + ], + } + + +class TerraformLexer(RegexLexer): + """ + Lexer for `terraformi .tf files `_. + + .. versionadded:: 2.1 + """ + + name = 'Terraform' + aliases = ['terraform', 'tf'] + filenames = ['*.tf'] + mimetypes = ['application/x-tf', 'application/x-terraform'] + + tokens = { + 'root': [ + include('string'), + include('punctuation'), + include('curly'), + include('basic'), + include('whitespace'), + (r'[0-9]+', Number), + ], + 'basic': [ + (words(('true', 'false'), prefix=r'\b', suffix=r'\b'), Keyword.Type), + (r'\s*/\*', Comment.Multiline, 'comment'), + (r'\s*#.*\n', Comment.Single), + (r'(.*?)(\s*)(=)', bygroups(Name.Attribute, Text, Operator)), + (words(('variable', 'resource', 'provider', 'provisioner', 'module'), + prefix=r'\b', suffix=r'\b'), Keyword.Reserved, 'function'), + (words(('ingress', 'egress', 'listener', 'default', 'connection'), + prefix=r'\b', suffix=r'\b'), Keyword.Declaration), + ('\$\{', String.Interpol, 'var_builtin'), + ], + 'function': [ + (r'(\s+)(".*")(\s+)', bygroups(Text, String, Text)), + include('punctuation'), + include('curly'), + ], + 'var_builtin': [ + (r'\$\{', String.Interpol, '#push'), + (words(('concat', 'file', 'join', 'lookup', 'element'), + prefix=r'\b', suffix=r'\b'), Name.Builtin), + include('string'), + include('punctuation'), + (r'\s+', Text), + (r'\}', String.Interpol, '#pop'), + ], + 'string': [ + (r'(".*")', bygroups(String.Double)), + ], + 'punctuation': [ + (r'[\[\](),.]', Punctuation), + ], + # Keep this seperate from punctuation - we sometimes want to use different + # Tokens for { } + 'curly': [ + (r'\{', Text.Punctuation), + (r'\}', Text.Punctuation), + ], + 'comment': [ + (r'[^*/]', Comment.Multiline), + (r'/\*', Comment.Multiline, '#push'), + (r'\*/', Comment.Multiline, '#pop'), + (r'[*/]', Comment.Multiline) + ], + 'whitespace': [ + (r'\n', Text), + (r'\s+', Text), + (r'\\\n', Text), + ], + } + + +class TermcapLexer(RegexLexer): + """ + Lexer for termcap database source. + + This is very simple and minimal. + + .. versionadded:: 2.1 + """ + name = 'Termcap' + aliases = ['termcap'] + filenames = ['termcap', 'termcap.src'] + mimetypes = [] + + # 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'), + ], + 'names': [ + (r'\n', Text, '#pop'), + (r':', Punctuation, 'defs'), + (r'\|', Punctuation), + (r'[^:|]+', Name.Attribute), + ], + 'defs': [ + (r'\\\n[ \t]*', Text), + (r'\n[ \t]*', Text, '#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. + + .. versionadded:: 2.1 + """ + name = 'Terminfo' + aliases = ['terminfo'] + filenames = ['terminfo', 'terminfo.src'] + mimetypes = [] + + # 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'), + ], + 'names': [ + (r'\n', Text, '#pop'), + (r'(,)([ \t]*)', bygroups(Punctuation, Text), 'defs'), + (r'\|', Punctuation), + (r'[^,|]+', Name.Attribute), + ], + 'defs': [ + (r'\n[ \t]+', Text), + (r'\n', Text, '#pop:2'), + (r'(#)([0-9]+)', bygroups(Operator, Number)), + (r'=', Operator, 'data'), + (r'(,)([ \t]*)', bygroups(Punctuation, Text)), + (r'[^\s,=#]+', Name.Class), + ], + 'data': [ + (r'\\[,\\]', Literal), + (r'(,)([ \t]*)', bygroups(Punctuation, Text), '#pop'), + (r'[^\\,]+', Literal), # for performance + (r'.', Literal), + ], + } + + +class PkgConfigLexer(RegexLexer): + """ + Lexer for `pkg-config + `_ + (see also `manual page `_). + + .. versionadded:: 2.1 + """ + + name = 'PkgConfig' + aliases = ['pkgconfig'] + filenames = ['*.pc'] + mimetypes = [] + + 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'[^${}#=:\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', Text, '#pop'), + + # fallback + (r'[^${}#\n]+', 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. + + .. versionadded:: 2.1 + """ + + name = 'PacmanConf' + aliases = ['pacmanconf'] + filenames = ['pacman.conf'] + mimetypes = [] + + tokens = { + 'root': [ + # comment + (r'#.*$', Comment.Single), + + # section header + (r'^\s*\[.*?\]\s*$', Keyword), + + # variable definitions + # (Leading space is allowed...) + (r'(\w+)(\s*)(=)', + bygroups(Name.Attribute, Text, Operator)), + + # flags to on + (r'^(\s*)(\w+)(\s*)$', + bygroups(Text, Name.Attribute, Text)), + + # built-in special values + (words(( + '$repo', # repository + '$arch', # architecture + '%o', # outfile + '%u', # url + ), suffix=r'\b'), + Name.Variable), + + # fallback + (r'.', Text), + ], + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/crystal.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/crystal.py new file mode 100644 index 0000000000000000000000000000000000000000..bea4833f2ea011bc1953222092ec8b2c0f52b50c --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/crystal.py @@ -0,0 +1,393 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.crystal + ~~~~~~~~~~~~~~~~~~~~~~~ + + Lexer for Crystal. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import ExtendedRegexLexer, include, \ + bygroups, default, LexerContext, words +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Error + +__all__ = ['CrystalLexer'] + +line_re = re.compile('.*?\n') + + +CRYSTAL_OPERATORS = [ + '!=', '!~', '!', '%', '&&', '&', '**', '*', '+', '-', '/', '<=>', '<<', '<=', '<', + '===', '==', '=~', '=', '>=', '>>', '>', '[]=', '[]?', '[]', '^', '||', '|', '~' +] + + +class CrystalLexer(ExtendedRegexLexer): + """ + For `Crystal `_ source code. + + .. versionadded:: 2.2 + """ + + name = 'Crystal' + aliases = ['cr', 'crystal'] + filenames = ['*.cr'] + mimetypes = ['text/x-crystal'] + + flags = re.DOTALL | re.MULTILINE + + def heredoc_callback(self, match, ctx): + # okay, this is the hardest part of parsing Crystal... + # 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) == '<<-', match.group(3))) + + ctx.pos = match.start(5) + ctx.end = match.end(5) + # this may find other heredocs + for i, t, v in self.get_tokens_unprocessed(context=ctx): + yield i, t, v + 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_crystalstrings_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[imsx]* + 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'] = [ + (r'\:@{0,2}[a-zA-Z_]\w*[!?]?', String.Symbol), + (words(CRYSTAL_OPERATORS, prefix=r'\:@{0,2}'), String.Symbol), + (r":'(\\\\|\\'|[^'])*'", String.Symbol), + # This allows arbitrary text after '\ for simplicity + (r"'(\\\\|\\'|[^']|\\[^'\\]+)'", String.Char), + (r':"', String.Symbol, 'simple-sym'), + # Crystal doesn't have "symbol:"s but this simplifies function args + (r'([a-zA-Z_]\w*)(:)(?!:)', bygroups(String.Symbol, Punctuation)), + (r'"', String.Double, 'simple-string'), + (r'(?', '<>', 'ab'): + states[name+'-intp-string'] = [ + (r'\\[' + lbrace + ']', 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'%' + 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), + ] + # http://crystal-lang.org/docs/syntax_and_semantics/literals/array.html + states['strings'].append((r'%[wi]' + lbrace, String.Other, + name+'-string')) + states[name+'-regex'] = [ + (r'\\[\\' + bracecc + ']', String.Regex), + (lbrace, String.Regex, '#push'), + (rbrace + '[imsx]*', 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[imsx]*)', + intp_regex_callback), + # regular fancy strings with qsw + (r'(%[wi]([\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(Text, 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(Text, String.Other, None)), + # all regular fancy strings without qsw + (r'(%([\[{(<]))((?:\\\2|(?!\2).)*)(\2)', + intp_string_callback), + ] + + return states + + tokens = { + 'root': [ + (r'#.*?$', Comment.Single), + # keywords + (words(''' + abstract asm as begin break case do else elsif end ensure extend ifdef if + include instance_sizeof next of pointerof private protected rescue return + require sizeof super then typeof unless until when while with yield + '''.split(), suffix=r'\b'), Keyword), + (words(['true', 'false', 'nil'], suffix=r'\b'), Keyword.Constant), + # start of function, class and module names + (r'(module|lib)(\s+)([a-zA-Z_]\w*(?:::[a-zA-Z_]\w*)*)', + bygroups(Keyword, Text, Name.Namespace)), + (r'(def|fun|macro)(\s+)((?:[a-zA-Z_]\w*::)*)', + bygroups(Keyword, Text, Name.Namespace), 'funcname'), + (r'def(?=[*%&^`~+-/\[<>=])', Keyword, 'funcname'), + (r'(class|struct|union|type|alias|enum)(\s+)((?:[a-zA-Z_]\w*::)*)', + bygroups(Keyword, Text, Name.Namespace), 'classname'), + (r'(self|out|uninitialized)\b|(is_a|responds_to)\?', Keyword.Pseudo), + # macros + (words(''' + debugger record pp assert_responds_to spawn parallel + getter setter property delegate def_hash def_equals def_equals_and_hash + forward_missing_to + '''.split(), suffix=r'\b'), Name.Builtin.Pseudo), + (r'getter[!?]|property[!?]|__(DIR|FILE|LINE)__\b', Name.Builtin.Pseudo), + # builtins + # http://crystal-lang.org/api/toplevel.html + (words(''' + Object Value Struct Reference Proc Class Nil Symbol Enum Void + Bool Number Int Int8 Int16 Int32 Int64 UInt8 UInt16 UInt32 UInt64 + Float Float32 Float64 Char String + Pointer Slice Range Exception Regex + Mutex StaticArray Array Hash Set Tuple Deque Box Process File + Dir Time Channel Concurrent Scheduler + abort at_exit caller delay exit fork future get_stack_top gets + lazy loop main p print printf puts + raise rand read_line sleep sprintf system with_color + '''.split(), 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(Text, 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'(0o[0-7]+(?:_[0-7]+)*(?:_?[iu][0-9]+)?)\b(\s*)([/?])?', + bygroups(Number.Oct, Text, Operator)), + (r'(0x[0-9A-Fa-f]+(?:_[0-9A-Fa-f]+)*(?:_?[iu][0-9]+)?)\b(\s*)([/?])?', + bygroups(Number.Hex, Text, Operator)), + (r'(0b[01]+(?:_[01]+)*(?:_?[iu][0-9]+)?)\b(\s*)([/?])?', + bygroups(Number.Bin, Text, Operator)), + # 3 separate expressions for floats because any of the 3 optional + # parts makes it a float + (r'((?:0(?![0-9])|[1-9][\d_]*)(?:\.\d[\d_]*)(?:e[+-]?[0-9]+)?' + r'(?:_?f[0-9]+)?)(\s*)([/?])?', + bygroups(Number.Float, Text, Operator)), + (r'((?:0(?![0-9])|[1-9][\d_]*)(?:\.\d[\d_]*)?(?:e[+-]?[0-9]+)' + r'(?:_?f[0-9]+)?)(\s*)([/?])?', + bygroups(Number.Float, Text, Operator)), + (r'((?:0(?![0-9])|[1-9][\d_]*)(?:\.\d[\d_]*)?(?:e[+-]?[0-9]+)?' + r'(?:_?f[0-9]+))(\s*)([/?])?', + bygroups(Number.Float, Text, Operator)), + (r'(0\b|[1-9][\d]*(?:_\d+)*(?:_?[iu][0-9]+)?)\b(\s*)([/?])?', + bygroups(Number.Integer, Text, 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'(\\([\\befnrtv#"\']|x[a-fA-F0-9]{1,2}|[0-7]{1,3})|\S)' + r'(?!\w)', + String.Char), + (r'[A-Z][A-Z_]+\b', Name.Constant), + # macro expansion + (r'\{%', String.Interpol, 'in-macro-control'), + (r'\{\{', String.Interpol, 'in-macro-expr'), + # attributes + (r'(@\[)(\s*)([A-Z]\w*)', + bygroups(Operator, Text, Name.Decorator), 'in-attr'), + # this is needed because Crystal attributes can look + # like keywords (class) or like this: ` ?!? + (words(CRYSTAL_OPERATORS, prefix=r'(\.|::)'), + bygroups(Operator, Name.Operator)), + (r'(\.|::)([a-zA-Z_]\w*[!?]?|[*%&^`~+\-/\[<>=])', + bygroups(Operator, Name)), + # Names can end with [!?] unless it's "!=" + (r'[a-zA-Z_]\w*(?:[!?](?!=))?', Name), + (r'(\[|\]\??|\*\*|<=>?|>=|<>?|=~|===|' + r'!~|&&?|\|\||\.{1,3})', Operator), + (r'[-+/*%=<>&!^|~]=?', Operator), + (r'[(){};,/?:\\]', Punctuation), + (r'\s+', Text) + ], + 'funcname': [ + (r'(?:([a-zA-Z_]\w*)(\.))?' + r'([a-zA-Z_]\w*[!?]?|\*\*?|[-+]@?|' + r'[/%&|^`~]|\[\]=?|<<|>>|<=?>|>=?|===?)', + bygroups(Name.Class, Operator, Name.Function), '#pop'), + default('#pop') + ], + 'classname': [ + (r'[A-Z_]\w*', Name.Class), + (r'(\()(\s*)([A-Z_]\w*)(\s*)(\))', + bygroups(Punctuation, Text, Name.Class, Text, Punctuation)), + default('#pop') + ], + 'in-intp': [ + (r'\{', String.Interpol, '#push'), + (r'\}', String.Interpol, '#pop'), + include('root'), + ], + 'string-intp': [ + (r'#\{', String.Interpol, 'in-intp'), + ], + 'string-escaped': [ + (r'\\([\\befnstv#"\']|x[a-fA-F0-9]{1,2}|[0-7]{1,3})', String.Escape) + ], + 'string-intp-escaped': [ + include('string-intp'), + include('string-escaped'), + ], + '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'/[imsx]*', String.Regex, '#pop'), + ], + 'end-part': [ + (r'.+', Comment.Preproc, '#pop') + ], + 'in-macro-control': [ + (r'\{%', String.Interpol, '#push'), + (r'%\}', String.Interpol, '#pop'), + (r'for\b|in\b', Keyword), + include('root'), + ], + 'in-macro-expr': [ + (r'\{\{', String.Interpol, '#push'), + (r'\}\}', String.Interpol, '#pop'), + include('root'), + ], + 'in-attr': [ + (r'\[', Operator, '#push'), + (r'\]', Operator, '#pop'), + include('root'), + ], + } + tokens.update(gen_crystalstrings_rules()) diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/csound.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/csound.py new file mode 100644 index 0000000000000000000000000000000000000000..858aa3482e34491b7153ab5718f606cec4b1d2eb --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/csound.py @@ -0,0 +1,366 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.csound + ~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for CSound languages. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, bygroups, default, include, using, words +from pygments.token import Comment, Keyword, Name, Number, Operator, Punctuation, \ + String, Text +from pygments.lexers._csound_builtins import OPCODES +from pygments.lexers.html import HtmlLexer +from pygments.lexers.python import PythonLexer +from pygments.lexers.scripting import LuaLexer + +__all__ = ['CsoundScoreLexer', 'CsoundOrchestraLexer', 'CsoundDocumentLexer'] + +newline = (r'((?:(?:;|//).*)*)(\n)', bygroups(Comment.Single, Text)) + + +class CsoundLexer(RegexLexer): + # Subclasses must define a 'single-line string' state. + tokens = { + 'whitespace': [ + (r'[ \t]+', Text), + (r'\\\n', Text), + (r'/[*](.|\n)*?[*]/', Comment.Multiline) + ], + + 'macro call': [ + (r'(\$\w+\.?)(\()', bygroups(Comment.Preproc, Punctuation), + 'function macro call'), + (r'\$\w+(\.|\b)', Comment.Preproc) + ], + 'function macro call': [ + (r"((?:\\['\)]|[^'\)])+)(')", bygroups(Comment.Preproc, Punctuation)), + (r"([^'\)]+)(\))", bygroups(Comment.Preproc, Punctuation), '#pop') + ], + + 'whitespace or macro call': [ + include('whitespace'), + include('macro call') + ], + + 'preprocessor directives': [ + (r'#(e(nd(if)?|lse)|ifn?def|undef)\b|##', Comment.Preproc), + (r'#include\b', Comment.Preproc, 'include'), + (r'#[ \t]*define\b', Comment.Preproc, 'macro name'), + (r'@+[ \t]*\d*', Comment.Preproc) + ], + + 'include': [ + include('whitespace'), + (r'"', String, 'single-line string') + ], + + 'macro name': [ + include('whitespace'), + (r'(\w+)(\()', bygroups(Comment.Preproc, Text), + 'function macro argument list'), + (r'\w+', Comment.Preproc, 'object macro definition after name') + ], + 'object macro definition after name': [ + include('whitespace'), + (r'#', Punctuation, 'object macro replacement text') + ], + 'object macro replacement text': [ + (r'(\\#|[^#])+', Comment.Preproc), + (r'#', Punctuation, '#pop:3') + ], + 'function macro argument list': [ + (r"(\w+)(['#])", bygroups(Comment.Preproc, Punctuation)), + (r'(\w+)(\))', bygroups(Comment.Preproc, Punctuation), + 'function macro definition after name') + ], + 'function macro definition after name': [ + (r'[ \t]+', Text), + (r'#', Punctuation, 'function macro replacement text') + ], + 'function macro replacement text': [ + (r'(\\#|[^#])+', Comment.Preproc), + (r'#', Punctuation, '#pop:4') + ] + } + + +class CsoundScoreLexer(CsoundLexer): + """ + For `Csound `_ scores. + + .. versionadded:: 2.1 + """ + + name = 'Csound Score' + aliases = ['csound-score', 'csound-sco'] + filenames = ['*.sco'] + + tokens = { + 'partial statement': [ + include('preprocessor directives'), + (r'\d+e[+-]?\d+|(\d+\.\d*|\d*\.\d+)(e[+-]?\d+)?', Number.Float), + (r'0[xX][a-fA-F0-9]+', Number.Hex), + (r'\d+', Number.Integer), + (r'"', String, 'single-line string'), + (r'[+\-*/%^!=<>|&#~.]', Operator), + (r'[]()[]', Punctuation), + (r'\w+', Comment.Preproc) + ], + + 'statement': [ + include('whitespace or macro call'), + newline + ('#pop',), + include('partial statement') + ], + + 'root': [ + newline, + include('whitespace or macro call'), + (r'[{}]', Punctuation, 'statement'), + (r'[abefimq-tv-z]|[nN][pP]?', Keyword, 'statement') + ], + + 'single-line string': [ + (r'"', String, '#pop'), + (r'[^\\"]+', String) + ] + } + + +class CsoundOrchestraLexer(CsoundLexer): + """ + For `Csound `_ orchestras. + + .. versionadded:: 2.1 + """ + + name = 'Csound Orchestra' + aliases = ['csound', 'csound-orc'] + filenames = ['*.orc'] + + user_defined_opcodes = set() + + def opcode_name_callback(lexer, match): + opcode = match.group(0) + lexer.user_defined_opcodes.add(opcode) + yield match.start(), Name.Function, opcode + + def name_callback(lexer, match): + name = match.group(0) + if re.match('p\d+$', name) or name in OPCODES: + yield match.start(), Name.Builtin, name + elif name in lexer.user_defined_opcodes: + yield match.start(), Name.Function, name + else: + nameMatch = re.search(r'^(g?[aikSw])(\w+)', name) + if nameMatch: + yield nameMatch.start(1), Keyword.Type, nameMatch.group(1) + yield nameMatch.start(2), Name, nameMatch.group(2) + else: + yield match.start(), Name, name + + tokens = { + 'label': [ + (r'\b(\w+)(:)', bygroups(Name.Label, Punctuation)) + ], + + 'partial expression': [ + include('preprocessor directives'), + (r'\b(0dbfs|k(r|smps)|nchnls(_i)?|sr)\b', Name.Variable.Global), + (r'\d+e[+-]?\d+|(\d+\.\d*|\d*\.\d+)(e[+-]?\d+)?', Number.Float), + (r'0[xX][a-fA-F0-9]+', Number.Hex), + (r'\d+', Number.Integer), + (r'"', String, 'single-line string'), + (r'\{\{', String, 'multi-line string'), + (r'[+\-*/%^!=&|<>#~¬]', Operator), + (r'[](),?:[]', Punctuation), + (words(( + # Keywords + 'do', 'else', 'elseif', 'endif', 'enduntil', 'fi', 'if', 'ithen', 'kthen', + 'od', 'then', 'until', 'while', + # Opcodes that act as control structures + 'return', 'timout' + ), prefix=r'\b', suffix=r'\b'), Keyword), + (words(('goto', 'igoto', 'kgoto', 'rigoto', 'tigoto'), + prefix=r'\b', suffix=r'\b'), Keyword, 'goto label'), + (words(('cggoto', 'cigoto', 'cingoto', 'ckgoto', 'cngoto'), + prefix=r'\b', suffix=r'\b'), Keyword, + ('goto label', 'goto expression')), + (words(('loop_ge', 'loop_gt', 'loop_le', 'loop_lt'), + prefix=r'\b', suffix=r'\b'), Keyword, + ('goto label', 'goto expression', 'goto expression', 'goto expression')), + (r'\bscoreline(_i)?\b', Name.Builtin, 'scoreline opcode'), + (r'\bpyl?run[it]?\b', Name.Builtin, 'python opcode'), + (r'\blua_(exec|opdef)\b', Name.Builtin, 'lua opcode'), + (r'\b[a-zA-Z_]\w*\b', name_callback) + ], + + 'expression': [ + include('whitespace or macro call'), + newline + ('#pop',), + include('partial expression') + ], + + 'root': [ + newline, + include('whitespace or macro call'), + (r'\binstr\b', Keyword, ('instrument block', 'instrument name list')), + (r'\bopcode\b', Keyword, ('opcode block', 'opcode parameter list', + 'opcode types', 'opcode types', 'opcode name')), + include('label'), + default('expression') + ], + + 'instrument name list': [ + include('whitespace or macro call'), + (r'\d+|\+?[a-zA-Z_]\w*', Name.Function), + (r',', Punctuation), + newline + ('#pop',) + ], + 'instrument block': [ + newline, + include('whitespace or macro call'), + (r'\bendin\b', Keyword, '#pop'), + include('label'), + default('expression') + ], + + 'opcode name': [ + include('whitespace or macro call'), + (r'[a-zA-Z_]\w*', opcode_name_callback, '#pop') + ], + 'opcode types': [ + include('whitespace or macro call'), + (r'0|[]afijkKoOpPStV[]+', Keyword.Type, '#pop'), + (r',', Punctuation) + ], + 'opcode parameter list': [ + include('whitespace or macro call'), + newline + ('#pop',) + ], + 'opcode block': [ + newline, + include('whitespace or macro call'), + (r'\bendop\b', Keyword, '#pop'), + include('label'), + default('expression') + ], + + 'goto label': [ + include('whitespace or macro call'), + (r'\w+', Name.Label, '#pop'), + default('#pop') + ], + 'goto expression': [ + include('whitespace or macro call'), + (r',', Punctuation, '#pop'), + include('partial expression') + ], + + 'single-line string': [ + include('macro call'), + (r'"', String, '#pop'), + # From https://github.com/csound/csound/blob/develop/Opcodes/fout.c#L1405 + (r'%\d*(\.\d+)?[cdhilouxX]', String.Interpol), + (r'%[!%nNrRtT]|[~^]|\\([\\aAbBnNrRtT"]|[0-7]{1,3})', String.Escape), + (r'[^\\"~$%\^\n]+', String), + (r'[\\"~$%\^\n]', String) + ], + 'multi-line string': [ + (r'\}\}', String, '#pop'), + (r'[^}]+|\}(?!\})', String) + ], + + 'scoreline opcode': [ + include('whitespace or macro call'), + (r'\{\{', String, 'scoreline'), + default('#pop') + ], + 'scoreline': [ + (r'\}\}', String, '#pop'), + (r'([^}]+)|\}(?!\})', using(CsoundScoreLexer)) + ], + + 'python opcode': [ + include('whitespace or macro call'), + (r'\{\{', String, 'python'), + default('#pop') + ], + 'python': [ + (r'\}\}', String, '#pop'), + (r'([^}]+)|\}(?!\})', using(PythonLexer)) + ], + + 'lua opcode': [ + include('whitespace or macro call'), + (r'"', String, 'single-line string'), + (r'\{\{', String, 'lua'), + (r',', Punctuation), + default('#pop') + ], + 'lua': [ + (r'\}\}', String, '#pop'), + (r'([^}]+)|\}(?!\})', using(LuaLexer)) + ] + } + + +class CsoundDocumentLexer(RegexLexer): + """ + For `Csound `_ documents. + + .. versionadded:: 2.1 + """ + + name = 'Csound Document' + aliases = ['csound-document', 'csound-csd'] + filenames = ['*.csd'] + + # These tokens are based on those in XmlLexer in pygments/lexers/html.py. Making + # CsoundDocumentLexer a subclass of XmlLexer rather than RegexLexer may seem like a + # better idea, since Csound Document files look like XML files. However, Csound + # Documents can contain Csound comments (preceded by //, for example) before and + # after the root element, unescaped bitwise AND & and less than < operators, etc. In + # other words, while Csound Document files look like XML files, they may not actually + # be XML files. + tokens = { + 'root': [ + newline, + (r'/[*](.|\n)*?[*]/', Comment.Multiline), + (r'[^<&;/]+', Text), + (r'<\s*CsInstruments', Name.Tag, ('orchestra', 'tag')), + (r'<\s*CsScore', Name.Tag, ('score', 'tag')), + (r'<\s*[hH][tT][mM][lL]', Name.Tag, ('HTML', 'tag')), + (r'<\s*[\w:.-]+', Name.Tag, 'tag'), + (r'<\s*/\s*[\w:.-]+\s*>', Name.Tag) + ], + 'orchestra': [ + (r'<\s*/\s*CsInstruments\s*>', Name.Tag, '#pop'), + (r'(.|\n)+?(?=<\s*/\s*CsInstruments\s*>)', using(CsoundOrchestraLexer)) + ], + 'score': [ + (r'<\s*/\s*CsScore\s*>', Name.Tag, '#pop'), + (r'(.|\n)+?(?=<\s*/\s*CsScore\s*>)', using(CsoundScoreLexer)) + ], + 'HTML': [ + (r'<\s*/\s*[hH][tT][mM][lL]\s*>', Name.Tag, '#pop'), + (r'(.|\n)+?(?=<\s*/\s*[hH][tT][mM][lL]\s*>)', using(HtmlLexer)) + ], + 'tag': [ + (r'\s+', Text), + (r'[\w.:-]+\s*=', Name.Attribute, 'attr'), + (r'/?\s*>', Name.Tag, '#pop') + ], + 'attr': [ + (r'\s+', Text), + (r'".*?"', String, '#pop'), + (r"'.*?'", String, '#pop'), + (r'[^\s>]+', String, '#pop') + ] + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/css.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/css.py new file mode 100644 index 0000000000000000000000000000000000000000..29d83707e15bf89d5f864693f84960a6c70aec27 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/css.py @@ -0,0 +1,689 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.css + ~~~~~~~~~~~~~~~~~~~ + + Lexers for CSS and related stylesheet formats. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re +import copy + +from pygments.lexer import ExtendedRegexLexer, RegexLexer, include, bygroups, \ + default, words, inherit +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation +from pygments.util import iteritems + +__all__ = ['CssLexer', 'SassLexer', 'ScssLexer', 'LessCssLexer'] + + +# List of vendor prefixes obtained from: +# https://www.w3.org/TR/CSS21/syndata.html#vendor-keyword-history +_vendor_prefixes = ( + '-ms-', 'mso-', '-moz-', '-o-', '-xv-', '-atsc-', '-wap-', '-khtml-', + '-webkit-', 'prince-', '-ah-', '-hp-', '-ro-', '-rim-', '-tc-', +) + +# List of CSS properties obtained from: +# https://www.w3.org/Style/CSS/all-properties.en.html +# Note: handle --* separately +_css_properties = ( + 'align-content', 'align-items', 'align-self', 'alignment-baseline', 'all', + 'animation', 'animation-delay', 'animation-direction', + 'animation-duration', 'animation-fill-mode', 'animation-iteration-count', + 'animation-name', 'animation-play-state', 'animation-timing-function', + 'appearance', 'azimuth', 'backface-visibility', 'background', + 'background-attachment', 'background-blend-mode', 'background-clip', + 'background-color', 'background-image', 'background-origin', + 'background-position', 'background-repeat', 'background-size', + 'baseline-shift', 'bookmark-label', 'bookmark-level', 'bookmark-state', + 'border', 'border-bottom', 'border-bottom-color', + 'border-bottom-left-radius', 'border-bottom-right-radius', + 'border-bottom-style', 'border-bottom-width', 'border-boundary', + 'border-collapse', 'border-color', 'border-image', 'border-image-outset', + 'border-image-repeat', 'border-image-slice', 'border-image-source', + 'border-image-width', 'border-left', 'border-left-color', + 'border-left-style', 'border-left-width', 'border-radius', 'border-right', + 'border-right-color', 'border-right-style', 'border-right-width', + 'border-spacing', 'border-style', 'border-top', 'border-top-color', + 'border-top-left-radius', 'border-top-right-radius', 'border-top-style', + 'border-top-width', 'border-width', 'bottom', 'box-decoration-break', + 'box-shadow', 'box-sizing', 'box-snap', 'box-suppress', 'break-after', + 'break-before', 'break-inside', 'caption-side', 'caret', 'caret-animation', + 'caret-color', 'caret-shape', 'chains', 'clear', 'clip', 'clip-path', + 'clip-rule', 'color', 'color-interpolation-filters', 'column-count', + 'column-fill', 'column-gap', 'column-rule', 'column-rule-color', + 'column-rule-style', 'column-rule-width', 'column-span', 'column-width', + 'columns', 'content', 'counter-increment', 'counter-reset', 'counter-set', + 'crop', 'cue', 'cue-after', 'cue-before', 'cursor', 'direction', 'display', + 'dominant-baseline', 'elevation', 'empty-cells', 'filter', 'flex', + 'flex-basis', 'flex-direction', 'flex-flow', 'flex-grow', 'flex-shrink', + 'flex-wrap', 'float', 'float-defer', 'float-offset', 'float-reference', + 'flood-color', 'flood-opacity', 'flow', 'flow-from', 'flow-into', 'font', + 'font-family', 'font-feature-settings', 'font-kerning', + 'font-language-override', 'font-size', 'font-size-adjust', 'font-stretch', + 'font-style', 'font-synthesis', 'font-variant', 'font-variant-alternates', + 'font-variant-caps', 'font-variant-east-asian', 'font-variant-ligatures', + 'font-variant-numeric', 'font-variant-position', 'font-weight', + 'footnote-display', 'footnote-policy', 'glyph-orientation-vertical', + 'grid', 'grid-area', 'grid-auto-columns', 'grid-auto-flow', + 'grid-auto-rows', 'grid-column', 'grid-column-end', 'grid-column-gap', + 'grid-column-start', 'grid-gap', 'grid-row', 'grid-row-end', + 'grid-row-gap', 'grid-row-start', 'grid-template', 'grid-template-areas', + 'grid-template-columns', 'grid-template-rows', 'hanging-punctuation', + 'height', 'hyphenate-character', 'hyphenate-limit-chars', + 'hyphenate-limit-last', 'hyphenate-limit-lines', 'hyphenate-limit-zone', + 'hyphens', 'image-orientation', 'image-resolution', 'initial-letter', + 'initial-letter-align', 'initial-letter-wrap', 'isolation', + 'justify-content', 'justify-items', 'justify-self', 'left', + 'letter-spacing', 'lighting-color', 'line-break', 'line-grid', + 'line-height', 'line-snap', 'list-style', 'list-style-image', + 'list-style-position', 'list-style-type', 'margin', 'margin-bottom', + 'margin-left', 'margin-right', 'margin-top', 'marker-side', + 'marquee-direction', 'marquee-loop', 'marquee-speed', 'marquee-style', + 'mask', 'mask-border', 'mask-border-mode', 'mask-border-outset', + 'mask-border-repeat', 'mask-border-slice', 'mask-border-source', + 'mask-border-width', 'mask-clip', 'mask-composite', 'mask-image', + 'mask-mode', 'mask-origin', 'mask-position', 'mask-repeat', 'mask-size', + 'mask-type', 'max-height', 'max-lines', 'max-width', 'min-height', + 'min-width', 'mix-blend-mode', 'motion', 'motion-offset', 'motion-path', + 'motion-rotation', 'move-to', 'nav-down', 'nav-left', 'nav-right', + 'nav-up', 'object-fit', 'object-position', 'offset-after', 'offset-before', + 'offset-end', 'offset-start', 'opacity', 'order', 'orphans', 'outline', + 'outline-color', 'outline-offset', 'outline-style', 'outline-width', + 'overflow', 'overflow-style', 'overflow-wrap', 'overflow-x', 'overflow-y', + 'padding', 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', + 'page', 'page-break-after', 'page-break-before', 'page-break-inside', + 'page-policy', 'pause', 'pause-after', 'pause-before', 'perspective', + 'perspective-origin', 'pitch', 'pitch-range', 'play-during', 'polar-angle', + 'polar-distance', 'position', 'presentation-level', 'quotes', + 'region-fragment', 'resize', 'rest', 'rest-after', 'rest-before', + 'richness', 'right', 'rotation', 'rotation-point', 'ruby-align', + 'ruby-merge', 'ruby-position', 'running', 'scroll-snap-coordinate', + 'scroll-snap-destination', 'scroll-snap-points-x', 'scroll-snap-points-y', + 'scroll-snap-type', 'shape-image-threshold', 'shape-inside', 'shape-margin', + 'shape-outside', 'size', 'speak', 'speak-as', 'speak-header', + 'speak-numeral', 'speak-punctuation', 'speech-rate', 'stress', 'string-set', + 'tab-size', 'table-layout', 'text-align', 'text-align-last', + 'text-combine-upright', 'text-decoration', 'text-decoration-color', + 'text-decoration-line', 'text-decoration-skip', 'text-decoration-style', + 'text-emphasis', 'text-emphasis-color', 'text-emphasis-position', + 'text-emphasis-style', 'text-indent', 'text-justify', 'text-orientation', + 'text-overflow', 'text-shadow', 'text-space-collapse', 'text-space-trim', + 'text-spacing', 'text-transform', 'text-underline-position', 'text-wrap', + 'top', 'transform', 'transform-origin', 'transform-style', 'transition', + 'transition-delay', 'transition-duration', 'transition-property', + 'transition-timing-function', 'unicode-bidi', 'user-select', + 'vertical-align', 'visibility', 'voice-balance', 'voice-duration', + 'voice-family', 'voice-pitch', 'voice-range', 'voice-rate', 'voice-stress', + 'voice-volume', 'volume', 'white-space', 'widows', 'width', 'will-change', + 'word-break', 'word-spacing', 'word-wrap', 'wrap-after', 'wrap-before', + 'wrap-flow', 'wrap-inside', 'wrap-through', 'writing-mode', 'z-index', +) + +# List of keyword values obtained from: +# http://cssvalues.com/ +_keyword_values = ( + 'absolute', 'alias', 'all', 'all-petite-caps', 'all-scroll', + 'all-small-caps', 'allow-end', 'alpha', 'alternate', 'alternate-reverse', + 'always', 'armenian', 'auto', 'avoid', 'avoid-column', 'avoid-page', + 'backwards', 'balance', 'baseline', 'below', 'blink', 'block', 'bold', + 'bolder', 'border-box', 'both', 'bottom', 'box-decoration', 'break-word', + 'capitalize', 'cell', 'center', 'circle', 'clip', 'clone', 'close-quote', + 'col-resize', 'collapse', 'color', 'color-burn', 'color-dodge', 'column', + 'column-reverse', 'compact', 'condensed', 'contain', 'container', + 'content-box', 'context-menu', 'copy', 'cover', 'crisp-edges', 'crosshair', + 'currentColor', 'cursive', 'darken', 'dashed', 'decimal', + 'decimal-leading-zero', 'default', 'descendants', 'difference', 'digits', + 'disc', 'distribute', 'dot', 'dotted', 'double', 'double-circle', 'e-resize', + 'each-line', 'ease', 'ease-in', 'ease-in-out', 'ease-out', 'edges', + 'ellipsis', 'end', 'ew-resize', 'exclusion', 'expanded', 'extra-condensed', + 'extra-expanded', 'fantasy', 'fill', 'fill-box', 'filled', 'first', 'fixed', + 'flat', 'flex', 'flex-end', 'flex-start', 'flip', 'force-end', 'forwards', + 'from-image', 'full-width', 'geometricPrecision', 'georgian', 'groove', + 'hanging', 'hard-light', 'help', 'hidden', 'hide', 'horizontal', 'hue', + 'icon', 'infinite', 'inherit', 'initial', 'ink', 'inline', 'inline-block', + 'inline-flex', 'inline-table', 'inset', 'inside', 'inter-word', 'invert', + 'isolate', 'italic', 'justify', 'large', 'larger', 'last', 'left', + 'lighten', 'lighter', 'line-through', 'linear', 'list-item', 'local', + 'loose', 'lower-alpha', 'lower-greek', 'lower-latin', 'lower-roman', + 'lowercase', 'ltr', 'luminance', 'luminosity', 'mandatory', 'manipulation', + 'manual', 'margin-box', 'match-parent', 'medium', 'mixed', 'monospace', + 'move', 'multiply', 'n-resize', 'ne-resize', 'nesw-resize', + 'no-close-quote', 'no-drop', 'no-open-quote', 'no-repeat', 'none', 'normal', + 'not-allowed', 'nowrap', 'ns-resize', 'nw-resize', 'nwse-resize', 'objects', + 'oblique', 'off', 'on', 'open', 'open-quote', 'optimizeLegibility', + 'optimizeSpeed', 'outset', 'outside', 'over', 'overlay', 'overline', + 'padding-box', 'page', 'pan-down', 'pan-left', 'pan-right', 'pan-up', + 'pan-x', 'pan-y', 'paused', 'petite-caps', 'pixelated', 'pointer', + 'preserve-3d', 'progress', 'proximity', 'relative', 'repeat', + 'repeat no-repeat', 'repeat-x', 'repeat-y', 'reverse', 'ridge', 'right', + 'round', 'row', 'row-resize', 'row-reverse', 'rtl', 'ruby', 'ruby-base', + 'ruby-base-container', 'ruby-text', 'ruby-text-container', 'run-in', + 'running', 's-resize', 'sans-serif', 'saturation', 'scale-down', 'screen', + 'scroll', 'se-resize', 'semi-condensed', 'semi-expanded', 'separate', + 'serif', 'sesame', 'show', 'sideways', 'sideways-left', 'sideways-right', + 'slice', 'small', 'small-caps', 'smaller', 'smooth', 'snap', 'soft-light', + 'solid', 'space', 'space-around', 'space-between', 'spaces', 'square', + 'start', 'static', 'step-end', 'step-start', 'sticky', 'stretch', 'strict', + 'stroke-box', 'style', 'sw-resize', 'table', 'table-caption', 'table-cell', + 'table-column', 'table-column-group', 'table-footer-group', + 'table-header-group', 'table-row', 'table-row-group', 'text', 'thick', + 'thin', 'titling-caps', 'to', 'top', 'triangle', 'ultra-condensed', + 'ultra-expanded', 'under', 'underline', 'unicase', 'unset', 'upper-alpha', + 'upper-latin', 'upper-roman', 'uppercase', 'upright', 'use-glyph-orientation', + 'vertical', 'vertical-text', 'view-box', 'visible', 'w-resize', 'wait', + 'wavy', 'weight', 'weight style', 'wrap', 'wrap-reverse', 'x-large', + 'x-small', 'xx-large', 'xx-small', 'zoom-in', 'zoom-out', +) + +# List of extended color keywords obtained from: +# https://drafts.csswg.org/css-color/#named-colors +_color_keywords = ( + 'aliceblue', 'antiquewhite', 'aqua', 'aquamarine', 'azure', 'beige', + 'bisque', 'black', 'blanchedalmond', 'blue', 'blueviolet', 'brown', + 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', + 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', + 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', + 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', + 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', + 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', + 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', + 'forestgreen', 'fuchsia', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', + 'gray', 'green', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', + 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', + 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', + 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', + 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', + 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', + 'lime', 'limegreen', 'linen', 'magenta', 'maroon', 'mediumaquamarine', + 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', + 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', + 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', + 'navajowhite', 'navy', 'oldlace', 'olive', 'olivedrab', 'orange', + 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', + 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', + 'powderblue', 'purple', 'rebeccapurple', 'red', 'rosybrown', 'royalblue', + 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', + 'silver', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', + 'springgreen', 'steelblue', 'tan', 'teal', 'thistle', 'tomato', 'turquoise', + 'violet', 'wheat', 'white', 'whitesmoke', 'yellow', 'yellowgreen', +) + ('transparent',) + +# List of other keyword values from other sources: +_other_keyword_values = ( + 'above', 'aural', 'behind', 'bidi-override', 'center-left', 'center-right', + 'cjk-ideographic', 'continuous', 'crop', 'cross', 'embed', 'far-left', + 'far-right', 'fast', 'faster', 'hebrew', 'high', 'higher', 'hiragana', + 'hiragana-iroha', 'katakana', 'katakana-iroha', 'landscape', 'left-side', + 'leftwards', 'level', 'loud', 'low', 'lower', 'message-box', 'middle', + 'mix', 'narrower', 'once', 'portrait', 'right-side', 'rightwards', 'silent', + 'slow', 'slower', 'small-caption', 'soft', 'spell-out', 'status-bar', + 'super', 'text-bottom', 'text-top', 'wider', 'x-fast', 'x-high', 'x-loud', + 'x-low', 'x-soft', 'yes', 'pre', 'pre-wrap', 'pre-line', +) + +# List of functional notation and function keyword values: +_functional_notation_keyword_values = ( + 'attr', 'blackness', 'blend', 'blenda', 'blur', 'brightness', 'calc', + 'circle', 'color-mod', 'contrast', 'counter', 'cubic-bezier', 'device-cmyk', + 'drop-shadow', 'ellipse', 'gray', 'grayscale', 'hsl', 'hsla', 'hue', + 'hue-rotate', 'hwb', 'image', 'inset', 'invert', 'lightness', + 'linear-gradient', 'matrix', 'matrix3d', 'opacity', 'perspective', + 'polygon', 'radial-gradient', 'rect', 'repeating-linear-gradient', + 'repeating-radial-gradient', 'rgb', 'rgba', 'rotate', 'rotate3d', 'rotateX', + 'rotateY', 'rotateZ', 'saturate', 'saturation', 'scale', 'scale3d', + 'scaleX', 'scaleY', 'scaleZ', 'sepia', 'shade', 'skewX', 'skewY', 'steps', + 'tint', 'toggle', 'translate', 'translate3d', 'translateX', 'translateY', + 'translateZ', 'whiteness', +) +# Note! Handle url(...) separately. + +# List of units obtained from: +# https://www.w3.org/TR/css3-values/ +_angle_units = ( + 'deg', 'grad', 'rad', 'turn', +) +_frequency_units = ( + 'Hz', 'kHz', +) +_length_units = ( + 'em', 'ex', 'ch', 'rem', + 'vh', 'vw', 'vmin', 'vmax', + 'px', 'mm', 'cm', 'in', 'pt', 'pc', 'q', +) +_resolution_units = ( + 'dpi', 'dpcm', 'dppx', +) +_time_units = ( + 's', 'ms', +) +_all_units = _angle_units + _frequency_units + _length_units + \ + _resolution_units + _time_units + + +class CssLexer(RegexLexer): + """ + For CSS (Cascading Style Sheets). + """ + + name = 'CSS' + aliases = ['css'] + filenames = ['*.css'] + mimetypes = ['text/css'] + + tokens = { + 'root': [ + include('basics'), + ], + 'basics': [ + (r'\s+', Text), + (r'/\*(?:.|\n)*?\*/', Comment), + (r'\{', Punctuation, 'content'), + (r'(\:{1,2})([\w-]+)', bygroups(Punctuation, Name.Decorator)), + (r'(\.)([\w-]+)', bygroups(Punctuation, Name.Class)), + (r'(\#)([\w-]+)', bygroups(Punctuation, Name.Namespace)), + (r'(@)([\w-]+)', bygroups(Punctuation, Keyword), 'atrule'), + (r'[\w-]+', Name.Tag), + (r'[~^*!%&$\[\]()<>|+=@:;,./?-]', Operator), + (r'"(\\\\|\\"|[^"])*"', String.Double), + (r"'(\\\\|\\'|[^'])*'", String.Single) + ], + 'atrule': [ + (r'\{', Punctuation, 'atcontent'), + (r';', Punctuation, '#pop'), + include('basics'), + ], + 'atcontent': [ + include('basics'), + (r'\}', Punctuation, '#pop:2'), + ], + 'content': [ + (r'\s+', Text), + (r'\}', Punctuation, '#pop'), + (r';', Punctuation), + (r'^@.*?$', Comment.Preproc), + + (words(_vendor_prefixes,), Keyword.Pseudo), + (r'('+r'|'.join(_css_properties)+r')(\s*)(\:)', + bygroups(Keyword, Text, Punctuation), 'value-start'), + (r'([a-zA-Z_][\w-]*)(\s*)(\:)', bygroups(Name, Text, Punctuation), + 'value-start'), + + (r'/\*(?:.|\n)*?\*/', Comment), + ], + 'value-start': [ + (r'\s+', Text), + (words(_vendor_prefixes,), Name.Builtin.Pseudo), + include('urls'), + (r'('+r'|'.join(_functional_notation_keyword_values)+r')(\()', + bygroups(Name.Builtin, Punctuation), 'function-start'), + (r'([a-zA-Z_][\w-]+)(\()', bygroups(Name.Function, Punctuation), 'function-start'), + (words(_keyword_values, suffix=r'\b'), Keyword.Constant), + (words(_other_keyword_values, suffix=r'\b'), Keyword.Constant), + (words(_color_keywords, suffix=r'\b'), Keyword.Constant), + (words(_css_properties, suffix=r'\b'), Keyword), # for transition-property etc. + (r'\!important', Comment.Preproc), + (r'/\*(?:.|\n)*?\*/', Comment), + + include('numeric-values'), + + (r'[~^*!%&<>|+=@:./?-]+', Operator), + (r'[\[\](),]+', Punctuation), + (r'"(\\\\|\\"|[^"])*"', String.Double), + (r"'(\\\\|\\'|[^'])*'", String.Single), + (r'[a-zA-Z_][\w-]*', Name), + (r';', Punctuation, '#pop'), + (r'\}', Punctuation, '#pop:2'), + ], + 'function-start': [ + (r'\s+', Text), + include('urls'), + (words(_vendor_prefixes,), Keyword.Pseudo), + (words(_keyword_values, suffix=r'\b'), Keyword.Constant), + (words(_other_keyword_values, suffix=r'\b'), Keyword.Constant), + (words(_color_keywords, suffix=r'\b'), Keyword.Constant), + + # function-start may be entered recursively + (r'(' + r'|'.join(_functional_notation_keyword_values) + r')(\()', + bygroups(Name.Builtin, Punctuation), 'function-start'), + (r'([a-zA-Z_][\w-]+)(\()', bygroups(Name.Function, Punctuation), 'function-start'), + + (r'/\*(?:.|\n)*?\*/', Comment), + include('numeric-values'), + (r'[*+/-]', Operator), + (r'[,]', Punctuation), + (r'"(\\\\|\\"|[^"])*"', String.Double), + (r"'(\\\\|\\'|[^'])*'", String.Single), + (r'[a-zA-Z_-]\w*', Name), + (r'\)', Punctuation, '#pop'), + ], + 'urls': [ + (r'(url)(\()(".*?")(\))', bygroups(Name.Builtin, Punctuation, + String.Double, Punctuation)), + (r"(url)(\()('.*?')(\))", bygroups(Name.Builtin, Punctuation, + String.Single, Punctuation)), + (r'(url)(\()(.*?)(\))', bygroups(Name.Builtin, Punctuation, + String.Other, Punctuation)), + ], + 'numeric-values': [ + (r'\#[a-zA-Z0-9]{1,6}', Number.Hex), + (r'[+\-]?[0-9]*[.][0-9]+', Number.Float, 'numeric-end'), + (r'[+\-]?[0-9]+', Number.Integer, 'numeric-end'), + ], + 'numeric-end': [ + (words(_all_units, suffix=r'\b'), Keyword.Type), + (r'%', Keyword.Type), + default('#pop'), + ], + } + + +common_sass_tokens = { + 'value': [ + (r'[ \t]+', Text), + (r'[!$][\w-]+', Name.Variable), + (r'url\(', String.Other, 'string-url'), + (r'[a-z_-][\w-]*(?=\()', Name.Function), + (words(_css_properties + ( + 'above', 'absolute', 'always', 'armenian', 'aural', 'auto', 'avoid', 'baseline', + 'behind', 'below', 'bidi-override', 'blink', 'block', 'bold', 'bolder', 'both', + 'capitalize', 'center-left', 'center-right', 'center', 'circle', + 'cjk-ideographic', 'close-quote', 'collapse', 'condensed', 'continuous', + 'crop', 'crosshair', 'cross', 'cursive', 'dashed', 'decimal-leading-zero', + 'decimal', 'default', 'digits', 'disc', 'dotted', 'double', 'e-resize', 'embed', + 'extra-condensed', 'extra-expanded', 'expanded', 'fantasy', 'far-left', + 'far-right', 'faster', 'fast', 'fixed', 'georgian', 'groove', 'hebrew', 'help', + 'hidden', 'hide', 'higher', 'high', 'hiragana-iroha', 'hiragana', 'icon', + 'inherit', 'inline-table', 'inline', 'inset', 'inside', 'invert', 'italic', + 'justify', 'katakana-iroha', 'katakana', 'landscape', 'larger', 'large', + 'left-side', 'leftwards', 'level', 'lighter', 'line-through', 'list-item', + 'loud', 'lower-alpha', 'lower-greek', 'lower-roman', 'lowercase', 'ltr', + 'lower', 'low', 'medium', 'message-box', 'middle', 'mix', 'monospace', + 'n-resize', 'narrower', 'ne-resize', 'no-close-quote', 'no-open-quote', + 'no-repeat', 'none', 'normal', 'nowrap', 'nw-resize', 'oblique', 'once', + 'open-quote', 'outset', 'outside', 'overline', 'pointer', 'portrait', 'px', + 'relative', 'repeat-x', 'repeat-y', 'repeat', 'rgb', 'ridge', 'right-side', + 'rightwards', 's-resize', 'sans-serif', 'scroll', 'se-resize', + 'semi-condensed', 'semi-expanded', 'separate', 'serif', 'show', 'silent', + 'slow', 'slower', 'small-caps', 'small-caption', 'smaller', 'soft', 'solid', + 'spell-out', 'square', 'static', 'status-bar', 'super', 'sw-resize', + 'table-caption', 'table-cell', 'table-column', 'table-column-group', + 'table-footer-group', 'table-header-group', 'table-row', + 'table-row-group', 'text', 'text-bottom', 'text-top', 'thick', 'thin', + 'transparent', 'ultra-condensed', 'ultra-expanded', 'underline', + 'upper-alpha', 'upper-latin', 'upper-roman', 'uppercase', 'url', + 'visible', 'w-resize', 'wait', 'wider', 'x-fast', 'x-high', 'x-large', 'x-loud', + 'x-low', 'x-small', 'x-soft', 'xx-large', 'xx-small', 'yes'), suffix=r'\b'), + Name.Constant), + (words(_color_keywords, suffix=r'\b'), Name.Entity), + (words(( + 'black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', + 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua'), suffix=r'\b'), + Name.Builtin), + (r'\!(important|default)', Name.Exception), + (r'(true|false)', Name.Pseudo), + (r'(and|or|not)', Operator.Word), + (r'/\*', Comment.Multiline, 'inline-comment'), + (r'//[^\n]*', Comment.Single), + (r'\#[a-z0-9]{1,6}', Number.Hex), + (r'(-?\d+)(\%|[a-z]+)?', bygroups(Number.Integer, Keyword.Type)), + (r'(-?\d*\.\d+)(\%|[a-z]+)?', bygroups(Number.Float, Keyword.Type)), + (r'#\{', String.Interpol, 'interpolation'), + (r'[~^*!&%<>|+=@:,./?-]+', Operator), + (r'[\[\]()]+', Punctuation), + (r'"', String.Double, 'string-double'), + (r"'", String.Single, 'string-single'), + (r'[a-z_-][\w-]*', Name), + ], + + 'interpolation': [ + (r'\}', String.Interpol, '#pop'), + include('value'), + ], + + 'selector': [ + (r'[ \t]+', Text), + (r'\:', Name.Decorator, 'pseudo-class'), + (r'\.', Name.Class, 'class'), + (r'\#', Name.Namespace, 'id'), + (r'[\w-]+', Name.Tag), + (r'#\{', String.Interpol, 'interpolation'), + (r'&', Keyword), + (r'[~^*!&\[\]()<>|+=@:;,./?-]', Operator), + (r'"', String.Double, 'string-double'), + (r"'", String.Single, 'string-single'), + ], + + 'string-double': [ + (r'(\\.|#(?=[^\n{])|[^\n"#])+', String.Double), + (r'#\{', String.Interpol, 'interpolation'), + (r'"', String.Double, '#pop'), + ], + + 'string-single': [ + (r"(\\.|#(?=[^\n{])|[^\n'#])+", String.Double), + (r'#\{', String.Interpol, 'interpolation'), + (r"'", String.Double, '#pop'), + ], + + 'string-url': [ + (r'(\\#|#(?=[^\n{])|[^\n#)])+', String.Other), + (r'#\{', String.Interpol, 'interpolation'), + (r'\)', String.Other, '#pop'), + ], + + 'pseudo-class': [ + (r'[\w-]+', Name.Decorator), + (r'#\{', String.Interpol, 'interpolation'), + default('#pop'), + ], + + 'class': [ + (r'[\w-]+', Name.Class), + (r'#\{', String.Interpol, 'interpolation'), + default('#pop'), + ], + + 'id': [ + (r'[\w-]+', Name.Namespace), + (r'#\{', String.Interpol, 'interpolation'), + default('#pop'), + ], + + 'for': [ + (r'(from|to|through)', Operator.Word), + include('value'), + ], +} + + +def _indentation(lexer, match, ctx): + indentation = match.group(0) + yield match.start(), Text, indentation + ctx.last_indentation = indentation + ctx.pos = match.end() + + if hasattr(ctx, 'block_state') and ctx.block_state and \ + indentation.startswith(ctx.block_indentation) and \ + indentation != ctx.block_indentation: + ctx.stack.append(ctx.block_state) + else: + ctx.block_state = None + ctx.block_indentation = None + ctx.stack.append('content') + + +def _starts_block(token, state): + def callback(lexer, match, ctx): + yield match.start(), token, match.group(0) + + if hasattr(ctx, 'last_indentation'): + ctx.block_indentation = ctx.last_indentation + else: + ctx.block_indentation = '' + + ctx.block_state = state + ctx.pos = match.end() + + return callback + + +class SassLexer(ExtendedRegexLexer): + """ + For Sass stylesheets. + + .. versionadded:: 1.3 + """ + + name = 'Sass' + aliases = ['sass'] + filenames = ['*.sass'] + mimetypes = ['text/x-sass'] + + flags = re.IGNORECASE | re.MULTILINE + + tokens = { + 'root': [ + (r'[ \t]*\n', Text), + (r'[ \t]*', _indentation), + ], + + 'content': [ + (r'//[^\n]*', _starts_block(Comment.Single, 'single-comment'), + 'root'), + (r'/\*[^\n]*', _starts_block(Comment.Multiline, 'multi-comment'), + 'root'), + (r'@import', Keyword, 'import'), + (r'@for', Keyword, 'for'), + (r'@(debug|warn|if|while)', Keyword, 'value'), + (r'(@mixin)( [\w-]+)', bygroups(Keyword, Name.Function), 'value'), + (r'(@include)( [\w-]+)', bygroups(Keyword, Name.Decorator), 'value'), + (r'@extend', Keyword, 'selector'), + (r'@[\w-]+', Keyword, 'selector'), + (r'=[\w-]+', Name.Function, 'value'), + (r'\+[\w-]+', Name.Decorator, 'value'), + (r'([!$][\w-]\w*)([ \t]*(?:(?:\|\|)?=|:))', + bygroups(Name.Variable, Operator), 'value'), + (r':', Name.Attribute, 'old-style-attr'), + (r'(?=.+?[=:]([^a-z]|$))', Name.Attribute, 'new-style-attr'), + default('selector'), + ], + + 'single-comment': [ + (r'.+', Comment.Single), + (r'\n', Text, 'root'), + ], + + 'multi-comment': [ + (r'.+', Comment.Multiline), + (r'\n', Text, 'root'), + ], + + 'import': [ + (r'[ \t]+', Text), + (r'\S+', String), + (r'\n', Text, 'root'), + ], + + 'old-style-attr': [ + (r'[^\s:="\[]+', Name.Attribute), + (r'#\{', String.Interpol, 'interpolation'), + (r'[ \t]*=', Operator, 'value'), + default('value'), + ], + + 'new-style-attr': [ + (r'[^\s:="\[]+', Name.Attribute), + (r'#\{', String.Interpol, 'interpolation'), + (r'[ \t]*[=:]', Operator, 'value'), + ], + + 'inline-comment': [ + (r"(\\#|#(?=[^\n{])|\*(?=[^\n/])|[^\n#*])+", Comment.Multiline), + (r'#\{', String.Interpol, 'interpolation'), + (r"\*/", Comment, '#pop'), + ], + } + for group, common in iteritems(common_sass_tokens): + tokens[group] = copy.copy(common) + tokens['value'].append((r'\n', Text, 'root')) + tokens['selector'].append((r'\n', Text, 'root')) + + +class ScssLexer(RegexLexer): + """ + For SCSS stylesheets. + """ + + name = 'SCSS' + aliases = ['scss'] + filenames = ['*.scss'] + mimetypes = ['text/x-scss'] + + flags = re.IGNORECASE | re.DOTALL + tokens = { + 'root': [ + (r'\s+', Text), + (r'//.*?\n', Comment.Single), + (r'/\*.*?\*/', Comment.Multiline), + (r'@import', Keyword, 'value'), + (r'@for', Keyword, 'for'), + (r'@(debug|warn|if|while)', Keyword, 'value'), + (r'(@mixin)( [\w-]+)', bygroups(Keyword, Name.Function), 'value'), + (r'(@include)( [\w-]+)', bygroups(Keyword, Name.Decorator), 'value'), + (r'@extend', Keyword, 'selector'), + (r'(@media)(\s+)', bygroups(Keyword, Text), 'value'), + (r'@[\w-]+', Keyword, 'selector'), + (r'(\$[\w-]*\w)([ \t]*:)', bygroups(Name.Variable, Operator), 'value'), + # TODO: broken, and prone to infinite loops. + # (r'(?=[^;{}][;}])', Name.Attribute, 'attr'), + # (r'(?=[^;{}:]+:[^a-z])', Name.Attribute, 'attr'), + default('selector'), + ], + + 'attr': [ + (r'[^\s:="\[]+', Name.Attribute), + (r'#\{', String.Interpol, 'interpolation'), + (r'[ \t]*:', Operator, 'value'), + default('#pop'), + ], + + 'inline-comment': [ + (r"(\\#|#(?=[^{])|\*(?=[^/])|[^#*])+", Comment.Multiline), + (r'#\{', String.Interpol, 'interpolation'), + (r"\*/", Comment, '#pop'), + ], + } + for group, common in iteritems(common_sass_tokens): + tokens[group] = copy.copy(common) + tokens['value'].extend([(r'\n', Text), (r'[;{}]', Punctuation, '#pop')]) + tokens['selector'].extend([(r'\n', Text), (r'[;{}]', Punctuation, '#pop')]) + + +class LessCssLexer(CssLexer): + """ + For `LESS `_ styleshets. + + .. versionadded:: 2.1 + """ + + name = 'LessCss' + aliases = ['less'] + filenames = ['*.less'] + mimetypes = ['text/x-less-css'] + + tokens = { + 'root': [ + (r'@\w+', Name.Variable), + inherit, + ], + 'content': [ + (r'\{', Punctuation, '#push'), + inherit, + ], + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/data.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/data.py new file mode 100644 index 0000000000000000000000000000000000000000..296366c225604574dcaf362203839d0cf05373c0 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/data.py @@ -0,0 +1,555 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.data + ~~~~~~~~~~~~~~~~~~~~ + + Lexers for data file format. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, ExtendedRegexLexer, LexerContext, \ + include, bygroups, inherit +from pygments.token import Text, Comment, Keyword, Name, String, Number, \ + Punctuation, Literal, Error + +__all__ = ['YamlLexer', 'JsonLexer', 'JsonBareObjectLexer', 'JsonLdLexer'] + + +class YamlLexerContext(LexerContext): + """Indentation context for the YAML lexer.""" + + def __init__(self, *args, **kwds): + super(YamlLexerContext, self).__init__(*args, **kwds) + self.indent_stack = [] + self.indent = -1 + self.next_indent = 0 + self.block_scalar_indent = None + + +class YamlLexer(ExtendedRegexLexer): + """ + Lexer for `YAML `_, a human-friendly data serialization + language. + + .. versionadded:: 0.11 + """ + + name = 'YAML' + aliases = ['yaml'] + filenames = ['*.yaml', '*.yml'] + mimetypes = ['text/x-yaml'] + + def something(token_class): + """Do not produce empty tokens.""" + def callback(lexer, match, context): + text = match.group() + if not text: + return + yield match.start(), token_class, text + context.pos = match.end() + return callback + + def reset_indent(token_class): + """Reset the indentation levels.""" + def callback(lexer, match, context): + text = match.group() + context.indent_stack = [] + context.indent = -1 + context.next_indent = 0 + context.block_scalar_indent = None + yield match.start(), token_class, text + context.pos = match.end() + return callback + + def save_indent(token_class, start=False): + """Save a possible indentation level.""" + def callback(lexer, match, context): + text = match.group() + extra = '' + if start: + context.next_indent = len(text) + if context.next_indent < context.indent: + while context.next_indent < context.indent: + context.indent = context.indent_stack.pop() + if context.next_indent > context.indent: + extra = text[context.indent:] + text = text[:context.indent] + else: + context.next_indent += len(text) + if text: + yield match.start(), token_class, text + if extra: + yield match.start()+len(text), token_class.Error, extra + context.pos = match.end() + return callback + + def set_indent(token_class, implicit=False): + """Set the previously saved indentation level.""" + def callback(lexer, match, context): + text = match.group() + if context.indent < context.next_indent: + context.indent_stack.append(context.indent) + context.indent = context.next_indent + if not implicit: + context.next_indent += len(text) + yield match.start(), token_class, text + context.pos = match.end() + return callback + + def set_block_scalar_indent(token_class): + """Set an explicit indentation level for a block scalar.""" + def callback(lexer, match, context): + text = match.group() + context.block_scalar_indent = None + if not text: + return + increment = match.group(1) + if increment: + current_indent = max(context.indent, 0) + increment = int(increment) + context.block_scalar_indent = current_indent + increment + if text: + yield match.start(), token_class, text + context.pos = match.end() + return callback + + def parse_block_scalar_empty_line(indent_token_class, content_token_class): + """Process an empty line in a block scalar.""" + def callback(lexer, match, context): + text = match.group() + if (context.block_scalar_indent is None or + len(text) <= context.block_scalar_indent): + if text: + yield match.start(), indent_token_class, text + else: + indentation = text[:context.block_scalar_indent] + content = text[context.block_scalar_indent:] + yield match.start(), indent_token_class, indentation + yield (match.start()+context.block_scalar_indent, + content_token_class, content) + context.pos = match.end() + return callback + + def parse_block_scalar_indent(token_class): + """Process indentation spaces in a block scalar.""" + def callback(lexer, match, context): + text = match.group() + if context.block_scalar_indent is None: + if len(text) <= max(context.indent, 0): + context.stack.pop() + context.stack.pop() + return + context.block_scalar_indent = len(text) + else: + if len(text) < context.block_scalar_indent: + context.stack.pop() + context.stack.pop() + return + if text: + yield match.start(), token_class, text + context.pos = match.end() + return callback + + def parse_plain_scalar_indent(token_class): + """Process indentation spaces in a plain scalar.""" + def callback(lexer, match, context): + text = match.group() + if len(text) <= context.indent: + context.stack.pop() + context.stack.pop() + return + if text: + yield match.start(), token_class, text + context.pos = match.end() + return callback + + tokens = { + # the root rules + 'root': [ + # ignored whitespaces + (r'[ ]+(?=#|$)', Text), + # line breaks + (r'\n+', Text), + # a comment + (r'#[^\n]*', Comment.Single), + # the '%YAML' directive + (r'^%YAML(?=[ ]|$)', reset_indent(Name.Tag), 'yaml-directive'), + # the %TAG directive + (r'^%TAG(?=[ ]|$)', reset_indent(Name.Tag), 'tag-directive'), + # document start and document end indicators + (r'^(?:---|\.\.\.)(?=[ ]|$)', reset_indent(Name.Namespace), + 'block-line'), + # indentation spaces + (r'[ ]*(?!\s|$)', save_indent(Text, start=True), + ('block-line', 'indentation')), + ], + + # trailing whitespaces after directives or a block scalar indicator + 'ignored-line': [ + # ignored whitespaces + (r'[ ]+(?=#|$)', Text), + # a comment + (r'#[^\n]*', Comment.Single), + # line break + (r'\n', Text, '#pop:2'), + ], + + # the %YAML directive + 'yaml-directive': [ + # the version number + (r'([ ]+)([0-9]+\.[0-9]+)', + bygroups(Text, Number), 'ignored-line'), + ], + + # the %YAG directive + 'tag-directive': [ + # a tag handle and the corresponding prefix + (r'([ ]+)(!|![\w-]*!)' + r'([ ]+)(!|!?[\w;/?:@&=+$,.!~*\'()\[\]%-]+)', + bygroups(Text, Keyword.Type, Text, Keyword.Type), + 'ignored-line'), + ], + + # block scalar indicators and indentation spaces + 'indentation': [ + # trailing whitespaces are ignored + (r'[ ]*$', something(Text), '#pop:2'), + # whitespaces preceeding block collection indicators + (r'[ ]+(?=[?:-](?:[ ]|$))', save_indent(Text)), + # block collection indicators + (r'[?:-](?=[ ]|$)', set_indent(Punctuation.Indicator)), + # the beginning a block line + (r'[ ]*', save_indent(Text), '#pop'), + ], + + # an indented line in the block context + 'block-line': [ + # the line end + (r'[ ]*(?=#|$)', something(Text), '#pop'), + # whitespaces separating tokens + (r'[ ]+', Text), + # tags, anchors and aliases, + include('descriptors'), + # block collections and scalars + include('block-nodes'), + # flow collections and quoted scalars + include('flow-nodes'), + # a plain scalar + (r'(?=[^\s?:,\[\]{}#&*!|>\'"%@`-]|[?:-]\S)', + something(Name.Variable), + 'plain-scalar-in-block-context'), + ], + + # tags, anchors, aliases + 'descriptors': [ + # a full-form tag + (r'!<[\w#;/?:@&=+$,.!~*\'()\[\]%-]+>', Keyword.Type), + # a tag in the form '!', '!suffix' or '!handle!suffix' + (r'!(?:[\w-]+!)?' + r'[\w#;/?:@&=+$,.!~*\'()\[\]%-]+', Keyword.Type), + # an anchor + (r'&[\w-]+', Name.Label), + # an alias + (r'\*[\w-]+', Name.Variable), + ], + + # block collections and scalars + 'block-nodes': [ + # implicit key + (r':(?=[ ]|$)', set_indent(Punctuation.Indicator, implicit=True)), + # literal and folded scalars + (r'[|>]', Punctuation.Indicator, + ('block-scalar-content', 'block-scalar-header')), + ], + + # flow collections and quoted scalars + 'flow-nodes': [ + # a flow sequence + (r'\[', Punctuation.Indicator, 'flow-sequence'), + # a flow mapping + (r'\{', Punctuation.Indicator, 'flow-mapping'), + # a single-quoted scalar + (r'\'', String, 'single-quoted-scalar'), + # a double-quoted scalar + (r'\"', String, 'double-quoted-scalar'), + ], + + # the content of a flow collection + 'flow-collection': [ + # whitespaces + (r'[ ]+', Text), + # line breaks + (r'\n+', Text), + # a comment + (r'#[^\n]*', Comment.Single), + # simple indicators + (r'[?:,]', Punctuation.Indicator), + # tags, anchors and aliases + include('descriptors'), + # nested collections and quoted scalars + include('flow-nodes'), + # a plain scalar + (r'(?=[^\s?:,\[\]{}#&*!|>\'"%@`])', + something(Name.Variable), + 'plain-scalar-in-flow-context'), + ], + + # a flow sequence indicated by '[' and ']' + 'flow-sequence': [ + # include flow collection rules + include('flow-collection'), + # the closing indicator + (r'\]', Punctuation.Indicator, '#pop'), + ], + + # a flow mapping indicated by '{' and '}' + 'flow-mapping': [ + # include flow collection rules + include('flow-collection'), + # the closing indicator + (r'\}', Punctuation.Indicator, '#pop'), + ], + + # block scalar lines + 'block-scalar-content': [ + # line break + (r'\n', Text), + # empty line + (r'^[ ]+$', + parse_block_scalar_empty_line(Text, Name.Constant)), + # indentation spaces (we may leave the state here) + (r'^[ ]*', parse_block_scalar_indent(Text)), + # line content + (r'[\S\t ]+', Name.Constant), + ], + + # the content of a literal or folded scalar + 'block-scalar-header': [ + # indentation indicator followed by chomping flag + (r'([1-9])?[+-]?(?=[ ]|$)', + set_block_scalar_indent(Punctuation.Indicator), + 'ignored-line'), + # chomping flag followed by indentation indicator + (r'[+-]?([1-9])?(?=[ ]|$)', + set_block_scalar_indent(Punctuation.Indicator), + 'ignored-line'), + ], + + # ignored and regular whitespaces in quoted scalars + 'quoted-scalar-whitespaces': [ + # leading and trailing whitespaces are ignored + (r'^[ ]+', Text), + (r'[ ]+$', Text), + # line breaks are ignored + (r'\n+', Text), + # other whitespaces are a part of the value + (r'[ ]+', Name.Variable), + ], + + # single-quoted scalars + 'single-quoted-scalar': [ + # include whitespace and line break rules + include('quoted-scalar-whitespaces'), + # escaping of the quote character + (r'\'\'', String.Escape), + # regular non-whitespace characters + (r'[^\s\']+', String), + # the closing quote + (r'\'', String, '#pop'), + ], + + # double-quoted scalars + 'double-quoted-scalar': [ + # include whitespace and line break rules + include('quoted-scalar-whitespaces'), + # escaping of special characters + (r'\\[0abt\tn\nvfre "\\N_LP]', String), + # escape codes + (r'\\(?:x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})', + String.Escape), + # regular non-whitespace characters + (r'[^\s"\\]+', String), + # the closing quote + (r'"', String, '#pop'), + ], + + # the beginning of a new line while scanning a plain scalar + 'plain-scalar-in-block-context-new-line': [ + # empty lines + (r'^[ ]+$', Text), + # line breaks + (r'\n+', Text), + # document start and document end indicators + (r'^(?=---|\.\.\.)', something(Name.Namespace), '#pop:3'), + # indentation spaces (we may leave the block line state here) + (r'^[ ]*', parse_plain_scalar_indent(Text), '#pop'), + ], + + # a plain scalar in the block context + 'plain-scalar-in-block-context': [ + # the scalar ends with the ':' indicator + (r'[ ]*(?=:[ ]|:$)', something(Text), '#pop'), + # the scalar ends with whitespaces followed by a comment + (r'[ ]+(?=#)', Text, '#pop'), + # trailing whitespaces are ignored + (r'[ ]+$', Text), + # line breaks are ignored + (r'\n+', Text, 'plain-scalar-in-block-context-new-line'), + # other whitespaces are a part of the value + (r'[ ]+', Literal.Scalar.Plain), + # regular non-whitespace characters + (r'(?::(?!\s)|[^\s:])+', Literal.Scalar.Plain), + ], + + # a plain scalar is the flow context + 'plain-scalar-in-flow-context': [ + # the scalar ends with an indicator character + (r'[ ]*(?=[,:?\[\]{}])', something(Text), '#pop'), + # the scalar ends with a comment + (r'[ ]+(?=#)', Text, '#pop'), + # leading and trailing whitespaces are ignored + (r'^[ ]+', Text), + (r'[ ]+$', Text), + # line breaks are ignored + (r'\n+', Text), + # other whitespaces are a part of the value + (r'[ ]+', Name.Variable), + # regular non-whitespace characters + (r'[^\s,:?\[\]{}]+', Name.Variable), + ], + + } + + def get_tokens_unprocessed(self, text=None, context=None): + if context is None: + context = YamlLexerContext(text, 0) + return super(YamlLexer, self).get_tokens_unprocessed(text, context) + + +class JsonLexer(RegexLexer): + """ + For JSON data structures. + + .. versionadded:: 1.5 + """ + + name = 'JSON' + aliases = ['json'] + filenames = ['*.json'] + mimetypes = ['application/json'] + + flags = re.DOTALL + + # integer part of a number + int_part = r'-?(0|[1-9]\d*)' + + # fractional part of a number + frac_part = r'\.\d+' + + # exponential part of a number + exp_part = r'[eE](\+|-)?\d+' + + tokens = { + 'whitespace': [ + (r'\s+', Text), + ], + + # represents a simple terminal value + 'simplevalue': [ + (r'(true|false|null)\b', Keyword.Constant), + (('%(int_part)s(%(frac_part)s%(exp_part)s|' + '%(exp_part)s|%(frac_part)s)') % vars(), + Number.Float), + (int_part, Number.Integer), + (r'"(\\\\|\\"|[^"])*"', String.Double), + ], + + + # the right hand side of an object, after the attribute name + 'objectattribute': [ + include('value'), + (r':', Punctuation), + # comma terminates the attribute but expects more + (r',', Punctuation, '#pop'), + # a closing bracket terminates the entire object, so pop twice + (r'\}', Punctuation, '#pop:2'), + ], + + # a json object - { attr, attr, ... } + 'objectvalue': [ + include('whitespace'), + (r'"(\\\\|\\"|[^"])*"', Name.Tag, 'objectattribute'), + (r'\}', Punctuation, '#pop'), + ], + + # json array - [ value, value, ... } + 'arrayvalue': [ + include('whitespace'), + include('value'), + (r',', Punctuation), + (r'\]', Punctuation, '#pop'), + ], + + # a json value - either a simple value or a complex value (object or array) + 'value': [ + include('whitespace'), + include('simplevalue'), + (r'\{', Punctuation, 'objectvalue'), + (r'\[', Punctuation, 'arrayvalue'), + ], + + # the root of a json document whould be a value + 'root': [ + include('value'), + ], + } + + +class JsonBareObjectLexer(JsonLexer): + """ + For JSON data structures (with missing object curly braces). + + .. versionadded:: 2.2 + """ + + name = 'JSONBareObject' + aliases = ['json-object'] + filenames = [] + mimetypes = ['application/json-object'] + + tokens = { + 'root': [ + (r'\}', Error), + include('objectvalue'), + ], + 'objectattribute': [ + (r'\}', Error), + inherit, + ], + } + + +class JsonLdLexer(JsonLexer): + """ + For `JSON-LD `_ linked data. + + .. versionadded:: 2.0 + """ + + name = 'JSON-LD' + aliases = ['jsonld', 'json-ld'] + filenames = ['*.jsonld'] + mimetypes = ['application/ld+json'] + + tokens = { + 'objectvalue': [ + (r'"@(context|id|value|language|type|container|list|set|' + r'reverse|index|base|vocab|graph)"', Name.Decorator, + 'objectattribute'), + inherit, + ], + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/dotnet.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/dotnet.py new file mode 100644 index 0000000000000000000000000000000000000000..4e2bc8ab5c91b5444a90a31948e4dd35b10b79f8 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/dotnet.py @@ -0,0 +1,691 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.dotnet + ~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for .net languages. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" +import re + +from pygments.lexer import RegexLexer, DelegatingLexer, bygroups, include, \ + using, this, default, words +from pygments.token import Punctuation, \ + Text, Comment, Operator, Keyword, Name, String, Number, Literal, Other +from pygments.util import get_choice_opt, iteritems +from pygments import unistring as uni + +from pygments.lexers.html import XmlLexer + +__all__ = ['CSharpLexer', 'NemerleLexer', 'BooLexer', 'VbNetLexer', + 'CSharpAspxLexer', 'VbNetAspxLexer', 'FSharpLexer'] + + +class CSharpLexer(RegexLexer): + """ + For `C# `_ + source code. + + Additional options accepted: + + `unicodelevel` + Determines which Unicode characters this lexer allows for identifiers. + The possible values are: + + * ``none`` -- only the ASCII letters and numbers are allowed. This + is the fastest selection. + * ``basic`` -- all Unicode characters from the specification except + category ``Lo`` are allowed. + * ``full`` -- all Unicode characters as specified in the C# specs + are allowed. Note that this means a considerable slowdown since the + ``Lo`` category has more than 40,000 characters in it! + + The default value is ``basic``. + + .. versionadded:: 0.8 + """ + + name = 'C#' + aliases = ['csharp', 'c#'] + filenames = ['*.cs'] + mimetypes = ['text/x-csharp'] # inferred + + flags = re.MULTILINE | re.DOTALL | re.UNICODE + + # for the range of allowed unicode characters in identifiers, see + # http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-334.pdf + + levels = { + 'none': '@?[_a-zA-Z]\w*', + 'basic': ('@?[_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl') + ']' + + '[' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc', + 'Cf', 'Mn', 'Mc') + ']*'), + 'full': ('@?(?:_|[^' + + uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl') + '])' + + '[^' + uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl', + 'Nd', 'Pc', 'Cf', 'Mn', 'Mc') + ']*'), + } + + tokens = {} + token_variants = True + + for levelname, cs_ident in iteritems(levels): + tokens[levelname] = { + 'root': [ + # method names + (r'^([ \t]*(?:' + cs_ident + r'(?:\[\])?\s+)+?)' # return type + r'(' + cs_ident + ')' # method name + r'(\s*)(\()', # signature start + bygroups(using(this), Name.Function, Text, Punctuation)), + (r'^\s*\[.*?\]', Name.Attribute), + (r'[^\S\n]+', Text), + (r'\\\n', Text), # line continuation + (r'//.*?\n', Comment.Single), + (r'/[*].*?[*]/', Comment.Multiline), + (r'\n', Text), + (r'[~!%^&*()+=|\[\]:;,.<>/?-]', Punctuation), + (r'[{}]', Punctuation), + (r'@"(""|[^"])*"', String), + (r'"(\\\\|\\"|[^"\n])*["\n]', String), + (r"'\\.'|'[^\\]'", String.Char), + (r"[0-9](\.[0-9]*)?([eE][+-][0-9]+)?" + r"[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?", Number), + (r'#[ \t]*(if|endif|else|elif|define|undef|' + r'line|error|warning|region|endregion|pragma)\b.*?\n', + Comment.Preproc), + (r'\b(extern)(\s+)(alias)\b', bygroups(Keyword, Text, + Keyword)), + (r'(abstract|as|async|await|base|break|by|case|catch|' + r'checked|const|continue|default|delegate|' + r'do|else|enum|event|explicit|extern|false|finally|' + r'fixed|for|foreach|goto|if|implicit|in|interface|' + r'internal|is|let|lock|new|null|on|operator|' + r'out|override|params|private|protected|public|readonly|' + r'ref|return|sealed|sizeof|stackalloc|static|' + r'switch|this|throw|true|try|typeof|' + r'unchecked|unsafe|virtual|void|while|' + r'get|set|new|partial|yield|add|remove|value|alias|ascending|' + r'descending|from|group|into|orderby|select|thenby|where|' + r'join|equals)\b', Keyword), + (r'(global)(::)', bygroups(Keyword, Punctuation)), + (r'(bool|byte|char|decimal|double|dynamic|float|int|long|object|' + r'sbyte|short|string|uint|ulong|ushort|var)\b\??', Keyword.Type), + (r'(class|struct)(\s+)', bygroups(Keyword, Text), 'class'), + (r'(namespace|using)(\s+)', bygroups(Keyword, Text), 'namespace'), + (cs_ident, Name), + ], + 'class': [ + (cs_ident, Name.Class, '#pop'), + default('#pop'), + ], + 'namespace': [ + (r'(?=\()', Text, '#pop'), # using (resource) + ('(' + cs_ident + r'|\.)+', Name.Namespace, '#pop'), + ] + } + + def __init__(self, **options): + level = get_choice_opt(options, 'unicodelevel', list(self.tokens), 'basic') + if level not in self._all_tokens: + # compile the regexes now + self._tokens = self.__class__.process_tokendef(level) + else: + self._tokens = self._all_tokens[level] + + RegexLexer.__init__(self, **options) + + +class NemerleLexer(RegexLexer): + """ + For `Nemerle `_ source code. + + Additional options accepted: + + `unicodelevel` + Determines which Unicode characters this lexer allows for identifiers. + The possible values are: + + * ``none`` -- only the ASCII letters and numbers are allowed. This + is the fastest selection. + * ``basic`` -- all Unicode characters from the specification except + category ``Lo`` are allowed. + * ``full`` -- all Unicode characters as specified in the C# specs + are allowed. Note that this means a considerable slowdown since the + ``Lo`` category has more than 40,000 characters in it! + + The default value is ``basic``. + + .. versionadded:: 1.5 + """ + + name = 'Nemerle' + aliases = ['nemerle'] + filenames = ['*.n'] + mimetypes = ['text/x-nemerle'] # inferred + + flags = re.MULTILINE | re.DOTALL | re.UNICODE + + # for the range of allowed unicode characters in identifiers, see + # http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-334.pdf + + levels = { + 'none': '@?[_a-zA-Z]\w*', + 'basic': ('@?[_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl') + ']' + + '[' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc', + 'Cf', 'Mn', 'Mc') + ']*'), + 'full': ('@?(?:_|[^' + + uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl') + '])' + + '[^' + uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl', + 'Nd', 'Pc', 'Cf', 'Mn', 'Mc') + ']*'), + } + + tokens = {} + token_variants = True + + for levelname, cs_ident in iteritems(levels): + tokens[levelname] = { + 'root': [ + # method names + (r'^([ \t]*(?:' + cs_ident + r'(?:\[\])?\s+)+?)' # return type + r'(' + cs_ident + ')' # method name + r'(\s*)(\()', # signature start + bygroups(using(this), Name.Function, Text, Punctuation)), + (r'^\s*\[.*?\]', Name.Attribute), + (r'[^\S\n]+', Text), + (r'\\\n', Text), # line continuation + (r'//.*?\n', Comment.Single), + (r'/[*].*?[*]/', Comment.Multiline), + (r'\n', Text), + (r'\$\s*"', String, 'splice-string'), + (r'\$\s*<#', String, 'splice-string2'), + (r'<#', String, 'recursive-string'), + + (r'(<\[)\s*(' + cs_ident + ':)?', Keyword), + (r'\]\>', Keyword), + + # quasiquotation only + (r'\$' + cs_ident, Name), + (r'(\$)(\()', bygroups(Name, Punctuation), + 'splice-string-content'), + + (r'[~!%^&*()+=|\[\]:;,.<>/?-]', Punctuation), + (r'[{}]', Punctuation), + (r'@"(""|[^"])*"', String), + (r'"(\\\\|\\"|[^"\n])*["\n]', String), + (r"'\\.'|'[^\\]'", String.Char), + (r"0[xX][0-9a-fA-F]+[Ll]?", Number), + (r"[0-9](\.[0-9]*)?([eE][+-][0-9]+)?[flFLdD]?", Number), + (r'#[ \t]*(if|endif|else|elif|define|undef|' + r'line|error|warning|region|endregion|pragma)\b.*?\n', + Comment.Preproc), + (r'\b(extern)(\s+)(alias)\b', bygroups(Keyword, Text, + Keyword)), + (r'(abstract|and|as|base|catch|def|delegate|' + r'enum|event|extern|false|finally|' + r'fun|implements|interface|internal|' + r'is|macro|match|matches|module|mutable|new|' + r'null|out|override|params|partial|private|' + r'protected|public|ref|sealed|static|' + r'syntax|this|throw|true|try|type|typeof|' + r'virtual|volatile|when|where|with|' + r'assert|assert2|async|break|checked|continue|do|else|' + r'ensures|for|foreach|if|late|lock|new|nolate|' + r'otherwise|regexp|repeat|requires|return|surroundwith|' + r'unchecked|unless|using|while|yield)\b', Keyword), + (r'(global)(::)', bygroups(Keyword, Punctuation)), + (r'(bool|byte|char|decimal|double|float|int|long|object|sbyte|' + r'short|string|uint|ulong|ushort|void|array|list)\b\??', + Keyword.Type), + (r'(:>?)\s*(' + cs_ident + r'\??)', + bygroups(Punctuation, Keyword.Type)), + (r'(class|struct|variant|module)(\s+)', + bygroups(Keyword, Text), 'class'), + (r'(namespace|using)(\s+)', bygroups(Keyword, Text), + 'namespace'), + (cs_ident, Name), + ], + 'class': [ + (cs_ident, Name.Class, '#pop') + ], + 'namespace': [ + (r'(?=\()', Text, '#pop'), # using (resource) + ('(' + cs_ident + r'|\.)+', Name.Namespace, '#pop') + ], + 'splice-string': [ + (r'[^"$]', String), + (r'\$' + cs_ident, Name), + (r'(\$)(\()', bygroups(Name, Punctuation), + 'splice-string-content'), + (r'\\"', String), + (r'"', String, '#pop') + ], + 'splice-string2': [ + (r'[^#<>$]', String), + (r'\$' + cs_ident, Name), + (r'(\$)(\()', bygroups(Name, Punctuation), + 'splice-string-content'), + (r'<#', String, '#push'), + (r'#>', String, '#pop') + ], + 'recursive-string': [ + (r'[^#<>]', String), + (r'<#', String, '#push'), + (r'#>', String, '#pop') + ], + 'splice-string-content': [ + (r'if|match', Keyword), + (r'[~!%^&*+=|\[\]:;,.<>/?-\\"$ ]', Punctuation), + (cs_ident, Name), + (r'\d+', Number), + (r'\(', Punctuation, '#push'), + (r'\)', Punctuation, '#pop') + ] + } + + def __init__(self, **options): + level = get_choice_opt(options, 'unicodelevel', list(self.tokens), + 'basic') + if level not in self._all_tokens: + # compile the regexes now + self._tokens = self.__class__.process_tokendef(level) + else: + self._tokens = self._all_tokens[level] + + RegexLexer.__init__(self, **options) + + +class BooLexer(RegexLexer): + """ + For `Boo `_ source code. + """ + + name = 'Boo' + aliases = ['boo'] + filenames = ['*.boo'] + mimetypes = ['text/x-boo'] + + tokens = { + 'root': [ + (r'\s+', Text), + (r'(#|//).*$', Comment.Single), + (r'/[*]', Comment.Multiline, 'comment'), + (r'[]{}:(),.;[]', Punctuation), + (r'\\\n', Text), + (r'\\', Text), + (r'(in|is|and|or|not)\b', Operator.Word), + (r'/(\\\\|\\/|[^/\s])/', String.Regex), + (r'@/(\\\\|\\/|[^/])*/', String.Regex), + (r'=~|!=|==|<<|>>|[-+/*%=<>&^|]', Operator), + (r'(as|abstract|callable|constructor|destructor|do|import|' + r'enum|event|final|get|interface|internal|of|override|' + r'partial|private|protected|public|return|set|static|' + r'struct|transient|virtual|yield|super|and|break|cast|' + r'continue|elif|else|ensure|except|for|given|goto|if|in|' + r'is|isa|not|or|otherwise|pass|raise|ref|try|unless|when|' + r'while|from|as)\b', Keyword), + (r'def(?=\s+\(.*?\))', Keyword), + (r'(def)(\s+)', bygroups(Keyword, Text), 'funcname'), + (r'(class)(\s+)', bygroups(Keyword, Text), 'classname'), + (r'(namespace)(\s+)', bygroups(Keyword, Text), 'namespace'), + (r'(?`_ + source code. + """ + + name = 'VB.net' + aliases = ['vb.net', 'vbnet'] + filenames = ['*.vb', '*.bas'] + mimetypes = ['text/x-vbnet', 'text/x-vba'] # (?) + + uni_name = '[_' + uni.combine('Ll', 'Lt', 'Lm', 'Nl') + ']' + \ + '[' + uni.combine('Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc', + 'Cf', 'Mn', 'Mc') + ']*' + + flags = re.MULTILINE | re.IGNORECASE + tokens = { + 'root': [ + (r'^\s*<.*?>', Name.Attribute), + (r'\s+', Text), + (r'\n', Text), + (r'rem\b.*?\n', Comment), + (r"'.*?\n", Comment), + (r'#If\s.*?\sThen|#ElseIf\s.*?\sThen|#Else|#End\s+If|#Const|' + r'#ExternalSource.*?\n|#End\s+ExternalSource|' + r'#Region.*?\n|#End\s+Region|#ExternalChecksum', + Comment.Preproc), + (r'[(){}!#,.:]', Punctuation), + (r'Option\s+(Strict|Explicit|Compare)\s+' + r'(On|Off|Binary|Text)', Keyword.Declaration), + (words(( + 'AddHandler', 'Alias', 'ByRef', 'ByVal', 'Call', 'Case', + 'Catch', 'CBool', 'CByte', 'CChar', 'CDate', 'CDec', 'CDbl', + 'CInt', 'CLng', 'CObj', 'Continue', 'CSByte', 'CShort', 'CSng', + 'CStr', 'CType', 'CUInt', 'CULng', 'CUShort', 'Declare', + 'Default', 'Delegate', 'DirectCast', 'Do', 'Each', 'Else', + 'ElseIf', 'EndIf', 'Erase', 'Error', 'Event', 'Exit', 'False', + 'Finally', 'For', 'Friend', 'Get', 'Global', 'GoSub', 'GoTo', + 'Handles', 'If', 'Implements', 'Inherits', 'Interface', 'Let', + 'Lib', 'Loop', 'Me', 'MustInherit', 'MustOverride', 'MyBase', + 'MyClass', 'Narrowing', 'New', 'Next', 'Not', 'Nothing', + 'NotInheritable', 'NotOverridable', 'Of', 'On', 'Operator', + 'Option', 'Optional', 'Overloads', 'Overridable', 'Overrides', + 'ParamArray', 'Partial', 'Private', 'Protected', 'Public', + 'RaiseEvent', 'ReadOnly', 'ReDim', 'RemoveHandler', 'Resume', + 'Return', 'Select', 'Set', 'Shadows', 'Shared', 'Single', + 'Static', 'Step', 'Stop', 'SyncLock', 'Then', 'Throw', 'To', + 'True', 'Try', 'TryCast', 'Wend', 'Using', 'When', 'While', + 'Widening', 'With', 'WithEvents', 'WriteOnly'), + prefix='(?>=|<<|>>|:=|' + r'<=|>=|<>|[-&*/\\^+=<>\[\]]', + Operator), + ('"', String, 'string'), + (r'_\n', Text), # Line continuation (must be before Name) + (uni_name + '[%&@!#$]?', Name), + ('#.*?#', Literal.Date), + (r'(\d+\.\d*|\d*\.\d+)(F[+-]?[0-9]+)?', Number.Float), + (r'\d+([SILDFR]|US|UI|UL)?', Number.Integer), + (r'&H[0-9a-f]+([SILDFR]|US|UI|UL)?', Number.Integer), + (r'&O[0-7]+([SILDFR]|US|UI|UL)?', Number.Integer), + ], + 'string': [ + (r'""', String), + (r'"C?', String, '#pop'), + (r'[^"]+', String), + ], + 'dim': [ + (uni_name, Name.Variable, '#pop'), + default('#pop'), # any other syntax + ], + 'funcname': [ + (uni_name, Name.Function, '#pop'), + ], + 'classname': [ + (uni_name, Name.Class, '#pop'), + ], + 'namespace': [ + (uni_name, Name.Namespace), + (r'\.', Name.Namespace), + default('#pop'), + ], + 'end': [ + (r'\s+', Text), + (r'(Function|Sub|Property|Class|Structure|Enum|Module|Namespace)\b', + Keyword, '#pop'), + default('#pop'), + ] + } + + def analyse_text(text): + if re.search(r'^\s*(#If|Module|Namespace)', text, re.MULTILINE): + return 0.5 + + +class GenericAspxLexer(RegexLexer): + """ + Lexer for ASP.NET pages. + """ + + name = 'aspx-gen' + filenames = [] + mimetypes = [] + + flags = re.DOTALL + + tokens = { + 'root': [ + (r'(<%[@=#]?)(.*?)(%>)', bygroups(Name.Tag, Other, Name.Tag)), + (r'()(.*?)()', bygroups(using(XmlLexer), + Other, + using(XmlLexer))), + (r'(.+?)(?=<)', using(XmlLexer)), + (r'.+', using(XmlLexer)), + ], + } + + +# TODO support multiple languages within the same source file +class CSharpAspxLexer(DelegatingLexer): + """ + Lexer for highlighting C# within ASP.NET pages. + """ + + name = 'aspx-cs' + aliases = ['aspx-cs'] + filenames = ['*.aspx', '*.asax', '*.ascx', '*.ashx', '*.asmx', '*.axd'] + mimetypes = [] + + def __init__(self, **options): + super(CSharpAspxLexer, self).__init__(CSharpLexer, GenericAspxLexer, + **options) + + def analyse_text(text): + if re.search(r'Page\s*Language="C#"', text, re.I) is not None: + return 0.2 + elif re.search(r'script[^>]+language=["\']C#', text, re.I) is not None: + return 0.15 + + +class VbNetAspxLexer(DelegatingLexer): + """ + Lexer for highlighting Visual Basic.net within ASP.NET pages. + """ + + name = 'aspx-vb' + aliases = ['aspx-vb'] + filenames = ['*.aspx', '*.asax', '*.ascx', '*.ashx', '*.asmx', '*.axd'] + mimetypes = [] + + def __init__(self, **options): + super(VbNetAspxLexer, self).__init__(VbNetLexer, GenericAspxLexer, + **options) + + def analyse_text(text): + if re.search(r'Page\s*Language="Vb"', text, re.I) is not None: + return 0.2 + elif re.search(r'script[^>]+language=["\']vb', text, re.I) is not None: + return 0.15 + + +# Very close to functional.OcamlLexer +class FSharpLexer(RegexLexer): + """ + For the F# language (version 3.0). + + AAAAACK Strings + http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/spec.html#_Toc335818775 + + .. versionadded:: 1.5 + """ + + name = 'FSharp' + aliases = ['fsharp'] + filenames = ['*.fs', '*.fsi'] + mimetypes = ['text/x-fsharp'] + + keywords = [ + 'abstract', 'as', 'assert', 'base', 'begin', 'class', 'default', + 'delegate', 'do!', 'do', 'done', 'downcast', 'downto', 'elif', 'else', + 'end', 'exception', 'extern', 'false', 'finally', 'for', 'function', + 'fun', 'global', 'if', 'inherit', 'inline', 'interface', 'internal', + 'in', 'lazy', 'let!', 'let', 'match', 'member', 'module', 'mutable', + 'namespace', 'new', 'null', 'of', 'open', 'override', 'private', 'public', + 'rec', 'return!', 'return', 'select', 'static', 'struct', 'then', 'to', + 'true', 'try', 'type', 'upcast', 'use!', 'use', 'val', 'void', 'when', + 'while', 'with', 'yield!', 'yield', + ] + # Reserved words; cannot hurt to color them as keywords too. + keywords += [ + 'atomic', 'break', 'checked', 'component', 'const', 'constraint', + 'constructor', 'continue', 'eager', 'event', 'external', 'fixed', + 'functor', 'include', 'method', 'mixin', 'object', 'parallel', + 'process', 'protected', 'pure', 'sealed', 'tailcall', 'trait', + 'virtual', 'volatile', + ] + keyopts = [ + '!=', '#', '&&', '&', '\(', '\)', '\*', '\+', ',', '-\.', + '->', '-', '\.\.', '\.', '::', ':=', ':>', ':', ';;', ';', '<-', + '<\]', '<', '>\]', '>', '\?\?', '\?', '\[<', '\[\|', '\[', '\]', + '_', '`', '\{', '\|\]', '\|', '\}', '~', '<@@', '<@', '=', '@>', '@@>', + ] + + operators = r'[!$%&*+\./:<=>?@^|~-]' + word_operators = ['and', 'or', 'not'] + prefix_syms = r'[!?~]' + infix_syms = r'[=<>@^|&+\*/$%-]' + primitives = [ + 'sbyte', 'byte', 'char', 'nativeint', 'unativeint', 'float32', 'single', + 'float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', + 'uint32', 'int64', 'uint64', 'decimal', 'unit', 'bool', 'string', + 'list', 'exn', 'obj', 'enum', + ] + + # See http://msdn.microsoft.com/en-us/library/dd233181.aspx and/or + # http://fsharp.org/about/files/spec.pdf for reference. Good luck. + + tokens = { + 'escape-sequence': [ + (r'\\[\\"\'ntbrafv]', String.Escape), + (r'\\[0-9]{3}', String.Escape), + (r'\\u[0-9a-fA-F]{4}', String.Escape), + (r'\\U[0-9a-fA-F]{8}', String.Escape), + ], + 'root': [ + (r'\s+', Text), + (r'\(\)|\[\]', Name.Builtin.Pseudo), + (r'\b(?`_ + definition files. + + .. versionadded:: 1.4 + """ + + name = 'Protocol Buffer' + aliases = ['protobuf', 'proto'] + filenames = ['*.proto'] + + tokens = { + 'root': [ + (r'[ \t]+', Text), + (r'[,;{}\[\]()<>]', Punctuation), + (r'/(\\\n)?/(\n|(.|\n)*?[^\\]\n)', Comment.Single), + (r'/(\\\n)?\*(.|\n)*?\*(\\\n)?/', Comment.Multiline), + (words(( + 'import', 'option', 'optional', 'required', 'repeated', 'default', + 'packed', 'ctype', 'extensions', 'to', 'max', 'rpc', 'returns', + 'oneof'), prefix=r'\b', suffix=r'\b'), + Keyword), + (words(( + 'int32', 'int64', 'uint32', 'uint64', 'sint32', 'sint64', + 'fixed32', 'fixed64', 'sfixed32', 'sfixed64', + 'float', 'double', 'bool', 'string', 'bytes'), suffix=r'\b'), + Keyword.Type), + (r'(true|false)\b', Keyword.Constant), + (r'(package)(\s+)', bygroups(Keyword.Namespace, Text), 'package'), + (r'(message|extend)(\s+)', + bygroups(Keyword.Declaration, Text), 'message'), + (r'(enum|group|service)(\s+)', + bygroups(Keyword.Declaration, Text), 'type'), + (r'\".*?\"', String), + (r'\'.*?\'', String), + (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*', Number.Float), + (r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float), + (r'(\-?(inf|nan))\b', Number.Float), + (r'0x[0-9a-fA-F]+[LlUu]*', Number.Hex), + (r'0[0-7]+[LlUu]*', Number.Oct), + (r'\d+[LlUu]*', Number.Integer), + (r'[+-=]', Operator), + (r'([a-zA-Z_][\w.]*)([ \t]*)(=)', + bygroups(Name.Attribute, Text, Operator)), + ('[a-zA-Z_][\w.]*', Name), + ], + 'package': [ + (r'[a-zA-Z_]\w*', Name.Namespace, '#pop'), + default('#pop'), + ], + 'message': [ + (r'[a-zA-Z_]\w*', Name.Class, '#pop'), + default('#pop'), + ], + 'type': [ + (r'[a-zA-Z_]\w*', Name, '#pop'), + default('#pop'), + ], + } + + +class ThriftLexer(RegexLexer): + """ + For `Thrift `__ interface definitions. + + .. versionadded:: 2.1 + """ + name = 'Thrift' + aliases = ['thrift'] + filenames = ['*.thrift'] + mimetypes = ['application/x-thrift'] + + tokens = { + 'root': [ + include('whitespace'), + include('comments'), + (r'"', String.Double, combined('stringescape', 'dqs')), + (r'\'', String.Single, combined('stringescape', 'sqs')), + (r'(namespace)(\s+)', + bygroups(Keyword.Namespace, Text.Whitespace), 'namespace'), + (r'(enum|union|struct|service|exception)(\s+)', + bygroups(Keyword.Declaration, Text.Whitespace), 'class'), + (r'((?:(?:[^\W\d]|\$)[\w.\[\]$<>]*\s+)+?)' # return arguments + r'((?:[^\W\d]|\$)[\w$]*)' # method name + r'(\s*)(\()', # signature start + bygroups(using(this), Name.Function, Text, Operator)), + include('keywords'), + include('numbers'), + (r'[&=]', Operator), + (r'[:;,{}()<>\[\]]', Punctuation), + (r'[a-zA-Z_](\.\w|\w)*', Name), + ], + 'whitespace': [ + (r'\n', Text.Whitespace), + (r'\s+', Text.Whitespace), + ], + 'comments': [ + (r'#.*$', Comment), + (r'//.*?\n', Comment), + (r'/\*[\w\W]*?\*/', Comment.Multiline), + ], + 'stringescape': [ + (r'\\([\\nrt"\'])', String.Escape), + ], + 'dqs': [ + (r'"', String.Double, '#pop'), + (r'[^\\"\n]+', String.Double), + ], + 'sqs': [ + (r"'", String.Single, '#pop'), + (r'[^\\\'\n]+', String.Single), + ], + 'namespace': [ + (r'[a-z*](\.\w|\w)*', Name.Namespace, '#pop'), + default('#pop'), + ], + 'class': [ + (r'[a-zA-Z_]\w*', Name.Class, '#pop'), + default('#pop'), + ], + 'keywords': [ + (r'(async|oneway|extends|throws|required|optional)\b', Keyword), + (r'(true|false)\b', Keyword.Constant), + (r'(const|typedef)\b', Keyword.Declaration), + (words(( + 'cpp_namespace', 'cpp_include', 'cpp_type', 'java_package', + 'cocoa_prefix', 'csharp_namespace', 'delphi_namespace', + 'php_namespace', 'py_module', 'perl_package', + 'ruby_namespace', 'smalltalk_category', 'smalltalk_prefix', + 'xsd_all', 'xsd_optional', 'xsd_nillable', 'xsd_namespace', + 'xsd_attrs', 'include'), suffix=r'\b'), + Keyword.Namespace), + (words(( + 'void', 'bool', 'byte', 'i16', 'i32', 'i64', 'double', + 'string', 'binary', 'map', 'list', 'set', 'slist', + 'senum'), suffix=r'\b'), + Keyword.Type), + (words(( + 'BEGIN', 'END', '__CLASS__', '__DIR__', '__FILE__', + '__FUNCTION__', '__LINE__', '__METHOD__', '__NAMESPACE__', + 'abstract', 'alias', 'and', 'args', 'as', 'assert', 'begin', + 'break', 'case', 'catch', 'class', 'clone', 'continue', + 'declare', 'def', 'default', 'del', 'delete', 'do', 'dynamic', + 'elif', 'else', 'elseif', 'elsif', 'end', 'enddeclare', + 'endfor', 'endforeach', 'endif', 'endswitch', 'endwhile', + 'ensure', 'except', 'exec', 'finally', 'float', 'for', + 'foreach', 'function', 'global', 'goto', 'if', 'implements', + 'import', 'in', 'inline', 'instanceof', 'interface', 'is', + 'lambda', 'module', 'native', 'new', 'next', 'nil', 'not', + 'or', 'pass', 'public', 'print', 'private', 'protected', + 'raise', 'redo', 'rescue', 'retry', 'register', 'return', + 'self', 'sizeof', 'static', 'super', 'switch', 'synchronized', + 'then', 'this', 'throw', 'transient', 'try', 'undef', + 'unless', 'unsigned', 'until', 'use', 'var', 'virtual', + 'volatile', 'when', 'while', 'with', 'xor', 'yield'), + prefix=r'\b', suffix=r'\b'), + Keyword.Reserved), + ], + 'numbers': [ + (r'[+-]?(\d+\.\d+([eE][+-]?\d+)?|\.?\d+[eE][+-]?\d+)', Number.Float), + (r'[+-]?0x[0-9A-Fa-f]+', Number.Hex), + (r'[+-]?[0-9]+', Number.Integer), + ], + } + + +class BroLexer(RegexLexer): + """ + For `Bro `_ scripts. + + .. versionadded:: 1.5 + """ + name = 'Bro' + aliases = ['bro'] + filenames = ['*.bro'] + + _hex = r'[0-9a-fA-F_]' + _float = r'((\d*\.?\d+)|(\d+\.?\d*))([eE][-+]?\d+)?' + _h = r'[A-Za-z0-9][-A-Za-z0-9]*' + + tokens = { + 'root': [ + # Whitespace + (r'^@.*?\n', Comment.Preproc), + (r'#.*?\n', Comment.Single), + (r'\n', Text), + (r'\s+', Text), + (r'\\\n', Text), + # Keywords + (r'(add|alarm|break|case|const|continue|delete|do|else|enum|event' + r'|export|for|function|if|global|hook|local|module|next' + r'|of|print|redef|return|schedule|switch|type|when|while)\b', Keyword), + (r'(addr|any|bool|count|counter|double|file|int|interval|net' + r'|pattern|port|record|set|string|subnet|table|time|timer' + r'|vector)\b', Keyword.Type), + (r'(T|F)\b', Keyword.Constant), + (r'(&)((?:add|delete|expire)_func|attr|(?:create|read|write)_expire' + r'|default|disable_print_hook|raw_output|encrypt|group|log' + r'|mergeable|optional|persistent|priority|redef' + r'|rotate_(?:interval|size)|synchronized)\b', + bygroups(Punctuation, Keyword)), + (r'\s+module\b', Keyword.Namespace), + # Addresses, ports and networks + (r'\d+/(tcp|udp|icmp|unknown)\b', Number), + (r'(\d+\.){3}\d+', Number), + (r'(' + _hex + r'){7}' + _hex, Number), + (r'0x' + _hex + r'(' + _hex + r'|:)*::(' + _hex + r'|:)*', Number), + (r'((\d+|:)(' + _hex + r'|:)*)?::(' + _hex + r'|:)*', Number), + (r'(\d+\.\d+\.|(\d+\.){2}\d+)', Number), + # Hostnames + (_h + r'(\.' + _h + r')+', String), + # Numeric + (_float + r'\s+(day|hr|min|sec|msec|usec)s?\b', Literal.Date), + (r'0[xX]' + _hex, Number.Hex), + (_float, Number.Float), + (r'\d+', Number.Integer), + (r'/', String.Regex, 'regex'), + (r'"', String, 'string'), + # Operators + (r'[!%*/+:<=>?~|-]', Operator), + (r'([-+=&|]{2}|[+=!><-]=)', Operator), + (r'(in|match)\b', Operator.Word), + (r'[{}()\[\]$.,;]', Punctuation), + # Identfier + (r'([_a-zA-Z]\w*)(::)', bygroups(Name, Name.Namespace)), + (r'[a-zA-Z_]\w*', Name) + ], + '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), + (r'\\', String) + ], + 'regex': [ + (r'/', String.Regex, '#pop'), + (r'\\[\\nt/]', String.Regex), # String.Escape is too intense here. + (r'[^\\/\n]+', String.Regex), + (r'\\\n', String.Regex), + (r'\\', String.Regex) + ] + } + + +class PuppetLexer(RegexLexer): + """ + For `Puppet `__ configuration DSL. + + .. versionadded:: 1.6 + """ + name = 'Puppet' + aliases = ['puppet'] + filenames = ['*.pp'] + + tokens = { + 'root': [ + include('comments'), + include('keywords'), + include('names'), + include('numbers'), + include('operators'), + include('strings'), + + (r'[]{}:(),;[]', Punctuation), + (r'[^\S\n]+', Text), + ], + + 'comments': [ + (r'\s*#.*$', Comment), + (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline), + ], + + 'operators': [ + (r'(=>|\?|<|>|=|\+|-|/|\*|~|!|\|)', Operator), + (r'(in|and|or|not)\b', Operator.Word), + ], + + 'names': [ + ('[a-zA-Z_]\w*', Name.Attribute), + (r'(\$\S+)(\[)(\S+)(\])', bygroups(Name.Variable, Punctuation, + String, Punctuation)), + (r'\$\S+', Name.Variable), + ], + + 'numbers': [ + # Copypasta from the Python lexer + (r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?j?', Number.Float), + (r'\d+[eE][+-]?[0-9]+j?', Number.Float), + (r'0[0-7]+j?', Number.Oct), + (r'0[xX][a-fA-F0-9]+', Number.Hex), + (r'\d+L', Number.Integer.Long), + (r'\d+j?', Number.Integer) + ], + + 'keywords': [ + # Left out 'group' and 'require' + # Since they're often used as attributes + (words(( + 'absent', 'alert', 'alias', 'audit', 'augeas', 'before', 'case', + 'check', 'class', 'computer', 'configured', 'contained', + 'create_resources', 'crit', 'cron', 'debug', 'default', + 'define', 'defined', 'directory', 'else', 'elsif', 'emerg', + 'err', 'exec', 'extlookup', 'fail', 'false', 'file', + 'filebucket', 'fqdn_rand', 'generate', 'host', 'if', 'import', + 'include', 'info', 'inherits', 'inline_template', 'installed', + 'interface', 'k5login', 'latest', 'link', 'loglevel', + 'macauthorization', 'mailalias', 'maillist', 'mcx', 'md5', + 'mount', 'mounted', 'nagios_command', 'nagios_contact', + 'nagios_contactgroup', 'nagios_host', 'nagios_hostdependency', + 'nagios_hostescalation', 'nagios_hostextinfo', 'nagios_hostgroup', + 'nagios_service', 'nagios_servicedependency', 'nagios_serviceescalation', + 'nagios_serviceextinfo', 'nagios_servicegroup', 'nagios_timeperiod', + 'node', 'noop', 'notice', 'notify', 'package', 'present', 'purged', + 'realize', 'regsubst', 'resources', 'role', 'router', 'running', + 'schedule', 'scheduled_task', 'search', 'selboolean', 'selmodule', + 'service', 'sha1', 'shellquote', 'split', 'sprintf', + 'ssh_authorized_key', 'sshkey', 'stage', 'stopped', 'subscribe', + 'tag', 'tagged', 'template', 'tidy', 'true', 'undef', 'unmounted', + 'user', 'versioncmp', 'vlan', 'warning', 'yumrepo', 'zfs', 'zone', + 'zpool'), prefix='(?i)', suffix=r'\b'), + Keyword), + ], + + 'strings': [ + (r'"([^"])*"', String), + (r"'(\\'|[^'])*'", String), + ], + + } + + +class RslLexer(RegexLexer): + """ + `RSL `_ is the formal specification + language used in RAISE (Rigorous Approach to Industrial Software Engineering) + method. + + .. versionadded:: 2.0 + """ + name = 'RSL' + aliases = ['rsl'] + filenames = ['*.rsl'] + mimetypes = ['text/rsl'] + + flags = re.MULTILINE | re.DOTALL + + tokens = { + 'root': [ + (words(( + 'Bool', 'Char', 'Int', 'Nat', 'Real', 'Text', 'Unit', 'abs', + 'all', 'always', 'any', 'as', 'axiom', 'card', 'case', 'channel', + 'chaos', 'class', 'devt_relation', 'dom', 'elems', 'else', 'elif', + 'end', 'exists', 'extend', 'false', 'for', 'hd', 'hide', 'if', + 'in', 'is', 'inds', 'initialise', 'int', 'inter', 'isin', 'len', + 'let', 'local', 'ltl_assertion', 'object', 'of', 'out', 'post', + 'pre', 'read', 'real', 'rng', 'scheme', 'skip', 'stop', 'swap', + 'then', 'theory', 'test_case', 'tl', 'transition_system', 'true', + 'type', 'union', 'until', 'use', 'value', 'variable', 'while', + 'with', 'write', '~isin', '-inflist', '-infset', '-list', + '-set'), prefix=r'\b', suffix=r'\b'), + Keyword), + (r'(variable|value)\b', Keyword.Declaration), + (r'--.*?\n', Comment), + (r'<:.*?:>', Comment), + (r'\{!.*?!\}', Comment), + (r'/\*.*?\*/', Comment), + (r'^[ \t]*([\w]+)[ \t]*:[^:]', Name.Function), + (r'(^[ \t]*)([\w]+)([ \t]*\([\w\s,]*\)[ \t]*)(is|as)', + bygroups(Text, Name.Function, Text, Keyword)), + (r'\b[A-Z]\w*\b', Keyword.Type), + (r'(true|false)\b', Keyword.Constant), + (r'".*"', String), + (r'\'.\'', String.Char), + (r'(><|->|-m->|/\\|<=|<<=|<\.|\|\||\|\^\||-~->|-~m->|\\/|>=|>>|' + r'\.>|\+\+|-\\|<->|=>|:-|~=|\*\*|<<|>>=|\+>|!!|\|=\||#)', + Operator), + (r'[0-9]+\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), + (r'0x[0-9a-f]+', Number.Hex), + (r'[0-9]+', Number.Integer), + (r'.', Text), + ], + } + + def analyse_text(text): + """ + Check for the most common text in the beginning of a RSL file. + """ + if re.search(r'scheme\s*.*?=\s*class\s*type', text, re.I) is not None: + return 1.0 + + +class MscgenLexer(RegexLexer): + """ + For `Mscgen `_ files. + + .. versionadded:: 1.6 + """ + name = 'Mscgen' + aliases = ['mscgen', 'msc'] + filenames = ['*.msc'] + + _var = r'(\w+|"(?:\\"|[^"])*")' + + tokens = { + 'root': [ + (r'msc\b', Keyword.Type), + # Options + (r'(hscale|HSCALE|width|WIDTH|wordwraparcs|WORDWRAPARCS' + r'|arcgradient|ARCGRADIENT)\b', Name.Property), + # Operators + (r'(abox|ABOX|rbox|RBOX|box|BOX|note|NOTE)\b', Operator.Word), + (r'(\.|-|\|){3}', Keyword), + (r'(?:-|=|\.|:){2}' + r'|<<=>>|<->|<=>|<<>>|<:>' + r'|->|=>>|>>|=>|:>|-x|-X' + r'|<-|<<=|<<|<=|<:|x-|X-|=', Operator), + # Names + (r'\*', Name.Builtin), + (_var, Name.Variable), + # Other + (r'\[', Punctuation, 'attrs'), + (r'\{|\}|,|;', Punctuation), + include('comments') + ], + 'attrs': [ + (r'\]', Punctuation, '#pop'), + (_var + r'(\s*)(=)(\s*)' + _var, + bygroups(Name.Attribute, Text.Whitespace, Operator, Text.Whitespace, + String)), + (r',', Punctuation), + include('comments') + ], + 'comments': [ + (r'(?://|#).*?\n', Comment.Single), + (r'/\*(?:.|\n)*?\*/', Comment.Multiline), + (r'[ \t\r\n]+', Text.Whitespace) + ] + } + + +class VGLLexer(RegexLexer): + """ + For `SampleManager VGL `_ + source code. + + .. versionadded:: 1.6 + """ + name = 'VGL' + aliases = ['vgl'] + filenames = ['*.rpf'] + + flags = re.MULTILINE | re.DOTALL | re.IGNORECASE + + tokens = { + 'root': [ + (r'\{[^}]*\}', Comment.Multiline), + (r'declare', Keyword.Constant), + (r'(if|then|else|endif|while|do|endwhile|and|or|prompt|object' + r'|create|on|line|with|global|routine|value|endroutine|constant' + r'|global|set|join|library|compile_option|file|exists|create|copy' + r'|delete|enable|windows|name|notprotected)(?! *[=<>.,()])', + Keyword), + (r'(true|false|null|empty|error|locked)', Keyword.Constant), + (r'[~^*#!%&\[\]()<>|+=:;,./?-]', Operator), + (r'"[^"]*"', String), + (r'(\.)([a-z_$][\w$]*)', bygroups(Operator, Name.Attribute)), + (r'[0-9][0-9]*(\.[0-9]+(e[+\-]?[0-9]+)?)?', Number), + (r'[a-z_$][\w$]*', Name), + (r'[\r\n]+', Text), + (r'\s+', Text) + ] + } + + +class AlloyLexer(RegexLexer): + """ + For `Alloy `_ source code. + + .. versionadded:: 2.0 + """ + + name = 'Alloy' + aliases = ['alloy'] + filenames = ['*.als'] + mimetypes = ['text/x-alloy'] + + flags = re.MULTILINE | re.DOTALL + + iden_rex = r'[a-zA-Z_][\w\']*' + text_tuple = (r'[^\S\n]+', Text) + + tokens = { + 'sig': [ + (r'(extends)\b', Keyword, '#pop'), + (iden_rex, Name), + text_tuple, + (r',', Punctuation), + (r'\{', Operator, '#pop'), + ], + 'module': [ + text_tuple, + (iden_rex, Name, '#pop'), + ], + 'fun': [ + text_tuple, + (r'\{', Operator, '#pop'), + (iden_rex, Name, '#pop'), + ], + 'root': [ + (r'--.*?$', Comment.Single), + (r'//.*?$', Comment.Single), + (r'/\*.*?\*/', Comment.Multiline), + text_tuple, + (r'(module|open)(\s+)', bygroups(Keyword.Namespace, Text), + 'module'), + (r'(sig|enum)(\s+)', bygroups(Keyword.Declaration, Text), 'sig'), + (r'(iden|univ|none)\b', Keyword.Constant), + (r'(int|Int)\b', Keyword.Type), + (r'(this|abstract|extends|set|seq|one|lone|let)\b', Keyword), + (r'(all|some|no|sum|disj|when|else)\b', Keyword), + (r'(run|check|for|but|exactly|expect|as)\b', Keyword), + (r'(and|or|implies|iff|in)\b', Operator.Word), + (r'(fun|pred|fact|assert)(\s+)', bygroups(Keyword, Text), 'fun'), + (r'!|#|&&|\+\+|<<|>>|>=|<=>|<=|\.|->', Operator), + (r'[-+/*%=<>&!^|~{}\[\]().]', Operator), + (iden_rex, Name), + (r'[:,]', Punctuation), + (r'[0-9]+', Number.Integer), + (r'"(\\\\|\\"|[^"])*"', String), + (r'\n', Text), + ] + } + + +class PanLexer(RegexLexer): + """ + Lexer for `pan `_ source files. + + Based on tcsh lexer. + + .. versionadded:: 2.0 + """ + + name = 'Pan' + aliases = ['pan'] + filenames = ['*.pan'] + + tokens = { + 'root': [ + include('basic'), + (r'\(', Keyword, 'paren'), + (r'\{', Keyword, 'curly'), + include('data'), + ], + 'basic': [ + (words(( + 'if', 'for', 'with', 'else', 'type', 'bind', 'while', 'valid', 'final', + 'prefix', 'unique', 'object', 'foreach', 'include', 'template', + 'function', 'variable', 'structure', 'extensible', 'declaration'), + prefix=r'\b', suffix=r'\s*\b'), + Keyword), + (words(( + 'file_contents', 'format', 'index', 'length', 'match', 'matches', + 'replace', 'splice', 'split', 'substr', 'to_lowercase', 'to_uppercase', + 'debug', 'error', 'traceback', 'deprecated', 'base64_decode', + 'base64_encode', 'digest', 'escape', 'unescape', 'append', 'create', + 'first', 'nlist', 'key', 'list', 'merge', 'next', 'prepend', 'is_boolean', + 'is_defined', 'is_double', 'is_list', 'is_long', 'is_nlist', 'is_null', + 'is_number', 'is_property', 'is_resource', 'is_string', 'to_boolean', + 'to_double', 'to_long', 'to_string', 'clone', 'delete', 'exists', + 'path_exists', 'if_exists', 'return', 'value'), + prefix=r'\b', suffix=r'\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), + ], + 'curly': [ + (r'\}', Keyword, '#pop'), + (r':-', Keyword), + (r'\w+', Name.Variable), + (r'[^}:"\'`$]+', Punctuation), + (r':', Punctuation), + include('root'), + ], + 'paren': [ + (r'\)', Keyword, '#pop'), + include('root'), + ], + } + + +class CrmshLexer(RegexLexer): + """ + Lexer for `crmsh `_ configuration files + for Pacemaker clusters. + + .. versionadded:: 2.1 + """ + name = 'Crmsh' + aliases = ['crmsh', 'pcmk'] + filenames = ['*.crmsh', '*.pcmk'] + mimetypes = [] + + elem = words(( + 'node', 'primitive', 'group', 'clone', 'ms', 'location', + 'colocation', 'order', 'fencing_topology', 'rsc_ticket', + 'rsc_template', 'property', 'rsc_defaults', + 'op_defaults', 'acl_target', 'acl_group', 'user', 'role', + 'tag'), suffix=r'(?![\w#$-])') + sub = words(( + 'params', 'meta', 'operations', 'op', 'rule', + 'attributes', 'utilization'), suffix=r'(?![\w#$-])') + acl = words(('read', 'write', 'deny'), suffix=r'(?![\w#$-])') + bin_rel = words(('and', 'or'), suffix=r'(?![\w#$-])') + un_ops = words(('defined', 'not_defined'), suffix=r'(?![\w#$-])') + date_exp = words(('in_range', 'date', 'spec', 'in'), suffix=r'(?![\w#$-])') + acl_mod = (r'(?:tag|ref|reference|attribute|type|xpath)') + bin_ops = (r'(?:lt|gt|lte|gte|eq|ne)') + val_qual = (r'(?:string|version|number)') + rsc_role_action = (r'(?:Master|Started|Slave|Stopped|' + r'start|promote|demote|stop)') + + tokens = { + 'root': [ + (r'^#.*\n?', Comment), + # attr=value (nvpair) + (r'([\w#$-]+)(=)("(?:""|[^"])*"|\S+)', + bygroups(Name.Attribute, Punctuation, String)), + # need this construct, otherwise numeric node ids + # are matched as scores + # elem id: + (r'(node)(\s+)([\w#$-]+)(:)', + bygroups(Keyword, Whitespace, Name, Punctuation)), + # scores + (r'([+-]?([0-9]+|inf)):', Number), + # keywords (elements and other) + (elem, Keyword), + (sub, Keyword), + (acl, Keyword), + # binary operators + (r'(?:%s:)?(%s)(?![\w#$-])' % (val_qual, bin_ops), Operator.Word), + # other operators + (bin_rel, Operator.Word), + (un_ops, Operator.Word), + (date_exp, Operator.Word), + # builtin attributes (e.g. #uname) + (r'#[a-z]+(?![\w#$-])', Name.Builtin), + # acl_mod:blah + (r'(%s)(:)("(?:""|[^"])*"|\S+)' % acl_mod, + bygroups(Keyword, Punctuation, Name)), + # rsc_id[:(role|action)] + # NB: this matches all other identifiers + (r'([\w#$-]+)(?:(:)(%s))?(?![\w#$-])' % rsc_role_action, + bygroups(Name, Punctuation, Operator.Word)), + # punctuation + (r'(\\(?=\n)|[[\](){}/:@])', Punctuation), + (r'\s+|\n', Whitespace), + ], + } + + +class FlatlineLexer(RegexLexer): + """ + Lexer for `Flatline `_ expressions. + + .. versionadded:: 2.2 + """ + name = 'Flatline' + aliases = ['flatline'] + filenames = [] + mimetypes = ['text/x-flatline'] + + special_forms = ('let',) + + builtins = ( + "!=", "*", "+", "-", "<", "<=", "=", ">", ">=", "abs", "acos", "all", + "all-but", "all-with-defaults", "all-with-numeric-default", "and", + "asin", "atan", "avg", "avg-window", "bin-center", "bin-count", "call", + "category-count", "ceil", "cond", "cond-window", "cons", "cos", "cosh", + "count", "diff-window", "div", "ensure-value", "ensure-weighted-value", + "epoch", "epoch-day", "epoch-fields", "epoch-hour", "epoch-millisecond", + "epoch-minute", "epoch-month", "epoch-second", "epoch-weekday", + "epoch-year", "exp", "f", "field", "field-prop", "fields", "filter", + "first", "floor", "head", "if", "in", "integer", "language", "length", + "levenshtein", "linear-regression", "list", "ln", "log", "log10", "map", + "matches", "matches?", "max", "maximum", "md5", "mean", "median", "min", + "minimum", "missing", "missing-count", "missing?", "missing_count", + "mod", "mode", "normalize", "not", "nth", "occurrences", "or", + "percentile", "percentile-label", "population", "population-fraction", + "pow", "preferred", "preferred?", "quantile-label", "rand", "rand-int", + "random-value", "re-quote", "real", "replace", "replace-first", "rest", + "round", "row-number", "segment-label", "sha1", "sha256", "sin", "sinh", + "sqrt", "square", "standard-deviation", "standard_deviation", "str", + "subs", "sum", "sum-squares", "sum-window", "sum_squares", "summary", + "summary-no", "summary-str", "tail", "tan", "tanh", "to-degrees", + "to-radians", "variance", "vectorize", "weighted-random-value", "window", + "winnow", "within-percentiles?", "z-score", + ) + + valid_name = r'(?!#)[\w!$%*+<=>?/.#-]+' + + tokens = { + 'root': [ + # whitespaces - usually not relevant + (r'[,\s]+', Text), + + # numbers + (r'-?\d+\.\d+', Number.Float), + (r'-?\d+', Number.Integer), + (r'0x-?[a-f\d]+', Number.Hex), + + # strings, symbols and characters + (r'"(\\\\|\\"|[^"])*"', String), + (r"\\(.|[a-z]+)", String.Char), + + # expression template placeholder + (r'_', String.Symbol), + + # highlight the special forms + (words(special_forms, suffix=' '), Keyword), + + # highlight the builtins + (words(builtins, suffix=' '), Name.Builtin), + + # the remaining functions + (r'(?<=\()' + valid_name, Name.Function), + + # find the remaining variables + (valid_name, Name.Variable), + + # parentheses + (r'(\(|\))', Punctuation), + ], + } + + +class SnowballLexer(ExtendedRegexLexer): + """ + Lexer for `Snowball `_ source code. + + .. versionadded:: 2.2 + """ + + name = 'Snowball' + aliases = ['snowball'] + filenames = ['*.sbl'] + + _ws = r'\n\r\t ' + + def __init__(self, **options): + self._reset_stringescapes() + ExtendedRegexLexer.__init__(self, **options) + + def _reset_stringescapes(self): + self._start = "'" + self._end = "'" + + def _string(do_string_first): + def callback(lexer, match, ctx): + s = match.start() + text = match.group() + string = re.compile(r'([^%s]*)(.)' % re.escape(lexer._start)).match + escape = re.compile(r'([^%s]*)(.)' % re.escape(lexer._end)).match + pos = 0 + do_string = do_string_first + while pos < len(text): + if do_string: + match = string(text, pos) + yield s + match.start(1), String.Single, match.group(1) + if match.group(2) == "'": + yield s + match.start(2), String.Single, match.group(2) + ctx.stack.pop() + break + yield s + match.start(2), String.Escape, match.group(2) + pos = match.end() + match = escape(text, pos) + yield s + match.start(), String.Escape, match.group() + if match.group(2) != lexer._end: + ctx.stack[-1] = 'escape' + break + pos = match.end() + do_string = True + ctx.pos = s + match.end() + return callback + + def _stringescapes(lexer, match, ctx): + lexer._start = match.group(3) + lexer._end = match.group(5) + return bygroups(Keyword.Reserved, Text, String.Escape, Text, + String.Escape)(lexer, match, ctx) + + tokens = { + 'root': [ + (words(('len', 'lenof'), suffix=r'\b'), Operator.Word), + include('root1'), + ], + 'root1': [ + (r'[%s]+' % _ws, Text), + (r'\d+', Number.Integer), + (r"'", String.Single, 'string'), + (r'[()]', Punctuation), + (r'/\*[\w\W]*?\*/', Comment.Multiline), + (r'//.*', Comment.Single), + (r'[!*+\-/<=>]=|[-=]>|<[+-]|[$*+\-/<=>?\[\]]', Operator), + (words(('as', 'get', 'hex', 'among', 'define', 'decimal', + 'backwardmode'), suffix=r'\b'), + Keyword.Reserved), + (words(('strings', 'booleans', 'integers', 'routines', 'externals', + 'groupings'), suffix=r'\b'), + Keyword.Reserved, 'declaration'), + (words(('do', 'or', 'and', 'for', 'hop', 'non', 'not', 'set', 'try', + 'fail', 'goto', 'loop', 'next', 'test', 'true', + 'false', 'unset', 'atmark', 'attach', 'delete', 'gopast', + 'insert', 'repeat', 'sizeof', 'tomark', 'atleast', + 'atlimit', 'reverse', 'setmark', 'tolimit', 'setlimit', + 'backwards', 'substring'), suffix=r'\b'), + Operator.Word), + (words(('size', 'limit', 'cursor', 'maxint', 'minint'), + suffix=r'\b'), + Name.Builtin), + (r'(stringdef\b)([%s]*)([^%s]+)' % (_ws, _ws), + bygroups(Keyword.Reserved, Text, String.Escape)), + (r'(stringescapes\b)([%s]*)(.)([%s]*)(.)' % (_ws, _ws), + _stringescapes), + (r'[A-Za-z]\w*', Name), + ], + 'declaration': [ + (r'\)', Punctuation, '#pop'), + (words(('len', 'lenof'), suffix=r'\b'), Name, + ('root1', 'declaration')), + include('root1'), + ], + 'string': [ + (r"[^']*'", _string(True)), + ], + 'escape': [ + (r"[^']*'", _string(False)), + ], + } + + def get_tokens_unprocessed(self, text=None, context=None): + self._reset_stringescapes() + return ExtendedRegexLexer.get_tokens_unprocessed(self, text, context) diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/dylan.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/dylan.py new file mode 100644 index 0000000000000000000000000000000000000000..f61bb60d162282c73af505ea649f13064ab557c5 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/dylan.py @@ -0,0 +1,289 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.dylan + ~~~~~~~~~~~~~~~~~~~~~ + + Lexers for the Dylan language. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import Lexer, RegexLexer, bygroups, do_insertions, default +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Generic, Literal + +__all__ = ['DylanLexer', 'DylanConsoleLexer', 'DylanLidLexer'] + + +class DylanLexer(RegexLexer): + """ + For the `Dylan `_ language. + + .. versionadded:: 0.7 + """ + + name = 'Dylan' + aliases = ['dylan'] + filenames = ['*.dylan', '*.dyl', '*.intr'] + mimetypes = ['text/x-dylan'] + + flags = re.IGNORECASE + + builtins = set(( + 'subclass', 'abstract', 'block', 'concrete', 'constant', 'class', + 'compiler-open', 'compiler-sideways', 'domain', 'dynamic', + 'each-subclass', 'exception', 'exclude', 'function', 'generic', + 'handler', 'inherited', 'inline', 'inline-only', 'instance', + 'interface', 'import', 'keyword', 'library', 'macro', 'method', + 'module', 'open', 'primary', 'required', 'sealed', 'sideways', + 'singleton', 'slot', 'thread', 'variable', 'virtual')) + + keywords = set(( + 'above', 'afterwards', 'begin', 'below', 'by', 'case', 'cleanup', + 'create', 'define', 'else', 'elseif', 'end', 'export', 'finally', + 'for', 'from', 'if', 'in', 'let', 'local', 'otherwise', 'rename', + 'select', 'signal', 'then', 'to', 'unless', 'until', 'use', 'when', + 'while')) + + operators = set(( + '~', '+', '-', '*', '|', '^', '=', '==', '~=', '~==', '<', '<=', + '>', '>=', '&', '|')) + + functions = set(( + 'abort', 'abs', 'add', 'add!', 'add-method', 'add-new', 'add-new!', + 'all-superclasses', 'always', 'any?', 'applicable-method?', 'apply', + 'aref', 'aref-setter', 'as', 'as-lowercase', 'as-lowercase!', + 'as-uppercase', 'as-uppercase!', 'ash', 'backward-iteration-protocol', + 'break', 'ceiling', 'ceiling/', 'cerror', 'check-type', 'choose', + 'choose-by', 'complement', 'compose', 'concatenate', 'concatenate-as', + 'condition-format-arguments', 'condition-format-string', 'conjoin', + 'copy-sequence', 'curry', 'default-handler', 'dimension', 'dimensions', + 'direct-subclasses', 'direct-superclasses', 'disjoin', 'do', + 'do-handlers', 'element', 'element-setter', 'empty?', 'error', 'even?', + 'every?', 'false-or', 'fill!', 'find-key', 'find-method', 'first', + 'first-setter', 'floor', 'floor/', 'forward-iteration-protocol', + 'function-arguments', 'function-return-values', + 'function-specializers', 'gcd', 'generic-function-mandatory-keywords', + 'generic-function-methods', 'head', 'head-setter', 'identity', + 'initialize', 'instance?', 'integral?', 'intersection', + 'key-sequence', 'key-test', 'last', 'last-setter', 'lcm', 'limited', + 'list', 'logand', 'logbit?', 'logior', 'lognot', 'logxor', 'make', + 'map', 'map-as', 'map-into', 'max', 'member?', 'merge-hash-codes', + 'min', 'modulo', 'negative', 'negative?', 'next-method', + 'object-class', 'object-hash', 'odd?', 'one-of', 'pair', 'pop', + 'pop-last', 'positive?', 'push', 'push-last', 'range', 'rank', + 'rcurry', 'reduce', 'reduce1', 'remainder', 'remove', 'remove!', + 'remove-duplicates', 'remove-duplicates!', 'remove-key!', + 'remove-method', 'replace-elements!', 'replace-subsequence!', + 'restart-query', 'return-allowed?', 'return-description', + 'return-query', 'reverse', 'reverse!', 'round', 'round/', + 'row-major-index', 'second', 'second-setter', 'shallow-copy', + 'signal', 'singleton', 'size', 'size-setter', 'slot-initialized?', + 'sort', 'sort!', 'sorted-applicable-methods', 'subsequence-position', + 'subtype?', 'table-protocol', 'tail', 'tail-setter', 'third', + 'third-setter', 'truncate', 'truncate/', 'type-error-expected-type', + 'type-error-value', 'type-for-copy', 'type-union', 'union', 'values', + 'vector', 'zero?')) + + valid_name = '\\\\?[\\w!&*<>|^$%@\\-+~?/=]+' + + def get_tokens_unprocessed(self, text): + for index, token, value in RegexLexer.get_tokens_unprocessed(self, text): + if token is Name: + lowercase_value = value.lower() + if lowercase_value in self.builtins: + yield index, Name.Builtin, value + continue + if lowercase_value in self.keywords: + yield index, Keyword, value + continue + if lowercase_value in self.functions: + yield index, Name.Builtin, value + continue + if lowercase_value in self.operators: + yield index, Operator, value + continue + yield index, token, value + + tokens = { + 'root': [ + # Whitespace + (r'\s+', Text), + + # single line comment + (r'//.*?\n', Comment.Single), + + # lid header + (r'([a-z0-9-]+)(:)([ \t]*)(.*(?:\n[ \t].+)*)', + bygroups(Name.Attribute, Operator, Text, String)), + + default('code') # no header match, switch to code + ], + 'code': [ + # Whitespace + (r'\s+', Text), + + # single line comment + (r'//.*?\n', Comment.Single), + + # multi-line comment + (r'/\*', Comment.Multiline, 'comment'), + + # strings and characters + (r'"', String, 'string'), + (r"'(\\.|\\[0-7]{1,3}|\\x[a-f0-9]{1,2}|[^\\\'\n])'", String.Char), + + # binary integer + (r'#b[01]+', Number.Bin), + + # octal integer + (r'#o[0-7]+', Number.Oct), + + # floating point + (r'[-+]?(\d*\.\d+(e[-+]?\d+)?|\d+(\.\d*)?e[-+]?\d+)', Number.Float), + + # decimal integer + (r'[-+]?\d+', Number.Integer), + + # hex integer + (r'#x[0-9a-f]+', Number.Hex), + + # Macro parameters + (r'(\?' + valid_name + ')(:)' + r'(token|name|variable|expression|body|case-body|\*)', + bygroups(Name.Tag, Operator, Name.Builtin)), + (r'(\?)(:)(token|name|variable|expression|body|case-body|\*)', + bygroups(Name.Tag, Operator, Name.Builtin)), + (r'\?' + valid_name, Name.Tag), + + # Punctuation + (r'(=>|::|#\(|#\[|##|\?\?|\?=|\?|[(){}\[\],.;])', Punctuation), + + # Most operators are picked up as names and then re-flagged. + # This one isn't valid in a name though, so we pick it up now. + (r':=', Operator), + + # Pick up #t / #f before we match other stuff with #. + (r'#[tf]', Literal), + + # #"foo" style keywords + (r'#"', String.Symbol, 'keyword'), + + # #rest, #key, #all-keys, etc. + (r'#[a-z0-9-]+', Keyword), + + # required-init-keyword: style keywords. + (valid_name + ':', Keyword), + + # class names + (r'<' + valid_name + '>', Name.Class), + + # define variable forms. + (r'\*' + valid_name + '\*', Name.Variable.Global), + + # define constant forms. + (r'\$' + valid_name, Name.Constant), + + # everything else. We re-flag some of these in the method above. + (valid_name, Name), + ], + 'comment': [ + (r'[^*/]', Comment.Multiline), + (r'/\*', Comment.Multiline, '#push'), + (r'\*/', Comment.Multiline, '#pop'), + (r'[*/]', Comment.Multiline) + ], + 'keyword': [ + (r'"', String.Symbol, '#pop'), + (r'[^\\"]+', String.Symbol), # all other characters + ], + 'string': [ + (r'"', String, '#pop'), + (r'\\([\\abfnrtv"\']|x[a-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 + ] + } + + +class DylanLidLexer(RegexLexer): + """ + For Dylan LID (Library Interchange Definition) files. + + .. versionadded:: 1.6 + """ + + name = 'DylanLID' + aliases = ['dylan-lid', 'lid'] + filenames = ['*.lid', '*.hdp'] + mimetypes = ['text/x-dylan-lid'] + + flags = re.IGNORECASE + + tokens = { + 'root': [ + # Whitespace + (r'\s+', Text), + + # single line comment + (r'//.*?\n', Comment.Single), + + # lid header + (r'(.*?)(:)([ \t]*)(.*(?:\n[ \t].+)*)', + bygroups(Name.Attribute, Operator, Text, String)), + ] + } + + +class DylanConsoleLexer(Lexer): + """ + For Dylan interactive console output like: + + .. sourcecode:: dylan-console + + ? let a = 1; + => 1 + ? a + => 1 + + This is based on a copy of the RubyConsoleLexer. + + .. versionadded:: 1.6 + """ + name = 'Dylan session' + aliases = ['dylan-console', 'dylan-repl'] + filenames = ['*.dylan-console'] + mimetypes = ['text/x-dylan-console'] + + _line_re = re.compile('.*?\n') + _prompt_re = re.compile('\?| ') + + def get_tokens_unprocessed(self, text): + dylexer = DylanLexer(**self.options) + + curcode = '' + insertions = [] + for match in self._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: + for item in do_insertions(insertions, + dylexer.get_tokens_unprocessed(curcode)): + yield item + curcode = '' + insertions = [] + yield match.start(), Generic.Output, line + if curcode: + for item in do_insertions(insertions, + dylexer.get_tokens_unprocessed(curcode)): + yield item diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/ezhil.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/ezhil.py new file mode 100644 index 0000000000000000000000000000000000000000..ce1cdb2df1ab5a385d1c88076845738195f3e54e --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/ezhil.py @@ -0,0 +1,69 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.ezhil + ~~~~~~~~~~~~~~~~~~~~~ + + Pygments lexers for Ezhil language. + + :copyright: Copyright 2006-2017 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, Text, Comment, Name +from pygments.token import String, Number, Punctuation, Operator + +__all__ = ['EzhilLexer'] + + +class EzhilLexer(RegexLexer): + """ + Lexer for `Ezhil, a Tamil script-based programming language `_ + + .. versionadded:: 2.1 + """ + name = 'Ezhil' + aliases = ['ezhil'] + filenames = ['*.n'] + mimetypes = ['text/x-ezhil'] + flags = re.MULTILINE | re.UNICODE + # 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 = u'[a-zA-Z_]|[\u0b80-\u0bff]' + tokens = { + 'root': [ + include('keywords'), + (r'#.*\n', Comment.Single), + (r'[@+/*,^\-%]|[!<>=]=?|&&?|\|\|?', Operator), + (u'இல்', Operator.Word), + (words((u'assert', u'max', u'min', + u'நீளம்', u'சரம்_இடமாற்று', u'சரம்_கண்டுபிடி', + u'பட்டியல்', u'பின்இணை', u'வரிசைப்படுத்து', + u'எடு', u'தலைகீழ்', u'நீட்டிக்க', u'நுழைக்க', u'வை', + u'கோப்பை_திற', u'கோப்பை_எழுது', u'கோப்பை_மூடு', + u'pi', u'sin', u'cos', u'tan', u'sqrt', u'hypot', u'pow', + u'exp', u'log', u'log10', u'exit', + ), suffix=r'\b'), Name.Builtin), + (r'(True|False)\b', Keyword.Constant), + (r'[^\S\n]+', Text), + include('identifier'), + include('literal'), + (r'[(){}\[\]:;.]', Punctuation), + ], + 'keywords': [ + (u'பதிப்பி|தேர்ந்தெடு|தேர்வு|ஏதேனில்|ஆனால்|இல்லைஆனால்|இல்லை|ஆக|ஒவ்வொன்றாக|இல்|வரை|செய்|முடியேனில்|பின்கொடு|முடி|நிரல்பாகம்|தொடர்|நிறுத்து|நிரல்பாகம்', Keyword), + ], + 'identifier': [ + (u'(?:'+_TALETTERS+u')(?:[0-9]|'+_TALETTERS+u')*', Name), + ], + 'literal': [ + (r'".*?"', String), + (r'(?u)\d+((\.\d*)?[eE][+-]?\d+|\.\d*)', Number.Float), + (r'(?u)\d+', Number.Integer), + ] + } + + def __init__(self, **options): + super(EzhilLexer, self).__init__(**options) + self.encoding = options.get('encoding', 'utf-8') diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/fortran.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/fortran.py new file mode 100644 index 0000000000000000000000000000000000000000..1a611c9dc21104b0043c6fcd9d10f89a6dba35fb --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/fortran.py @@ -0,0 +1,205 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.fortran + ~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for Fortran languages. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, bygroups, include, words, using, default +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Generic + +__all__ = ['FortranLexer', 'FortranFixedLexer'] + + +class FortranLexer(RegexLexer): + """ + Lexer for FORTRAN 90 code. + + .. versionadded:: 0.10 + """ + name = 'Fortran' + aliases = ['fortran'] + filenames = ['*.f03', '*.f90', '*.F03', '*.F90'] + mimetypes = ['text/x-fortran'] + flags = re.IGNORECASE | re.MULTILINE + + # Data Types: INTEGER, REAL, COMPLEX, LOGICAL, CHARACTER and DOUBLE PRECISION + # Operators: **, *, +, -, /, <, >, <=, >=, ==, /= + # Logical (?): NOT, AND, OR, EQV, NEQV + + # Builtins: + # http://gcc.gnu.org/onlinedocs/gcc-3.4.6/g77/Table-of-Intrinsic-Functions.html + + tokens = { + 'root': [ + (r'^#.*\n', Comment.Preproc), + (r'!.*\n', Comment), + include('strings'), + include('core'), + (r'[a-z][\w$]*', Name), + include('nums'), + (r'[\s]+', Text), + ], + 'core': [ + # Statements + (words(( + 'ABSTRACT', 'ACCEPT', 'ALL', 'ALLSTOP', 'ALLOCATABLE', 'ALLOCATE', + 'ARRAY', 'ASSIGN', 'ASSOCIATE', 'ASYNCHRONOUS', 'BACKSPACE', 'BIND', + 'BLOCK', 'BLOCKDATA', 'BYTE', 'CALL', 'CASE', 'CLASS', 'CLOSE', + 'CODIMENSION', 'COMMON', 'CONCURRRENT', 'CONTIGUOUS', 'CONTAINS', + 'CONTINUE', 'CRITICAL', 'CYCLE', 'DATA', 'DEALLOCATE', 'DECODE', + 'DEFERRED', 'DIMENSION', 'DO', 'ELEMENTAL', 'ELSE', 'ENCODE', 'END', + 'ENTRY', 'ENUM', 'ENUMERATOR', 'EQUIVALENCE', 'EXIT', 'EXTENDS', + 'EXTERNAL', 'EXTRINSIC', 'FILE', 'FINAL', 'FORALL', 'FORMAT', + 'FUNCTION', 'GENERIC', 'GOTO', 'IF', 'IMAGES', 'IMPLICIT', + 'IMPORT', 'IMPURE', 'INCLUDE', 'INQUIRE', 'INTENT', 'INTERFACE', + 'INTRINSIC', 'IS', 'LOCK', 'MEMORY', 'MODULE', 'NAMELIST', 'NULLIFY', + 'NONE', 'NON_INTRINSIC', 'NON_OVERRIDABLE', 'NOPASS', 'OPEN', 'OPTIONAL', + 'OPTIONS', 'PARAMETER', 'PASS', 'PAUSE', 'POINTER', 'PRINT', 'PRIVATE', + 'PROGRAM', 'PROCEDURE', 'PROTECTED', 'PUBLIC', 'PURE', 'READ', + 'RECURSIVE', 'RESULT', 'RETURN', 'REWIND', 'SAVE', 'SELECT', 'SEQUENCE', + 'STOP', 'SUBMODULE', 'SUBROUTINE', 'SYNC', 'SYNCALL', 'SYNCIMAGES', + 'SYNCMEMORY', 'TARGET', 'THEN', 'TYPE', 'UNLOCK', 'USE', 'VALUE', + 'VOLATILE', 'WHERE', 'WRITE', 'WHILE'), prefix=r'\b', suffix=r'\s*\b'), + Keyword), + + # Data Types + (words(( + 'CHARACTER', 'COMPLEX', 'DOUBLE PRECISION', 'DOUBLE COMPLEX', 'INTEGER', + 'LOGICAL', 'REAL', 'C_INT', 'C_SHORT', 'C_LONG', 'C_LONG_LONG', + 'C_SIGNED_CHAR', 'C_SIZE_T', 'C_INT8_T', 'C_INT16_T', 'C_INT32_T', + 'C_INT64_T', 'C_INT_LEAST8_T', 'C_INT_LEAST16_T', 'C_INT_LEAST32_T', + 'C_INT_LEAST64_T', 'C_INT_FAST8_T', 'C_INT_FAST16_T', 'C_INT_FAST32_T', + 'C_INT_FAST64_T', 'C_INTMAX_T', 'C_INTPTR_T', 'C_FLOAT', 'C_DOUBLE', + 'C_LONG_DOUBLE', 'C_FLOAT_COMPLEX', 'C_DOUBLE_COMPLEX', + 'C_LONG_DOUBLE_COMPLEX', 'C_BOOL', 'C_CHAR', 'C_PTR', 'C_FUNPTR'), + prefix=r'\b', suffix=r'\s*\b'), + Keyword.Type), + + # Operators + (r'(\*\*|\*|\+|-|\/|<|>|<=|>=|==|\/=|=)', Operator), + + (r'(::)', Keyword.Declaration), + + (r'[()\[\],:&%;.]', Punctuation), + # Intrinsics + (words(( + 'Abort', 'Abs', 'Access', 'AChar', 'ACos', 'ACosH', 'AdjustL', + 'AdjustR', 'AImag', 'AInt', 'Alarm', 'All', 'Allocated', 'ALog', + 'AMax', 'AMin', 'AMod', 'And', 'ANInt', 'Any', 'ASin', 'ASinH', + 'Associated', 'ATan', 'ATanH', 'Atomic_Define', 'Atomic_Ref', + 'BesJ', 'BesJN', 'Bessel_J0', 'Bessel_J1', 'Bessel_JN', 'Bessel_Y0', + 'Bessel_Y1', 'Bessel_YN', 'BesY', 'BesYN', 'BGE', 'BGT', 'BLE', + 'BLT', 'Bit_Size', 'BTest', 'CAbs', 'CCos', 'Ceiling', 'CExp', + 'Char', 'ChDir', 'ChMod', 'CLog', 'Cmplx', 'Command_Argument_Count', + 'Complex', 'Conjg', 'Cos', 'CosH', 'Count', 'CPU_Time', 'CShift', + 'CSin', 'CSqRt', 'CTime', 'C_Loc', 'C_Associated', + 'C_Null_Ptr', 'C_Null_Funptr', 'C_F_Pointer', 'C_F_ProcPointer', + 'C_Null_Char', 'C_Alert', 'C_Backspace', 'C_Form_Feed', 'C_FunLoc', + 'C_Sizeof', 'C_New_Line', 'C_Carriage_Return', + 'C_Horizontal_Tab', 'C_Vertical_Tab', 'DAbs', 'DACos', 'DASin', + 'DATan', 'Date_and_Time', 'DbesJ', 'DbesJN', 'DbesY', + 'DbesYN', 'Dble', 'DCos', 'DCosH', 'DDiM', 'DErF', + 'DErFC', 'DExp', 'Digits', 'DiM', 'DInt', 'DLog', 'DMax', + 'DMin', 'DMod', 'DNInt', 'Dot_Product', 'DProd', 'DSign', 'DSinH', + 'DShiftL', 'DShiftR', 'DSin', 'DSqRt', 'DTanH', 'DTan', 'DTime', + 'EOShift', 'Epsilon', 'ErF', 'ErFC', 'ErFC_Scaled', 'ETime', + 'Execute_Command_Line', 'Exit', 'Exp', 'Exponent', 'Extends_Type_Of', + 'FDate', 'FGet', 'FGetC', 'FindLoc', 'Float', 'Floor', 'Flush', + 'FNum', 'FPutC', 'FPut', 'Fraction', 'FSeek', 'FStat', 'FTell', + 'Gamma', 'GError', 'GetArg', 'Get_Command', 'Get_Command_Argument', + 'Get_Environment_Variable', 'GetCWD', 'GetEnv', 'GetGId', 'GetLog', + 'GetPId', 'GetUId', 'GMTime', 'HostNm', 'Huge', 'Hypot', 'IAbs', + 'IAChar', 'IAll', 'IAnd', 'IAny', 'IArgC', 'IBClr', 'IBits', + 'IBSet', 'IChar', 'IDate', 'IDiM', 'IDInt', 'IDNInt', 'IEOr', + 'IErrNo', 'IFix', 'Imag', 'ImagPart', 'Image_Index', 'Index', + 'Int', 'IOr', 'IParity', 'IRand', 'IsaTty', 'IShft', 'IShftC', + 'ISign', 'Iso_C_Binding', 'Is_Contiguous', 'Is_Iostat_End', + 'Is_Iostat_Eor', 'ITime', 'Kill', 'Kind', 'LBound', 'LCoBound', + 'Len', 'Len_Trim', 'LGe', 'LGt', 'Link', 'LLe', 'LLt', 'LnBlnk', + 'Loc', 'Log', 'Log_Gamma', 'Logical', 'Long', 'LShift', 'LStat', + 'LTime', 'MaskL', 'MaskR', 'MatMul', 'Max', 'MaxExponent', + 'MaxLoc', 'MaxVal', 'MClock', 'Merge', 'Merge_Bits', 'Move_Alloc', + 'Min', 'MinExponent', 'MinLoc', 'MinVal', 'Mod', 'Modulo', 'MvBits', + 'Nearest', 'New_Line', 'NInt', 'Norm2', 'Not', 'Null', 'Num_Images', + 'Or', 'Pack', 'Parity', 'PError', 'Precision', 'Present', 'Product', + 'Radix', 'Rand', 'Random_Number', 'Random_Seed', 'Range', 'Real', + 'RealPart', 'Rename', 'Repeat', 'Reshape', 'RRSpacing', 'RShift', + 'Same_Type_As', 'Scale', 'Scan', 'Second', 'Selected_Char_Kind', + 'Selected_Int_Kind', 'Selected_Real_Kind', 'Set_Exponent', 'Shape', + 'ShiftA', 'ShiftL', 'ShiftR', 'Short', 'Sign', 'Signal', 'SinH', + 'Sin', 'Sleep', 'Sngl', 'Spacing', 'Spread', 'SqRt', 'SRand', + 'Stat', 'Storage_Size', 'Sum', 'SymLnk', 'System', 'System_Clock', + 'Tan', 'TanH', 'Time', 'This_Image', 'Tiny', 'TrailZ', 'Transfer', + 'Transpose', 'Trim', 'TtyNam', 'UBound', 'UCoBound', 'UMask', + 'Unlink', 'Unpack', 'Verify', 'XOr', 'ZAbs', 'ZCos', 'ZExp', + 'ZLog', 'ZSin', 'ZSqRt'), prefix=r'\b', suffix=r'\s*\b'), + Name.Builtin), + + # Booleans + (r'\.(true|false)\.', Name.Builtin), + # Comparing Operators + (r'\.(eq|ne|lt|le|gt|ge|not|and|or|eqv|neqv)\.', Operator.Word), + ], + + 'strings': [ + (r'(?s)"(\\\\|\\[0-7]+|\\.|[^"\\])*"', String.Double), + (r"(?s)'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single), + ], + + 'nums': [ + (r'\d+(?![.e])(_[a-z]\w+)?', Number.Integer), + (r'[+-]?\d*\.\d+([ed][-+]?\d+)?(_[a-z]\w+)?', Number.Float), + (r'[+-]?\d+\.\d*([ed][-+]?\d+)?(_[a-z]\w+)?', Number.Float), + ], + } + + +class FortranFixedLexer(RegexLexer): + """ + Lexer for fixed format Fortran. + + .. versionadded:: 2.1 + """ + name = 'FortranFixed' + aliases = ['fortranfixed'] + filenames = ['*.f', '*.F'] + + flags = re.IGNORECASE + + def _lex_fortran(self, match, ctx=None): + """Lex a line just as free form fortran without line break.""" + lexer = FortranLexer() + text = match.group(0) + "\n" + for index, token, value in lexer.get_tokens_unprocessed(text): + value = value.replace('\n', '') + if value != '': + yield index, token, value + + tokens = { + 'root': [ + (r'[C*].*\n', Comment), + (r'#.*\n', Comment.Preproc), + (r' {0,4}!.*\n', Comment), + (r'(.{5})', Name.Label, 'cont-char'), + (r'.*\n', using(FortranLexer)), + ], + 'cont-char': [ + (' ', Text, 'code'), + ('0', Comment, 'code'), + ('.', Generic.Strong, 'code'), + ], + 'code': [ + (r'(.{66})(.*)(\n)', + bygroups(_lex_fortran, Comment, Text), 'root'), + (r'(.*)(\n)', bygroups(_lex_fortran, Text), 'root'), + default('root'), + ] + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/foxpro.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/foxpro.py new file mode 100644 index 0000000000000000000000000000000000000000..7c0d2621919abde9cb0cd70de2c108b88bb7ab3c --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/foxpro.py @@ -0,0 +1,428 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.foxpro + ~~~~~~~~~~~~~~~~~~~~~~ + + Simple lexer for Microsoft Visual FoxPro source code. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer +from pygments.token import Punctuation, Text, Comment, Operator, Keyword, \ + Name, String + +__all__ = ['FoxProLexer'] + + +class FoxProLexer(RegexLexer): + """Lexer for Microsoft Visual FoxPro language. + + FoxPro syntax allows to shorten all keywords and function names + to 4 characters. Shortened forms are not recognized by this lexer. + + .. versionadded:: 1.6 + """ + + name = 'FoxPro' + aliases = ['foxpro', 'vfp', 'clipper', 'xbase'] + filenames = ['*.PRG', '*.prg'] + mimetype = [] + + flags = re.IGNORECASE | re.MULTILINE + + tokens = { + 'root': [ + (r';\s*\n', Punctuation), # consume newline + (r'(^|\n)\s*', Text, 'newline'), + + # Square brackets may be used for array indices + # and for string literal. Look for arrays + # before matching string literals. + (r'(?<=\w)\[[0-9, ]+\]', Text), + (r'\'[^\'\n]*\'|"[^"\n]*"|\[[^]*]\]', String), + (r'(^\s*\*|&&|&&).*?\n', Comment.Single), + + (r'(ABS|ACLASS|ACOPY|ACOS|ADATABASES|ADBOBJECTS|ADDBS|' + r'ADDPROPERTY|ADEL|ADIR|ADLLS|ADOCKSTATE|AELEMENT|AERROR|' + r'AEVENTS|AFIELDS|AFONT|AGETCLASS|AGETFILEVERSION|AINS|' + r'AINSTANCE|ALANGUAGE|ALEN|ALIAS|ALINES|ALLTRIM|' + r'AMEMBERS|AMOUSEOBJ|ANETRESOURCES|APRINTERS|APROCINFO|' + r'ASC|ASCAN|ASELOBJ|ASESSIONS|ASIN|ASORT|ASQLHANDLES|' + r'ASTACKINFO|ASUBSCRIPT|AT|AT_C|ATAGINFO|ATAN|ATC|ATCC|' + r'ATCLINE|ATLINE|ATN2|AUSED|AVCXCLASSES|BAR|BARCOUNT|' + r'BARPROMPT|BETWEEN|BINDEVENT|BINTOC|BITAND|BITCLEAR|' + r'BITLSHIFT|BITNOT|BITOR|BITRSHIFT|BITSET|BITTEST|BITXOR|' + r'BOF|CANDIDATE|CAPSLOCK|CAST|CDOW|CDX|CEILING|CHR|CHRSAW|' + r'CHRTRAN|CHRTRANC|CLEARRESULTSET|CMONTH|CNTBAR|CNTPAD|COL|' + r'COM|Functions|COMARRAY|COMCLASSINFO|COMPOBJ|COMPROP|' + r'COMRETURNERROR|COS|CPCONVERT|CPCURRENT|CPDBF|CREATEBINARY|' + r'CREATEOBJECT|CREATEOBJECTEX|CREATEOFFLINE|CTOBIN|CTOD|' + r'CTOT|CURDIR|CURSORGETPROP|CURSORSETPROP|CURSORTOXML|' + r'CURVAL|DATE|DATETIME|DAY|DBC|DBF|DBGETPROP|DBSETPROP|' + r'DBUSED|DDEAbortTrans|DDEAdvise|DDEEnabled|DDEExecute|' + r'DDEInitiate|DDELastError|DDEPoke|DDERequest|DDESetOption|' + r'DDESetService|DDESetTopic|DDETerminate|DEFAULTEXT|' + r'DELETED|DESCENDING|DIFFERENCE|DIRECTORY|DISKSPACE|' + r'DisplayPath|DMY|DODEFAULT|DOW|DRIVETYPE|DROPOFFLINE|' + r'DTOC|DTOR|DTOS|DTOT|EDITSOURCE|EMPTY|EOF|ERROR|EVAL(UATE)?|' + r'EVENTHANDLER|EVL|EXECSCRIPT|EXP|FCHSIZE|FCLOSE|FCOUNT|' + r'FCREATE|FDATE|FEOF|FERROR|FFLUSH|FGETS|FIELD|FILE|' + r'FILETOSTR|FILTER|FKLABEL|FKMAX|FLDLIST|FLOCK|FLOOR|' + r'FONTMETRIC|FOPEN|FOR|FORCEEXT|FORCEPATH|FOUND|FPUTS|' + r'FREAD|FSEEK|FSIZE|FTIME|FULLPATH|FV|FWRITE|' + r'GETAUTOINCVALUE|GETBAR|GETCOLOR|GETCP|GETDIR|GETENV|' + r'GETFILE|GETFLDSTATE|GETFONT|GETINTERFACE|' + r'GETNEXTMODIFIED|GETOBJECT|GETPAD|GETPEM|GETPICT|' + r'GETPRINTER|GETRESULTSET|GETWORDCOUNT|GETWORDNUM|' + r'GETCURSORADAPTER|GOMONTH|HEADER|HOME|HOUR|ICASE|' + r'IDXCOLLATE|IIF|IMESTATUS|INDBC|INDEXSEEK|INKEY|INLIST|' + r'INPUTBOX|INSMODE|INT|ISALPHA|ISBLANK|ISCOLOR|ISDIGIT|' + r'ISEXCLUSIVE|ISFLOCKED|ISLEADBYTE|ISLOWER|ISMEMOFETCHED|' + r'ISMOUSE|ISNULL|ISPEN|ISREADONLY|ISRLOCKED|' + r'ISTRANSACTABLE|ISUPPER|JUSTDRIVE|JUSTEXT|JUSTFNAME|' + r'JUSTPATH|JUSTSTEM|KEY|KEYMATCH|LASTKEY|LEFT|LEFTC|LEN|' + r'LENC|LIKE|LIKEC|LINENO|LOADPICTURE|LOCFILE|LOCK|LOG|' + r'LOG10|LOOKUP|LOWER|LTRIM|LUPDATE|MAKETRANSACTABLE|MAX|' + r'MCOL|MDOWN|MDX|MDY|MEMLINES|MEMORY|MENU|MESSAGE|' + r'MESSAGEBOX|MIN|MINUTE|MLINE|MOD|MONTH|MRKBAR|MRKPAD|' + r'MROW|MTON|MWINDOW|NDX|NEWOBJECT|NORMALIZE|NTOM|NUMLOCK|' + r'NVL|OBJNUM|OBJTOCLIENT|OBJVAR|OCCURS|OEMTOANSI|OLDVAL|' + r'ON|ORDER|OS|PAD|PADL|PARAMETERS|PAYMENT|PCOL|PCOUNT|' + r'PEMSTATUS|PI|POPUP|PRIMARY|PRINTSTATUS|PRMBAR|PRMPAD|' + r'PROGRAM|PROMPT|PROPER|PROW|PRTINFO|PUTFILE|PV|QUARTER|' + r'RAISEEVENT|RAND|RAT|RATC|RATLINE|RDLEVEL|READKEY|RECCOUNT|' + r'RECNO|RECSIZE|REFRESH|RELATION|REPLICATE|REQUERY|RGB|' + r'RGBSCHEME|RIGHT|RIGHTC|RLOCK|ROUND|ROW|RTOD|RTRIM|' + r'SAVEPICTURE|SCHEME|SCOLS|SEC|SECONDS|SEEK|SELECT|SET|' + r'SETFLDSTATE|SETRESULTSET|SIGN|SIN|SKPBAR|SKPPAD|SOUNDEX|' + r'SPACE|SQLCANCEL|SQLCOLUMNS|SQLCOMMIT|SQLCONNECT|' + r'SQLDISCONNECT|SQLEXEC|SQLGETPROP|SQLIDLEDISCONNECT|' + r'SQLMORERESULTS|SQLPREPARE|SQLROLLBACK|SQLSETPROP|' + r'SQLSTRINGCONNECT|SQLTABLES|SQRT|SROWS|STR|STRCONV|' + r'STREXTRACT|STRTOFILE|STRTRAN|STUFF|STUFFC|SUBSTR|' + r'SUBSTRC|SYS|SYSMETRIC|TABLEREVERT|TABLEUPDATE|TAG|' + r'TAGCOUNT|TAGNO|TAN|TARGET|TEXTMERGE|TIME|TRANSFORM|' + r'TRIM|TTOC|TTOD|TXNLEVEL|TXTWIDTH|TYPE|UNBINDEVENTS|' + r'UNIQUE|UPDATED|UPPER|USED|VAL|VARREAD|VARTYPE|VERSION|' + r'WBORDER|WCHILD|WCOLS|WDOCKABLE|WEEK|WEXIST|WFONT|WLAST|' + r'WLCOL|WLROW|WMAXIMUM|WMINIMUM|WONTOP|WOUTPUT|WPARENT|' + r'WREAD|WROWS|WTITLE|WVISIBLE|XMLTOCURSOR|XMLUPDATEGRAM|' + r'YEAR)(?=\s*\()', Name.Function), + + (r'_ALIGNMENT|_ASCIICOLS|_ASCIIROWS|_ASSIST|_BEAUTIFY|_BOX|' + r'_BROWSER|_BUILDER|_CALCMEM|_CALCVALUE|_CLIPTEXT|_CONVERTER|' + r'_COVERAGE|_CUROBJ|_DBLCLICK|_DIARYDATE|_DOS|_FOXDOC|_FOXREF|' + r'_GALLERY|_GENGRAPH|_GENHTML|_GENMENU|_GENPD|_GENSCRN|' + r'_GENXTAB|_GETEXPR|_INCLUDE|_INCSEEK|_INDENT|_LMARGIN|_MAC|' + r'_MENUDESIGNER|_MLINE|_PADVANCE|_PAGENO|_PAGETOTAL|_PBPAGE|' + r'_PCOLNO|_PCOPIES|_PDRIVER|_PDSETUP|_PECODE|_PEJECT|_PEPAGE|' + r'_PLENGTH|_PLINENO|_PLOFFSET|_PPITCH|_PQUALITY|_PRETEXT|' + r'_PSCODE|_PSPACING|_PWAIT|_RMARGIN|_REPORTBUILDER|' + r'_REPORTOUTPUT|_REPORTPREVIEW|_SAMPLES|_SCCTEXT|_SCREEN|' + r'_SHELL|_SPELLCHK|_STARTUP|_TABS|_TALLY|_TASKPANE|_TEXT|' + r'_THROTTLE|_TOOLBOX|_TOOLTIPTIMEOUT|_TRANSPORT|_TRIGGERLEVEL|' + r'_UNIX|_VFP|_WINDOWS|_WIZARD|_WRAP', Keyword.Pseudo), + + (r'THISFORMSET|THISFORM|THIS', Name.Builtin), + + (r'Application|CheckBox|Collection|Column|ComboBox|' + r'CommandButton|CommandGroup|Container|Control|CursorAdapter|' + r'Cursor|Custom|DataEnvironment|DataObject|EditBox|' + r'Empty|Exception|Fields|Files|File|FormSet|Form|FoxCode|' + r'Grid|Header|Hyperlink|Image|Label|Line|ListBox|Objects|' + r'OptionButton|OptionGroup|PageFrame|Page|ProjectHook|Projects|' + r'Project|Relation|ReportListener|Separator|Servers|Server|' + r'Session|Shape|Spinner|Tables|TextBox|Timer|ToolBar|' + r'XMLAdapter|XMLField|XMLTable', Name.Class), + + (r'm\.[a-z_]\w*', Name.Variable), + (r'\.(F|T|AND|OR|NOT|NULL)\.|\b(AND|OR|NOT|NULL)\b', Operator.Word), + + (r'\.(ActiveColumn|ActiveControl|ActiveForm|ActivePage|' + r'ActiveProject|ActiveRow|AddLineFeeds|ADOCodePage|Alias|' + r'Alignment|Align|AllowAddNew|AllowAutoColumnFit|' + r'AllowCellSelection|AllowDelete|AllowHeaderSizing|' + r'AllowInsert|AllowModalMessages|AllowOutput|AllowRowSizing|' + r'AllowSimultaneousFetch|AllowTabs|AllowUpdate|' + r'AlwaysOnBottom|AlwaysOnTop|Anchor|Application|' + r'AutoActivate|AutoCenter|AutoCloseTables|AutoComplete|' + r'AutoCompSource|AutoCompTable|AutoHideScrollBar|' + r'AutoIncrement|AutoOpenTables|AutoRelease|AutoSize|' + r'AutoVerbMenu|AutoYield|BackColor|ForeColor|BackStyle|' + r'BaseClass|BatchUpdateCount|BindControls|BorderColor|' + r'BorderStyle|BorderWidth|BoundColumn|BoundTo|Bound|' + r'BreakOnError|BufferModeOverride|BufferMode|' + r'BuildDateTime|ButtonCount|Buttons|Cancel|Caption|' + r'Centered|Century|ChildAlias|ChildOrder|ChildTable|' + r'ClassLibrary|Class|ClipControls|Closable|CLSID|CodePage|' + r'ColorScheme|ColorSource|ColumnCount|ColumnLines|' + r'ColumnOrder|Columns|ColumnWidths|CommandClauses|' + r'Comment|CompareMemo|ConflictCheckCmd|ConflictCheckType|' + r'ContinuousScroll|ControlBox|ControlCount|Controls|' + r'ControlSource|ConversionFunc|Count|CurrentControl|' + r'CurrentDataSession|CurrentPass|CurrentX|CurrentY|' + r'CursorSchema|CursorSource|CursorStatus|Curvature|' + r'Database|DataSessionID|DataSession|DataSourceType|' + r'DataSource|DataType|DateFormat|DateMark|Debug|' + r'DeclareXMLPrefix|DEClassLibrary|DEClass|DefaultFilePath|' + r'Default|DefOLELCID|DeleteCmdDataSourceType|DeleteCmdDataSource|' + r'DeleteCmd|DeleteMark|Description|Desktop|' + r'Details|DisabledBackColor|DisabledForeColor|' + r'DisabledItemBackColor|DisabledItemForeColor|' + r'DisabledPicture|DisableEncode|DisplayCount|' + r'DisplayValue|Dockable|Docked|DockPosition|' + r'DocumentFile|DownPicture|DragIcon|DragMode|DrawMode|' + r'DrawStyle|DrawWidth|DynamicAlignment|DynamicBackColor|' + r'DynamicForeColor|DynamicCurrentControl|DynamicFontBold|' + r'DynamicFontItalic|DynamicFontStrikethru|' + r'DynamicFontUnderline|DynamicFontName|DynamicFontOutline|' + r'DynamicFontShadow|DynamicFontSize|DynamicInputMask|' + r'DynamicLineHeight|EditorOptions|Enabled|' + r'EnableHyperlinks|Encrypted|ErrorNo|Exclude|Exclusive|' + r'FetchAsNeeded|FetchMemoCmdList|FetchMemoDataSourceType|' + r'FetchMemoDataSource|FetchMemo|FetchSize|' + r'FileClassLibrary|FileClass|FillColor|FillStyle|Filter|' + r'FirstElement|FirstNestedTable|Flags|FontBold|FontItalic|' + r'FontStrikethru|FontUnderline|FontCharSet|FontCondense|' + r'FontExtend|FontName|FontOutline|FontShadow|FontSize|' + r'ForceCloseTag|Format|FormCount|FormattedOutput|Forms|' + r'FractionDigits|FRXDataSession|FullName|GDIPlusGraphics|' + r'GridLineColor|GridLines|GridLineWidth|HalfHeightCaption|' + r'HeaderClassLibrary|HeaderClass|HeaderHeight|Height|' + r'HelpContextID|HideSelection|HighlightBackColor|' + r'HighlightForeColor|HighlightStyle|HighlightRowLineWidth|' + r'HighlightRow|Highlight|HomeDir|Hours|HostName|' + r'HScrollSmallChange|hWnd|Icon|IncrementalSearch|Increment|' + r'InitialSelectedAlias|InputMask|InsertCmdDataSourceType|' + r'InsertCmdDataSource|InsertCmdRefreshCmd|' + r'InsertCmdRefreshFieldList|InsertCmdRefreshKeyFieldList|' + r'InsertCmd|Instancing|IntegralHeight|' + r'Interval|IMEMode|IsAttribute|IsBase64|IsBinary|IsNull|' + r'IsDiffGram|IsLoaded|ItemBackColor,|ItemData|ItemIDData|' + r'ItemTips|IXMLDOMElement|KeyboardHighValue|KeyboardLowValue|' + r'Keyfield|KeyFieldList|KeyPreview|KeySort|LanguageOptions|' + r'LeftColumn|Left|LineContents|LineNo|LineSlant|LinkMaster|' + r'ListCount|ListenerType|ListIndex|ListItemID|ListItem|' + r'List|LockColumnsLeft|LockColumns|LockScreen|MacDesktop|' + r'MainFile|MapN19_4ToCurrency|MapBinary|MapVarchar|Margin|' + r'MaxButton|MaxHeight|MaxLeft|MaxLength|MaxRecords|MaxTop|' + r'MaxWidth|MDIForm|MemberClassLibrary|MemberClass|' + r'MemoWindow|Message|MinButton|MinHeight|MinWidth|' + r'MouseIcon|MousePointer|Movable|MoverBars|MultiSelect|' + r'Name|NestedInto|NewIndex|NewItemID|NextSiblingTable|' + r'NoCpTrans|NoDataOnLoad|NoData|NullDisplay|' + r'NumberOfElements|Object|OLEClass|OLEDragMode|' + r'OLEDragPicture|OLEDropEffects|OLEDropHasData|' + r'OLEDropMode|OLEDropTextInsertion|OLELCID|' + r'OLERequestPendingTimeout|OLEServerBusyRaiseError|' + r'OLEServerBusyTimeout|OLETypeAllowed|OneToMany|' + r'OpenViews|OpenWindow|Optimize|OrderDirection|Order|' + r'OutputPageCount|OutputType|PageCount|PageHeight|' + r'PageNo|PageOrder|Pages|PageTotal|PageWidth|' + r'PanelLink|Panel|ParentAlias|ParentClass|ParentTable|' + r'Parent|Partition|PasswordChar|PictureMargin|' + r'PicturePosition|PictureSpacing|PictureSelectionDisplay|' + r'PictureVal|Picture|Prepared|' + r'PolyPoints|PreserveWhiteSpace|PreviewContainer|' + r'PrintJobName|Procedure|PROCESSID|ProgID|ProjectHookClass|' + r'ProjectHookLibrary|ProjectHook|QuietMode|' + r'ReadCycle|ReadLock|ReadMouse|ReadObject|ReadOnly|' + r'ReadSave|ReadTimeout|RecordMark|RecordSourceType|' + r'RecordSource|RefreshAlias|' + r'RefreshCmdDataSourceType|RefreshCmdDataSource|RefreshCmd|' + r'RefreshIgnoreFieldList|RefreshTimeStamp|RelationalExpr|' + r'RelativeColumn|RelativeRow|ReleaseType|Resizable|' + r'RespectCursorCP|RespectNesting|RightToLeft|RotateFlip|' + r'Rotation|RowColChange|RowHeight|RowSourceType|' + r'RowSource|ScaleMode|SCCProvider|SCCStatus|ScrollBars|' + r'Seconds|SelectCmd|SelectedID|' + r'SelectedItemBackColor|SelectedItemForeColor|Selected|' + r'SelectionNamespaces|SelectOnEntry|SelLength|SelStart|' + r'SelText|SendGDIPlusImage|SendUpdates|ServerClassLibrary|' + r'ServerClass|ServerHelpFile|ServerName|' + r'ServerProject|ShowTips|ShowInTaskbar|ShowWindow|' + r'Sizable|SizeBox|SOM|Sorted|Sparse|SpecialEffect|' + r'SpinnerHighValue|SpinnerLowValue|SplitBar|StackLevel|' + r'StartMode|StatusBarText|StatusBar|Stretch|StrictDateEntry|' + r'Style|TabIndex|Tables|TabOrientation|Tabs|TabStop|' + r'TabStretch|TabStyle|Tag|TerminateRead|Text|Themes|' + r'ThreadID|TimestampFieldList|TitleBar|ToolTipText|' + r'TopIndex|TopItemID|Top|TwoPassProcess|TypeLibCLSID|' + r'TypeLibDesc|TypeLibName|Type|Unicode|UpdatableFieldList|' + r'UpdateCmdDataSourceType|UpdateCmdDataSource|' + r'UpdateCmdRefreshCmd|UpdateCmdRefreshFieldList|' + r'UpdateCmdRefreshKeyFieldList|UpdateCmd|' + r'UpdateGramSchemaLocation|UpdateGram|UpdateNameList|UpdateType|' + r'UseCodePage|UseCursorSchema|UseDeDataSource|UseMemoSize|' + r'UserValue|UseTransactions|UTF8Encoded|Value|VersionComments|' + r'VersionCompany|VersionCopyright|VersionDescription|' + r'VersionNumber|VersionProduct|VersionTrademarks|Version|' + r'VFPXMLProgID|ViewPortHeight|ViewPortLeft|' + r'ViewPortTop|ViewPortWidth|VScrollSmallChange|View|Visible|' + r'VisualEffect|WhatsThisButton|WhatsThisHelpID|WhatsThisHelp|' + r'WhereType|Width|WindowList|WindowState|WindowType|WordWrap|' + r'WrapCharInCDATA|WrapInCDATA|WrapMemoInCDATA|XMLAdapter|' + r'XMLConstraints|XMLNameIsXPath|XMLNamespace|XMLName|' + r'XMLPrefix|XMLSchemaLocation|XMLTable|XMLType|' + r'XSDfractionDigits|XSDmaxLength|XSDtotalDigits|' + r'XSDtype|ZoomBox)', Name.Attribute), + + (r'\.(ActivateCell|AddColumn|AddItem|AddListItem|AddObject|' + r'AddProperty|AddTableSchema|AddToSCC|Add|' + r'ApplyDiffgram|Attach|AutoFit|AutoOpen|Box|Build|' + r'CancelReport|ChangesToCursor|CheckIn|CheckOut|Circle|' + r'CleanUp|ClearData|ClearStatus|Clear|CloneObject|CloseTables|' + r'Close|Cls|CursorAttach|CursorDetach|CursorFill|' + r'CursorRefresh|DataToClip|DelayedMemoFetch|DeleteColumn|' + r'Dock|DoMessage|DoScroll|DoStatus|DoVerb|Drag|Draw|Eval|' + r'GetData|GetDockState|GetFormat|GetKey|GetLatestVersion|' + r'GetPageHeight|GetPageWidth|Help|Hide|IncludePageInOutput|' + r'IndexToItemID|ItemIDToIndex|Item|LoadXML|Line|Modify|' + r'MoveItem|Move|Nest|OLEDrag|OnPreviewClose|OutputPage|' + r'Point|Print|PSet|Quit|ReadExpression|ReadMethod|' + r'RecordRefresh|Refresh|ReleaseXML|Release|RemoveFromSCC|' + r'RemoveItem|RemoveListItem|RemoveObject|Remove|' + r'Render|Requery|RequestData|ResetToDefault|Reset|Run|' + r'SaveAsClass|SaveAs|SetAll|SetData|SetFocus|SetFormat|' + r'SetMain|SetVar|SetViewPort|ShowWhatsThis|Show|' + r'SupportsListenerType|TextHeight|TextWidth|ToCursor|' + r'ToXML|UndoCheckOut|Unnest|UpdateStatus|WhatsThisMode|' + r'WriteExpression|WriteMethod|ZOrder)', Name.Function), + + (r'\.(Activate|AdjustObjectSize|AfterBand|AfterBuild|' + r'AfterCloseTables|AfterCursorAttach|AfterCursorClose|' + r'AfterCursorDetach|AfterCursorFill|AfterCursorRefresh|' + r'AfterCursorUpdate|AfterDelete|AfterInsert|' + r'AfterRecordRefresh|AfterUpdate|AfterDock|AfterReport|' + r'AfterRowColChange|BeforeBand|BeforeCursorAttach|' + r'BeforeCursorClose|BeforeCursorDetach|BeforeCursorFill|' + r'BeforeCursorRefresh|BeforeCursorUpdate|BeforeDelete|' + r'BeforeInsert|BeforeDock|BeforeOpenTables|' + r'BeforeRecordRefresh|BeforeReport|BeforeRowColChange|' + r'BeforeUpdate|Click|dbc_Activate|dbc_AfterAddTable|' + r'dbc_AfterAppendProc|dbc_AfterCloseTable|dbc_AfterCopyProc|' + r'dbc_AfterCreateConnection|dbc_AfterCreateOffline|' + r'dbc_AfterCreateTable|dbc_AfterCreateView|dbc_AfterDBGetProp|' + r'dbc_AfterDBSetProp|dbc_AfterDeleteConnection|' + r'dbc_AfterDropOffline|dbc_AfterDropTable|' + r'dbc_AfterModifyConnection|dbc_AfterModifyProc|' + r'dbc_AfterModifyTable|dbc_AfterModifyView|dbc_AfterOpenTable|' + r'dbc_AfterRemoveTable|dbc_AfterRenameConnection|' + r'dbc_AfterRenameTable|dbc_AfterRenameView|' + r'dbc_AfterValidateData|dbc_BeforeAddTable|' + r'dbc_BeforeAppendProc|dbc_BeforeCloseTable|' + r'dbc_BeforeCopyProc|dbc_BeforeCreateConnection|' + r'dbc_BeforeCreateOffline|dbc_BeforeCreateTable|' + r'dbc_BeforeCreateView|dbc_BeforeDBGetProp|' + r'dbc_BeforeDBSetProp|dbc_BeforeDeleteConnection|' + r'dbc_BeforeDropOffline|dbc_BeforeDropTable|' + r'dbc_BeforeModifyConnection|dbc_BeforeModifyProc|' + r'dbc_BeforeModifyTable|dbc_BeforeModifyView|' + r'dbc_BeforeOpenTable|dbc_BeforeRemoveTable|' + r'dbc_BeforeRenameConnection|dbc_BeforeRenameTable|' + r'dbc_BeforeRenameView|dbc_BeforeValidateData|' + r'dbc_CloseData|dbc_Deactivate|dbc_ModifyData|dbc_OpenData|' + r'dbc_PackData|DblClick|Deactivate|Deleted|Destroy|DoCmd|' + r'DownClick|DragDrop|DragOver|DropDown|ErrorMessage|Error|' + r'EvaluateContents|GotFocus|Init|InteractiveChange|KeyPress|' + r'LoadReport|Load|LostFocus|Message|MiddleClick|MouseDown|' + r'MouseEnter|MouseLeave|MouseMove|MouseUp|MouseWheel|Moved|' + r'OLECompleteDrag|OLEDragOver|OLEGiveFeedback|OLESetData|' + r'OLEStartDrag|OnMoveItem|Paint|ProgrammaticChange|' + r'QueryAddFile|QueryModifyFile|QueryNewFile|QueryRemoveFile|' + r'QueryRunFile|QueryUnload|RangeHigh|RangeLow|ReadActivate|' + r'ReadDeactivate|ReadShow|ReadValid|ReadWhen|Resize|' + r'RightClick|SCCInit|SCCDestroy|Scrolled|Timer|UIEnable|' + r'UnDock|UnloadReport|Unload|UpClick|Valid|When)', Name.Function), + + (r'\s+', Text), + # everything else is not colored + (r'.', Text), + ], + 'newline': [ + (r'\*.*?$', Comment.Single, '#pop'), + (r'(ACCEPT|ACTIVATE\s*MENU|ACTIVATE\s*POPUP|ACTIVATE\s*SCREEN|' + r'ACTIVATE\s*WINDOW|APPEND|APPEND\s*FROM|APPEND\s*FROM\s*ARRAY|' + r'APPEND\s*GENERAL|APPEND\s*MEMO|ASSIST|AVERAGE|BLANK|BROWSE|' + r'BUILD\s*APP|BUILD\s*EXE|BUILD\s*PROJECT|CALCULATE|CALL|' + r'CANCEL|CHANGE|CLEAR|CLOSE|CLOSE\s*MEMO|COMPILE|CONTINUE|' + r'COPY\s*FILE|COPY\s*INDEXES|COPY\s*MEMO|COPY\s*STRUCTURE|' + r'COPY\s*STRUCTURE\s*EXTENDED|COPY\s*TAG|COPY\s*TO|' + r'COPY\s*TO\s*ARRAY|COUNT|CREATE|CREATE\s*COLOR\s*SET|' + r'CREATE\s*CURSOR|CREATE\s*FROM|CREATE\s*LABEL|CREATE\s*MENU|' + r'CREATE\s*PROJECT|CREATE\s*QUERY|CREATE\s*REPORT|' + r'CREATE\s*SCREEN|CREATE\s*TABLE|CREATE\s*VIEW|DDE|' + r'DEACTIVATE\s*MENU|DEACTIVATE\s*POPUP|DEACTIVATE\s*WINDOW|' + r'DECLARE|DEFINE\s*BAR|DEFINE\s*BOX|DEFINE\s*MENU|' + r'DEFINE\s*PAD|DEFINE\s*POPUP|DEFINE\s*WINDOW|DELETE|' + r'DELETE\s*FILE|DELETE\s*TAG|DIMENSION|DIRECTORY|DISPLAY|' + r'DISPLAY\s*FILES|DISPLAY\s*MEMORY|DISPLAY\s*STATUS|' + r'DISPLAY\s*STRUCTURE|DO|EDIT|EJECT|EJECT\s*PAGE|ERASE|' + r'EXIT|EXPORT|EXTERNAL|FILER|FIND|FLUSH|FUNCTION|GATHER|' + r'GETEXPR|GO|GOTO|HELP|HIDE\s*MENU|HIDE\s*POPUP|' + r'HIDE\s*WINDOW|IMPORT|INDEX|INPUT|INSERT|JOIN|KEYBOARD|' + r'LABEL|LIST|LOAD|LOCATE|LOOP|MENU|MENU\s*TO|MODIFY\s*COMMAND|' + r'MODIFY\s*FILE|MODIFY\s*GENERAL|MODIFY\s*LABEL|MODIFY\s*MEMO|' + r'MODIFY\s*MENU|MODIFY\s*PROJECT|MODIFY\s*QUERY|' + r'MODIFY\s*REPORT|MODIFY\s*SCREEN|MODIFY\s*STRUCTURE|' + r'MODIFY\s*WINDOW|MOVE\s*POPUP|MOVE\s*WINDOW|NOTE|' + r'ON\s*APLABOUT|ON\s*BAR|ON\s*ERROR|ON\s*ESCAPE|' + r'ON\s*EXIT\s*BAR|ON\s*EXIT\s*MENU|ON\s*EXIT\s*PAD|' + r'ON\s*EXIT\s*POPUP|ON\s*KEY|ON\s*KEY\s*=|ON\s*KEY\s*LABEL|' + r'ON\s*MACHELP|ON\s*PAD|ON\s*PAGE|ON\s*READERROR|' + r'ON\s*SELECTION\s*BAR|ON\s*SELECTION\s*MENU|' + r'ON\s*SELECTION\s*PAD|ON\s*SELECTION\s*POPUP|ON\s*SHUTDOWN|' + r'PACK|PARAMETERS|PLAY\s*MACRO|POP\s*KEY|POP\s*MENU|' + r'POP\s*POPUP|PRIVATE|PROCEDURE|PUBLIC|PUSH\s*KEY|' + r'PUSH\s*MENU|PUSH\s*POPUP|QUIT|READ|READ\s*MENU|RECALL|' + r'REINDEX|RELEASE|RELEASE\s*MODULE|RENAME|REPLACE|' + r'REPLACE\s*FROM\s*ARRAY|REPORT|RESTORE\s*FROM|' + r'RESTORE\s*MACROS|RESTORE\s*SCREEN|RESTORE\s*WINDOW|' + r'RESUME|RETRY|RETURN|RUN|RUN\s*\/N"|RUNSCRIPT|' + r'SAVE\s*MACROS|SAVE\s*SCREEN|SAVE\s*TO|SAVE\s*WINDOWS|' + r'SCATTER|SCROLL|SEEK|SELECT|SET|SET\s*ALTERNATE|' + r'SET\s*ANSI|SET\s*APLABOUT|SET\s*AUTOSAVE|SET\s*BELL|' + r'SET\s*BLINK|SET\s*BLOCKSIZE|SET\s*BORDER|SET\s*BRSTATUS|' + r'SET\s*CARRY|SET\s*CENTURY|SET\s*CLEAR|SET\s*CLOCK|' + r'SET\s*COLLATE|SET\s*COLOR\s*OF|SET\s*COLOR\s*OF\s*SCHEME|' + r'SET\s*COLOR\s*SET|SET\s*COLOR\s*TO|SET\s*COMPATIBLE|' + r'SET\s*CONFIRM|SET\s*CONSOLE|SET\s*CURRENCY|SET\s*CURSOR|' + r'SET\s*DATE|SET\s*DEBUG|SET\s*DECIMALS|SET\s*DEFAULT|' + r'SET\s*DELETED|SET\s*DELIMITERS|SET\s*DEVELOPMENT|' + r'SET\s*DEVICE|SET\s*DISPLAY|SET\s*DOHISTORY|SET\s*ECHO|' + r'SET\s*ESCAPE|SET\s*EXACT|SET\s*EXCLUSIVE|SET\s*FIELDS|' + r'SET\s*FILTER|SET\s*FIXED|SET\s*FORMAT|SET\s*FULLPATH|' + r'SET\s*FUNCTION|SET\s*HEADINGS|SET\s*HELP|SET\s*HELPFILTER|' + r'SET\s*HOURS|SET\s*INDEX|SET\s*INTENSITY|SET\s*KEY|' + r'SET\s*KEYCOMP|SET\s*LIBRARY|SET\s*LOCK|SET\s*LOGERRORS|' + r'SET\s*MACDESKTOP|SET\s*MACHELP|SET\s*MACKEY|SET\s*MARGIN|' + r'SET\s*MARK\s*OF|SET\s*MARK\s*TO|SET\s*MEMOWIDTH|' + r'SET\s*MESSAGE|SET\s*MOUSE|SET\s*MULTILOCKS|SET\s*NEAR|' + r'SET\s*NOCPTRANS|SET\s*NOTIFY|SET\s*ODOMETER|SET\s*OPTIMIZE|' + r'SET\s*ORDER|SET\s*PALETTE|SET\s*PATH|SET\s*PDSETUP|' + r'SET\s*POINT|SET\s*PRINTER|SET\s*PROCEDURE|SET\s*READBORDER|' + r'SET\s*REFRESH|SET\s*RELATION|SET\s*RELATION\s*OFF|' + r'SET\s*REPROCESS|SET\s*RESOURCE|SET\s*SAFETY|SET\s*SCOREBOARD|' + r'SET\s*SEPARATOR|SET\s*SHADOWS|SET\s*SKIP|SET\s*SKIP\s*OF|' + r'SET\s*SPACE|SET\s*STATUS|SET\s*STATUS\s*BAR|SET\s*STEP|' + r'SET\s*STICKY|SET\s*SYSMENU|SET\s*TALK|SET\s*TEXTMERGE|' + r'SET\s*TEXTMERGE\s*DELIMITERS|SET\s*TOPIC|SET\s*TRBETWEEN|' + r'SET\s*TYPEAHEAD|SET\s*UDFPARMS|SET\s*UNIQUE|SET\s*VIEW|' + r'SET\s*VOLUME|SET\s*WINDOW\s*OF\s*MEMO|SET\s*XCMDFILE|' + r'SHOW\s*GET|SHOW\s*GETS|SHOW\s*MENU|SHOW\s*OBJECT|' + r'SHOW\s*POPUP|SHOW\s*WINDOW|SIZE\s*POPUP|SKIP|SORT|' + r'STORE|SUM|SUSPEND|TOTAL|TYPE|UNLOCK|UPDATE|USE|WAIT|' + r'ZAP|ZOOM\s*WINDOW|DO\s*CASE|CASE|OTHERWISE|ENDCASE|' + r'DO\s*WHILE|ENDDO|FOR|ENDFOR|NEXT|IF|ELSE|ENDIF|PRINTJOB|' + r'ENDPRINTJOB|SCAN|ENDSCAN|TEXT|ENDTEXT|=)', + Keyword.Reserved, '#pop'), + (r'#\s*(IF|ELIF|ELSE|ENDIF|DEFINE|IFDEF|IFNDEF|INCLUDE)', + Comment.Preproc, '#pop'), + (r'(m\.)?[a-z_]\w*', Name.Variable, '#pop'), + (r'.', Text, '#pop'), + ], + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/functional.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/functional.py new file mode 100644 index 0000000000000000000000000000000000000000..254df795f6b54090a0d00bf96e8c235240b17258 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/functional.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.functional + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Just export lexer classes previously contained in this module. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +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/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/grammar_notation.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/grammar_notation.py new file mode 100644 index 0000000000000000000000000000000000000000..076249d3df6c4f81a38e8c76172d1589d5e35840 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/grammar_notation.py @@ -0,0 +1,213 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.grammar_notation + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for grammer notations like BNF. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, bygroups, include, this, using, words +from pygments.token import Comment, Keyword, Literal, Name, Number, \ + Operator, Punctuation, String, Text + +__all__ = ['BnfLexer', 'AbnfLexer', 'JsgfLexer'] + + +class BnfLexer(RegexLexer): + """ + This lexer is for grammer notations which are similar to + original BNF. + + In order to maximize a number of targets of this lexer, + let's decide some designs: + + * We don't distinguish `Terminal Symbol`. + + * We do assume that `NonTerminal Symbol` are always enclosed + with arrow brackets. + + * We do assume that `NonTerminal Symbol` may include + any printable characters except arrow brackets and ASCII 0x20. + This assumption is for `RBNF `_. + + * We do assume that target notation doesn't support comment. + + * We don't distinguish any operators and punctuation except + `::=`. + + Though these desision making might cause too minimal highlighting + and you might be disappointed, but it is reasonable for us. + + .. versionadded:: 2.1 + """ + + name = 'BNF' + aliases = ['bnf'] + filenames = ['*.bnf'] + mimetypes = ['text/x-bnf'] + + tokens = { + 'root': [ + (r'(<)([ -;=?-~]+)(>)', + bygroups(Punctuation, Name.Class, Punctuation)), + + # an only operator + (r'::=', Operator), + + # fallback + (r'[^<>:]+', Text), # for performance + (r'.', Text), + ], + } + + +class AbnfLexer(RegexLexer): + """ + Lexer for `IETF 7405 ABNF + `_ + (Updates `5234 `_) + grammars. + + .. versionadded:: 2.1 + """ + + name = 'ABNF' + aliases = ['abnf'] + filenames = ['*.abnf'] + mimetypes = ['text/x-abnf'] + + _core_rules = ( + 'ALPHA', 'BIT', 'CHAR', 'CR', 'CRLF', 'CTL', 'DIGIT', + 'DQUOTE', 'HEXDIG', 'HTAB', 'LF', 'LWSP', 'OCTET', + 'SP', 'VCHAR', 'WSP') + + tokens = { + 'root': [ + # comment + (r';.*$', Comment.Single), + + # quoted + # double quote itself in this state, it is as '%x22'. + (r'(%[si])?"[^"]*"', Literal), + + # binary (but i have never seen...) + (r'%b[01]+\-[01]+\b', Literal), # range + (r'%b[01]+(\.[01]+)*\b', Literal), # concat + + # decimal + (r'%d[0-9]+\-[0-9]+\b', Literal), # range + (r'%d[0-9]+(\.[0-9]+)*\b', Literal), # concat + + # hexadecimal + (r'%x[0-9a-fA-F]+\-[0-9a-fA-F]+\b', Literal), # range + (r'%x[0-9a-fA-F]+(\.[0-9a-fA-F]+)*\b', Literal), # concat + + # repetition (*element) including nRule + (r'\b[0-9]+\*[0-9]+', Operator), + (r'\b[0-9]+\*', Operator), + (r'\b[0-9]+', Operator), + (r'\*', Operator), + + # Strictly speaking, these are not keyword but + # are called `Core Rule'. + (words(_core_rules, suffix=r'\b'), Keyword), + + # nonterminals (ALPHA *(ALPHA / DIGIT / "-")) + (r'[a-zA-Z][a-zA-Z0-9-]+\b', Name.Class), + + # operators + (r'(=/|=|/)', Operator), + + # punctuation + (r'[\[\]()]', Punctuation), + + # fallback + (r'\s+', Text), + (r'.', Text), + ], + } + + +class JsgfLexer(RegexLexer): + """ + For `JSpeech Grammar Format `_ + grammars. + + .. versionadded:: 2.2 + """ + name = 'JSGF' + aliases = ['jsgf'] + filenames = ['*.jsgf'] + mimetypes = ['application/jsgf', 'application/x-jsgf', 'text/jsgf'] + + flags = re.MULTILINE | re.UNICODE + + tokens = { + 'root': [ + include('comments'), + include('non-comments'), + ], + 'comments': [ + (r'/\*\*(?!/)', Comment.Multiline, 'documentation comment'), + (r'/\*[\w\W]*?\*/', Comment.Multiline), + (r'//.*', Comment.Single), + ], + 'non-comments': [ + ('\A#JSGF[^;]*', Comment.Preproc), + (r'\s+', Text), + (r';', Punctuation), + (r'[=|()\[\]*+]', Operator), + (r'/[^/]+/', Number.Float), + (r'"', String.Double, 'string'), + (r'\{', String.Other, 'tag'), + (words(('import', 'public'), suffix=r'\b'), Keyword.Reserved), + (r'grammar\b', Keyword.Reserved, 'grammar name'), + (r'(<)(NULL|VOID)(>)', + bygroups(Punctuation, Name.Builtin, Punctuation)), + (r'<', Punctuation, 'rulename'), + (r'\w+|[^\s;=|()\[\]*+/"{<\w]+', Text), + ], + 'string': [ + (r'"', String.Double, '#pop'), + (r'\\.', String.Escape), + (r'[^\\"]+', String.Double), + ], + 'tag': [ + (r'\}', String.Other, '#pop'), + (r'\\.', String.Escape), + (r'[^\\}]+', String.Other), + ], + 'grammar name': [ + (r';', Punctuation, '#pop'), + (r'\s+', Text), + (r'\.', Punctuation), + (r'[^;\s.]+', Name.Namespace), + ], + 'rulename': [ + (r'>', Punctuation, '#pop'), + (r'\*', Punctuation), + (r'\s+', Text), + (r'([^.>]+)(\s*)(\.)', bygroups(Name.Namespace, Text, Punctuation)), + (r'[^.>]+', Name.Constant), + ], + 'documentation comment': [ + (r'\*/', Comment.Multiline, '#pop'), + (r'(^\s*\*?\s*)(@(?:example|see)\s+)' + r'([\w\W]*?(?=(?:^\s*\*?\s*@|\*/)))', + bygroups(Comment.Multiline, Comment.Special, + using(this, state='example'))), + (r'(^\s*\*?\s*)(@\S*)', + bygroups(Comment.Multiline, Comment.Special)), + (r'[^*\n@]+|\w|\W', Comment.Multiline), + ], + 'example': [ + (r'\n\s*\*', Comment.Multiline), + include('non-comments'), + (r'.', Comment.Multiline), + ], + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/graph.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/graph.py new file mode 100644 index 0000000000000000000000000000000000000000..1a33824603a62ff243a7fec94c576dd447a75625 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/graph.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.graph + ~~~~~~~~~~~~~~~~~~~~~ + + Lexers for graph query languages. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, include, bygroups, using, this +from pygments.token import Keyword, Punctuation, Comment, Operator, Name,\ + String, Number, Whitespace + + +__all__ = ['CypherLexer'] + + +class CypherLexer(RegexLexer): + """ + For `Cypher Query Language + `_ + + For the Cypher version in Neo4J 2.0 + + .. versionadded:: 2.0 + """ + name = 'Cypher' + aliases = ['cypher'] + filenames = ['*.cyp', '*.cypher'] + + flags = re.MULTILINE | re.IGNORECASE + + tokens = { + 'root': [ + include('comment'), + include('keywords'), + include('clauses'), + include('relations'), + include('strings'), + include('whitespace'), + include('barewords'), + ], + 'comment': [ + (r'^.*//.*\n', Comment.Single), + ], + 'keywords': [ + (r'(create|order|match|limit|set|skip|start|return|with|where|' + r'delete|foreach|not|by)\b', Keyword), + ], + 'clauses': [ + # TODO: many missing ones, see http://docs.neo4j.org/refcard/2.0/ + (r'(all|any|as|asc|create|create\s+unique|delete|' + r'desc|distinct|foreach|in|is\s+null|limit|match|none|' + r'order\s+by|return|set|skip|single|start|union|where|with)\b', + Keyword), + ], + 'relations': [ + (r'(-\[)(.*?)(\]->)', bygroups(Operator, using(this), Operator)), + (r'(<-\[)(.*?)(\]-)', bygroups(Operator, using(this), Operator)), + (r'(-\[)(.*?)(\]-)', bygroups(Operator, using(this), Operator)), + (r'-->|<--|\[|\]', Operator), + (r'<|>|<>|=|<=|=>|\(|\)|\||:|,|;', Punctuation), + (r'[.*{}]', Punctuation), + ], + 'strings': [ + (r'"(?:\\[tbnrf\'"\\]|[^\\"])*"', String), + (r'`(?:``|[^`])+`', Name.Variable), + ], + 'whitespace': [ + (r'\s+', Whitespace), + ], + 'barewords': [ + (r'[a-z]\w*', Name), + (r'\d+', Number), + ], + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/graphics.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/graphics.py new file mode 100644 index 0000000000000000000000000000000000000000..c8af9f9916eb453e44d6ff1e950bf38c6ee85778 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/graphics.py @@ -0,0 +1,553 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.graphics + ~~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for computer graphics and plotting related languages. + + :copyright: Copyright 2006-2017 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 + +__all__ = ['GLShaderLexer', 'PostScriptLexer', 'AsymptoteLexer', 'GnuplotLexer', + 'PovrayLexer'] + + +class GLShaderLexer(RegexLexer): + """ + GLSL (OpenGL Shader) lexer. + + .. versionadded:: 1.1 + """ + name = 'GLSL' + aliases = ['glsl'] + filenames = ['*.vert', '*.frag', '*.geo'] + mimetypes = ['text/x-glslsrc'] + + tokens = { + 'root': [ + (r'^#.*', 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(( + 'attribute', 'const', 'uniform', 'varying', 'centroid', 'break', + 'continue', 'do', 'for', 'while', 'if', 'else', 'in', 'out', + 'inout', 'float', 'int', 'void', 'bool', 'true', 'false', + 'invariant', 'discard', 'return', 'mat2', 'mat3' 'mat4', + 'mat2x2', 'mat3x2', 'mat4x2', 'mat2x3', 'mat3x3', 'mat4x3', + 'mat2x4', 'mat3x4', 'mat4x4', 'vec2', 'vec3', 'vec4', + 'ivec2', 'ivec3', 'ivec4', 'bvec2', 'bvec3', 'bvec4', + 'sampler1D', 'sampler2D', 'sampler3D' 'samplerCube', + 'sampler1DShadow', 'sampler2DShadow', 'struct'), + prefix=r'\b', suffix=r'\b'), + Keyword), + (words(( + 'asm', 'class', 'union', 'enum', 'typedef', 'template', 'this', + 'packed', 'goto', 'switch', 'default', 'inline', 'noinline', + 'volatile', 'public', 'static', 'extern', 'external', 'interface', + 'long', 'short', 'double', 'half', 'fixed', 'unsigned', 'lowp', + 'mediump', 'highp', 'precision', 'input', 'output', + 'hvec2', 'hvec3', 'hvec4', 'dvec2', 'dvec3', 'dvec4', + 'fvec2', 'fvec3', 'fvec4', 'sampler2DRect', 'sampler3DRect', + 'sampler2DRectShadow', 'sizeof', 'cast', 'namespace', 'using'), + prefix=r'\b', suffix=r'\b'), + Keyword), # future use + (r'[a-zA-Z_]\w*', Name), + (r'\.', Punctuation), + (r'\s+', Text), + ], + } + + +class PostScriptLexer(RegexLexer): + """ + Lexer for PostScript files. + + The PostScript Language Reference published by Adobe at + + is the authority for this. + + .. versionadded:: 1.4 + """ + name = 'PostScript' + aliases = ['postscript', 'postscr'] + filenames = ['*.ps', '*.eps'] + mimetypes = ['application/postscript'] + + delimiter = r'()<>\[\]{}/%\s' + delimiter_end = r'(?=[%s])' % delimiter + + valid_name_chars = r'[^%s]' % delimiter + valid_name = r"%s+%s" % (valid_name_chars, delimiter_end) + + tokens = { + 'root': [ + # All comment types + (r'^%!.+\n', Comment.Preproc), + (r'%%.*\n', Comment.Special), + (r'(^%.*\n){2,}', Comment.Multiline), + (r'%.*\n', 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 + (r'\/%s' % 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+', Text), + ], + + '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. + + .. versionadded:: 1.2 + """ + name = 'Asymptote' + aliases = ['asy', 'asymptote'] + filenames = ['*.asy'] + mimetypes = ['text/x-asymptote'] + + #: optional Comment or Whitespace + _ws = r'(?:\s|//.*?\n|/\*.*?\*/)+' + + tokens = { + 'whitespace': [ + (r'\n', Text), + (r'\s+', Text), + (r'\\\n', Text), # 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), + ('[a-zA-Z_]\w*:(?!:)', Name.Label), + ('[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. + + .. versionadded:: 0.11 + """ + + name = 'Gnuplot' + aliases = ['gnuplot'] + filenames = ['*.plot', '*.plt'] + mimetypes = ['text/x-gnuplot'] + + 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'), + ('([a-zA-Z_]\w*)(\s*)(=)', + bygroups(Name.Variable, Text, Operator), 'genericargs'), + ('([a-zA-Z_]\w*)(\s*\(.*?\)\s*)(=)', + bygroups(Name.Function, Text, 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]+', Text), + ], + 'noargs': [ + include('whitespace'), + # semicolon and newline end the argument list + (r';', Punctuation, '#pop'), + (r'\n', Text, '#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', String, '#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', String, '#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), + ('[{}()\[\]]', 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', Text), + ], + '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. + + .. versionadded:: 0.11 + """ + name = 'POVRay' + aliases = ['pov'] + filenames = ['*.pov', '*.inc'] + mimetypes = ['text/x-povray'] + + tokens = { + 'root': [ + (r'/\*[\w\W]*?\*/', Comment.Multiline), + (r'//.*\n', 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), + # TODO: <=, etc + (r'[\[\](){}<>;,]', Punctuation), + (r'[-+*/=]', Operator), + (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.Float), + (r'[0-9]+', Number.Integer), + (r'"(\\\\|\\"|[^"])*"', String), + (r'\s+', Text), + ] + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/haskell.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/haskell.py new file mode 100644 index 0000000000000000000000000000000000000000..1a2f221771ff1b30867835352a207e9f01e1e3bd --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/haskell.py @@ -0,0 +1,843 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.haskell + ~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for Haskell and related languages. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import Lexer, RegexLexer, bygroups, do_insertions, \ + default, include +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Generic +from pygments import unistring as uni + +__all__ = ['HaskellLexer', 'IdrisLexer', 'AgdaLexer', 'CryptolLexer', + 'LiterateHaskellLexer', 'LiterateIdrisLexer', 'LiterateAgdaLexer', + 'LiterateCryptolLexer', 'KokaLexer'] + + +line_re = re.compile('.*?\n') + + +class HaskellLexer(RegexLexer): + """ + A Haskell lexer based on the lexemes defined in the Haskell 98 Report. + + .. versionadded:: 0.8 + """ + name = 'Haskell' + aliases = ['haskell', 'hs'] + filenames = ['*.hs'] + mimetypes = ['text/x-haskell'] + + flags = re.MULTILINE | re.UNICODE + + reserved = ('case', 'class', 'data', 'default', 'deriving', 'do', 'else', + 'family', 'if', 'in', 'infix[lr]?', 'instance', + 'let', 'newtype', 'of', 'then', 'type', 'where', '_') + 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') + + tokens = { + 'root': [ + # Whitespace: + (r'\s+', Text), + # (r'--\s*|.*$', Comment.Doc), + (r'--(?![!#$%&*+./<=>?@^|_~:\\]).*?$', Comment.Single), + (r'\{-', Comment.Multiline, 'comment'), + # Lexemes: + # Identifiers + (r'\bimport\b', Keyword.Reserved, 'import'), + (r'\bmodule\b', Keyword.Reserved, 'module'), + (r'\berror\b', Name.Exception), + (r'\b(%s)(?!\')\b' % '|'.join(reserved), Keyword.Reserved), + (r"'[^\\]'", String.Char), # this has to come before the TH quote + (r'^[_' + uni.Ll + r'][\w\']*', Name.Function), + (r"'?[_" + uni.Ll + r"][\w']*", Name), + (r"('')?[" + uni.Lu + r"][\w\']*", Keyword.Type), + (r"(')[" + uni.Lu + r"][\w\']*", Keyword.Type), + (r"(')\[[^\]]*\]", Keyword.Type), # tuples and lists get special treatment in GHC + (r"(')\([^)]*\)", Keyword.Type), # .. + # Operators + (r'\\(?![:!#$%&*+.\\/<=>?@^|~-]+)', Name.Function), # lambda operator + (r'(<-|::|->|=>|=)(?![:!#$%&*+.\\/<=>?@^|~-]+)', Operator.Word), # specials + (r':[:!#$%&*+.\\/<=>?@^|~-]*', Keyword.Type), # Constructor operators + (r'[:!#$%&*+.\\/<=>?@^|~-]+', Operator), # Other operators + # Numbers + (r'\d+[eE][+-]?\d+', Number.Float), + (r'\d+\.\d+([eE][+-]?\d+)?', Number.Float), + (r'0[oO][0-7]+', Number.Oct), + (r'0[xX][\da-fA-F]+', Number.Hex), + (r'\d+', Number.Integer), + # Character/String Literals + (r"'", String.Char, 'character'), + (r'"', String, 'string'), + # Special + (r'\[\]', Keyword.Type), + (r'\(\)', Name.Builtin), + (r'[][(),;`{}]', Punctuation), + ], + 'import': [ + # Import statements + (r'\s+', Text), + (r'"', String, 'string'), + # after "funclist" state + (r'\)', Punctuation, '#pop'), + (r'qualified\b', Keyword), + # import X as Y + (r'([' + uni.Lu + r'][\w.]*)(\s+)(as)(\s+)([' + uni.Lu + r'][\w.]*)', + bygroups(Name.Namespace, Text, Keyword, Text, Name), '#pop'), + # import X hiding (functions) + (r'([' + uni.Lu + r'][\w.]*)(\s+)(hiding)(\s+)(\()', + bygroups(Name.Namespace, Text, Keyword, Text, Punctuation), 'funclist'), + # import X (functions) + (r'([' + uni.Lu + r'][\w.]*)(\s+)(\()', + bygroups(Name.Namespace, Text, Punctuation), 'funclist'), + # import X + (r'[\w.]+', Name.Namespace, '#pop'), + ], + 'module': [ + (r'\s+', Text), + (r'([' + uni.Lu + r'][\w.]*)(\s+)(\()', + bygroups(Name.Namespace, Text, Punctuation), 'funclist'), + (r'[' + uni.Lu + r'][\w.]*', Name.Namespace, '#pop'), + ], + 'funclist': [ + (r'\s+', Text), + (r'[' + uni.Lu + r']\w*', Keyword.Type), + (r'(_[\w\']+|[' + uni.Ll + r'][\w\']*)', Name.Function), + (r'--(?![!#$%&*+./<=>?@^|_~:\\]).*?$', Comment.Single), + (r'\{-', Comment.Multiline, 'comment'), + (r',', Punctuation), + (r'[:!#$%&*+.\\/<=>?@^|~-]+', Operator), + # (HACK, but it makes sense to push two instances, believe me) + (r'\(', Punctuation, ('funclist', 'funclist')), + (r'\)', Punctuation, '#pop:2'), + ], + # NOTE: the next four states are shared in the AgdaLexer; make sure + # any change is compatible with Agda as well or copy over and change + 'comment': [ + # Multiline Comments + (r'[^-{}]+', Comment.Multiline), + (r'\{-', Comment.Multiline, '#push'), + (r'-\}', Comment.Multiline, '#pop'), + (r'[-{}]', Comment.Multiline), + ], + '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+\\', String.Escape, '#pop'), + ], + } + + +class IdrisLexer(RegexLexer): + """ + A lexer for the dependently typed programming language Idris. + + Based on the Haskell and Agda Lexer. + + .. versionadded:: 2.0 + """ + name = 'Idris' + aliases = ['idris', 'idr'] + filenames = ['*.idr'] + mimetypes = ['text/x-idris'] + + reserved = ('case', 'class', 'data', 'default', 'using', 'do', 'else', + 'if', 'in', 'infix[lr]?', 'instance', 'rewrite', 'auto', + 'namespace', 'codata', 'mutual', 'private', 'public', 'abstract', + 'total', 'partial', + 'let', 'proof', 'of', 'then', 'static', 'where', '_', 'with', + 'pattern', 'term', 'syntax', 'prefix', + 'postulate', 'parameters', 'record', 'dsl', 'impossible', 'implicit', + 'tactics', 'intros', 'intro', 'compute', 'refine', 'exact', 'trivial') + + 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') + + directives = ('lib', 'link', 'flag', 'include', 'hide', 'freeze', 'access', + 'default', 'logging', 'dynamic', 'name', 'error_handlers', 'language') + + tokens = { + 'root': [ + # Comments + (r'^(\s*)(%%%s)' % '|'.join(directives), + bygroups(Text, Keyword.Reserved)), + (r'(\s*)(--(?![!#$%&*+./<=>?@^|_~:\\]).*?)$', bygroups(Text, Comment.Single)), + (r'(\s*)(\|{3}.*?)$', bygroups(Text, Comment.Single)), + (r'(\s*)(\{-)', bygroups(Text, Comment.Multiline), 'comment'), + # Declaration + (r'^(\s*)([^\s(){}]+)(\s*)(:)(\s*)', + bygroups(Text, Name.Function, Text, Operator.Word, Text)), + # Identifiers + (r'\b(%s)(?!\')\b' % '|'.join(reserved), Keyword.Reserved), + (r'(import|module)(\s+)', bygroups(Keyword.Reserved, Text), 'module'), + (r"('')?[A-Z][\w\']*", Keyword.Type), + (r'[a-z][\w\']*', Text), + # Special Symbols + (r'(<-|::|->|=>|=)', Operator.Word), # specials + (r'([(){}\[\]:!#$%&*+.\\/<=>?@^|~-]+)', Operator.Word), # specials + # Numbers + (r'\d+[eE][+-]?\d+', Number.Float), + (r'\d+\.\d+([eE][+-]?\d+)?', Number.Float), + (r'0[xX][\da-fA-F]+', Number.Hex), + (r'\d+', Number.Integer), + # Strings + (r"'", String.Char, 'character'), + (r'"', String, 'string'), + (r'[^\s(){}]+', Text), + (r'\s+?', Text), # Whitespace + ], + 'module': [ + (r'\s+', Text), + (r'([A-Z][\w.]*)(\s+)(\()', + bygroups(Name.Namespace, Text, Punctuation), 'funclist'), + (r'[A-Z][\w.]*', Name.Namespace, '#pop'), + ], + 'funclist': [ + (r'\s+', Text), + (r'[A-Z]\w*', Keyword.Type), + (r'(_[\w\']+|[a-z][\w\']*)', Name.Function), + (r'--.*$', Comment.Single), + (r'\{-', Comment.Multiline, 'comment'), + (r',', Punctuation), + (r'[:!#$%&*+.\\/<=>?@^|~-]+', Operator), + # (HACK, but it makes sense to push two instances, believe me) + (r'\(', Punctuation, ('funclist', 'funclist')), + (r'\)', Punctuation, '#pop:2'), + ], + # NOTE: the next four states are shared in the AgdaLexer; make sure + # any change is compatible with Agda as well or copy over and change + 'comment': [ + # Multiline Comments + (r'[^-{}]+', Comment.Multiline), + (r'\{-', Comment.Multiline, '#push'), + (r'-\}', Comment.Multiline, '#pop'), + (r'[-{}]', Comment.Multiline), + ], + 'character': [ + # Allows multi-chars, incorrectly. + (r"[^\\']", String.Char), + (r"\\", String.Escape, 'escape'), + ("'", String.Char, '#pop'), + ], + 'string': [ + (r'[^\\"]+', String), + (r"\\", String.Escape, 'escape'), + ('"', String, '#pop'), + ], + 'escape': [ + (r'[abfnrtv"\'&\\]', String.Escape, '#pop'), + (r'\^[][A-Z@^_]', 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+\\', String.Escape, '#pop') + ], + } + + +class AgdaLexer(RegexLexer): + """ + For the `Agda `_ + dependently typed functional programming language and proof assistant. + + .. versionadded:: 2.0 + """ + + name = 'Agda' + aliases = ['agda'] + filenames = ['*.agda'] + mimetypes = ['text/x-agda'] + + reserved = ['abstract', 'codata', 'coinductive', 'constructor', 'data', + 'field', 'forall', 'hiding', 'in', 'inductive', 'infix', + 'infixl', 'infixr', 'instance', 'let', 'mutual', 'open', + 'pattern', 'postulate', 'primitive', 'private', + 'quote', 'quoteGoal', 'quoteTerm', + 'record', 'renaming', 'rewrite', 'syntax', 'tactic', + 'unquote', 'unquoteDecl', 'using', 'where', 'with'] + + tokens = { + 'root': [ + # Declaration + (r'^(\s*)([^\s(){}]+)(\s*)(:)(\s*)', + bygroups(Text, Name.Function, Text, Operator.Word, Text)), + # Comments + (r'--(?![!#$%&*+./<=>?@^|_~:\\]).*?$', Comment.Single), + (r'\{-', Comment.Multiline, 'comment'), + # Holes + (r'\{!', Comment.Directive, 'hole'), + # Lexemes: + # Identifiers + (r'\b(%s)(?!\')\b' % '|'.join(reserved), Keyword.Reserved), + (r'(import|module)(\s+)', bygroups(Keyword.Reserved, Text), 'module'), + (r'\b(Set|Prop)\b', Keyword.Type), + # Special Symbols + (r'(\(|\)|\{|\})', Operator), + (u'(\\.{1,3}|\\||\u039B|\u2200|\u2192|:|=|->)', Operator.Word), + # Numbers + (r'\d+[eE][+-]?\d+', Number.Float), + (r'\d+\.\d+([eE][+-]?\d+)?', Number.Float), + (r'0[xX][\da-fA-F]+', Number.Hex), + (r'\d+', Number.Integer), + # Strings + (r"'", String.Char, 'character'), + (r'"', String, 'string'), + (r'[^\s(){}]+', Text), + (r'\s+?', Text), # Whitespace + ], + 'hole': [ + # Holes + (r'[^!{}]+', Comment.Directive), + (r'\{!', Comment.Directive, '#push'), + (r'!\}', Comment.Directive, '#pop'), + (r'[!{}]', Comment.Directive), + ], + 'module': [ + (r'\{-', Comment.Multiline, 'comment'), + (r'[a-zA-Z][\w.]*', Name, '#pop'), + (r'[\W0-9_]+', Text) + ], + 'comment': HaskellLexer.tokens['comment'], + 'character': HaskellLexer.tokens['character'], + 'string': HaskellLexer.tokens['string'], + 'escape': HaskellLexer.tokens['escape'] + } + + +class CryptolLexer(RegexLexer): + """ + FIXME: A Cryptol2 lexer based on the lexemes defined in the Haskell 98 Report. + + .. versionadded:: 2.0 + """ + name = 'Cryptol' + aliases = ['cryptol', 'cry'] + filenames = ['*.cry'] + mimetypes = ['text/x-cryptol'] + + reserved = ('Arith', 'Bit', 'Cmp', 'False', 'Inf', 'True', 'else', + 'export', 'extern', 'fin', 'if', 'import', 'inf', 'lg2', + 'max', 'min', 'module', 'newtype', 'pragma', 'property', + 'then', 'type', 'where', 'width') + 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') + + tokens = { + 'root': [ + # Whitespace: + (r'\s+', Text), + # (r'--\s*|.*$', Comment.Doc), + (r'//.*$', Comment.Single), + (r'/\*', Comment.Multiline, 'comment'), + # Lexemes: + # Identifiers + (r'\bimport\b', Keyword.Reserved, 'import'), + (r'\bmodule\b', Keyword.Reserved, 'module'), + (r'\berror\b', Name.Exception), + (r'\b(%s)(?!\')\b' % '|'.join(reserved), Keyword.Reserved), + (r'^[_a-z][\w\']*', Name.Function), + (r"'?[_a-z][\w']*", Name), + (r"('')?[A-Z][\w\']*", Keyword.Type), + # Operators + (r'\\(?![:!#$%&*+.\\/<=>?@^|~-]+)', Name.Function), # lambda operator + (r'(<-|::|->|=>|=)(?![:!#$%&*+.\\/<=>?@^|~-]+)', Operator.Word), # specials + (r':[:!#$%&*+.\\/<=>?@^|~-]*', Keyword.Type), # Constructor operators + (r'[:!#$%&*+.\\/<=>?@^|~-]+', Operator), # Other operators + # Numbers + (r'\d+[eE][+-]?\d+', Number.Float), + (r'\d+\.\d+([eE][+-]?\d+)?', Number.Float), + (r'0[oO][0-7]+', Number.Oct), + (r'0[xX][\da-fA-F]+', Number.Hex), + (r'\d+', Number.Integer), + # Character/String Literals + (r"'", String.Char, 'character'), + (r'"', String, 'string'), + # Special + (r'\[\]', Keyword.Type), + (r'\(\)', Name.Builtin), + (r'[][(),;`{}]', Punctuation), + ], + 'import': [ + # Import statements + (r'\s+', Text), + (r'"', String, 'string'), + # after "funclist" state + (r'\)', Punctuation, '#pop'), + (r'qualified\b', Keyword), + # import X as Y + (r'([A-Z][\w.]*)(\s+)(as)(\s+)([A-Z][\w.]*)', + bygroups(Name.Namespace, Text, Keyword, Text, Name), '#pop'), + # import X hiding (functions) + (r'([A-Z][\w.]*)(\s+)(hiding)(\s+)(\()', + bygroups(Name.Namespace, Text, Keyword, Text, Punctuation), 'funclist'), + # import X (functions) + (r'([A-Z][\w.]*)(\s+)(\()', + bygroups(Name.Namespace, Text, Punctuation), 'funclist'), + # import X + (r'[\w.]+', Name.Namespace, '#pop'), + ], + 'module': [ + (r'\s+', Text), + (r'([A-Z][\w.]*)(\s+)(\()', + bygroups(Name.Namespace, Text, Punctuation), 'funclist'), + (r'[A-Z][\w.]*', Name.Namespace, '#pop'), + ], + 'funclist': [ + (r'\s+', Text), + (r'[A-Z]\w*', Keyword.Type), + (r'(_[\w\']+|[a-z][\w\']*)', Name.Function), + # TODO: these don't match the comments in docs, remove. + #(r'--(?![!#$%&*+./<=>?@^|_~:\\]).*?$', Comment.Single), + #(r'{-', Comment.Multiline, 'comment'), + (r',', Punctuation), + (r'[:!#$%&*+.\\/<=>?@^|~-]+', Operator), + # (HACK, but it makes sense to push two instances, believe me) + (r'\(', Punctuation, ('funclist', 'funclist')), + (r'\)', Punctuation, '#pop:2'), + ], + 'comment': [ + # Multiline Comments + (r'[^/*]+', Comment.Multiline), + (r'/\*', Comment.Multiline, '#push'), + (r'\*/', Comment.Multiline, '#pop'), + (r'[*/]', Comment.Multiline), + ], + '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'\^[][A-Z@^_]', 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+\\', String.Escape, '#pop'), + ], + } + + EXTRA_KEYWORDS = set(('join', 'split', 'reverse', 'transpose', 'width', + 'length', 'tail', '<<', '>>', '<<<', '>>>', 'const', + 'reg', 'par', 'seq', 'ASSERT', 'undefined', 'error', + 'trace')) + + def get_tokens_unprocessed(self, text): + stack = ['root'] + for index, token, value in \ + RegexLexer.get_tokens_unprocessed(self, text, stack): + if token is Name and value in self.EXTRA_KEYWORDS: + yield index, Name.Builtin, value + else: + yield index, token, value + + +class LiterateLexer(Lexer): + """ + Base class for lexers of literate file formats based on LaTeX or Bird-style + (prefixing each code line with ">"). + + Additional options accepted: + + `litstyle` + If given, must be ``"bird"`` or ``"latex"``. If not given, the style + is autodetected: if the first non-whitespace character in the source + is a backslash or percent character, LaTeX is assumed, else Bird. + """ + + bird_re = re.compile(r'(>[ \t]*)(.*\n)') + + def __init__(self, baselexer, **options): + self.baselexer = baselexer + Lexer.__init__(self, **options) + + def get_tokens_unprocessed(self, text): + style = self.options.get('litstyle') + if style is None: + style = (text.lstrip()[0:1] in '%\\') and 'latex' or 'bird' + + code = '' + insertions = [] + if style == 'bird': + # bird-style + for match in line_re.finditer(text): + line = match.group() + m = self.bird_re.match(line) + if m: + insertions.append((len(code), + [(0, Comment.Special, m.group(1))])) + code += m.group(2) + else: + insertions.append((len(code), [(0, Text, line)])) + else: + # latex-style + from pygments.lexers.markup import TexLexer + lxlexer = TexLexer(**self.options) + codelines = 0 + latex = '' + for match in line_re.finditer(text): + line = match.group() + if codelines: + if line.lstrip().startswith('\\end{code}'): + codelines = 0 + latex += line + else: + code += line + elif line.lstrip().startswith('\\begin{code}'): + codelines = 1 + latex += line + insertions.append((len(code), + list(lxlexer.get_tokens_unprocessed(latex)))) + latex = '' + else: + latex += line + insertions.append((len(code), + list(lxlexer.get_tokens_unprocessed(latex)))) + for item in do_insertions(insertions, self.baselexer.get_tokens_unprocessed(code)): + yield item + + +class LiterateHaskellLexer(LiterateLexer): + """ + For Literate Haskell (Bird-style or LaTeX) source. + + Additional options accepted: + + `litstyle` + If given, must be ``"bird"`` or ``"latex"``. If not given, the style + is autodetected: if the first non-whitespace character in the source + is a backslash or percent character, LaTeX is assumed, else Bird. + + .. versionadded:: 0.9 + """ + name = 'Literate Haskell' + aliases = ['lhs', 'literate-haskell', 'lhaskell'] + filenames = ['*.lhs'] + mimetypes = ['text/x-literate-haskell'] + + def __init__(self, **options): + hslexer = HaskellLexer(**options) + LiterateLexer.__init__(self, hslexer, **options) + + +class LiterateIdrisLexer(LiterateLexer): + """ + For Literate Idris (Bird-style or LaTeX) source. + + Additional options accepted: + + `litstyle` + If given, must be ``"bird"`` or ``"latex"``. If not given, the style + is autodetected: if the first non-whitespace character in the source + is a backslash or percent character, LaTeX is assumed, else Bird. + + .. versionadded:: 2.0 + """ + name = 'Literate Idris' + aliases = ['lidr', 'literate-idris', 'lidris'] + filenames = ['*.lidr'] + mimetypes = ['text/x-literate-idris'] + + def __init__(self, **options): + hslexer = IdrisLexer(**options) + LiterateLexer.__init__(self, hslexer, **options) + + +class LiterateAgdaLexer(LiterateLexer): + """ + For Literate Agda source. + + Additional options accepted: + + `litstyle` + If given, must be ``"bird"`` or ``"latex"``. If not given, the style + is autodetected: if the first non-whitespace character in the source + is a backslash or percent character, LaTeX is assumed, else Bird. + + .. versionadded:: 2.0 + """ + name = 'Literate Agda' + aliases = ['lagda', 'literate-agda'] + filenames = ['*.lagda'] + mimetypes = ['text/x-literate-agda'] + + def __init__(self, **options): + agdalexer = AgdaLexer(**options) + LiterateLexer.__init__(self, agdalexer, litstyle='latex', **options) + + +class LiterateCryptolLexer(LiterateLexer): + """ + For Literate Cryptol (Bird-style or LaTeX) source. + + Additional options accepted: + + `litstyle` + If given, must be ``"bird"`` or ``"latex"``. If not given, the style + is autodetected: if the first non-whitespace character in the source + is a backslash or percent character, LaTeX is assumed, else Bird. + + .. versionadded:: 2.0 + """ + name = 'Literate Cryptol' + aliases = ['lcry', 'literate-cryptol', 'lcryptol'] + filenames = ['*.lcry'] + mimetypes = ['text/x-literate-cryptol'] + + def __init__(self, **options): + crylexer = CryptolLexer(**options) + LiterateLexer.__init__(self, crylexer, **options) + + +class KokaLexer(RegexLexer): + """ + Lexer for the `Koka `_ + language. + + .. versionadded:: 1.6 + """ + + name = 'Koka' + aliases = ['koka'] + filenames = ['*.kk', '*.kki'] + mimetypes = ['text/x-koka'] + + keywords = [ + 'infix', 'infixr', 'infixl', + 'type', 'cotype', 'rectype', 'alias', + 'struct', 'con', + 'fun', 'function', 'val', 'var', + 'external', + 'if', 'then', 'else', 'elif', 'return', 'match', + 'private', 'public', 'private', + 'module', 'import', 'as', + 'include', 'inline', + 'rec', + 'try', 'yield', 'enum', + 'interface', 'instance', + ] + + # keywords that are followed by a type + typeStartKeywords = [ + 'type', 'cotype', 'rectype', 'alias', 'struct', 'enum', + ] + + # keywords valid in a type + typekeywords = [ + 'forall', 'exists', 'some', 'with', + ] + + # builtin names and special names + builtin = [ + 'for', 'while', 'repeat', + 'foreach', 'foreach-indexed', + 'error', 'catch', 'finally', + 'cs', 'js', 'file', 'ref', 'assigned', + ] + + # symbols that can be in an operator + symbols = r'[$%&*+@!/\\^~=.:\-?|<>]+' + + # symbol boundary: an operator keyword should not be followed by any of these + sboundary = '(?!'+symbols+')' + + # name boundary: a keyword should not be followed by any of these + boundary = '(?![\w/])' + + # koka token abstractions + tokenType = Name.Attribute + tokenTypeDef = Name.Class + tokenConstructor = Generic.Emph + + # main lexer + tokens = { + 'root': [ + include('whitespace'), + + # go into type mode + (r'::?' + sboundary, tokenType, 'type'), + (r'(alias)(\s+)([a-z]\w*)?', bygroups(Keyword, Text, tokenTypeDef), + 'alias-type'), + (r'(struct)(\s+)([a-z]\w*)?', bygroups(Keyword, Text, tokenTypeDef), + 'struct-type'), + ((r'(%s)' % '|'.join(typeStartKeywords)) + + r'(\s+)([a-z]\w*)?', bygroups(Keyword, Text, tokenTypeDef), + 'type'), + + # special sequences of tokens (we use ?: for non-capturing group as + # required by 'bygroups') + (r'(module)(\s+)(interface\s+)?((?:[a-z]\w*/)*[a-z]\w*)', + bygroups(Keyword, Text, Keyword, Name.Namespace)), + (r'(import)(\s+)((?:[a-z]\w*/)*[a-z]\w*)' + r'(?:(\s*)(=)(\s*)((?:qualified\s*)?)' + r'((?:[a-z]\w*/)*[a-z]\w*))?', + bygroups(Keyword, Text, Name.Namespace, Text, Keyword, Text, + Keyword, Name.Namespace)), + + (r'(^(?:(?:public|private)\s*)?(?:function|fun|val))' + r'(\s+)([a-z]\w*|\((?:' + symbols + r'|/)\))', + bygroups(Keyword, Text, Name.Function)), + (r'(^(?:(?:public|private)\s*)?external)(\s+)(inline\s+)?' + r'([a-z]\w*|\((?:' + symbols + r'|/)\))', + bygroups(Keyword, Text, Keyword, Name.Function)), + + # keywords + (r'(%s)' % '|'.join(typekeywords) + boundary, Keyword.Type), + (r'(%s)' % '|'.join(keywords) + boundary, Keyword), + (r'(%s)' % '|'.join(builtin) + boundary, Keyword.Pseudo), + (r'::?|:=|\->|[=.]' + sboundary, Keyword), + + # names + (r'((?:[a-z]\w*/)*)([A-Z]\w*)', + bygroups(Name.Namespace, tokenConstructor)), + (r'((?:[a-z]\w*/)*)([a-z]\w*)', bygroups(Name.Namespace, Name)), + (r'((?:[a-z]\w*/)*)(\((?:' + symbols + r'|/)\))', + bygroups(Name.Namespace, Name)), + (r'_\w*', Name.Variable), + + # literal string + (r'@"', String.Double, 'litstring'), + + # operators + (symbols + "|/(?![*/])", Operator), + (r'`', Operator), + (r'[{}()\[\];,]', Punctuation), + + # literals. No check for literal characters with len > 1 + (r'[0-9]+\.[0-9]+([eE][\-+]?[0-9]+)?', Number.Float), + (r'0[xX][0-9a-fA-F]+', Number.Hex), + (r'[0-9]+', Number.Integer), + + (r"'", String.Char, 'char'), + (r'"', String.Double, 'string'), + ], + + # type started by alias + 'alias-type': [ + (r'=', Keyword), + include('type') + ], + + # type started by struct + 'struct-type': [ + (r'(?=\((?!,*\)))', Punctuation, '#pop'), + include('type') + ], + + # type started by colon + 'type': [ + (r'[(\[<]', tokenType, 'type-nested'), + include('type-content') + ], + + # type nested in brackets: can contain parameters, comma etc. + 'type-nested': [ + (r'[)\]>]', tokenType, '#pop'), + (r'[(\[<]', tokenType, 'type-nested'), + (r',', tokenType), + (r'([a-z]\w*)(\s*)(:)(?!:)', + bygroups(Name, Text, tokenType)), # parameter name + include('type-content') + ], + + # shared contents of a type + 'type-content': [ + include('whitespace'), + + # keywords + (r'(%s)' % '|'.join(typekeywords) + boundary, Keyword), + (r'(?=((%s)' % '|'.join(keywords) + boundary + '))', + Keyword, '#pop'), # need to match because names overlap... + + # kinds + (r'[EPHVX]' + boundary, tokenType), + + # type names + (r'[a-z][0-9]*(?![\w/])', tokenType), + (r'_\w*', tokenType.Variable), # Generic.Emph + (r'((?:[a-z]\w*/)*)([A-Z]\w*)', + bygroups(Name.Namespace, tokenType)), + (r'((?:[a-z]\w*/)*)([a-z]\w+)', + bygroups(Name.Namespace, tokenType)), + + # type keyword operators + (r'::|->|[.:|]', tokenType), + + # catchall + default('#pop') + ], + + # comments and literals + 'whitespace': [ + (r'\n\s*#.*$', Comment.Preproc), + (r'\s+', Text), + (r'/\*', Comment.Multiline, 'comment'), + (r'//.*$', Comment.Single) + ], + 'comment': [ + (r'[^/*]+', Comment.Multiline), + (r'/\*', Comment.Multiline, '#push'), + (r'\*/', Comment.Multiline, '#pop'), + (r'[*/]', Comment.Multiline), + ], + 'litstring': [ + (r'[^"]+', String.Double), + (r'""', String.Escape), + (r'"', String.Double, '#pop'), + ], + 'string': [ + (r'[^\\"\n]+', String.Double), + include('escape-sequence'), + (r'["\n]', String.Double, '#pop'), + ], + 'char': [ + (r'[^\\\'\n]+', String.Char), + include('escape-sequence'), + (r'[\'\n]', String.Char, '#pop'), + ], + 'escape-sequence': [ + (r'\\[nrt\\"\']', String.Escape), + (r'\\x[0-9a-fA-F]{2}', String.Escape), + (r'\\u[0-9a-fA-F]{4}', String.Escape), + # Yes, \U literals are 6 hex digits. + (r'\\U[0-9a-fA-F]{6}', String.Escape) + ] + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/igor.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/igor.py new file mode 100644 index 0000000000000000000000000000000000000000..1a21fe878967fa58131061d5b0ad2d5c62503ffb --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/igor.py @@ -0,0 +1,288 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.igor + ~~~~~~~~~~~~~~~~~~~~ + + Lexers for Igor Pro. + + :copyright: Copyright 2006-2017 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, Keyword, Name, String + +__all__ = ['IgorLexer'] + + +class IgorLexer(RegexLexer): + """ + Pygments Lexer for Igor Pro procedure files (.ipf). + See http://www.wavemetrics.com/ and http://www.igorexchange.com/. + + .. versionadded:: 2.0 + """ + + name = 'Igor' + aliases = ['igor', 'igorpro'] + filenames = ['*.ipf'] + mimetypes = ['text/ipf'] + + flags = re.IGNORECASE | re.MULTILINE + + flowControl = ( + 'if', 'else', 'elseif', 'endif', 'for', 'endfor', 'strswitch', 'switch', + 'case', 'default', 'endswitch', 'do', 'while', 'try', 'catch', 'endtry', + 'break', 'continue', 'return', 'AbortOnRTE', 'AbortOnValue' + ) + types = ( + 'variable', 'string', 'constant', 'strconstant', 'NVAR', 'SVAR', 'WAVE', + 'STRUCT', 'dfref', 'funcref', 'char', 'uchar', 'int16', 'uint16', 'int32', + 'uint32', 'int64', 'uint64', 'float', 'double' + ) + keywords = ( + 'override', 'ThreadSafe', 'MultiThread', 'static', 'Proc', + 'Picture', 'Prompt', 'DoPrompt', 'macro', 'window', 'function', 'end', + 'Structure', 'EndStructure', 'EndMacro', 'Menu', 'SubMenu' + ) + operations = ( + 'Abort', 'AddFIFOData', 'AddFIFOVectData', 'AddMovieAudio', 'AddMovieFrame', + 'AdoptFiles', 'APMath', 'Append', 'AppendImage', 'AppendLayoutObject', + 'AppendMatrixContour', 'AppendText', 'AppendToGizmo', 'AppendToGraph', + 'AppendToLayout', 'AppendToTable', 'AppendXYZContour', 'AutoPositionWindow', + 'BackgroundInfo', 'Beep', 'BoundingBall', 'BoxSmooth', 'BrowseURL', 'BuildMenu', + 'Button', 'cd', 'Chart', 'CheckBox', 'CheckDisplayed', 'ChooseColor', 'Close', + 'CloseHelp', 'CloseMovie', 'CloseProc', 'ColorScale', 'ColorTab2Wave', + 'Concatenate', 'ControlBar', 'ControlInfo', 'ControlUpdate', + 'ConvertGlobalStringTextEncoding', 'ConvexHull', 'Convolve', 'CopyFile', + 'CopyFolder', 'CopyScales', 'Correlate', 'CreateAliasShortcut', 'CreateBrowser', + 'Cross', 'CtrlBackground', 'CtrlFIFO', 'CtrlNamedBackground', 'Cursor', + 'CurveFit', 'CustomControl', 'CWT', 'Debugger', 'DebuggerOptions', 'DefaultFont', + 'DefaultGuiControls', 'DefaultGuiFont', 'DefaultTextEncoding', 'DefineGuide', + 'DelayUpdate', 'DeleteAnnotations', 'DeleteFile', 'DeleteFolder', 'DeletePoints', + 'Differentiate', 'dir', 'Display', 'DisplayHelpTopic', 'DisplayProcedure', + 'DoAlert', 'DoIgorMenu', 'DoUpdate', 'DoWindow', 'DoXOPIdle', 'DPSS', + 'DrawAction', 'DrawArc', 'DrawBezier', 'DrawLine', 'DrawOval', 'DrawPICT', + 'DrawPoly', 'DrawRect', 'DrawRRect', 'DrawText', 'DrawUserShape', 'DSPDetrend', + 'DSPPeriodogram', 'Duplicate', 'DuplicateDataFolder', 'DWT', 'EdgeStats', 'Edit', + 'ErrorBars', 'EstimatePeakSizes', 'Execute', 'ExecuteScriptText', + 'ExperimentModified', 'ExportGizmo', 'Extract', 'FastGaussTransform', 'FastOp', + 'FBinRead', 'FBinWrite', 'FFT', 'FIFOStatus', 'FIFO2Wave', 'FilterFIR', + 'FilterIIR', 'FindAPeak', 'FindContour', 'FindDuplicates', 'FindLevel', + 'FindLevels', 'FindPeak', 'FindPointsInPoly', 'FindRoots', 'FindSequence', + 'FindValue', 'FPClustering', 'fprintf', 'FReadLine', 'FSetPos', 'FStatus', + 'FTPCreateDirectory', 'FTPDelete', 'FTPDownload', 'FTPUpload', 'FuncFit', + 'FuncFitMD', 'GBLoadWave', 'GetAxis', 'GetCamera', 'GetFileFolderInfo', + 'GetGizmo', 'GetLastUserMenuInfo', 'GetMarquee', 'GetMouse', 'GetSelection', + 'GetWindow', 'GPIBReadBinaryWave2', 'GPIBReadBinary2', 'GPIBReadWave2', + 'GPIBRead2', 'GPIBWriteBinaryWave2', 'GPIBWriteBinary2', 'GPIBWriteWave2', + 'GPIBWrite2', 'GPIB2', 'GraphNormal', 'GraphWaveDraw', 'GraphWaveEdit', 'Grep', + 'GroupBox', 'Hanning', 'HDF5CloseFile', 'HDF5CloseGroup', 'HDF5ConvertColors', + 'HDF5CreateFile', 'HDF5CreateGroup', 'HDF5CreateLink', 'HDF5Dump', + 'HDF5DumpErrors', 'HDF5DumpState', 'HDF5ListAttributes', 'HDF5ListGroup', + 'HDF5LoadData', 'HDF5LoadGroup', 'HDF5LoadImage', 'HDF5OpenFile', 'HDF5OpenGroup', + 'HDF5SaveData', 'HDF5SaveGroup', 'HDF5SaveImage', 'HDF5TestOperation', + 'HDF5UnlinkObject', 'HideIgorMenus', 'HideInfo', 'HideProcedures', 'HideTools', + 'HilbertTransform', 'Histogram', 'ICA', 'IFFT', 'ImageAnalyzeParticles', + 'ImageBlend', 'ImageBoundaryToMask', 'ImageEdgeDetection', 'ImageFileInfo', + 'ImageFilter', 'ImageFocus', 'ImageFromXYZ', 'ImageGenerateROIMask', 'ImageGLCM', + 'ImageHistModification', 'ImageHistogram', 'ImageInterpolate', 'ImageLineProfile', + 'ImageLoad', 'ImageMorphology', 'ImageRegistration', 'ImageRemoveBackground', + 'ImageRestore', 'ImageRotate', 'ImageSave', 'ImageSeedFill', 'ImageSkeleton3d', + 'ImageSnake', 'ImageStats', 'ImageThreshold', 'ImageTransform', + 'ImageUnwrapPhase', 'ImageWindow', 'IndexSort', 'InsertPoints', 'Integrate', + 'IntegrateODE', 'Integrate2D', 'Interpolate2', 'Interpolate3D', 'Interp3DPath', + 'JCAMPLoadWave', 'JointHistogram', 'KillBackground', 'KillControl', + 'KillDataFolder', 'KillFIFO', 'KillFreeAxis', 'KillPath', 'KillPICTs', + 'KillStrings', 'KillVariables', 'KillWaves', 'KillWindow', 'KMeans', 'Label', + 'Layout', 'LayoutPageAction', 'LayoutSlideShow', 'Legend', + 'LinearFeedbackShiftRegister', 'ListBox', 'LoadData', 'LoadPackagePreferences', + 'LoadPICT', 'LoadWave', 'Loess', 'LombPeriodogram', 'Make', 'MakeIndex', + 'MarkPerfTestTime', 'MatrixConvolve', 'MatrixCorr', 'MatrixEigenV', + 'MatrixFilter', 'MatrixGaussJ', 'MatrixGLM', 'MatrixInverse', 'MatrixLinearSolve', + 'MatrixLinearSolveTD', 'MatrixLLS', 'MatrixLUBkSub', 'MatrixLUD', 'MatrixLUDTD', + 'MatrixMultiply', 'MatrixOP', 'MatrixSchur', 'MatrixSolve', 'MatrixSVBkSub', + 'MatrixSVD', 'MatrixTranspose', 'MeasureStyledText', 'MLLoadWave', 'Modify', + 'ModifyBrowser', 'ModifyCamera', 'ModifyContour', 'ModifyControl', + 'ModifyControlList', 'ModifyFreeAxis', 'ModifyGizmo', 'ModifyGraph', + 'ModifyImage', 'ModifyLayout', 'ModifyPanel', 'ModifyTable', 'ModifyWaterfall', + 'MoveDataFolder', 'MoveFile', 'MoveFolder', 'MoveString', 'MoveSubwindow', + 'MoveVariable', 'MoveWave', 'MoveWindow', 'MultiTaperPSD', + 'MultiThreadingControl', 'NeuralNetworkRun', 'NeuralNetworkTrain', 'NewCamera', + 'NewDataFolder', 'NewFIFO', 'NewFIFOChan', 'NewFreeAxis', 'NewGizmo', 'NewImage', + 'NewLayout', 'NewMovie', 'NewNotebook', 'NewPanel', 'NewPath', 'NewWaterfall', + 'NI4882', 'Note', 'Notebook', 'NotebookAction', 'Open', 'OpenHelp', + 'OpenNotebook', 'Optimize', 'ParseOperationTemplate', 'PathInfo', 'PauseForUser', + 'PauseUpdate', 'PCA', 'PlayMovie', 'PlayMovieAction', 'PlaySound', + 'PopupContextualMenu', 'PopupMenu', 'Preferences', 'PrimeFactors', 'Print', + 'printf', 'PrintGraphs', 'PrintLayout', 'PrintNotebook', 'PrintSettings', + 'PrintTable', 'Project', 'PulseStats', 'PutScrapText', 'pwd', 'Quit', + 'RatioFromNumber', 'Redimension', 'Remove', 'RemoveContour', 'RemoveFromGizmo', + 'RemoveFromGraph', 'RemoveFromLayout', 'RemoveFromTable', 'RemoveImage', + 'RemoveLayoutObjects', 'RemovePath', 'Rename', 'RenameDataFolder', 'RenamePath', + 'RenamePICT', 'RenameWindow', 'ReorderImages', 'ReorderTraces', 'ReplaceText', + 'ReplaceWave', 'Resample', 'ResumeUpdate', 'Reverse', 'Rotate', 'Save', + 'SaveData', 'SaveExperiment', 'SaveGraphCopy', 'SaveNotebook', + 'SavePackagePreferences', 'SavePICT', 'SaveTableCopy', 'SetActiveSubwindow', + 'SetAxis', 'SetBackground', 'SetDashPattern', 'SetDataFolder', 'SetDimLabel', + 'SetDrawEnv', 'SetDrawLayer', 'SetFileFolderInfo', 'SetFormula', 'SetIgorHook', + 'SetIgorMenuMode', 'SetIgorOption', 'SetMarquee', 'SetProcessSleep', + 'SetRandomSeed', 'SetScale', 'SetVariable', 'SetWaveLock', 'SetWaveTextEncoding', + 'SetWindow', 'ShowIgorMenus', 'ShowInfo', 'ShowTools', 'Silent', 'Sleep', + 'Slider', 'Smooth', 'SmoothCustom', 'Sort', 'SortColumns', 'SoundInRecord', + 'SoundInSet', 'SoundInStartChart', 'SoundInStatus', 'SoundInStopChart', + 'SoundLoadWave', 'SoundSaveWave', 'SphericalInterpolate', 'SphericalTriangulate', + 'SplitString', 'SplitWave', 'sprintf', 'sscanf', 'Stack', 'StackWindows', + 'StatsAngularDistanceTest', 'StatsANOVA1Test', 'StatsANOVA2NRTest', + 'StatsANOVA2RMTest', 'StatsANOVA2Test', 'StatsChiTest', + 'StatsCircularCorrelationTest', 'StatsCircularMeans', 'StatsCircularMoments', + 'StatsCircularTwoSampleTest', 'StatsCochranTest', 'StatsContingencyTable', + 'StatsDIPTest', 'StatsDunnettTest', 'StatsFriedmanTest', 'StatsFTest', + 'StatsHodgesAjneTest', 'StatsJBTest', 'StatsKDE', 'StatsKendallTauTest', + 'StatsKSTest', 'StatsKWTest', 'StatsLinearCorrelationTest', + 'StatsLinearRegression', 'StatsMultiCorrelationTest', 'StatsNPMCTest', + 'StatsNPNominalSRTest', 'StatsQuantiles', 'StatsRankCorrelationTest', + 'StatsResample', 'StatsSample', 'StatsScheffeTest', 'StatsShapiroWilkTest', + 'StatsSignTest', 'StatsSRTest', 'StatsTTest', 'StatsTukeyTest', + 'StatsVariancesTest', 'StatsWatsonUSquaredTest', 'StatsWatsonWilliamsTest', + 'StatsWheelerWatsonTest', 'StatsWilcoxonRankTest', 'StatsWRCorrelationTest', + 'String', 'StructGet', 'StructPut', 'SumDimension', 'SumSeries', 'TabControl', + 'Tag', 'TextBox', 'ThreadGroupPutDF', 'ThreadStart', 'Tile', 'TileWindows', + 'TitleBox', 'ToCommandLine', 'ToolsGrid', 'Triangulate3d', 'Unwrap', 'URLRequest', + 'ValDisplay', 'Variable', 'VDTClosePort2', 'VDTGetPortList2', 'VDTGetStatus2', + 'VDTOpenPort2', 'VDTOperationsPort2', 'VDTReadBinaryWave2', 'VDTReadBinary2', + 'VDTReadHexWave2', 'VDTReadHex2', 'VDTReadWave2', 'VDTRead2', 'VDTTerminalPort2', + 'VDTWriteBinaryWave2', 'VDTWriteBinary2', 'VDTWriteHexWave2', 'VDTWriteHex2', + 'VDTWriteWave2', 'VDTWrite2', 'VDT2', 'WaveMeanStdv', 'WaveStats', + 'WaveTransform', 'wfprintf', 'WignerTransform', 'WindowFunction', 'XLLoadWave' + ) + functions = ( + 'abs', 'acos', 'acosh', 'AddListItem', 'AiryA', 'AiryAD', 'AiryB', 'AiryBD', + 'alog', 'AnnotationInfo', 'AnnotationList', 'area', 'areaXY', 'asin', 'asinh', + 'atan', 'atanh', 'atan2', 'AxisInfo', 'AxisList', 'AxisValFromPixel', 'Besseli', + 'Besselj', 'Besselk', 'Bessely', 'beta', 'betai', 'BinarySearch', + 'BinarySearchInterp', 'binomial', 'binomialln', 'binomialNoise', 'cabs', + 'CaptureHistory', 'CaptureHistoryStart', 'ceil', 'cequal', 'char2num', + 'chebyshev', 'chebyshevU', 'CheckName', 'ChildWindowList', 'CleanupName', 'cmplx', + 'cmpstr', 'conj', 'ContourInfo', 'ContourNameList', 'ContourNameToWaveRef', + 'ContourZ', 'ControlNameList', 'ConvertTextEncoding', 'cos', 'cosh', + 'cosIntegral', 'cot', 'coth', 'CountObjects', 'CountObjectsDFR', 'cpowi', + 'CreationDate', 'csc', 'csch', 'CsrInfo', 'CsrWave', 'CsrWaveRef', 'CsrXWave', + 'CsrXWaveRef', 'CTabList', 'DataFolderDir', 'DataFolderExists', + 'DataFolderRefsEqual', 'DataFolderRefStatus', 'date', 'datetime', 'DateToJulian', + 'date2secs', 'Dawson', 'DDERequestString', 'defined', 'deltax', 'digamma', + 'dilogarithm', 'DimDelta', 'DimOffset', 'DimSize', 'ei', 'enoise', 'equalWaves', + 'erf', 'erfc', 'erfcw', 'exists', 'exp', 'ExpConvExp', 'ExpConvExpFit', + 'ExpConvExpFitBL', 'ExpConvExpFit1Shape', 'ExpConvExpFit1ShapeBL', 'ExpGauss', + 'ExpGaussFit', 'ExpGaussFitBL', 'ExpGaussFit1Shape', 'ExpGaussFit1ShapeBL', + 'expInt', 'expIntegralE1', 'expNoise', 'factorial', 'fakedata', 'faverage', + 'faverageXY', 'FetchURL', 'FindDimLabel', 'FindListItem', 'floor', 'FontList', + 'FontSizeHeight', 'FontSizeStringWidth', 'FresnelCos', 'FresnelSin', + 'FuncRefInfo', 'FunctionInfo', 'FunctionList', 'FunctionPath', 'gamma', + 'gammaEuler', 'gammaInc', 'gammaNoise', 'gammln', 'gammp', 'gammq', 'Gauss', + 'GaussFit', 'GaussFitBL', 'GaussFit1Width', 'GaussFit1WidthBL', 'Gauss1D', + 'Gauss2D', 'gcd', 'GetBrowserLine', 'GetBrowserSelection', 'GetDataFolder', + 'GetDataFolderDFR', 'GetDefaultFont', 'GetDefaultFontSize', 'GetDefaultFontStyle', + 'GetDimLabel', 'GetEnvironmentVariable', 'GetErrMessage', 'GetFormula', + 'GetIndependentModuleName', 'GetIndexedObjName', 'GetIndexedObjNameDFR', + 'GetKeyState', 'GetRTErrMessage', 'GetRTError', 'GetRTLocation', 'GetRTLocInfo', + 'GetRTStackInfo', 'GetScrapText', 'GetUserData', 'GetWavesDataFolder', + 'GetWavesDataFolderDFR', 'GizmoInfo', 'GizmoScale', 'gnoise', 'GrepList', + 'GrepString', 'GuideInfo', 'GuideNameList', 'Hash', 'hcsr', 'HDF5AttributeInfo', + 'HDF5DatasetInfo', 'HDF5LibraryInfo', 'HDF5TypeInfo', 'hermite', 'hermiteGauss', + 'HyperGNoise', 'HyperGPFQ', 'HyperG0F1', 'HyperG1F1', 'HyperG2F1', 'IgorInfo', + 'IgorVersion', 'imag', 'ImageInfo', 'ImageNameList', 'ImageNameToWaveRef', + 'IndependentModuleList', 'IndexedDir', 'IndexedFile', 'Inf', 'Integrate1D', + 'interp', 'Interp2D', 'Interp3D', 'inverseERF', 'inverseERFC', 'ItemsInList', + 'JacobiCn', 'JacobiSn', 'JulianToDate', 'Laguerre', 'LaguerreA', 'LaguerreGauss', + 'LambertW', 'LayoutInfo', 'leftx', 'LegendreA', 'limit', 'ListMatch', + 'ListToTextWave', 'ListToWaveRefWave', 'ln', 'log', 'logNormalNoise', + 'LorentzianFit', 'LorentzianFitBL', 'LorentzianFit1Width', + 'LorentzianFit1WidthBL', 'lorentzianNoise', 'LowerStr', 'MacroList', 'magsqr', + 'MandelbrotPoint', 'MarcumQ', 'MatrixCondition', 'MatrixDet', 'MatrixDot', + 'MatrixRank', 'MatrixTrace', 'max', 'mean', 'median', 'min', 'mod', 'ModDate', + 'MPFXEMGPeak', 'MPFXExpConvExpPeak', 'MPFXGaussPeak', 'MPFXLorenzianPeak', + 'MPFXVoigtPeak', 'NameOfWave', 'NaN', 'NewFreeDataFolder', 'NewFreeWave', 'norm', + 'NormalizeUnicode', 'note', 'NumberByKey', 'numpnts', 'numtype', + 'NumVarOrDefault', 'num2char', 'num2istr', 'num2str', 'NVAR_Exists', + 'OperationList', 'PadString', 'PanelResolution', 'ParamIsDefault', + 'ParseFilePath', 'PathList', 'pcsr', 'Pi', 'PICTInfo', 'PICTList', + 'PixelFromAxisVal', 'pnt2x', 'poissonNoise', 'poly', 'PolygonArea', 'poly2D', + 'PossiblyQuoteName', 'ProcedureText', 'p2rect', 'qcsr', 'real', 'RemoveByKey', + 'RemoveEnding', 'RemoveFromList', 'RemoveListItem', 'ReplaceNumberByKey', + 'ReplaceString', 'ReplaceStringByKey', 'rightx', 'round', 'r2polar', 'sawtooth', + 'scaleToIndex', 'ScreenResolution', 'sec', 'sech', 'Secs2Date', 'Secs2Time', + 'SelectNumber', 'SelectString', 'SetEnvironmentVariable', 'sign', 'sin', 'sinc', + 'sinh', 'sinIntegral', 'SortList', 'SpecialCharacterInfo', 'SpecialCharacterList', + 'SpecialDirPath', 'SphericalBessJ', 'SphericalBessJD', 'SphericalBessY', + 'SphericalBessYD', 'SphericalHarmonics', 'sqrt', 'StartMSTimer', 'StatsBetaCDF', + 'StatsBetaPDF', 'StatsBinomialCDF', 'StatsBinomialPDF', 'StatsCauchyCDF', + 'StatsCauchyPDF', 'StatsChiCDF', 'StatsChiPDF', 'StatsCMSSDCDF', + 'StatsCorrelation', 'StatsDExpCDF', 'StatsDExpPDF', 'StatsErlangCDF', + 'StatsErlangPDF', 'StatsErrorPDF', 'StatsEValueCDF', 'StatsEValuePDF', + 'StatsExpCDF', 'StatsExpPDF', 'StatsFCDF', 'StatsFPDF', 'StatsFriedmanCDF', + 'StatsGammaCDF', 'StatsGammaPDF', 'StatsGeometricCDF', 'StatsGeometricPDF', + 'StatsGEVCDF', 'StatsGEVPDF', 'StatsHyperGCDF', 'StatsHyperGPDF', + 'StatsInvBetaCDF', 'StatsInvBinomialCDF', 'StatsInvCauchyCDF', 'StatsInvChiCDF', + 'StatsInvCMSSDCDF', 'StatsInvDExpCDF', 'StatsInvEValueCDF', 'StatsInvExpCDF', + 'StatsInvFCDF', 'StatsInvFriedmanCDF', 'StatsInvGammaCDF', 'StatsInvGeometricCDF', + 'StatsInvKuiperCDF', 'StatsInvLogisticCDF', 'StatsInvLogNormalCDF', + 'StatsInvMaxwellCDF', 'StatsInvMooreCDF', 'StatsInvNBinomialCDF', + 'StatsInvNCChiCDF', 'StatsInvNCFCDF', 'StatsInvNormalCDF', 'StatsInvParetoCDF', + 'StatsInvPoissonCDF', 'StatsInvPowerCDF', 'StatsInvQCDF', 'StatsInvQpCDF', + 'StatsInvRayleighCDF', 'StatsInvRectangularCDF', 'StatsInvSpearmanCDF', + 'StatsInvStudentCDF', 'StatsInvTopDownCDF', 'StatsInvTriangularCDF', + 'StatsInvUsquaredCDF', 'StatsInvVonMisesCDF', 'StatsInvWeibullCDF', + 'StatsKuiperCDF', 'StatsLogisticCDF', 'StatsLogisticPDF', 'StatsLogNormalCDF', + 'StatsLogNormalPDF', 'StatsMaxwellCDF', 'StatsMaxwellPDF', 'StatsMedian', + 'StatsMooreCDF', 'StatsNBinomialCDF', 'StatsNBinomialPDF', 'StatsNCChiCDF', + 'StatsNCChiPDF', 'StatsNCFCDF', 'StatsNCFPDF', 'StatsNCTCDF', 'StatsNCTPDF', + 'StatsNormalCDF', 'StatsNormalPDF', 'StatsParetoCDF', 'StatsParetoPDF', + 'StatsPermute', 'StatsPoissonCDF', 'StatsPoissonPDF', 'StatsPowerCDF', + 'StatsPowerNoise', 'StatsPowerPDF', 'StatsQCDF', 'StatsQpCDF', 'StatsRayleighCDF', + 'StatsRayleighPDF', 'StatsRectangularCDF', 'StatsRectangularPDF', 'StatsRunsCDF', + 'StatsSpearmanRhoCDF', 'StatsStudentCDF', 'StatsStudentPDF', 'StatsTopDownCDF', + 'StatsTriangularCDF', 'StatsTriangularPDF', 'StatsTrimmedMean', + 'StatsUSquaredCDF', 'StatsVonMisesCDF', 'StatsVonMisesNoise', 'StatsVonMisesPDF', + 'StatsWaldCDF', 'StatsWaldPDF', 'StatsWeibullCDF', 'StatsWeibullPDF', + 'StopMSTimer', 'StringByKey', 'stringCRC', 'StringFromList', 'StringList', + 'stringmatch', 'strlen', 'strsearch', 'StrVarOrDefault', 'str2num', 'StudentA', + 'StudentT', 'sum', 'SVAR_Exists', 'TableInfo', 'TagVal', 'TagWaveRef', 'tan', + 'tanh', 'TextEncodingCode', 'TextEncodingName', 'TextFile', 'ThreadGroupCreate', + 'ThreadGroupGetDF', 'ThreadGroupGetDFR', 'ThreadGroupRelease', 'ThreadGroupWait', + 'ThreadProcessorCount', 'ThreadReturnValue', 'ticks', 'time', 'TraceFromPixel', + 'TraceInfo', 'TraceNameList', 'TraceNameToWaveRef', 'trunc', 'UniqueName', + 'UnPadString', 'UnsetEnvironmentVariable', 'UpperStr', 'URLDecode', 'URLEncode', + 'VariableList', 'Variance', 'vcsr', 'Voigt', 'VoigtFit', 'VoigtFitBL', + 'VoigtFit1Shape', 'VoigtFit1ShapeBL', 'VoigtFit1Shape1Width', + 'VoigtFit1Shape1WidthBL', 'VoigtFunc', 'WaveCRC', 'WaveDims', 'WaveExists', + 'WaveInfo', 'WaveList', 'WaveMax', 'WaveMin', 'WaveName', 'WaveRefIndexed', + 'WaveRefIndexedDFR', 'WaveRefsEqual', 'WaveRefWaveToList', 'WaveTextEncoding', + 'WaveType', 'WaveUnits', 'WhichListItem', 'WinList', 'WinName', 'WinRecreation', + 'WinType', 'WMFindWholeWord', 'WNoise', 'xcsr', 'XWaveName', 'XWaveRefFromTrace', + 'x2pnt', 'zcsr', 'ZernikeR', 'zeta' + ) + + tokens = { + 'root': [ + (r'//.*$', Comment.Single), + (r'"([^"\\]|\\.)*"', String), + # Flow Control. + (words(flowControl, prefix=r'\b', suffix=r'\b'), Keyword), + # Types. + (words(types, prefix=r'\b', suffix=r'\b'), Keyword.Type), + # Keywords. + (words(keywords, prefix=r'\b', suffix=r'\b'), Keyword.Reserved), + # Built-in operations. + (words(operations, prefix=r'\b', suffix=r'\b'), Name.Class), + # Built-in functions. + (words(functions, prefix=r'\b', suffix=r'\b'), Name.Function), + # Compiler directives. + (r'^#(include|pragma|define|undef|ifdef|ifndef|if|elif|else|endif)', + Name.Decorator), + (r'[^a-z"/]+$', Text), + (r'.', Text), + ], + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/inferno.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/inferno.py new file mode 100644 index 0000000000000000000000000000000000000000..5fc5a0bad34b927a5955c7d5f8e7d0c03e5df60f --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/inferno.py @@ -0,0 +1,96 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.inferno + ~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for Inferno os and all the related stuff. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, include, bygroups, default +from pygments.token import Punctuation, Text, Comment, Operator, Keyword, \ + Name, String, Number + +__all__ = ['LimboLexer'] + + +class LimboLexer(RegexLexer): + """ + Lexer for `Limbo programming language `_ + + TODO: + - maybe implement better var declaration highlighting + - some simple syntax error highlighting + + .. versionadded:: 2.0 + """ + name = 'Limbo' + aliases = ['limbo'] + filenames = ['*.b'] + mimetypes = ['text/limbo'] + + tokens = { + 'whitespace': [ + (r'^(\s*)([a-zA-Z_]\w*:(\s*)\n)', + bygroups(Text, Name.Label)), + (r'\n', Text), + (r'\s+', Text), + (r'#(\n|(.|\n)*?[^\\]\n)', Comment.Single), + ], + '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 + ], + 'statements': [ + (r'"', String, 'string'), + (r"'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'", String.Char), + (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+', Number.Float), + (r'(\d+\.\d*|\.\d+|\d+[fF])', Number.Float), + (r'16r[0-9a-fA-F]+', Number.Hex), + (r'8r[0-7]+', Number.Oct), + (r'((([1-3]\d)|([2-9]))r)?(\d+)', Number.Integer), + (r'[()\[\],.]', Punctuation), + (r'[~!%^&*+=|?:<>/-]|(->)|(<-)|(=>)|(::)', Operator), + (r'(alt|break|case|continue|cyclic|do|else|exit' + r'for|hd|if|implement|import|include|len|load|or' + r'pick|return|spawn|tagof|tl|to|while)\b', Keyword), + (r'(byte|int|big|real|string|array|chan|list|adt' + r'|fn|ref|of|module|self|type)\b', Keyword.Type), + (r'(con|iota|nil)\b', Keyword.Constant), + ('[a-zA-Z_]\w*', Name), + ], + 'statement' : [ + include('whitespace'), + include('statements'), + ('[{}]', Punctuation), + (';', Punctuation, '#pop'), + ], + 'root': [ + include('whitespace'), + default('statement'), + ], + } + + def analyse_text(text): + # Any limbo module implements something + if re.search(r'^implement \w+;', text, re.MULTILINE): + return 0.7 + +# TODO: +# - Make lexers for: +# - asm sources +# - man pages +# - mkfiles +# - module definitions +# - namespace definitions +# - shell scripts +# - maybe keyfiles and fonts +# they all seem to be quite similar to their equivalents +# from unix world, so there should not be a lot of problems diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/int_fiction.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/int_fiction.py new file mode 100644 index 0000000000000000000000000000000000000000..f280a56d85fe98204428e689f7332843e2490b0d --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/int_fiction.py @@ -0,0 +1,1343 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.int_fiction + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for interactive fiction languages. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, include, bygroups, using, \ + this, default, words +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Error, Generic + +__all__ = ['Inform6Lexer', 'Inform6TemplateLexer', 'Inform7Lexer', + 'Tads3Lexer'] + + +class Inform6Lexer(RegexLexer): + """ + For `Inform 6 `_ source code. + + .. versionadded:: 2.0 + """ + + name = 'Inform 6' + aliases = ['inform6', 'i6'] + filenames = ['*.inf'] + + flags = re.MULTILINE | re.DOTALL | re.UNICODE + + _name = r'[a-zA-Z_]\w*' + + # Inform 7 maps these four character classes to their ASCII + # equivalents. To support Inform 6 inclusions within Inform 7, + # Inform6Lexer maps them too. + _dash = u'\\-\u2010-\u2014' + _dquote = u'"\u201c\u201d' + _squote = u"'\u2018\u2019" + _newline = u'\\n\u0085\u2028\u2029' + + tokens = { + 'root': [ + (r'\A(!%%[^%s]*[%s])+' % (_newline, _newline), Comment.Preproc, + 'directive'), + default('directive') + ], + '_whitespace': [ + (r'\s+', Text), + (r'![^%s]*' % _newline, Comment.Single) + ], + 'default': [ + include('_whitespace'), + (r'\[', Punctuation, 'many-values'), # Array initialization + (r':|(?=;)', Punctuation, '#pop'), + (r'<', Punctuation), # Second angle bracket in an action statement + default(('expression', '_expression')) + ], + + # Expressions + '_expression': [ + include('_whitespace'), + (r'(?=sp\b)', Text, '#pop'), + (r'(?=[%s%s$0-9#a-zA-Z_])' % (_dquote, _squote), Text, + ('#pop', 'value')), + (r'\+\+|[%s]{1,2}(?!>)|~~?' % _dash, Operator), + (r'(?=[()\[%s,?@{:;])' % _dash, Text, '#pop') + ], + 'expression': [ + include('_whitespace'), + (r'\(', Punctuation, ('expression', '_expression')), + (r'\)', Punctuation, '#pop'), + (r'\[', Punctuation, ('#pop', 'statements', 'locals')), + (r'>(?=(\s+|(![^%s]*))*[>;])' % _newline, Punctuation), + (r'\+\+|[%s]{2}(?!>)' % _dash, Operator), + (r',', Punctuation, '_expression'), + (r'&&?|\|\|?|[=~><]?=|[%s]{1,2}>?|\.\.?[&#]?|::|[<>+*/%%]' % _dash, + Operator, '_expression'), + (r'(has|hasnt|in|notin|ofclass|or|provides)\b', Operator.Word, + '_expression'), + (r'sp\b', Name), + (r'\?~?', Name.Label, 'label?'), + (r'[@{]', Error), + default('#pop') + ], + '_assembly-expression': [ + (r'\(', Punctuation, ('#push', '_expression')), + (r'[\[\]]', Punctuation), + (r'[%s]>' % _dash, Punctuation, '_expression'), + (r'sp\b', Keyword.Pseudo), + (r';', Punctuation, '#pop:3'), + include('expression') + ], + '_for-expression': [ + (r'\)', Punctuation, '#pop:2'), + (r':', Punctuation, '#pop'), + include('expression') + ], + '_keyword-expression': [ + (r'(from|near|to)\b', Keyword, '_expression'), + include('expression') + ], + '_list-expression': [ + (r',', Punctuation, '#pop'), + include('expression') + ], + '_object-expression': [ + (r'has\b', Keyword.Declaration, '#pop'), + include('_list-expression') + ], + + # Values + 'value': [ + include('_whitespace'), + # Strings + (r'[%s][^@][%s]' % (_squote, _squote), String.Char, '#pop'), + (r'([%s])(@\{[0-9a-fA-F]{1,4}\})([%s])' % (_squote, _squote), + bygroups(String.Char, String.Escape, String.Char), '#pop'), + (r'([%s])(@.{2})([%s])' % (_squote, _squote), + bygroups(String.Char, String.Escape, String.Char), '#pop'), + (r'[%s]' % _squote, String.Single, ('#pop', 'dictionary-word')), + (r'[%s]' % _dquote, String.Double, ('#pop', 'string')), + # Numbers + (r'\$[+%s][0-9]*\.?[0-9]*([eE][+%s]?[0-9]+)?' % (_dash, _dash), + Number.Float, '#pop'), + (r'\$[0-9a-fA-F]+', Number.Hex, '#pop'), + (r'\$\$[01]+', Number.Bin, '#pop'), + (r'[0-9]+', Number.Integer, '#pop'), + # Values prefixed by hashes + (r'(##|#a\$)(%s)' % _name, bygroups(Operator, Name), '#pop'), + (r'(#g\$)(%s)' % _name, + bygroups(Operator, Name.Variable.Global), '#pop'), + (r'#[nw]\$', Operator, ('#pop', 'obsolete-dictionary-word')), + (r'(#r\$)(%s)' % _name, bygroups(Operator, Name.Function), '#pop'), + (r'#', Name.Builtin, ('#pop', 'system-constant')), + # System functions + (words(( + 'child', 'children', 'elder', 'eldest', 'glk', 'indirect', 'metaclass', + 'parent', 'random', 'sibling', 'younger', 'youngest'), suffix=r'\b'), + Name.Builtin, '#pop'), + # Metaclasses + (r'(?i)(Class|Object|Routine|String)\b', Name.Builtin, '#pop'), + # Veneer routines + (words(( + 'Box__Routine', 'CA__Pr', 'CDefArt', 'CInDefArt', 'Cl__Ms', + 'Copy__Primitive', 'CP__Tab', 'DA__Pr', 'DB__Pr', 'DefArt', 'Dynam__String', + 'EnglishNumber', 'Glk__Wrap', 'IA__Pr', 'IB__Pr', 'InDefArt', 'Main__', + 'Meta__class', 'OB__Move', 'OB__Remove', 'OC__Cl', 'OP__Pr', 'Print__Addr', + 'Print__PName', 'PrintShortName', 'RA__Pr', 'RA__Sc', 'RL__Pr', 'R_Process', + 'RT__ChG', 'RT__ChGt', 'RT__ChLDB', 'RT__ChLDW', 'RT__ChPR', 'RT__ChPrintA', + 'RT__ChPrintC', 'RT__ChPrintO', 'RT__ChPrintS', 'RT__ChPS', 'RT__ChR', + 'RT__ChSTB', 'RT__ChSTW', 'RT__ChT', 'RT__Err', 'RT__TrPS', 'RV__Pr', + 'Symb__Tab', 'Unsigned__Compare', 'WV__Pr', 'Z__Region'), + prefix='(?i)', suffix=r'\b'), + Name.Builtin, '#pop'), + # Other built-in symbols + (words(( + 'call', 'copy', 'create', 'DEBUG', 'destroy', 'DICT_CHAR_SIZE', + 'DICT_ENTRY_BYTES', 'DICT_IS_UNICODE', 'DICT_WORD_SIZE', 'false', + 'FLOAT_INFINITY', 'FLOAT_NAN', 'FLOAT_NINFINITY', 'GOBJFIELD_CHAIN', + 'GOBJFIELD_CHILD', 'GOBJFIELD_NAME', 'GOBJFIELD_PARENT', + 'GOBJFIELD_PROPTAB', 'GOBJFIELD_SIBLING', 'GOBJ_EXT_START', + 'GOBJ_TOTAL_LENGTH', 'Grammar__Version', 'INDIV_PROP_START', 'INFIX', + 'infix__watching', 'MODULE_MODE', 'name', 'nothing', 'NUM_ATTR_BYTES', 'print', + 'print_to_array', 'recreate', 'remaining', 'self', 'sender', 'STRICT_MODE', + 'sw__var', 'sys__glob0', 'sys__glob1', 'sys__glob2', 'sys_statusline_flag', + 'TARGET_GLULX', 'TARGET_ZCODE', 'temp__global2', 'temp__global3', + 'temp__global4', 'temp_global', 'true', 'USE_MODULES', 'WORDSIZE'), + prefix='(?i)', suffix=r'\b'), + Name.Builtin, '#pop'), + # Other values + (_name, Name, '#pop') + ], + # Strings + 'dictionary-word': [ + (r'[~^]+', String.Escape), + (r'[^~^\\@({%s]+' % _squote, String.Single), + (r'[({]', String.Single), + (r'@\{[0-9a-fA-F]{,4}\}', String.Escape), + (r'@.{2}', String.Escape), + (r'[%s]' % _squote, String.Single, '#pop') + ], + 'string': [ + (r'[~^]+', String.Escape), + (r'[^~^\\@({%s]+' % _dquote, String.Double), + (r'[({]', String.Double), + (r'\\', String.Escape), + (r'@(\\\s*[%s]\s*)*@((\\\s*[%s]\s*)*[0-9])*' % + (_newline, _newline), String.Escape), + (r'@(\\\s*[%s]\s*)*\{((\\\s*[%s]\s*)*[0-9a-fA-F]){,4}' + r'(\\\s*[%s]\s*)*\}' % (_newline, _newline, _newline), + String.Escape), + (r'@(\\\s*[%s]\s*)*.(\\\s*[%s]\s*)*.' % (_newline, _newline), + String.Escape), + (r'[%s]' % _dquote, String.Double, '#pop') + ], + 'plain-string': [ + (r'[^~^\\({\[\]%s]+' % _dquote, String.Double), + (r'[~^({\[\]]', String.Double), + (r'\\', String.Escape), + (r'[%s]' % _dquote, String.Double, '#pop') + ], + # Names + '_constant': [ + include('_whitespace'), + (_name, Name.Constant, '#pop'), + include('value') + ], + '_global': [ + include('_whitespace'), + (_name, Name.Variable.Global, '#pop'), + include('value') + ], + 'label?': [ + include('_whitespace'), + (_name, Name.Label, '#pop'), + default('#pop') + ], + 'variable?': [ + include('_whitespace'), + (_name, Name.Variable, '#pop'), + default('#pop') + ], + # Values after hashes + 'obsolete-dictionary-word': [ + (r'\S\w*', String.Other, '#pop') + ], + 'system-constant': [ + include('_whitespace'), + (_name, Name.Builtin, '#pop') + ], + + # Directives + 'directive': [ + include('_whitespace'), + (r'#', Punctuation), + (r';', Punctuation, '#pop'), + (r'\[', Punctuation, + ('default', 'statements', 'locals', 'routine-name?')), + (words(( + 'abbreviate', 'endif', 'dictionary', 'ifdef', 'iffalse', 'ifndef', 'ifnot', + 'iftrue', 'ifv3', 'ifv5', 'release', 'serial', 'switches', 'system_file', + 'version'), prefix='(?i)', suffix=r'\b'), + Keyword, 'default'), + (r'(?i)(array|global)\b', Keyword, + ('default', 'directive-keyword?', '_global')), + (r'(?i)attribute\b', Keyword, ('default', 'alias?', '_constant')), + (r'(?i)class\b', Keyword, + ('object-body', 'duplicates', 'class-name')), + (r'(?i)(constant|default)\b', Keyword, + ('default', 'expression', '_constant')), + (r'(?i)(end\b)(.*)', bygroups(Keyword, Text)), + (r'(?i)(extend|verb)\b', Keyword, 'grammar'), + (r'(?i)fake_action\b', Keyword, ('default', '_constant')), + (r'(?i)import\b', Keyword, 'manifest'), + (r'(?i)(include|link)\b', Keyword, + ('default', 'before-plain-string')), + (r'(?i)(lowstring|undef)\b', Keyword, ('default', '_constant')), + (r'(?i)message\b', Keyword, ('default', 'diagnostic')), + (r'(?i)(nearby|object)\b', Keyword, + ('object-body', '_object-head')), + (r'(?i)property\b', Keyword, + ('default', 'alias?', '_constant', 'property-keyword*')), + (r'(?i)replace\b', Keyword, + ('default', 'routine-name?', 'routine-name?')), + (r'(?i)statusline\b', Keyword, ('default', 'directive-keyword?')), + (r'(?i)stub\b', Keyword, ('default', 'routine-name?')), + (r'(?i)trace\b', Keyword, + ('default', 'trace-keyword?', 'trace-keyword?')), + (r'(?i)zcharacter\b', Keyword, + ('default', 'directive-keyword?', 'directive-keyword?')), + (_name, Name.Class, ('object-body', '_object-head')) + ], + # [, Replace, Stub + 'routine-name?': [ + include('_whitespace'), + (_name, Name.Function, '#pop'), + default('#pop') + ], + 'locals': [ + include('_whitespace'), + (r';', Punctuation, '#pop'), + (r'\*', Punctuation), + (r'"', String.Double, 'plain-string'), + (_name, Name.Variable) + ], + # Array + 'many-values': [ + include('_whitespace'), + (r';', Punctuation), + (r'\]', Punctuation, '#pop'), + (r':', Error), + default(('expression', '_expression')) + ], + # Attribute, Property + 'alias?': [ + include('_whitespace'), + (r'alias\b', Keyword, ('#pop', '_constant')), + default('#pop') + ], + # Class, Object, Nearby + 'class-name': [ + include('_whitespace'), + (r'(?=[,;]|(class|has|private|with)\b)', Text, '#pop'), + (_name, Name.Class, '#pop') + ], + 'duplicates': [ + include('_whitespace'), + (r'\(', Punctuation, ('#pop', 'expression', '_expression')), + default('#pop') + ], + '_object-head': [ + (r'[%s]>' % _dash, Punctuation), + (r'(class|has|private|with)\b', Keyword.Declaration, '#pop'), + include('_global') + ], + 'object-body': [ + include('_whitespace'), + (r';', Punctuation, '#pop:2'), + (r',', Punctuation), + (r'class\b', Keyword.Declaration, 'class-segment'), + (r'(has|private|with)\b', Keyword.Declaration), + (r':', Error), + default(('_object-expression', '_expression')) + ], + 'class-segment': [ + include('_whitespace'), + (r'(?=[,;]|(class|has|private|with)\b)', Text, '#pop'), + (_name, Name.Class), + default('value') + ], + # Extend, Verb + 'grammar': [ + include('_whitespace'), + (r'=', Punctuation, ('#pop', 'default')), + (r'\*', Punctuation, ('#pop', 'grammar-line')), + default('_directive-keyword') + ], + 'grammar-line': [ + include('_whitespace'), + (r';', Punctuation, '#pop'), + (r'[/*]', Punctuation), + (r'[%s]>' % _dash, Punctuation, 'value'), + (r'(noun|scope)\b', Keyword, '=routine'), + default('_directive-keyword') + ], + '=routine': [ + include('_whitespace'), + (r'=', Punctuation, 'routine-name?'), + default('#pop') + ], + # Import + 'manifest': [ + include('_whitespace'), + (r';', Punctuation, '#pop'), + (r',', Punctuation), + (r'(?i)global\b', Keyword, '_global'), + default('_global') + ], + # Include, Link, Message + 'diagnostic': [ + include('_whitespace'), + (r'[%s]' % _dquote, String.Double, ('#pop', 'message-string')), + default(('#pop', 'before-plain-string', 'directive-keyword?')) + ], + 'before-plain-string': [ + include('_whitespace'), + (r'[%s]' % _dquote, String.Double, ('#pop', 'plain-string')) + ], + 'message-string': [ + (r'[~^]+', String.Escape), + include('plain-string') + ], + + # Keywords used in directives + '_directive-keyword!': [ + include('_whitespace'), + (words(( + 'additive', 'alias', 'buffer', 'class', 'creature', 'data', 'error', 'fatalerror', + 'first', 'has', 'held', 'initial', 'initstr', 'last', 'long', 'meta', 'multi', + 'multiexcept', 'multiheld', 'multiinside', 'noun', 'number', 'only', 'private', + 'replace', 'reverse', 'scope', 'score', 'special', 'string', 'table', 'terminating', + 'time', 'topic', 'warning', 'with'), suffix=r'\b'), + Keyword, '#pop'), + (r'[%s]{1,2}>|[+=]' % _dash, Punctuation, '#pop') + ], + '_directive-keyword': [ + include('_directive-keyword!'), + include('value') + ], + 'directive-keyword?': [ + include('_directive-keyword!'), + default('#pop') + ], + 'property-keyword*': [ + include('_whitespace'), + (r'(additive|long)\b', Keyword), + default('#pop') + ], + 'trace-keyword?': [ + include('_whitespace'), + (words(( + 'assembly', 'dictionary', 'expressions', 'lines', 'linker', + 'objects', 'off', 'on', 'symbols', 'tokens', 'verbs'), suffix=r'\b'), + Keyword, '#pop'), + default('#pop') + ], + + # Statements + 'statements': [ + include('_whitespace'), + (r'\]', Punctuation, '#pop'), + (r'[;{}]', Punctuation), + (words(( + 'box', 'break', 'continue', 'default', 'give', 'inversion', + 'new_line', 'quit', 'read', 'remove', 'return', 'rfalse', 'rtrue', + 'spaces', 'string', 'until'), suffix=r'\b'), + Keyword, 'default'), + (r'(do|else)\b', Keyword), + (r'(font|style)\b', Keyword, + ('default', 'miscellaneous-keyword?')), + (r'for\b', Keyword, ('for', '(?')), + (r'(if|switch|while)', Keyword, + ('expression', '_expression', '(?')), + (r'(jump|save|restore)\b', Keyword, ('default', 'label?')), + (r'objectloop\b', Keyword, + ('_keyword-expression', 'variable?', '(?')), + (r'print(_ret)?\b|(?=[%s])' % _dquote, Keyword, 'print-list'), + (r'\.', Name.Label, 'label?'), + (r'@', Keyword, 'opcode'), + (r'#(?![agrnw]\$|#)', Punctuation, 'directive'), + (r'<', Punctuation, 'default'), + (r'move\b', Keyword, + ('default', '_keyword-expression', '_expression')), + default(('default', '_keyword-expression', '_expression')) + ], + 'miscellaneous-keyword?': [ + include('_whitespace'), + (r'(bold|fixed|from|near|off|on|reverse|roman|to|underline)\b', + Keyword, '#pop'), + (r'(a|A|an|address|char|name|number|object|property|string|the|' + r'The)\b(?=(\s+|(![^%s]*))*\))' % _newline, Keyword.Pseudo, + '#pop'), + (r'%s(?=(\s+|(![^%s]*))*\))' % (_name, _newline), Name.Function, + '#pop'), + default('#pop') + ], + '(?': [ + include('_whitespace'), + (r'\(', Punctuation, '#pop'), + default('#pop') + ], + 'for': [ + include('_whitespace'), + (r';', Punctuation, ('_for-expression', '_expression')), + default(('_for-expression', '_expression')) + ], + 'print-list': [ + include('_whitespace'), + (r';', Punctuation, '#pop'), + (r':', Error), + default(('_list-expression', '_expression', '_list-expression', 'form')) + ], + 'form': [ + include('_whitespace'), + (r'\(', Punctuation, ('#pop', 'miscellaneous-keyword?')), + default('#pop') + ], + + # Assembly + 'opcode': [ + include('_whitespace'), + (r'[%s]' % _dquote, String.Double, ('operands', 'plain-string')), + (_name, Keyword, 'operands') + ], + 'operands': [ + (r':', Error), + default(('_assembly-expression', '_expression')) + ] + } + + def get_tokens_unprocessed(self, text): + # 'in' is either a keyword or an operator. + # If the token two tokens after 'in' is ')', 'in' is a keyword: + # objectloop(a in b) + # Otherwise, it is an operator: + # objectloop(a in b && true) + objectloop_queue = [] + objectloop_token_count = -1 + previous_token = None + for index, token, value in RegexLexer.get_tokens_unprocessed(self, + text): + if previous_token is Name.Variable and value == 'in': + objectloop_queue = [[index, token, value]] + objectloop_token_count = 2 + elif objectloop_token_count > 0: + if token not in Comment and token not in Text: + objectloop_token_count -= 1 + objectloop_queue.append((index, token, value)) + else: + if objectloop_token_count == 0: + if objectloop_queue[-1][2] == ')': + objectloop_queue[0][1] = Keyword + while objectloop_queue: + yield objectloop_queue.pop(0) + objectloop_token_count = -1 + yield index, token, value + if token not in Comment and token not in Text: + previous_token = token + while objectloop_queue: + yield objectloop_queue.pop(0) + + +class Inform7Lexer(RegexLexer): + """ + For `Inform 7 `_ source code. + + .. versionadded:: 2.0 + """ + + name = 'Inform 7' + aliases = ['inform7', 'i7'] + filenames = ['*.ni', '*.i7x'] + + flags = re.MULTILINE | re.DOTALL | re.UNICODE + + _dash = Inform6Lexer._dash + _dquote = Inform6Lexer._dquote + _newline = Inform6Lexer._newline + _start = r'\A|(?<=[%s])' % _newline + + # There are three variants of Inform 7, differing in how to + # interpret at signs and braces in I6T. In top-level inclusions, at + # signs in the first column are inweb syntax. In phrase definitions + # and use options, tokens in braces are treated as I7. Use options + # also interpret "{N}". + tokens = {} + token_variants = ['+i6t-not-inline', '+i6t-inline', '+i6t-use-option'] + + for level in token_variants: + tokens[level] = { + '+i6-root': list(Inform6Lexer.tokens['root']), + '+i6t-root': [ # For Inform6TemplateLexer + (r'[^%s]*' % Inform6Lexer._newline, Comment.Preproc, + ('directive', '+p')) + ], + 'root': [ + (r'(\|?\s)+', Text), + (r'\[', Comment.Multiline, '+comment'), + (r'[%s]' % _dquote, Generic.Heading, + ('+main', '+titling', '+titling-string')), + default(('+main', '+heading?')) + ], + '+titling-string': [ + (r'[^%s]+' % _dquote, Generic.Heading), + (r'[%s]' % _dquote, Generic.Heading, '#pop') + ], + '+titling': [ + (r'\[', Comment.Multiline, '+comment'), + (r'[^%s.;:|%s]+' % (_dquote, _newline), Generic.Heading), + (r'[%s]' % _dquote, Generic.Heading, '+titling-string'), + (r'[%s]{2}|(?<=[\s%s])\|[\s%s]' % (_newline, _dquote, _dquote), + Text, ('#pop', '+heading?')), + (r'[.;:]|(?<=[\s%s])\|' % _dquote, Text, '#pop'), + (r'[|%s]' % _newline, Generic.Heading) + ], + '+main': [ + (r'(?i)[^%s:a\[(|%s]+' % (_dquote, _newline), Text), + (r'[%s]' % _dquote, String.Double, '+text'), + (r':', Text, '+phrase-definition'), + (r'(?i)\bas\b', Text, '+use-option'), + (r'\[', Comment.Multiline, '+comment'), + (r'(\([%s])(.*?)([%s]\))' % (_dash, _dash), + bygroups(Punctuation, + using(this, state=('+i6-root', 'directive'), + i6t='+i6t-not-inline'), Punctuation)), + (r'(%s|(?<=[\s;:.%s]))\|\s|[%s]{2,}' % + (_start, _dquote, _newline), Text, '+heading?'), + (r'(?i)[a(|%s]' % _newline, Text) + ], + '+phrase-definition': [ + (r'\s+', Text), + (r'\[', Comment.Multiline, '+comment'), + (r'(\([%s])(.*?)([%s]\))' % (_dash, _dash), + bygroups(Punctuation, + using(this, state=('+i6-root', 'directive', + 'default', 'statements'), + i6t='+i6t-inline'), Punctuation), '#pop'), + default('#pop') + ], + '+use-option': [ + (r'\s+', Text), + (r'\[', Comment.Multiline, '+comment'), + (r'(\([%s])(.*?)([%s]\))' % (_dash, _dash), + bygroups(Punctuation, + using(this, state=('+i6-root', 'directive'), + i6t='+i6t-use-option'), Punctuation), '#pop'), + default('#pop') + ], + '+comment': [ + (r'[^\[\]]+', Comment.Multiline), + (r'\[', Comment.Multiline, '#push'), + (r'\]', Comment.Multiline, '#pop') + ], + '+text': [ + (r'[^\[%s]+' % _dquote, String.Double), + (r'\[.*?\]', String.Interpol), + (r'[%s]' % _dquote, String.Double, '#pop') + ], + '+heading?': [ + (r'(\|?\s)+', Text), + (r'\[', Comment.Multiline, '+comment'), + (r'[%s]{4}\s+' % _dash, Text, '+documentation-heading'), + (r'[%s]{1,3}' % _dash, Text), + (r'(?i)(volume|book|part|chapter|section)\b[^%s]*' % _newline, + Generic.Heading, '#pop'), + default('#pop') + ], + '+documentation-heading': [ + (r'\s+', Text), + (r'\[', Comment.Multiline, '+comment'), + (r'(?i)documentation\s+', Text, '+documentation-heading2'), + default('#pop') + ], + '+documentation-heading2': [ + (r'\s+', Text), + (r'\[', Comment.Multiline, '+comment'), + (r'[%s]{4}\s' % _dash, Text, '+documentation'), + default('#pop:2') + ], + '+documentation': [ + (r'(?i)(%s)\s*(chapter|example)\s*:[^%s]*' % + (_start, _newline), Generic.Heading), + (r'(?i)(%s)\s*section\s*:[^%s]*' % (_start, _newline), + Generic.Subheading), + (r'((%s)\t.*?[%s])+' % (_start, _newline), + using(this, state='+main')), + (r'[^%s\[]+|[%s\[]' % (_newline, _newline), Text), + (r'\[', Comment.Multiline, '+comment'), + ], + '+i6t-not-inline': [ + (r'(%s)@c( .*?)?([%s]|\Z)' % (_start, _newline), + Comment.Preproc), + (r'(%s)@([%s]+|Purpose:)[^%s]*' % (_start, _dash, _newline), + Comment.Preproc), + (r'(%s)@p( .*?)?([%s]|\Z)' % (_start, _newline), + Generic.Heading, '+p') + ], + '+i6t-use-option': [ + include('+i6t-not-inline'), + (r'(\{)(N)(\})', bygroups(Punctuation, Text, Punctuation)) + ], + '+i6t-inline': [ + (r'(\{)(\S[^}]*)?(\})', + bygroups(Punctuation, using(this, state='+main'), + Punctuation)) + ], + '+i6t': [ + (r'(\{[%s])(![^}]*)(\}?)' % _dash, + bygroups(Punctuation, Comment.Single, Punctuation)), + (r'(\{[%s])(lines)(:)([^}]*)(\}?)' % _dash, + bygroups(Punctuation, Keyword, Punctuation, Text, + Punctuation), '+lines'), + (r'(\{[%s])([^:}]*)(:?)([^}]*)(\}?)' % _dash, + bygroups(Punctuation, Keyword, Punctuation, Text, + Punctuation)), + (r'(\(\+)(.*?)(\+\)|\Z)', + bygroups(Punctuation, using(this, state='+main'), + Punctuation)) + ], + '+p': [ + (r'[^@]+', Comment.Preproc), + (r'(%s)@c( .*?)?([%s]|\Z)' % (_start, _newline), + Comment.Preproc, '#pop'), + (r'(%s)@([%s]|Purpose:)' % (_start, _dash), Comment.Preproc), + (r'(%s)@p( .*?)?([%s]|\Z)' % (_start, _newline), + Generic.Heading), + (r'@', Comment.Preproc) + ], + '+lines': [ + (r'(%s)@c( .*?)?([%s]|\Z)' % (_start, _newline), + Comment.Preproc), + (r'(%s)@([%s]|Purpose:)[^%s]*' % (_start, _dash, _newline), + Comment.Preproc), + (r'(%s)@p( .*?)?([%s]|\Z)' % (_start, _newline), + Generic.Heading, '+p'), + (r'(%s)@\w*[ %s]' % (_start, _newline), Keyword), + (r'![^%s]*' % _newline, Comment.Single), + (r'(\{)([%s]endlines)(\})' % _dash, + bygroups(Punctuation, Keyword, Punctuation), '#pop'), + (r'[^@!{]+?([%s]|\Z)|.' % _newline, Text) + ] + } + # Inform 7 can include snippets of Inform 6 template language, + # so all of Inform6Lexer's states are copied here, with + # modifications to account for template syntax. Inform7Lexer's + # own states begin with '+' to avoid name conflicts. Some of + # Inform6Lexer's states begin with '_': these are not modified. + # They deal with template syntax either by including modified + # states, or by matching r'' then pushing to modified states. + for token in Inform6Lexer.tokens: + if token == 'root': + continue + tokens[level][token] = list(Inform6Lexer.tokens[token]) + if not token.startswith('_'): + tokens[level][token][:0] = [include('+i6t'), include(level)] + + def __init__(self, **options): + level = options.get('i6t', '+i6t-not-inline') + if level not in self._all_tokens: + self._tokens = self.__class__.process_tokendef(level) + else: + self._tokens = self._all_tokens[level] + RegexLexer.__init__(self, **options) + + +class Inform6TemplateLexer(Inform7Lexer): + """ + For `Inform 6 template + `_ code. + + .. versionadded:: 2.0 + """ + + name = 'Inform 6 template' + aliases = ['i6t'] + filenames = ['*.i6t'] + + def get_tokens_unprocessed(self, text, stack=('+i6t-root',)): + return Inform7Lexer.get_tokens_unprocessed(self, text, stack) + + +class Tads3Lexer(RegexLexer): + """ + For `TADS 3 `_ source code. + """ + + name = 'TADS 3' + aliases = ['tads3'] + filenames = ['*.t'] + + flags = re.DOTALL | re.MULTILINE + + _comment_single = r'(?://(?:[^\\\n]|\\+[\w\W])*$)' + _comment_multiline = r'(?:/\*(?:[^*]|\*(?!/))*\*/)' + _escape = (r'(?:\\(?:[\n\\<>"\'^v bnrt]|u[\da-fA-F]{,4}|x[\da-fA-F]{,2}|' + r'[0-3]?[0-7]{1,2}))') + _name = r'(?:[_a-zA-Z]\w*)' + _no_quote = r'(?=\s|\\?>)' + _operator = (r'(?:&&|\|\||\+\+|--|\?\?|::|[.,@\[\]~]|' + r'(?:[=+\-*/%!&|^]|<>?>?)=?)') + _ws = r'(?:\\|\s|%s|%s)' % (_comment_single, _comment_multiline) + _ws_pp = r'(?:\\\n|[^\S\n]|%s|%s)' % (_comment_single, _comment_multiline) + + def _make_string_state(triple, double, verbatim=None, _escape=_escape): + if verbatim: + verbatim = ''.join(['(?:%s|%s)' % (re.escape(c.lower()), + re.escape(c.upper())) + for c in verbatim]) + char = r'"' if double else r"'" + token = String.Double if double else String.Single + escaped_quotes = r'+|%s(?!%s{2})' % (char, char) if triple else r'' + prefix = '%s%s' % ('t' if triple else '', 'd' if double else 's') + tag_state_name = '%sqt' % prefix + state = [] + if triple: + state += [ + (r'%s{3,}' % char, token, '#pop'), + (r'\\%s+' % char, String.Escape), + (char, token) + ] + else: + state.append((char, token, '#pop')) + state += [ + include('s/verbatim'), + (r'[^\\<&{}%s]+' % char, token) + ] + if verbatim: + # This regex can't use `(?i)` because escape sequences are + # case-sensitive. `<\XMP>` works; `<\xmp>` doesn't. + state.append((r'\\?<(/|\\\\|(?!%s)\\)%s(?=[\s=>])' % + (_escape, verbatim), + Name.Tag, ('#pop', '%sqs' % prefix, tag_state_name))) + else: + state += [ + (r'\\?<\\%s]|<(?!<)|\\%s%s|%s|\\.)*>?' % + (char, char, escaped_quotes, _escape), Comment.Multiline), + (r'(?i)\\?]|\\>)', Name.Tag, + ('#pop', '%sqs/listing' % prefix, tag_state_name)), + (r'(?i)\\?]|\\>)', Name.Tag, + ('#pop', '%sqs/xmp' % prefix, tag_state_name)), + (r'\\?<([^\s=><\\%s]|<(?!<)|\\%s%s|%s|\\.)*' % + (char, char, escaped_quotes, _escape), Name.Tag, + tag_state_name), + include('s/entity') + ] + state += [ + include('s/escape'), + (r'\{([^}<\\%s]|<(?!<)|\\%s%s|%s|\\.)*\}' % + (char, char, escaped_quotes, _escape), String.Interpol), + (r'[\\&{}<]', token) + ] + return state + + def _make_tag_state(triple, double, _escape=_escape): + char = r'"' if double else r"'" + quantifier = r'{3,}' if triple else r'' + state_name = '%s%sqt' % ('t' if triple else '', 'd' if double else 's') + token = String.Double if double else String.Single + escaped_quotes = r'+|%s(?!%s{2})' % (char, char) if triple else r'' + return [ + (r'%s%s' % (char, quantifier), token, '#pop:2'), + (r'(\s|\\\n)+', Text), + (r'(=)(\\?")', bygroups(Punctuation, String.Double), + 'dqs/%s' % state_name), + (r"(=)(\\?')", bygroups(Punctuation, String.Single), + 'sqs/%s' % state_name), + (r'=', Punctuation, 'uqs/%s' % state_name), + (r'\\?>', Name.Tag, '#pop'), + (r'\{([^}<\\%s]|<(?!<)|\\%s%s|%s|\\.)*\}' % + (char, char, escaped_quotes, _escape), String.Interpol), + (r'([^\s=><\\%s]|<(?!<)|\\%s%s|%s|\\.)+' % + (char, char, escaped_quotes, _escape), Name.Attribute), + include('s/escape'), + include('s/verbatim'), + include('s/entity'), + (r'[\\{}&]', Name.Attribute) + ] + + def _make_attribute_value_state(terminator, host_triple, host_double, + _escape=_escape): + token = (String.Double if terminator == r'"' else + String.Single if terminator == r"'" else String.Other) + host_char = r'"' if host_double else r"'" + host_quantifier = r'{3,}' if host_triple else r'' + host_token = String.Double if host_double else String.Single + escaped_quotes = (r'+|%s(?!%s{2})' % (host_char, host_char) + if host_triple else r'') + return [ + (r'%s%s' % (host_char, host_quantifier), host_token, '#pop:3'), + (r'%s%s' % (r'' if token is String.Other else r'\\?', terminator), + token, '#pop'), + include('s/verbatim'), + include('s/entity'), + (r'\{([^}<\\%s]|<(?!<)|\\%s%s|%s|\\.)*\}' % + (host_char, host_char, escaped_quotes, _escape), String.Interpol), + (r'([^\s"\'<%s{}\\&])+' % (r'>' if token is String.Other else r''), + token), + include('s/escape'), + (r'["\'\s&{<}\\]', token) + ] + + tokens = { + 'root': [ + (u'\ufeff', Text), + (r'\{', Punctuation, 'object-body'), + (r';+', Punctuation), + (r'(?=(argcount|break|case|catch|continue|default|definingobj|' + r'delegated|do|else|for|foreach|finally|goto|if|inherited|' + r'invokee|local|nil|new|operator|replaced|return|self|switch|' + r'targetobj|targetprop|throw|true|try|while)\b)', Text, 'block'), + (r'(%s)(%s*)(\()' % (_name, _ws), + bygroups(Name.Function, using(this, state='whitespace'), + Punctuation), + ('block?/root', 'more/parameters', 'main/parameters')), + include('whitespace'), + (r'\++', Punctuation), + (r'[^\s!"%-(*->@-_a-z{-~]+', Error), # Averts an infinite loop + (r'(?!\Z)', Text, 'main/root') + ], + 'main/root': [ + include('main/basic'), + default(('#pop', 'object-body/no-braces', 'classes', 'class')) + ], + 'object-body/no-braces': [ + (r';', Punctuation, '#pop'), + (r'\{', Punctuation, ('#pop', 'object-body')), + include('object-body') + ], + 'object-body': [ + (r';', Punctuation), + (r'\{', Punctuation, '#push'), + (r'\}', Punctuation, '#pop'), + (r':', Punctuation, ('classes', 'class')), + (r'(%s?)(%s*)(\()' % (_name, _ws), + bygroups(Name.Function, using(this, state='whitespace'), + Punctuation), + ('block?', 'more/parameters', 'main/parameters')), + (r'(%s)(%s*)(\{)' % (_name, _ws), + bygroups(Name.Function, using(this, state='whitespace'), + Punctuation), 'block'), + (r'(%s)(%s*)(:)' % (_name, _ws), + bygroups(Name.Variable, using(this, state='whitespace'), + Punctuation), + ('object-body/no-braces', 'classes', 'class')), + include('whitespace'), + (r'->|%s' % _operator, Punctuation, 'main'), + default('main/object-body') + ], + 'main/object-body': [ + include('main/basic'), + (r'(%s)(%s*)(=?)' % (_name, _ws), + bygroups(Name.Variable, using(this, state='whitespace'), + Punctuation), ('#pop', 'more', 'main')), + default('#pop:2') + ], + 'block?/root': [ + (r'\{', Punctuation, ('#pop', 'block')), + include('whitespace'), + (r'(?=[[\'"<(:])', Text, # It might be a VerbRule macro. + ('#pop', 'object-body/no-braces', 'grammar', 'grammar-rules')), + # It might be a macro like DefineAction. + default(('#pop', 'object-body/no-braces')) + ], + 'block?': [ + (r'\{', Punctuation, ('#pop', 'block')), + include('whitespace'), + default('#pop') + ], + 'block/basic': [ + (r'[;:]+', Punctuation), + (r'\{', Punctuation, '#push'), + (r'\}', Punctuation, '#pop'), + (r'default\b', Keyword.Reserved), + (r'(%s)(%s*)(:)' % (_name, _ws), + bygroups(Name.Label, using(this, state='whitespace'), + Punctuation)), + include('whitespace') + ], + 'block': [ + include('block/basic'), + (r'(?!\Z)', Text, ('more', 'main')) + ], + 'block/embed': [ + (r'>>', String.Interpol, '#pop'), + include('block/basic'), + (r'(?!\Z)', Text, ('more/embed', 'main')) + ], + 'main/basic': [ + include('whitespace'), + (r'\(', Punctuation, ('#pop', 'more', 'main')), + (r'\[', Punctuation, ('#pop', 'more/list', 'main')), + (r'\{', Punctuation, ('#pop', 'more/inner', 'main/inner', + 'more/parameters', 'main/parameters')), + (r'\*|\.{3}', Punctuation, '#pop'), + (r'(?i)0x[\da-f]+', Number.Hex, '#pop'), + (r'(\d+\.(?!\.)\d*|\.\d+)([eE][-+]?\d+)?|\d+[eE][-+]?\d+', + Number.Float, '#pop'), + (r'0[0-7]+', Number.Oct, '#pop'), + (r'\d+', Number.Integer, '#pop'), + (r'"""', String.Double, ('#pop', 'tdqs')), + (r"'''", String.Single, ('#pop', 'tsqs')), + (r'"', String.Double, ('#pop', 'dqs')), + (r"'", String.Single, ('#pop', 'sqs')), + (r'R"""', String.Regex, ('#pop', 'tdqr')), + (r"R'''", String.Regex, ('#pop', 'tsqr')), + (r'R"', String.Regex, ('#pop', 'dqr')), + (r"R'", String.Regex, ('#pop', 'sqr')), + # Two-token keywords + (r'(extern)(%s+)(object\b)' % _ws, + bygroups(Keyword.Reserved, using(this, state='whitespace'), + Keyword.Reserved)), + (r'(function|method)(%s*)(\()' % _ws, + bygroups(Keyword.Reserved, using(this, state='whitespace'), + Punctuation), + ('#pop', 'block?', 'more/parameters', 'main/parameters')), + (r'(modify)(%s+)(grammar\b)' % _ws, + bygroups(Keyword.Reserved, using(this, state='whitespace'), + Keyword.Reserved), + ('#pop', 'object-body/no-braces', ':', 'grammar')), + (r'(new)(%s+(?=(?:function|method)\b))' % _ws, + bygroups(Keyword.Reserved, using(this, state='whitespace'))), + (r'(object)(%s+)(template\b)' % _ws, + bygroups(Keyword.Reserved, using(this, state='whitespace'), + Keyword.Reserved), ('#pop', 'template')), + (r'(string)(%s+)(template\b)' % _ws, + bygroups(Keyword, using(this, state='whitespace'), + Keyword.Reserved), ('#pop', 'function-name')), + # Keywords + (r'(argcount|definingobj|invokee|replaced|targetobj|targetprop)\b', + Name.Builtin, '#pop'), + (r'(break|continue|goto)\b', Keyword.Reserved, ('#pop', 'label')), + (r'(case|extern|if|intrinsic|return|static|while)\b', + Keyword.Reserved), + (r'catch\b', Keyword.Reserved, ('#pop', 'catch')), + (r'class\b', Keyword.Reserved, + ('#pop', 'object-body/no-braces', 'class')), + (r'(default|do|else|finally|try)\b', Keyword.Reserved, '#pop'), + (r'(dictionary|property)\b', Keyword.Reserved, + ('#pop', 'constants')), + (r'enum\b', Keyword.Reserved, ('#pop', 'enum')), + (r'export\b', Keyword.Reserved, ('#pop', 'main')), + (r'(for|foreach)\b', Keyword.Reserved, + ('#pop', 'more/inner', 'main/inner')), + (r'(function|method)\b', Keyword.Reserved, + ('#pop', 'block?', 'function-name')), + (r'grammar\b', Keyword.Reserved, + ('#pop', 'object-body/no-braces', 'grammar')), + (r'inherited\b', Keyword.Reserved, ('#pop', 'inherited')), + (r'local\b', Keyword.Reserved, + ('#pop', 'more/local', 'main/local')), + (r'(modify|replace|switch|throw|transient)\b', Keyword.Reserved, + '#pop'), + (r'new\b', Keyword.Reserved, ('#pop', 'class')), + (r'(nil|true)\b', Keyword.Constant, '#pop'), + (r'object\b', Keyword.Reserved, ('#pop', 'object-body/no-braces')), + (r'operator\b', Keyword.Reserved, ('#pop', 'operator')), + (r'propertyset\b', Keyword.Reserved, + ('#pop', 'propertyset', 'main')), + (r'self\b', Name.Builtin.Pseudo, '#pop'), + (r'template\b', Keyword.Reserved, ('#pop', 'template')), + # Operators + (r'(__objref|defined)(%s*)(\()' % _ws, + bygroups(Operator.Word, using(this, state='whitespace'), + Operator), ('#pop', 'more/__objref', 'main')), + (r'delegated\b', Operator.Word), + # Compiler-defined macros and built-in properties + (r'(__DATE__|__DEBUG|__LINE__|__FILE__|' + r'__TADS_MACRO_FORMAT_VERSION|__TADS_SYS_\w*|__TADS_SYSTEM_NAME|' + r'__TADS_VERSION_MAJOR|__TADS_VERSION_MINOR|__TADS3|__TIME__|' + r'construct|finalize|grammarInfo|grammarTag|lexicalParent|' + r'miscVocab|sourceTextGroup|sourceTextGroupName|' + r'sourceTextGroupOrder|sourceTextOrder)\b', Name.Builtin, '#pop') + ], + 'main': [ + include('main/basic'), + (_name, Name, '#pop'), + default('#pop') + ], + 'more/basic': [ + (r'\(', Punctuation, ('more/list', 'main')), + (r'\[', Punctuation, ('more', 'main')), + (r'\.{3}', Punctuation), + (r'->|\.\.', Punctuation, 'main'), + (r'(?=;)|[:)\]]', Punctuation, '#pop'), + include('whitespace'), + (_operator, Operator, 'main'), + (r'\?', Operator, ('main', 'more/conditional', 'main')), + (r'(is|not)(%s+)(in\b)' % _ws, + bygroups(Operator.Word, using(this, state='whitespace'), + Operator.Word)), + (r'[^\s!"%-_a-z{-~]+', Error) # Averts an infinite loop + ], + 'more': [ + include('more/basic'), + default('#pop') + ], + # Then expression (conditional operator) + 'more/conditional': [ + (r':(?!:)', Operator, '#pop'), + include('more') + ], + # Embedded expressions + 'more/embed': [ + (r'>>', String.Interpol, '#pop:2'), + include('more') + ], + # For/foreach loop initializer or short-form anonymous function + 'main/inner': [ + (r'\(', Punctuation, ('#pop', 'more/inner', 'main/inner')), + (r'local\b', Keyword.Reserved, ('#pop', 'main/local')), + include('main') + ], + 'more/inner': [ + (r'\}', Punctuation, '#pop'), + (r',', Punctuation, 'main/inner'), + (r'(in|step)\b', Keyword, 'main/inner'), + include('more') + ], + # Local + 'main/local': [ + (_name, Name.Variable, '#pop'), + include('whitespace') + ], + 'more/local': [ + (r',', Punctuation, 'main/local'), + include('more') + ], + # List + 'more/list': [ + (r'[,:]', Punctuation, 'main'), + include('more') + ], + # Parameter list + 'main/parameters': [ + (r'(%s)(%s*)(?=:)' % (_name, _ws), + bygroups(Name.Variable, using(this, state='whitespace')), '#pop'), + (r'(%s)(%s+)(%s)' % (_name, _ws, _name), + bygroups(Name.Class, using(this, state='whitespace'), + Name.Variable), '#pop'), + (r'\[+', Punctuation), + include('main/basic'), + (_name, Name.Variable, '#pop'), + default('#pop') + ], + 'more/parameters': [ + (r'(:)(%s*(?=[?=,:)]))' % _ws, + bygroups(Punctuation, using(this, state='whitespace'))), + (r'[?\]]+', Punctuation), + (r'[:)]', Punctuation, ('#pop', 'multimethod?')), + (r',', Punctuation, 'main/parameters'), + (r'=', Punctuation, ('more/parameter', 'main')), + include('more') + ], + 'more/parameter': [ + (r'(?=[,)])', Text, '#pop'), + include('more') + ], + 'multimethod?': [ + (r'multimethod\b', Keyword, '#pop'), + include('whitespace'), + default('#pop') + ], + + # Statements and expressions + 'more/__objref': [ + (r',', Punctuation, 'mode'), + (r'\)', Operator, '#pop'), + include('more') + ], + 'mode': [ + (r'(error|warn)\b', Keyword, '#pop'), + include('whitespace') + ], + 'catch': [ + (r'\(+', Punctuation), + (_name, Name.Exception, ('#pop', 'variables')), + include('whitespace') + ], + 'enum': [ + include('whitespace'), + (r'token\b', Keyword, ('#pop', 'constants')), + default(('#pop', 'constants')) + ], + 'grammar': [ + (r'\)+', Punctuation), + (r'\(', Punctuation, 'grammar-tag'), + (r':', Punctuation, 'grammar-rules'), + (_name, Name.Class), + include('whitespace') + ], + 'grammar-tag': [ + include('whitespace'), + (r'"""([^\\"<]|""?(?!")|\\"+|\\.|<(?!<))+("{3,}|<<)|' + r'R"""([^\\"]|""?(?!")|\\"+|\\.)+"{3,}|' + r"'''([^\\'<]|''?(?!')|\\'+|\\.|<(?!<))+('{3,}|<<)|" + r"R'''([^\\']|''?(?!')|\\'+|\\.)+'{3,}|" + r'"([^\\"<]|\\.|<(?!<))+("|<<)|R"([^\\"]|\\.)+"|' + r"'([^\\'<]|\\.|<(?!<))+('|<<)|R'([^\\']|\\.)+'|" + r"([^)\s\\/]|/(?![/*]))+|\)", String.Other, '#pop') + ], + 'grammar-rules': [ + include('string'), + include('whitespace'), + (r'(\[)(%s*)(badness)' % _ws, + bygroups(Punctuation, using(this, state='whitespace'), Keyword), + 'main'), + (r'->|%s|[()]' % _operator, Punctuation), + (_name, Name.Constant), + default('#pop:2') + ], + ':': [ + (r':', Punctuation, '#pop') + ], + 'function-name': [ + (r'(<<([^>]|>>>|>(?!>))*>>)+', String.Interpol), + (r'(?=%s?%s*[({])' % (_name, _ws), Text, '#pop'), + (_name, Name.Function, '#pop'), + include('whitespace') + ], + 'inherited': [ + (r'<', Punctuation, ('#pop', 'classes', 'class')), + include('whitespace'), + (_name, Name.Class, '#pop'), + default('#pop') + ], + 'operator': [ + (r'negate\b', Operator.Word, '#pop'), + include('whitespace'), + (_operator, Operator), + default('#pop') + ], + 'propertyset': [ + (r'\(', Punctuation, ('more/parameters', 'main/parameters')), + (r'\{', Punctuation, ('#pop', 'object-body')), + include('whitespace') + ], + 'template': [ + (r'(?=;)', Text, '#pop'), + include('string'), + (r'inherited\b', Keyword.Reserved), + include('whitespace'), + (r'->|\?|%s' % _operator, Punctuation), + (_name, Name.Variable) + ], + + # Identifiers + 'class': [ + (r'\*|\.{3}', Punctuation, '#pop'), + (r'object\b', Keyword.Reserved, '#pop'), + (r'transient\b', Keyword.Reserved), + (_name, Name.Class, '#pop'), + include('whitespace'), + default('#pop') + ], + 'classes': [ + (r'[:,]', Punctuation, 'class'), + include('whitespace'), + (r'>', Punctuation, '#pop'), + default('#pop') + ], + 'constants': [ + (r',+', Punctuation), + (r';', Punctuation, '#pop'), + (r'property\b', Keyword.Reserved), + (_name, Name.Constant), + include('whitespace') + ], + 'label': [ + (_name, Name.Label, '#pop'), + include('whitespace'), + default('#pop') + ], + 'variables': [ + (r',+', Punctuation), + (r'\)', Punctuation, '#pop'), + include('whitespace'), + (_name, Name.Variable) + ], + + # Whitespace and comments + 'whitespace': [ + (r'^%s*#(%s|[^\n]|(?<=\\)\n)*\n?' % (_ws_pp, _comment_multiline), + Comment.Preproc), + (_comment_single, Comment.Single), + (_comment_multiline, Comment.Multiline), + (r'\\+\n+%s*#?|\n+|([^\S\n]|\\)+' % _ws_pp, Text) + ], + + # Strings + 'string': [ + (r'"""', String.Double, 'tdqs'), + (r"'''", String.Single, 'tsqs'), + (r'"', String.Double, 'dqs'), + (r"'", String.Single, 'sqs') + ], + 's/escape': [ + (r'\{\{|\}\}|%s' % _escape, String.Escape) + ], + 's/verbatim': [ + (r'<<\s*(as\s+decreasingly\s+likely\s+outcomes|cycling|else|end|' + r'first\s+time|one\s+of|only|or|otherwise|' + r'(sticky|(then\s+)?(purely\s+)?at)\s+random|stopping|' + r'(then\s+)?(half\s+)?shuffled|\|\|)\s*>>', String.Interpol), + (r'<<(%%(_(%s|\\?.)|[\-+ ,#]|\[\d*\]?)*\d*\.?\d*(%s|\\?.)|' + r'\s*((else|otherwise)\s+)?(if|unless)\b)?' % (_escape, _escape), + String.Interpol, ('block/embed', 'more/embed', 'main')) + ], + 's/entity': [ + (r'(?i)&(#(x[\da-f]+|\d+)|[a-z][\da-z]*);?', Name.Entity) + ], + 'tdqs': _make_string_state(True, True), + 'tsqs': _make_string_state(True, False), + 'dqs': _make_string_state(False, True), + 'sqs': _make_string_state(False, False), + 'tdqs/listing': _make_string_state(True, True, 'listing'), + 'tsqs/listing': _make_string_state(True, False, 'listing'), + 'dqs/listing': _make_string_state(False, True, 'listing'), + 'sqs/listing': _make_string_state(False, False, 'listing'), + 'tdqs/xmp': _make_string_state(True, True, 'xmp'), + 'tsqs/xmp': _make_string_state(True, False, 'xmp'), + 'dqs/xmp': _make_string_state(False, True, 'xmp'), + 'sqs/xmp': _make_string_state(False, False, 'xmp'), + + # Tags + 'tdqt': _make_tag_state(True, True), + 'tsqt': _make_tag_state(True, False), + 'dqt': _make_tag_state(False, True), + 'sqt': _make_tag_state(False, False), + 'dqs/tdqt': _make_attribute_value_state(r'"', True, True), + 'dqs/tsqt': _make_attribute_value_state(r'"', True, False), + 'dqs/dqt': _make_attribute_value_state(r'"', False, True), + 'dqs/sqt': _make_attribute_value_state(r'"', False, False), + 'sqs/tdqt': _make_attribute_value_state(r"'", True, True), + 'sqs/tsqt': _make_attribute_value_state(r"'", True, False), + 'sqs/dqt': _make_attribute_value_state(r"'", False, True), + 'sqs/sqt': _make_attribute_value_state(r"'", False, False), + 'uqs/tdqt': _make_attribute_value_state(_no_quote, True, True), + 'uqs/tsqt': _make_attribute_value_state(_no_quote, True, False), + 'uqs/dqt': _make_attribute_value_state(_no_quote, False, True), + 'uqs/sqt': _make_attribute_value_state(_no_quote, False, False), + + # Regular expressions + 'tdqr': [ + (r'[^\\"]+', String.Regex), + (r'\\"*', String.Regex), + (r'"{3,}', String.Regex, '#pop'), + (r'"', String.Regex) + ], + 'tsqr': [ + (r"[^\\']+", String.Regex), + (r"\\'*", String.Regex), + (r"'{3,}", String.Regex, '#pop'), + (r"'", String.Regex) + ], + 'dqr': [ + (r'[^\\"]+', String.Regex), + (r'\\"?', String.Regex), + (r'"', String.Regex, '#pop') + ], + 'sqr': [ + (r"[^\\']+", String.Regex), + (r"\\'?", String.Regex), + (r"'", String.Regex, '#pop') + ] + } + + def get_tokens_unprocessed(self, text, **kwargs): + pp = r'^%s*#%s*' % (self._ws_pp, self._ws_pp) + if_false_level = 0 + for index, token, value in ( + RegexLexer.get_tokens_unprocessed(self, text, **kwargs)): + if if_false_level == 0: # Not in a false #if + if (token is Comment.Preproc and + re.match(r'%sif%s+(0|nil)%s*$\n?' % + (pp, self._ws_pp, self._ws_pp), value)): + if_false_level = 1 + else: # In a false #if + if token is Comment.Preproc: + if (if_false_level == 1 and + re.match(r'%sel(if|se)\b' % pp, value)): + if_false_level = 0 + elif re.match(r'%sif' % pp, value): + if_false_level += 1 + elif re.match(r'%sendif\b' % pp, value): + if_false_level -= 1 + else: + token = Comment + yield index, token, value diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/jvm.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/jvm.py new file mode 100644 index 0000000000000000000000000000000000000000..f4392839ea7f4251e0851b31553d6106daeae40e --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/jvm.py @@ -0,0 +1,1573 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.jvm + ~~~~~~~~~~~~~~~~~~~ + + Pygments lexers for JVM languages. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import Lexer, RegexLexer, include, bygroups, using, \ + this, combined, default, words +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation +from pygments.util import shebang_matches +from pygments import unistring as uni + +__all__ = ['JavaLexer', 'ScalaLexer', 'GosuLexer', 'GosuTemplateLexer', + 'GroovyLexer', 'IokeLexer', 'ClojureLexer', 'ClojureScriptLexer', + 'KotlinLexer', 'XtendLexer', 'AspectJLexer', 'CeylonLexer', + 'PigLexer', 'GoloLexer', 'JasminLexer'] + + +class JavaLexer(RegexLexer): + """ + For `Java `_ source code. + """ + + name = 'Java' + aliases = ['java'] + filenames = ['*.java'] + mimetypes = ['text/x-java'] + + flags = re.MULTILINE | re.DOTALL | re.UNICODE + + tokens = { + 'root': [ + (r'[^\S\n]+', Text), + (r'//.*?\n', Comment.Single), + (r'/\*.*?\*/', Comment.Multiline), + # keywords: go before method names to avoid lexing "throw new XYZ" + # as a method signature + (r'(assert|break|case|catch|continue|default|do|else|finally|for|' + r'if|goto|instanceof|new|return|switch|this|throw|try|while)\b', + Keyword), + # method names + (r'((?:(?:[^\W\d]|\$)[\w.\[\]$<>]*\s+)+?)' # return arguments + r'((?:[^\W\d]|\$)[\w$]*)' # method name + r'(\s*)(\()', # signature start + bygroups(using(this), Name.Function, Text, Operator)), + (r'@[^\W\d][\w.]*', Name.Decorator), + (r'(abstract|const|enum|extends|final|implements|native|private|' + r'protected|public|static|strictfp|super|synchronized|throws|' + r'transient|volatile)\b', Keyword.Declaration), + (r'(boolean|byte|char|double|float|int|long|short|void)\b', + Keyword.Type), + (r'(package)(\s+)', bygroups(Keyword.Namespace, Text), 'import'), + (r'(true|false|null)\b', Keyword.Constant), + (r'(class|interface)(\s+)', bygroups(Keyword.Declaration, Text), + 'class'), + (r'(import(?:\s+static)?)(\s+)', bygroups(Keyword.Namespace, Text), + 'import'), + (r'"(\\\\|\\"|[^"])*"', String), + (r"'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'", String.Char), + (r'(\.)((?:[^\W\d]|\$)[\w$]*)', bygroups(Operator, Name.Attribute)), + (r'^\s*([^\W\d]|\$)[\w$]*:', Name.Label), + (r'([^\W\d]|\$)[\w$]*', Name), + (r'([0-9][0-9_]*\.([0-9][0-9_]*)?|' + r'\.[0-9][0-9_]*)' + r'([eE][+\-]?[0-9][0-9_]*)?[fFdD]?|' + r'[0-9][eE][+\-]?[0-9][0-9_]*[fFdD]?|' + r'[0-9]([eE][+\-]?[0-9][0-9_]*)?[fFdD]|' + r'0[xX]([0-9a-fA-F][0-9a-fA-F_]*\.?|' + r'([0-9a-fA-F][0-9a-fA-F_]*)?\.[0-9a-fA-F][0-9a-fA-F_]*)' + r'[pP][+\-]?[0-9][0-9_]*[fFdD]?', Number.Float), + (r'0[xX][0-9a-fA-F][0-9a-fA-F_]*[lL]?', Number.Hex), + (r'0[bB][01][01_]*[lL]?', Number.Bin), + (r'0[0-7_]+[lL]?', Number.Oct), + (r'0|[1-9][0-9_]*[lL]?', Number.Integer), + (r'[~^*!%&\[\](){}<>|+=:;,./?-]', Operator), + (r'\n', Text) + ], + 'class': [ + (r'([^\W\d]|\$)[\w$]*', Name.Class, '#pop') + ], + 'import': [ + (r'[\w.]+\*?', Name.Namespace, '#pop') + ], + } + + +class AspectJLexer(JavaLexer): + """ + For `AspectJ `_ source code. + + .. versionadded:: 1.6 + """ + + name = 'AspectJ' + aliases = ['aspectj'] + filenames = ['*.aj'] + mimetypes = ['text/x-aspectj'] + + aj_keywords = set(( + 'aspect', 'pointcut', 'privileged', 'call', 'execution', + 'initialization', 'preinitialization', 'handler', 'get', 'set', + 'staticinitialization', 'target', 'args', 'within', 'withincode', + 'cflow', 'cflowbelow', 'annotation', 'before', 'after', 'around', + 'proceed', 'throwing', 'returning', 'adviceexecution', 'declare', + 'parents', 'warning', 'error', 'soft', 'precedence', 'thisJoinPoint', + 'thisJoinPointStaticPart', 'thisEnclosingJoinPointStaticPart', + 'issingleton', 'perthis', 'pertarget', 'percflow', 'percflowbelow', + 'pertypewithin', 'lock', 'unlock', 'thisAspectInstance' + )) + aj_inter_type = set(('parents:', 'warning:', 'error:', 'soft:', 'precedence:')) + aj_inter_type_annotation = set(('@type', '@method', '@constructor', '@field')) + + def get_tokens_unprocessed(self, text): + for index, token, value in JavaLexer.get_tokens_unprocessed(self, text): + if token is Name and value in self.aj_keywords: + yield index, Keyword, value + elif token is Name.Label and value in self.aj_inter_type: + yield index, Keyword, value[:-1] + yield index, Operator, value[-1] + elif token is Name.Decorator and value in self.aj_inter_type_annotation: + yield index, Keyword, value + else: + yield index, token, value + + +class ScalaLexer(RegexLexer): + """ + For `Scala `_ source code. + """ + + name = 'Scala' + aliases = ['scala'] + filenames = ['*.scala'] + mimetypes = ['text/x-scala'] + + flags = re.MULTILINE | re.DOTALL + + # don't use raw unicode strings! + op = (u'[-~\\^\\*!%&\\\\<>\\|+=:/?@\u00a6-\u00a7\u00a9\u00ac\u00ae\u00b0-\u00b1' + u'\u00b6\u00d7\u00f7\u03f6\u0482\u0606-\u0608\u060e-\u060f\u06e9' + u'\u06fd-\u06fe\u07f6\u09fa\u0b70\u0bf3-\u0bf8\u0bfa\u0c7f\u0cf1-\u0cf2' + u'\u0d79\u0f01-\u0f03\u0f13-\u0f17\u0f1a-\u0f1f\u0f34\u0f36\u0f38' + u'\u0fbe-\u0fc5\u0fc7-\u0fcf\u109e-\u109f\u1360\u1390-\u1399\u1940' + u'\u19e0-\u19ff\u1b61-\u1b6a\u1b74-\u1b7c\u2044\u2052\u207a-\u207c' + u'\u208a-\u208c\u2100-\u2101\u2103-\u2106\u2108-\u2109\u2114\u2116-\u2118' + u'\u211e-\u2123\u2125\u2127\u2129\u212e\u213a-\u213b\u2140-\u2144' + u'\u214a-\u214d\u214f\u2190-\u2328\u232b-\u244a\u249c-\u24e9\u2500-\u2767' + u'\u2794-\u27c4\u27c7-\u27e5\u27f0-\u2982\u2999-\u29d7\u29dc-\u29fb' + u'\u29fe-\u2b54\u2ce5-\u2cea\u2e80-\u2ffb\u3004\u3012-\u3013\u3020' + u'\u3036-\u3037\u303e-\u303f\u3190-\u3191\u3196-\u319f\u31c0-\u31e3' + u'\u3200-\u321e\u322a-\u3250\u3260-\u327f\u328a-\u32b0\u32c0-\u33ff' + u'\u4dc0-\u4dff\ua490-\ua4c6\ua828-\ua82b\ufb29\ufdfd\ufe62\ufe64-\ufe66' + u'\uff0b\uff1c-\uff1e\uff5c\uff5e\uffe2\uffe4\uffe8-\uffee\ufffc-\ufffd]+') + + letter = (u'[a-zA-Z\\$_\u00aa\u00b5\u00ba\u00c0-\u00d6\u00d8-\u00f6' + u'\u00f8-\u02af\u0370-\u0373\u0376-\u0377\u037b-\u037d\u0386' + u'\u0388-\u03f5\u03f7-\u0481\u048a-\u0556\u0561-\u0587\u05d0-\u05f2' + u'\u0621-\u063f\u0641-\u064a\u066e-\u066f\u0671-\u06d3\u06d5' + u'\u06ee-\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5' + u'\u07b1\u07ca-\u07ea\u0904-\u0939\u093d\u0950\u0958-\u0961' + u'\u0972-\u097f\u0985-\u09b9\u09bd\u09ce\u09dc-\u09e1\u09f0-\u09f1' + u'\u0a05-\u0a39\u0a59-\u0a5e\u0a72-\u0a74\u0a85-\u0ab9\u0abd' + u'\u0ad0-\u0ae1\u0b05-\u0b39\u0b3d\u0b5c-\u0b61\u0b71\u0b83-\u0bb9' + u'\u0bd0\u0c05-\u0c3d\u0c58-\u0c61\u0c85-\u0cb9\u0cbd\u0cde-\u0ce1' + u'\u0d05-\u0d3d\u0d60-\u0d61\u0d7a-\u0d7f\u0d85-\u0dc6\u0e01-\u0e30' + u'\u0e32-\u0e33\u0e40-\u0e45\u0e81-\u0eb0\u0eb2-\u0eb3\u0ebd-\u0ec4' + u'\u0edc-\u0f00\u0f40-\u0f6c\u0f88-\u0f8b\u1000-\u102a\u103f' + u'\u1050-\u1055\u105a-\u105d\u1061\u1065-\u1066\u106e-\u1070' + u'\u1075-\u1081\u108e\u10a0-\u10fa\u1100-\u135a\u1380-\u138f' + u'\u13a0-\u166c\u166f-\u1676\u1681-\u169a\u16a0-\u16ea\u16ee-\u1711' + u'\u1720-\u1731\u1740-\u1751\u1760-\u1770\u1780-\u17b3\u17dc' + u'\u1820-\u1842\u1844-\u18a8\u18aa-\u191c\u1950-\u19a9\u19c1-\u19c7' + u'\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae-\u1baf' + u'\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c77\u1d00-\u1d2b\u1d62-\u1d77' + u'\u1d79-\u1d9a\u1e00-\u1fbc\u1fbe\u1fc2-\u1fcc\u1fd0-\u1fdb' + u'\u1fe0-\u1fec\u1ff2-\u1ffc\u2071\u207f\u2102\u2107\u210a-\u2113' + u'\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139' + u'\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c7c' + u'\u2c80-\u2ce4\u2d00-\u2d65\u2d80-\u2dde\u3006-\u3007\u3021-\u3029' + u'\u3038-\u303a\u303c\u3041-\u3096\u309f\u30a1-\u30fa\u30ff-\u318e' + u'\u31a0-\u31b7\u31f0-\u31ff\u3400-\u4db5\u4e00-\ua014\ua016-\ua48c' + u'\ua500-\ua60b\ua610-\ua61f\ua62a-\ua66e\ua680-\ua697\ua722-\ua76f' + u'\ua771-\ua787\ua78b-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822' + u'\ua840-\ua873\ua882-\ua8b3\ua90a-\ua925\ua930-\ua946\uaa00-\uaa28' + u'\uaa40-\uaa42\uaa44-\uaa4b\uac00-\ud7a3\uf900-\ufb1d\ufb1f-\ufb28' + u'\ufb2a-\ufd3d\ufd50-\ufdfb\ufe70-\ufefc\uff21-\uff3a\uff41-\uff5a' + u'\uff66-\uff6f\uff71-\uff9d\uffa0-\uffdc]') + + upper = (u'[A-Z\\$_\u00c0-\u00d6\u00d8-\u00de\u0100\u0102\u0104\u0106\u0108' + u'\u010a\u010c\u010e\u0110\u0112\u0114\u0116\u0118\u011a\u011c' + u'\u011e\u0120\u0122\u0124\u0126\u0128\u012a\u012c\u012e\u0130' + u'\u0132\u0134\u0136\u0139\u013b\u013d\u013f\u0141\u0143\u0145' + u'\u0147\u014a\u014c\u014e\u0150\u0152\u0154\u0156\u0158\u015a' + u'\u015c\u015e\u0160\u0162\u0164\u0166\u0168\u016a\u016c\u016e' + u'\u0170\u0172\u0174\u0176\u0178-\u0179\u017b\u017d\u0181-\u0182' + u'\u0184\u0186-\u0187\u0189-\u018b\u018e-\u0191\u0193-\u0194' + u'\u0196-\u0198\u019c-\u019d\u019f-\u01a0\u01a2\u01a4\u01a6-\u01a7' + u'\u01a9\u01ac\u01ae-\u01af\u01b1-\u01b3\u01b5\u01b7-\u01b8\u01bc' + u'\u01c4\u01c7\u01ca\u01cd\u01cf\u01d1\u01d3\u01d5\u01d7\u01d9' + u'\u01db\u01de\u01e0\u01e2\u01e4\u01e6\u01e8\u01ea\u01ec\u01ee' + u'\u01f1\u01f4\u01f6-\u01f8\u01fa\u01fc\u01fe\u0200\u0202\u0204' + u'\u0206\u0208\u020a\u020c\u020e\u0210\u0212\u0214\u0216\u0218' + u'\u021a\u021c\u021e\u0220\u0222\u0224\u0226\u0228\u022a\u022c' + u'\u022e\u0230\u0232\u023a-\u023b\u023d-\u023e\u0241\u0243-\u0246' + u'\u0248\u024a\u024c\u024e\u0370\u0372\u0376\u0386\u0388-\u038f' + u'\u0391-\u03ab\u03cf\u03d2-\u03d4\u03d8\u03da\u03dc\u03de\u03e0' + u'\u03e2\u03e4\u03e6\u03e8\u03ea\u03ec\u03ee\u03f4\u03f7' + u'\u03f9-\u03fa\u03fd-\u042f\u0460\u0462\u0464\u0466\u0468\u046a' + u'\u046c\u046e\u0470\u0472\u0474\u0476\u0478\u047a\u047c\u047e' + u'\u0480\u048a\u048c\u048e\u0490\u0492\u0494\u0496\u0498\u049a' + u'\u049c\u049e\u04a0\u04a2\u04a4\u04a6\u04a8\u04aa\u04ac\u04ae' + u'\u04b0\u04b2\u04b4\u04b6\u04b8\u04ba\u04bc\u04be\u04c0-\u04c1' + u'\u04c3\u04c5\u04c7\u04c9\u04cb\u04cd\u04d0\u04d2\u04d4\u04d6' + u'\u04d8\u04da\u04dc\u04de\u04e0\u04e2\u04e4\u04e6\u04e8\u04ea' + u'\u04ec\u04ee\u04f0\u04f2\u04f4\u04f6\u04f8\u04fa\u04fc\u04fe' + u'\u0500\u0502\u0504\u0506\u0508\u050a\u050c\u050e\u0510\u0512' + u'\u0514\u0516\u0518\u051a\u051c\u051e\u0520\u0522\u0531-\u0556' + u'\u10a0-\u10c5\u1e00\u1e02\u1e04\u1e06\u1e08\u1e0a\u1e0c\u1e0e' + u'\u1e10\u1e12\u1e14\u1e16\u1e18\u1e1a\u1e1c\u1e1e\u1e20\u1e22' + u'\u1e24\u1e26\u1e28\u1e2a\u1e2c\u1e2e\u1e30\u1e32\u1e34\u1e36' + u'\u1e38\u1e3a\u1e3c\u1e3e\u1e40\u1e42\u1e44\u1e46\u1e48\u1e4a' + u'\u1e4c\u1e4e\u1e50\u1e52\u1e54\u1e56\u1e58\u1e5a\u1e5c\u1e5e' + u'\u1e60\u1e62\u1e64\u1e66\u1e68\u1e6a\u1e6c\u1e6e\u1e70\u1e72' + u'\u1e74\u1e76\u1e78\u1e7a\u1e7c\u1e7e\u1e80\u1e82\u1e84\u1e86' + u'\u1e88\u1e8a\u1e8c\u1e8e\u1e90\u1e92\u1e94\u1e9e\u1ea0\u1ea2' + u'\u1ea4\u1ea6\u1ea8\u1eaa\u1eac\u1eae\u1eb0\u1eb2\u1eb4\u1eb6' + u'\u1eb8\u1eba\u1ebc\u1ebe\u1ec0\u1ec2\u1ec4\u1ec6\u1ec8\u1eca' + u'\u1ecc\u1ece\u1ed0\u1ed2\u1ed4\u1ed6\u1ed8\u1eda\u1edc\u1ede' + u'\u1ee0\u1ee2\u1ee4\u1ee6\u1ee8\u1eea\u1eec\u1eee\u1ef0\u1ef2' + u'\u1ef4\u1ef6\u1ef8\u1efa\u1efc\u1efe\u1f08-\u1f0f\u1f18-\u1f1d' + u'\u1f28-\u1f2f\u1f38-\u1f3f\u1f48-\u1f4d\u1f59-\u1f5f' + u'\u1f68-\u1f6f\u1fb8-\u1fbb\u1fc8-\u1fcb\u1fd8-\u1fdb' + u'\u1fe8-\u1fec\u1ff8-\u1ffb\u2102\u2107\u210b-\u210d\u2110-\u2112' + u'\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u2130-\u2133' + u'\u213e-\u213f\u2145\u2183\u2c00-\u2c2e\u2c60\u2c62-\u2c64\u2c67' + u'\u2c69\u2c6b\u2c6d-\u2c6f\u2c72\u2c75\u2c80\u2c82\u2c84\u2c86' + u'\u2c88\u2c8a\u2c8c\u2c8e\u2c90\u2c92\u2c94\u2c96\u2c98\u2c9a' + u'\u2c9c\u2c9e\u2ca0\u2ca2\u2ca4\u2ca6\u2ca8\u2caa\u2cac\u2cae' + u'\u2cb0\u2cb2\u2cb4\u2cb6\u2cb8\u2cba\u2cbc\u2cbe\u2cc0\u2cc2' + u'\u2cc4\u2cc6\u2cc8\u2cca\u2ccc\u2cce\u2cd0\u2cd2\u2cd4\u2cd6' + u'\u2cd8\u2cda\u2cdc\u2cde\u2ce0\u2ce2\ua640\ua642\ua644\ua646' + u'\ua648\ua64a\ua64c\ua64e\ua650\ua652\ua654\ua656\ua658\ua65a' + u'\ua65c\ua65e\ua662\ua664\ua666\ua668\ua66a\ua66c\ua680\ua682' + u'\ua684\ua686\ua688\ua68a\ua68c\ua68e\ua690\ua692\ua694\ua696' + u'\ua722\ua724\ua726\ua728\ua72a\ua72c\ua72e\ua732\ua734\ua736' + u'\ua738\ua73a\ua73c\ua73e\ua740\ua742\ua744\ua746\ua748\ua74a' + u'\ua74c\ua74e\ua750\ua752\ua754\ua756\ua758\ua75a\ua75c\ua75e' + u'\ua760\ua762\ua764\ua766\ua768\ua76a\ua76c\ua76e\ua779\ua77b' + u'\ua77d-\ua77e\ua780\ua782\ua784\ua786\ua78b\uff21-\uff3a]') + + idrest = u'%s(?:%s|[0-9])*(?:(?<=_)%s)?' % (letter, letter, op) + letter_letter_digit = u'%s(?:%s|\d)*' % (letter, letter) + + tokens = { + 'root': [ + # method names + (r'(class|trait|object)(\s+)', bygroups(Keyword, Text), 'class'), + (r'[^\S\n]+', Text), + (r'//.*?\n', Comment.Single), + (r'/\*', Comment.Multiline, 'comment'), + (u'@%s' % idrest, Name.Decorator), + (u'(abstract|ca(?:se|tch)|d(?:ef|o)|e(?:lse|xtends)|' + u'f(?:inal(?:ly)?|or(?:Some)?)|i(?:f|mplicit)|' + u'lazy|match|new|override|pr(?:ivate|otected)' + u'|re(?:quires|turn)|s(?:ealed|uper)|' + u't(?:h(?:is|row)|ry)|va[lr]|w(?:hile|ith)|yield)\\b|' + u'(<[%:-]|=>|>:|[#=@_\u21D2\u2190])(\\b|(?=\\s)|$)', Keyword), + (u':(?!%s)' % op, Keyword, 'type'), + (u'%s%s\\b' % (upper, idrest), Name.Class), + (r'(true|false|null)\b', Keyword.Constant), + (r'(import|package)(\s+)', bygroups(Keyword, Text), 'import'), + (r'(type)(\s+)', bygroups(Keyword, Text), 'type'), + (r'""".*?"""(?!")', String), + (r'"(\\\\|\\"|[^"])*"', String), + (r"'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'", String.Char), + (u"'%s" % idrest, Text.Symbol), + (r'[fs]"""', String, 'interptriplestring'), # interpolated strings + (r'[fs]"', String, 'interpstring'), # interpolated strings + (r'raw"(\\\\|\\"|[^"])*"', String), # raw strings + # (ur'(\.)(%s|%s|`[^`]+`)' % (idrest, op), bygroups(Operator, + # Name.Attribute)), + (idrest, Name), + (r'`[^`]+`', Name), + (r'\[', Operator, 'typeparam'), + (r'[(){};,.#]', Operator), + (op, Operator), + (r'([0-9][0-9]*\.[0-9]*|\.[0-9]+)([eE][+-]?[0-9]+)?[fFdD]?', + Number.Float), + (r'0x[0-9a-fA-F]+', Number.Hex), + (r'[0-9]+L?', Number.Integer), + (r'\n', Text) + ], + 'class': [ + (u'(%s|%s|`[^`]+`)(\\s*)(\\[)' % (idrest, op), + bygroups(Name.Class, Text, Operator), 'typeparam'), + (r'\s+', Text), + (r'\{', Operator, '#pop'), + (r'\(', Operator, '#pop'), + (r'//.*?\n', Comment.Single, '#pop'), + (u'%s|%s|`[^`]+`' % (idrest, op), Name.Class, '#pop'), + ], + 'type': [ + (r'\s+', Text), + (r'<[%:]|>:|[#_]|forSome|type', Keyword), + (u'([,);}]|=>|=|\u21d2)(\\s*)', bygroups(Operator, Text), '#pop'), + (r'[({]', Operator, '#push'), + (u'((?:%s|%s|`[^`]+`)(?:\\.(?:%s|%s|`[^`]+`))*)(\\s*)(\\[)' % + (idrest, op, idrest, op), + bygroups(Keyword.Type, Text, Operator), ('#pop', 'typeparam')), + (u'((?:%s|%s|`[^`]+`)(?:\\.(?:%s|%s|`[^`]+`))*)(\\s*)$' % + (idrest, op, idrest, op), + bygroups(Keyword.Type, Text), '#pop'), + (r'//.*?\n', Comment.Single, '#pop'), + (u'\\.|%s|%s|`[^`]+`' % (idrest, op), Keyword.Type) + ], + 'typeparam': [ + (r'[\s,]+', Text), + (u'<[%:]|=>|>:|[#_\u21D2]|forSome|type', Keyword), + (r'([\])}])', Operator, '#pop'), + (r'[(\[{]', Operator, '#push'), + (u'\\.|%s|%s|`[^`]+`' % (idrest, op), Keyword.Type) + ], + 'comment': [ + (r'[^/*]+', Comment.Multiline), + (r'/\*', Comment.Multiline, '#push'), + (r'\*/', Comment.Multiline, '#pop'), + (r'[*/]', Comment.Multiline) + ], + 'import': [ + (u'(%s|\\.)+' % idrest, Name.Namespace, '#pop') + ], + 'interpstringcommon': [ + (r'[^"$\\]+', String), + (r'\$\$', String), + (r'\$' + letter_letter_digit, String.Interpol), + (r'\$\{', String.Interpol, 'interpbrace'), + (r'\\.', String), + ], + 'interptriplestring': [ + (r'"""(?!")', String, '#pop'), + (r'"', String), + include('interpstringcommon'), + ], + 'interpstring': [ + (r'"', String, '#pop'), + include('interpstringcommon'), + ], + 'interpbrace': [ + (r'\}', String.Interpol, '#pop'), + (r'\{', String.Interpol, '#push'), + include('root'), + ], + } + + +class GosuLexer(RegexLexer): + """ + For Gosu source code. + + .. versionadded:: 1.5 + """ + + name = 'Gosu' + aliases = ['gosu'] + filenames = ['*.gs', '*.gsx', '*.gsp', '*.vark'] + mimetypes = ['text/x-gosu'] + + flags = re.MULTILINE | re.DOTALL + + tokens = { + 'root': [ + # method names + (r'^(\s*(?:[a-zA-Z_][\w.\[\]]*\s+)+?)' # modifiers etc. + r'([a-zA-Z_]\w*)' # method name + r'(\s*)(\()', # signature start + bygroups(using(this), Name.Function, Text, Operator)), + (r'[^\S\n]+', Text), + (r'//.*?\n', Comment.Single), + (r'/\*.*?\*/', Comment.Multiline), + (r'@[a-zA-Z_][\w.]*', Name.Decorator), + (r'(in|as|typeof|statictypeof|typeis|typeas|if|else|foreach|for|' + r'index|while|do|continue|break|return|try|catch|finally|this|' + r'throw|new|switch|case|default|eval|super|outer|classpath|' + r'using)\b', Keyword), + (r'(var|delegate|construct|function|private|internal|protected|' + r'public|abstract|override|final|static|extends|transient|' + r'implements|represents|readonly)\b', Keyword.Declaration), + (r'(property\s+)(get|set)?', Keyword.Declaration), + (r'(boolean|byte|char|double|float|int|long|short|void|block)\b', + Keyword.Type), + (r'(package)(\s+)', bygroups(Keyword.Namespace, Text)), + (r'(true|false|null|NaN|Infinity)\b', Keyword.Constant), + (r'(class|interface|enhancement|enum)(\s+)([a-zA-Z_]\w*)', + bygroups(Keyword.Declaration, Text, Name.Class)), + (r'(uses)(\s+)([\w.]+\*?)', + bygroups(Keyword.Namespace, Text, Name.Namespace)), + (r'"', String, 'string'), + (r'(\??[.#])([a-zA-Z_]\w*)', + bygroups(Operator, Name.Attribute)), + (r'(:)([a-zA-Z_]\w*)', + bygroups(Operator, Name.Attribute)), + (r'[a-zA-Z_$]\w*', Name), + (r'and|or|not|[\\~^*!%&\[\](){}<>|+=:;,./?-]', Operator), + (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), + (r'[0-9]+', Number.Integer), + (r'\n', Text) + ], + 'templateText': [ + (r'(\\<)|(\\\$)', String), + (r'(<%@\s+)(extends|params)', + bygroups(Operator, Name.Decorator), 'stringTemplate'), + (r'<%!--.*?--%>', Comment.Multiline), + (r'(<%)|(<%=)', Operator, 'stringTemplate'), + (r'\$\{', Operator, 'stringTemplateShorthand'), + (r'.', String) + ], + 'string': [ + (r'"', String, '#pop'), + include('templateText') + ], + 'stringTemplate': [ + (r'"', String, 'string'), + (r'%>', Operator, '#pop'), + include('root') + ], + 'stringTemplateShorthand': [ + (r'"', String, 'string'), + (r'\{', Operator, 'stringTemplateShorthand'), + (r'\}', Operator, '#pop'), + include('root') + ], + } + + +class GosuTemplateLexer(Lexer): + """ + For Gosu templates. + + .. versionadded:: 1.5 + """ + + name = 'Gosu Template' + aliases = ['gst'] + filenames = ['*.gst'] + mimetypes = ['text/x-gosu-template'] + + def get_tokens_unprocessed(self, text): + lexer = GosuLexer() + stack = ['templateText'] + for item in lexer.get_tokens_unprocessed(text, stack): + yield item + + +class GroovyLexer(RegexLexer): + """ + For `Groovy `_ source code. + + .. versionadded:: 1.5 + """ + + name = 'Groovy' + aliases = ['groovy'] + filenames = ['*.groovy','*.gradle'] + mimetypes = ['text/x-groovy'] + + flags = re.MULTILINE | re.DOTALL + + tokens = { + 'root': [ + # Groovy allows a file to start with a shebang + (r'#!(.*?)$', Comment.Preproc, 'base'), + default('base'), + ], + 'base': [ + # method names + (r'^(\s*(?:[a-zA-Z_][\w.\[\]]*\s+)+?)' # return arguments + r'([a-zA-Z_]\w*)' # method name + r'(\s*)(\()', # signature start + bygroups(using(this), Name.Function, Text, Operator)), + (r'[^\S\n]+', Text), + (r'//.*?\n', Comment.Single), + (r'/\*.*?\*/', Comment.Multiline), + (r'@[a-zA-Z_][\w.]*', Name.Decorator), + (r'(assert|break|case|catch|continue|default|do|else|finally|for|' + r'if|goto|instanceof|new|return|switch|this|throw|try|while|in|as)\b', + Keyword), + (r'(abstract|const|enum|extends|final|implements|native|private|' + r'protected|public|static|strictfp|super|synchronized|throws|' + r'transient|volatile)\b', Keyword.Declaration), + (r'(def|boolean|byte|char|double|float|int|long|short|void)\b', + Keyword.Type), + (r'(package)(\s+)', bygroups(Keyword.Namespace, Text)), + (r'(true|false|null)\b', Keyword.Constant), + (r'(class|interface)(\s+)', bygroups(Keyword.Declaration, Text), + 'class'), + (r'(import)(\s+)', bygroups(Keyword.Namespace, Text), 'import'), + (r'""".*?"""', String.Double), + (r"'''.*?'''", String.Single), + (r'"(\\\\|\\"|[^"])*"', String.Double), + (r"'(\\\\|\\'|[^'])*'", String.Single), + (r'\$/((?!/\$).)*/\$', String), + (r'/(\\\\|\\"|[^/])*/', String), + (r"'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'", String.Char), + (r'(\.)([a-zA-Z_]\w*)', bygroups(Operator, Name.Attribute)), + (r'[a-zA-Z_]\w*:', Name.Label), + (r'[a-zA-Z_$]\w*', Name), + (r'[~^*!%&\[\](){}<>|+=:;,./?-]', Operator), + (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), + (r'0x[0-9a-fA-F]+', Number.Hex), + (r'[0-9]+L?', Number.Integer), + (r'\n', Text) + ], + 'class': [ + (r'[a-zA-Z_]\w*', Name.Class, '#pop') + ], + 'import': [ + (r'[\w.]+\*?', Name.Namespace, '#pop') + ], + } + + def analyse_text(text): + return shebang_matches(text, r'groovy') + + +class IokeLexer(RegexLexer): + """ + For `Ioke `_ (a strongly typed, dynamic, + prototype based programming language) source. + + .. versionadded:: 1.4 + """ + name = 'Ioke' + filenames = ['*.ik'] + aliases = ['ioke', 'ik'] + mimetypes = ['text/x-iokesrc'] + tokens = { + 'interpolatableText': [ + (r'(\\b|\\e|\\t|\\n|\\f|\\r|\\"|\\\\|\\#|\\\Z|\\u[0-9a-fA-F]{1,4}' + r'|\\[0-3]?[0-7]?[0-7])', String.Escape), + (r'#\{', Punctuation, 'textInterpolationRoot') + ], + + 'text': [ + (r'(?>|\|\|>>|\*\*>>|:::|::|\.\.\.|===|\*\*>|\*\*=|&&>|&&=|' + r'\|\|>|\|\|=|\->>|\+>>|!>>|<>>>|<>>|&>>|%>>|#>>|@>>|/>>|\*>>|' + r'\?>>|\|>>|\^>>|~>>|\$>>|=>>|<<=|>>=|<=>|<\->|=~|!~|=>|\+\+|' + r'\-\-|<=|>=|==|!=|&&|\.\.|\+=|\-=|\*=|\/=|%=|&=|\^=|\|=|<\-|' + r'\+>|!>|<>|&>|%>|#>|\@>|\/>|\*>|\?>|\|>|\^>|~>|\$>|<\->|\->|' + r'<<|>>|\*\*|\?\||\?&|\|\||>|<|\*|\/|%|\+|\-|&|\^|\||=|\$|!|~|' + u'\\?|#|\u2260|\u2218|\u2208|\u2209)', Operator), + (r'(and|nand|or|xor|nor|return|import)(?![\w!?])', + Operator), + + # Punctuation + (r'(\`\`|\`|\'\'|\'|\.|\,|@@|@|\[|\]|\(|\)|\{|\})', Punctuation), + + # kinds + (r'[A-Z][\w!:?]*', Name.Class), + + # default cellnames + (r'[a-z_][\w!:?]*', Name) + ] + } + + +class ClojureLexer(RegexLexer): + """ + Lexer for `Clojure `_ source code. + + .. versionadded:: 0.11 + """ + name = 'Clojure' + aliases = ['clojure', 'clj'] + filenames = ['*.clj'] + mimetypes = ['text/x-clojure', 'application/x-clojure'] + + special_forms = ( + '.', 'def', 'do', 'fn', 'if', 'let', 'new', 'quote', 'var', 'loop' + ) + + # It's safe to consider 'ns' a declaration thing because it defines a new + # namespace. + declarations = ( + 'def-', 'defn', 'defn-', 'defmacro', 'defmulti', 'defmethod', + 'defstruct', 'defonce', 'declare', 'definline', 'definterface', + 'defprotocol', 'defrecord', 'deftype', 'defproject', 'ns' + ) + + builtins = ( + '*', '+', '-', '->', '/', '<', '<=', '=', '==', '>', '>=', '..', + 'accessor', 'agent', 'agent-errors', 'aget', 'alength', 'all-ns', + 'alter', 'and', 'append-child', 'apply', 'array-map', 'aset', + 'aset-boolean', 'aset-byte', 'aset-char', 'aset-double', 'aset-float', + 'aset-int', 'aset-long', 'aset-short', 'assert', 'assoc', 'await', + 'await-for', 'bean', 'binding', 'bit-and', 'bit-not', 'bit-or', + 'bit-shift-left', 'bit-shift-right', 'bit-xor', 'boolean', 'branch?', + 'butlast', 'byte', 'cast', 'char', 'children', 'class', + 'clear-agent-errors', 'comment', 'commute', 'comp', 'comparator', + 'complement', 'concat', 'conj', 'cons', 'constantly', 'cond', 'if-not', + 'construct-proxy', 'contains?', 'count', 'create-ns', 'create-struct', + 'cycle', 'dec', 'deref', 'difference', 'disj', 'dissoc', 'distinct', + 'doall', 'doc', 'dorun', 'doseq', 'dosync', 'dotimes', 'doto', + 'double', 'down', 'drop', 'drop-while', 'edit', 'end?', 'ensure', + 'eval', 'every?', 'false?', 'ffirst', 'file-seq', 'filter', 'find', + 'find-doc', 'find-ns', 'find-var', 'first', 'float', 'flush', 'for', + 'fnseq', 'frest', 'gensym', 'get-proxy-class', 'get', + 'hash-map', 'hash-set', 'identical?', 'identity', 'if-let', 'import', + 'in-ns', 'inc', 'index', 'insert-child', 'insert-left', 'insert-right', + 'inspect-table', 'inspect-tree', 'instance?', 'int', 'interleave', + 'intersection', 'into', 'into-array', 'iterate', 'join', 'key', 'keys', + 'keyword', 'keyword?', 'last', 'lazy-cat', 'lazy-cons', 'left', + 'lefts', 'line-seq', 'list*', 'list', 'load', 'load-file', + 'locking', 'long', 'loop', 'macroexpand', 'macroexpand-1', + 'make-array', 'make-node', 'map', 'map-invert', 'map?', 'mapcat', + 'max', 'max-key', 'memfn', 'merge', 'merge-with', 'meta', 'min', + 'min-key', 'name', 'namespace', 'neg?', 'new', 'newline', 'next', + 'nil?', 'node', 'not', 'not-any?', 'not-every?', 'not=', 'ns-imports', + 'ns-interns', 'ns-map', 'ns-name', 'ns-publics', 'ns-refers', + 'ns-resolve', 'ns-unmap', 'nth', 'nthrest', 'or', 'parse', 'partial', + 'path', 'peek', 'pop', 'pos?', 'pr', 'pr-str', 'print', 'print-str', + 'println', 'println-str', 'prn', 'prn-str', 'project', 'proxy', + 'proxy-mappings', 'quot', 'rand', 'rand-int', 'range', 're-find', + 're-groups', 're-matcher', 're-matches', 're-pattern', 're-seq', + 'read', 'read-line', 'reduce', 'ref', 'ref-set', 'refer', 'rem', + 'remove', 'remove-method', 'remove-ns', 'rename', 'rename-keys', + 'repeat', 'replace', 'replicate', 'resolve', 'rest', 'resultset-seq', + 'reverse', 'rfirst', 'right', 'rights', 'root', 'rrest', 'rseq', + 'second', 'select', 'select-keys', 'send', 'send-off', 'seq', + 'seq-zip', 'seq?', 'set', 'short', 'slurp', 'some', 'sort', + 'sort-by', 'sorted-map', 'sorted-map-by', 'sorted-set', + 'special-symbol?', 'split-at', 'split-with', 'str', 'string?', + 'struct', 'struct-map', 'subs', 'subvec', 'symbol', 'symbol?', + 'sync', 'take', 'take-nth', 'take-while', 'test', 'time', 'to-array', + 'to-array-2d', 'tree-seq', 'true?', 'union', 'up', 'update-proxy', + 'val', 'vals', 'var-get', 'var-set', 'var?', 'vector', 'vector-zip', + 'vector?', 'when', 'when-first', 'when-let', 'when-not', + 'with-local-vars', 'with-meta', 'with-open', 'with-out-str', + 'xml-seq', 'xml-zip', 'zero?', 'zipmap', 'zipper') + + # valid names for identifiers + # well, names can only not consist fully of numbers + # but this should be good enough for now + + # TODO / should divide keywords/symbols into namespace/rest + # but that's hard, so just pretend / is part of the name + 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]+', Text), + + # numbers + (r'-?\d+\.\d+', Number.Float), + (r'-?\d+', Number.Integer), + (r'0x-?[abcdef\d]+', Number.Hex), + + # strings, symbols and characters + (r'"(\\\\|\\"|[^"])*"', String), + (r"'" + valid_name, String.Symbol), + (r"\\(.|[a-z]+)", String.Char), + + # keywords + (r'::?#?' + valid_name, String.Symbol), + + # special operators + (r'~@|[`\'#^~&@]', Operator), + + # highlight the special forms + (words(special_forms, suffix=' '), 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. + (words(declarations, suffix=' '), Keyword.Declaration), + + # highlight the builtins + (words(builtins, suffix=' '), Name.Builtin), + + # the remaining functions + (r'(?<=\()' + valid_name, Name.Function), + + # find the remaining variables + (valid_name, Name.Variable), + + # Clojure accepts vector notation + (r'(\[|\])', Punctuation), + + # Clojure accepts map notation + (r'(\{|\})', Punctuation), + + # the famous parentheses! + (r'(\(|\))', Punctuation), + ], + } + + +class ClojureScriptLexer(ClojureLexer): + """ + Lexer for `ClojureScript `_ + source code. + + .. versionadded:: 2.0 + """ + name = 'ClojureScript' + aliases = ['clojurescript', 'cljs'] + filenames = ['*.cljs'] + mimetypes = ['text/x-clojurescript', 'application/x-clojurescript'] + + +class TeaLangLexer(RegexLexer): + """ + For `Tea `_ source code. Only used within a + TeaTemplateLexer. + + .. versionadded:: 1.5 + """ + + flags = re.MULTILINE | re.DOTALL + + tokens = { + 'root': [ + # method names + (r'^(\s*(?:[a-zA-Z_][\w\.\[\]]*\s+)+?)' # return arguments + r'([a-zA-Z_]\w*)' # method name + r'(\s*)(\()', # signature start + bygroups(using(this), Name.Function, Text, Operator)), + (r'[^\S\n]+', Text), + (r'//.*?\n', Comment.Single), + (r'/\*.*?\*/', Comment.Multiline), + (r'@[a-zA-Z_][\w\.]*', Name.Decorator), + (r'(and|break|else|foreach|if|in|not|or|reverse)\b', + Keyword), + (r'(as|call|define)\b', Keyword.Declaration), + (r'(true|false|null)\b', Keyword.Constant), + (r'(template)(\s+)', bygroups(Keyword.Declaration, Text), 'template'), + (r'(import)(\s+)', bygroups(Keyword.Namespace, Text), 'import'), + (r'"(\\\\|\\"|[^"])*"', String), + (r'\'(\\\\|\\\'|[^\'])*\'', String), + (r'(\.)([a-zA-Z_]\w*)', bygroups(Operator, Name.Attribute)), + (r'[a-zA-Z_]\w*:', Name.Label), + (r'[a-zA-Z_\$]\w*', Name), + (r'(isa|[.]{3}|[.]{2}|[=#!<>+-/%&;,.\*\\\(\)\[\]\{\}])', Operator), + (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), + (r'0x[0-9a-fA-F]+', Number.Hex), + (r'[0-9]+L?', Number.Integer), + (r'\n', Text) + ], + 'template': [ + (r'[a-zA-Z_]\w*', Name.Class, '#pop') + ], + 'import': [ + (r'[\w.]+\*?', Name.Namespace, '#pop') + ], + } + + +class CeylonLexer(RegexLexer): + """ + For `Ceylon `_ source code. + + .. versionadded:: 1.6 + """ + + name = 'Ceylon' + aliases = ['ceylon'] + filenames = ['*.ceylon'] + mimetypes = ['text/x-ceylon'] + + flags = re.MULTILINE | re.DOTALL + + #: optional Comment or Whitespace + _ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+' + + tokens = { + 'root': [ + # method names + (r'^(\s*(?:[a-zA-Z_][\w.\[\]]*\s+)+?)' # return arguments + r'([a-zA-Z_]\w*)' # method name + r'(\s*)(\()', # signature start + bygroups(using(this), Name.Function, Text, Operator)), + (r'[^\S\n]+', Text), + (r'//.*?\n', Comment.Single), + (r'/\*', Comment.Multiline, 'comment'), + (r'(shared|abstract|formal|default|actual|variable|deprecated|small|' + r'late|literal|doc|by|see|throws|optional|license|tagged|final|native|' + r'annotation|sealed)\b', Name.Decorator), + (r'(break|case|catch|continue|else|finally|for|in|' + r'if|return|switch|this|throw|try|while|is|exists|dynamic|' + r'nonempty|then|outer|assert|let)\b', Keyword), + (r'(abstracts|extends|satisfies|' + r'super|given|of|out|assign)\b', Keyword.Declaration), + (r'(function|value|void|new)\b', + Keyword.Type), + (r'(assembly|module|package)(\s+)', bygroups(Keyword.Namespace, Text)), + (r'(true|false|null)\b', Keyword.Constant), + (r'(class|interface|object|alias)(\s+)', + bygroups(Keyword.Declaration, Text), 'class'), + (r'(import)(\s+)', bygroups(Keyword.Namespace, Text), 'import'), + (r'"(\\\\|\\"|[^"])*"', String), + (r"'\\.'|'[^\\]'|'\\\{#[0-9a-fA-F]{4}\}'", String.Char), + (r'".*``.*``.*"', String.Interpol), + (r'(\.)([a-z_]\w*)', + bygroups(Operator, Name.Attribute)), + (r'[a-zA-Z_]\w*:', Name.Label), + (r'[a-zA-Z_]\w*', Name), + (r'[~^*!%&\[\](){}<>|+=:;,./?-]', Operator), + (r'\d{1,3}(_\d{3})+\.\d{1,3}(_\d{3})+[kMGTPmunpf]?', Number.Float), + (r'\d{1,3}(_\d{3})+\.[0-9]+([eE][+-]?[0-9]+)?[kMGTPmunpf]?', + Number.Float), + (r'[0-9][0-9]*\.\d{1,3}(_\d{3})+[kMGTPmunpf]?', Number.Float), + (r'[0-9][0-9]*\.[0-9]+([eE][+-]?[0-9]+)?[kMGTPmunpf]?', + Number.Float), + (r'#([0-9a-fA-F]{4})(_[0-9a-fA-F]{4})+', Number.Hex), + (r'#[0-9a-fA-F]+', Number.Hex), + (r'\$([01]{4})(_[01]{4})+', Number.Bin), + (r'\$[01]+', Number.Bin), + (r'\d{1,3}(_\d{3})+[kMGTP]?', Number.Integer), + (r'[0-9]+[kMGTP]?', Number.Integer), + (r'\n', Text) + ], + 'class': [ + (r'[A-Za-z_]\w*', Name.Class, '#pop') + ], + 'import': [ + (r'[a-z][\w.]*', + Name.Namespace, '#pop') + ], + 'comment': [ + (r'[^*/]', Comment.Multiline), + (r'/\*', Comment.Multiline, '#push'), + (r'\*/', Comment.Multiline, '#pop'), + (r'[*/]', Comment.Multiline) + ], + } + + +class KotlinLexer(RegexLexer): + """ + For `Kotlin `_ + source code. + + .. versionadded:: 1.5 + """ + + name = 'Kotlin' + aliases = ['kotlin'] + filenames = ['*.kt'] + mimetypes = ['text/x-kotlin'] + + flags = re.MULTILINE | re.DOTALL | re.UNICODE + + kt_name = ('@?[_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl') + ']' + + '[' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc', 'Cf', + 'Mn', 'Mc') + ']*') + kt_id = '(' + kt_name + '|`' + kt_name + '`)' + + tokens = { + 'root': [ + (r'^\s*\[.*?\]', Name.Attribute), + (r'[^\S\n]+', Text), + (r'\\\n', Text), # line continuation + (r'//.*?\n', Comment.Single), + (r'/[*].*?[*]/', Comment.Multiline), + (r'\n', Text), + (r'::|!!|\?[:.]', Operator), + (r'[~!%^&*()+=|\[\]:;,.<>/?-]', Punctuation), + (r'[{}]', Punctuation), + (r'@"(""|[^"])*"', String), + (r'"(\\\\|\\"|[^"\n])*["\n]', String), + (r"'\\.'|'[^\\]'", String.Char), + (r"[0-9](\.[0-9]*)?([eE][+-][0-9]+)?[flFL]?|" + r"0[xX][0-9a-fA-F]+[Ll]?", Number), + (r'(class)(\s+)(object)', bygroups(Keyword, Text, Keyword)), + (r'(class|interface|object)(\s+)', bygroups(Keyword, Text), 'class'), + (r'(package|import)(\s+)', bygroups(Keyword, Text), 'package'), + (r'(val|var)(\s+)', bygroups(Keyword, Text), 'property'), + (r'(fun)(\s+)', bygroups(Keyword, Text), 'function'), + (r'(abstract|annotation|as|break|by|catch|class|companion|const|' + r'constructor|continue|crossinline|data|do|dynamic|else|enum|' + r'external|false|final|finally|for|fun|get|if|import|in|infix|' + r'inline|inner|interface|internal|is|lateinit|noinline|null|' + r'object|open|operator|out|override|package|private|protected|' + r'public|reified|return|sealed|set|super|tailrec|this|throw|' + r'true|try|val|var|vararg|when|where|while)\b', Keyword), + (kt_id, Name), + ], + 'package': [ + (r'\S+', Name.Namespace, '#pop') + ], + 'class': [ + (kt_id, Name.Class, '#pop') + ], + 'property': [ + (kt_id, Name.Property, '#pop') + ], + 'function': [ + (kt_id, Name.Function, '#pop') + ], + } + + +class XtendLexer(RegexLexer): + """ + For `Xtend `_ source code. + + .. versionadded:: 1.6 + """ + + name = 'Xtend' + aliases = ['xtend'] + filenames = ['*.xtend'] + mimetypes = ['text/x-xtend'] + + flags = re.MULTILINE | re.DOTALL + + tokens = { + 'root': [ + # method names + (r'^(\s*(?:[a-zA-Z_][\w.\[\]]*\s+)+?)' # return arguments + r'([a-zA-Z_$][\w$]*)' # method name + r'(\s*)(\()', # signature start + bygroups(using(this), Name.Function, Text, Operator)), + (r'[^\S\n]+', Text), + (r'//.*?\n', Comment.Single), + (r'/\*.*?\*/', Comment.Multiline), + (r'@[a-zA-Z_][\w.]*', Name.Decorator), + (r'(assert|break|case|catch|continue|default|do|else|finally|for|' + r'if|goto|instanceof|new|return|switch|this|throw|try|while|IF|' + r'ELSE|ELSEIF|ENDIF|FOR|ENDFOR|SEPARATOR|BEFORE|AFTER)\b', + Keyword), + (r'(def|abstract|const|enum|extends|final|implements|native|private|' + r'protected|public|static|strictfp|super|synchronized|throws|' + r'transient|volatile)\b', Keyword.Declaration), + (r'(boolean|byte|char|double|float|int|long|short|void)\b', + Keyword.Type), + (r'(package)(\s+)', bygroups(Keyword.Namespace, Text)), + (r'(true|false|null)\b', Keyword.Constant), + (r'(class|interface)(\s+)', bygroups(Keyword.Declaration, Text), + 'class'), + (r'(import)(\s+)', bygroups(Keyword.Namespace, Text), 'import'), + (r"(''')", String, 'template'), + (u'(\u00BB)', String, 'template'), + (r'"(\\\\|\\"|[^"])*"', String), + (r"'(\\\\|\\'|[^'])*'", String), + (r'[a-zA-Z_]\w*:', Name.Label), + (r'[a-zA-Z_$]\w*', Name), + (r'[~^*!%&\[\](){}<>\|+=:;,./?-]', Operator), + (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), + (r'0x[0-9a-fA-F]+', Number.Hex), + (r'[0-9]+L?', Number.Integer), + (r'\n', Text) + ], + 'class': [ + (r'[a-zA-Z_]\w*', Name.Class, '#pop') + ], + 'import': [ + (r'[\w.]+\*?', Name.Namespace, '#pop') + ], + 'template': [ + (r"'''", String, '#pop'), + (u'\u00AB', String, '#pop'), + (r'.', String) + ], + } + + +class PigLexer(RegexLexer): + """ + For `Pig Latin `_ source code. + + .. versionadded:: 2.0 + """ + + name = 'Pig' + aliases = ['pig'] + filenames = ['*.pig'] + mimetypes = ['text/x-pig'] + + flags = re.MULTILINE | re.IGNORECASE + + tokens = { + 'root': [ + (r'\s+', Text), + (r'--.*', Comment), + (r'/\*[\w\W]*?\*/', Comment.Multiline), + (r'\\\n', Text), + (r'\\', Text), + (r'\'(?:\\[ntbrf\\\']|\\u[0-9a-f]{4}|[^\'\\\n\r])*\'', String), + include('keywords'), + include('types'), + include('builtins'), + include('punct'), + include('operators'), + (r'[0-9]*\.[0-9]+(e[0-9]+)?[fd]?', Number.Float), + (r'0x[0-9a-f]+', Number.Hex), + (r'[0-9]+L?', Number.Integer), + (r'\n', Text), + (r'([a-z_]\w*)(\s*)(\()', + bygroups(Name.Function, Text, Punctuation)), + (r'[()#:]', Text), + (r'[^(:#\'")\s]+', Text), + (r'\S+\s+', Text) # TODO: make tests pass without \s+ + ], + 'keywords': [ + (r'(assert|and|any|all|arrange|as|asc|bag|by|cache|CASE|cat|cd|cp|' + r'%declare|%default|define|dense|desc|describe|distinct|du|dump|' + r'eval|exex|explain|filter|flatten|foreach|full|generate|group|' + r'help|if|illustrate|import|inner|input|into|is|join|kill|left|' + r'limit|load|ls|map|matches|mkdir|mv|not|null|onschema|or|order|' + r'outer|output|parallel|pig|pwd|quit|register|returns|right|rm|' + r'rmf|rollup|run|sample|set|ship|split|stderr|stdin|stdout|store|' + r'stream|through|union|using|void)\b', Keyword) + ], + 'builtins': [ + (r'(AVG|BinStorage|cogroup|CONCAT|copyFromLocal|copyToLocal|COUNT|' + r'cross|DIFF|MAX|MIN|PigDump|PigStorage|SIZE|SUM|TextLoader|' + r'TOKENIZE)\b', Name.Builtin) + ], + 'types': [ + (r'(bytearray|BIGINTEGER|BIGDECIMAL|chararray|datetime|double|float|' + r'int|long|tuple)\b', Keyword.Type) + ], + 'punct': [ + (r'[;(){}\[\]]', Punctuation), + ], + 'operators': [ + (r'[#=,./%+\-?]', Operator), + (r'(eq|gt|lt|gte|lte|neq|matches)\b', Operator), + (r'(==|<=|<|>=|>|!=)', Operator), + ], + } + + +class GoloLexer(RegexLexer): + """ + For `Golo `_ source code. + + .. versionadded:: 2.0 + """ + + name = 'Golo' + filenames = ['*.golo'] + aliases = ['golo'] + + tokens = { + 'root': [ + (r'[^\S\n]+', Text), + + (r'#.*$', Comment), + + (r'(\^|\.\.\.|:|\?:|->|==|!=|=|\+|\*|%|/|<=|<|>=|>|=|\.)', + Operator), + (r'(?<=[^-])(-)(?=[^-])', Operator), + + (r'(?<=[^`])(is|isnt|and|or|not|oftype|in|orIfNull)\b', Operator.Word), + (r'[]{}|(),[]', Punctuation), + + (r'(module|import)(\s+)', + bygroups(Keyword.Namespace, Text), + 'modname'), + (r'\b([a-zA-Z_][\w$.]*)(::)', bygroups(Name.Namespace, Punctuation)), + (r'\b([a-zA-Z_][\w$]*(?:\.[a-zA-Z_][\w$]*)+)\b', Name.Namespace), + + (r'(let|var)(\s+)', + bygroups(Keyword.Declaration, Text), + 'varname'), + (r'(struct)(\s+)', + bygroups(Keyword.Declaration, Text), + 'structname'), + (r'(function)(\s+)', + bygroups(Keyword.Declaration, Text), + 'funcname'), + + (r'(null|true|false)\b', Keyword.Constant), + (r'(augment|pimp' + r'|if|else|case|match|return' + r'|case|when|then|otherwise' + r'|while|for|foreach' + r'|try|catch|finally|throw' + r'|local' + r'|continue|break)\b', Keyword), + + (r'(map|array|list|set|vector|tuple)(\[)', + bygroups(Name.Builtin, Punctuation)), + (r'(print|println|readln|raise|fun' + r'|asInterfaceInstance)\b', Name.Builtin), + (r'(`?[a-zA-Z_][\w$]*)(\()', + bygroups(Name.Function, Punctuation)), + + (r'-?[\d_]*\.[\d_]*([eE][+-]?\d[\d_]*)?F?', Number.Float), + (r'0[0-7]+j?', Number.Oct), + (r'0[xX][a-fA-F0-9]+', Number.Hex), + (r'-?\d[\d_]*L', Number.Integer.Long), + (r'-?\d[\d_]*', Number.Integer), + + ('`?[a-zA-Z_][\w$]*', Name), + (r'@[a-zA-Z_][\w$.]*', Name.Decorator), + + (r'"""', String, combined('stringescape', 'triplestring')), + (r'"', String, combined('stringescape', 'doublestring')), + (r"'", String, combined('stringescape', 'singlestring')), + (r'----((.|\n)*?)----', String.Doc) + + ], + + 'funcname': [ + (r'`?[a-zA-Z_][\w$]*', Name.Function, '#pop'), + ], + 'modname': [ + (r'[a-zA-Z_][\w$.]*\*?', Name.Namespace, '#pop') + ], + 'structname': [ + (r'`?[\w.]+\*?', Name.Class, '#pop') + ], + 'varname': [ + (r'`?[a-zA-Z_][\w$]*', Name.Variable, '#pop'), + ], + 'string': [ + (r'[^\\\'"\n]+', String), + (r'[\'"\\]', String) + ], + 'stringescape': [ + (r'\\([\\abfnrtv"\']|\n|N\{.*?\}|u[a-fA-F0-9]{4}|' + r'U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape) + ], + 'triplestring': [ + (r'"""', String, '#pop'), + include('string'), + (r'\n', String), + ], + 'doublestring': [ + (r'"', String.Double, '#pop'), + include('string'), + ], + 'singlestring': [ + (r"'", String, '#pop'), + include('string'), + ], + 'operators': [ + (r'[#=,./%+\-?]', Operator), + (r'(eq|gt|lt|gte|lte|neq|matches)\b', Operator), + (r'(==|<=|<|>=|>|!=)', Operator), + ], + } + + +class JasminLexer(RegexLexer): + """ + For `Jasmin `_ assembly code. + + .. versionadded:: 2.0 + """ + + name = 'Jasmin' + aliases = ['jasmin', 'jasminxt'] + filenames = ['*.j'] + + _whitespace = r' \n\t\r' + _ws = r'(?:[%s]+)' % _whitespace + _separator = r'%s:=' % _whitespace + _break = r'(?=[%s]|$)' % _separator + _name = r'[^%s]+' % _separator + _unqualified_name = r'(?:[^%s.;\[/]+)' % _separator + + tokens = { + 'default': [ + (r'\n', Text, '#pop'), + (r"'", String.Single, ('#pop', 'quote')), + (r'"', String.Double, 'string'), + (r'=', Punctuation), + (r':', Punctuation, 'label'), + (_ws, Text), + (r';.*', Comment.Single), + (r'(\$[-+])?0x-?[\da-fA-F]+%s' % _break, Number.Hex), + (r'(\$[-+]|\+)?-?\d+%s' % _break, Number.Integer), + (r'-?(\d+\.\d*|\.\d+)([eE][-+]?\d+)?[fFdD]?' + r'[\x00-\x08\x0b\x0c\x0e-\x1f]*%s' % _break, Number.Float), + (r'\$%s' % _name, Name.Variable), + + # Directives + (r'\.annotation%s' % _break, Keyword.Reserved, 'annotation'), + (r'(\.attribute|\.bytecode|\.debug|\.deprecated|\.enclosing|' + r'\.interface|\.line|\.signature|\.source|\.stack|\.var|abstract|' + r'annotation|bridge|class|default|enum|field|final|fpstrict|' + r'interface|native|private|protected|public|signature|static|' + r'synchronized|synthetic|transient|varargs|volatile)%s' % _break, + Keyword.Reserved), + (r'\.catch%s' % _break, Keyword.Reserved, 'caught-exception'), + (r'(\.class|\.implements|\.inner|\.super|inner|invisible|' + r'invisibleparam|outer|visible|visibleparam)%s' % _break, + Keyword.Reserved, 'class/convert-dots'), + (r'\.field%s' % _break, Keyword.Reserved, + ('descriptor/convert-dots', 'field')), + (r'(\.end|\.limit|use)%s' % _break, Keyword.Reserved, + 'no-verification'), + (r'\.method%s' % _break, Keyword.Reserved, 'method'), + (r'\.set%s' % _break, Keyword.Reserved, 'var'), + (r'\.throws%s' % _break, Keyword.Reserved, 'exception'), + (r'(from|offset|to|using)%s' % _break, Keyword.Reserved, 'label'), + (r'is%s' % _break, Keyword.Reserved, + ('descriptor/convert-dots', 'var')), + (r'(locals|stack)%s' % _break, Keyword.Reserved, 'verification'), + (r'method%s' % _break, Keyword.Reserved, 'enclosing-method'), + + # Instructions + (words(( + 'aaload', 'aastore', 'aconst_null', 'aload', 'aload_0', 'aload_1', 'aload_2', + 'aload_3', 'aload_w', 'areturn', 'arraylength', 'astore', 'astore_0', 'astore_1', + 'astore_2', 'astore_3', 'astore_w', 'athrow', 'baload', 'bastore', 'bipush', + 'breakpoint', 'caload', 'castore', 'd2f', 'd2i', 'd2l', 'dadd', 'daload', 'dastore', + 'dcmpg', 'dcmpl', 'dconst_0', 'dconst_1', 'ddiv', 'dload', 'dload_0', 'dload_1', + 'dload_2', 'dload_3', 'dload_w', 'dmul', 'dneg', 'drem', 'dreturn', 'dstore', 'dstore_0', + 'dstore_1', 'dstore_2', 'dstore_3', 'dstore_w', 'dsub', 'dup', 'dup2', 'dup2_x1', + 'dup2_x2', 'dup_x1', 'dup_x2', 'f2d', 'f2i', 'f2l', 'fadd', 'faload', 'fastore', 'fcmpg', + 'fcmpl', 'fconst_0', 'fconst_1', 'fconst_2', 'fdiv', 'fload', 'fload_0', 'fload_1', + 'fload_2', 'fload_3', 'fload_w', 'fmul', 'fneg', 'frem', 'freturn', 'fstore', 'fstore_0', + 'fstore_1', 'fstore_2', 'fstore_3', 'fstore_w', 'fsub', 'i2b', 'i2c', 'i2d', 'i2f', 'i2l', + 'i2s', 'iadd', 'iaload', 'iand', 'iastore', 'iconst_0', 'iconst_1', 'iconst_2', + 'iconst_3', 'iconst_4', 'iconst_5', 'iconst_m1', 'idiv', 'iinc', 'iinc_w', 'iload', + 'iload_0', 'iload_1', 'iload_2', 'iload_3', 'iload_w', 'imul', 'ineg', 'int2byte', + 'int2char', 'int2short', 'ior', 'irem', 'ireturn', 'ishl', 'ishr', 'istore', 'istore_0', + 'istore_1', 'istore_2', 'istore_3', 'istore_w', 'isub', 'iushr', 'ixor', 'l2d', 'l2f', + 'l2i', 'ladd', 'laload', 'land', 'lastore', 'lcmp', 'lconst_0', 'lconst_1', 'ldc2_w', + 'ldiv', 'lload', 'lload_0', 'lload_1', 'lload_2', 'lload_3', 'lload_w', 'lmul', 'lneg', + 'lookupswitch', 'lor', 'lrem', 'lreturn', 'lshl', 'lshr', 'lstore', 'lstore_0', + 'lstore_1', 'lstore_2', 'lstore_3', 'lstore_w', 'lsub', 'lushr', 'lxor', + 'monitorenter', 'monitorexit', 'nop', 'pop', 'pop2', 'ret', 'ret_w', 'return', 'saload', + 'sastore', 'sipush', 'swap'), suffix=_break), Keyword.Reserved), + (r'(anewarray|checkcast|instanceof|ldc|ldc_w|new)%s' % _break, + Keyword.Reserved, 'class/no-dots'), + (r'invoke(dynamic|interface|nonvirtual|special|' + r'static|virtual)%s' % _break, Keyword.Reserved, + 'invocation'), + (r'(getfield|putfield)%s' % _break, Keyword.Reserved, + ('descriptor/no-dots', 'field')), + (r'(getstatic|putstatic)%s' % _break, Keyword.Reserved, + ('descriptor/no-dots', 'static')), + (words(( + 'goto', 'goto_w', 'if_acmpeq', 'if_acmpne', 'if_icmpeq', + 'if_icmpge', 'if_icmpgt', 'if_icmple', 'if_icmplt', 'if_icmpne', + 'ifeq', 'ifge', 'ifgt', 'ifle', 'iflt', 'ifne', 'ifnonnull', + 'ifnull', 'jsr', 'jsr_w'), suffix=_break), + Keyword.Reserved, 'label'), + (r'(multianewarray|newarray)%s' % _break, Keyword.Reserved, + 'descriptor/convert-dots'), + (r'tableswitch%s' % _break, Keyword.Reserved, 'table') + ], + 'quote': [ + (r"'", String.Single, '#pop'), + (r'\\u[\da-fA-F]{4}', String.Escape), + (r"[^'\\]+", String.Single) + ], + 'string': [ + (r'"', String.Double, '#pop'), + (r'\\([nrtfb"\'\\]|u[\da-fA-F]{4}|[0-3]?[0-7]{1,2})', + String.Escape), + (r'[^"\\]+', String.Double) + ], + 'root': [ + (r'\n+', Text), + (r"'", String.Single, 'quote'), + include('default'), + (r'(%s)([ \t\r]*)(:)' % _name, + bygroups(Name.Label, Text, Punctuation)), + (_name, String.Other) + ], + 'annotation': [ + (r'\n', Text, ('#pop', 'annotation-body')), + (r'default%s' % _break, Keyword.Reserved, + ('#pop', 'annotation-default')), + include('default') + ], + 'annotation-body': [ + (r'\n+', Text), + (r'\.end%s' % _break, Keyword.Reserved, '#pop'), + include('default'), + (_name, String.Other, ('annotation-items', 'descriptor/no-dots')) + ], + 'annotation-default': [ + (r'\n+', Text), + (r'\.end%s' % _break, Keyword.Reserved, '#pop'), + include('default'), + default(('annotation-items', 'descriptor/no-dots')) + ], + 'annotation-items': [ + (r"'", String.Single, 'quote'), + include('default'), + (_name, String.Other) + ], + 'caught-exception': [ + (r'all%s' % _break, Keyword, '#pop'), + include('exception') + ], + 'class/convert-dots': [ + include('default'), + (r'(L)((?:%s[/.])*)(%s)(;)' % (_unqualified_name, _name), + bygroups(Keyword.Type, Name.Namespace, Name.Class, Punctuation), + '#pop'), + (r'((?:%s[/.])*)(%s)' % (_unqualified_name, _name), + bygroups(Name.Namespace, Name.Class), '#pop') + ], + 'class/no-dots': [ + include('default'), + (r'\[+', Punctuation, ('#pop', 'descriptor/no-dots')), + (r'(L)((?:%s/)*)(%s)(;)' % (_unqualified_name, _name), + bygroups(Keyword.Type, Name.Namespace, Name.Class, Punctuation), + '#pop'), + (r'((?:%s/)*)(%s)' % (_unqualified_name, _name), + bygroups(Name.Namespace, Name.Class), '#pop') + ], + 'descriptor/convert-dots': [ + include('default'), + (r'\[+', Punctuation), + (r'(L)((?:%s[/.])*)(%s?)(;)' % (_unqualified_name, _name), + bygroups(Keyword.Type, Name.Namespace, Name.Class, Punctuation), + '#pop'), + (r'[^%s\[)L]+' % _separator, Keyword.Type, '#pop'), + default('#pop') + ], + 'descriptor/no-dots': [ + include('default'), + (r'\[+', Punctuation), + (r'(L)((?:%s/)*)(%s)(;)' % (_unqualified_name, _name), + bygroups(Keyword.Type, Name.Namespace, Name.Class, Punctuation), + '#pop'), + (r'[^%s\[)L]+' % _separator, Keyword.Type, '#pop'), + default('#pop') + ], + 'descriptors/convert-dots': [ + (r'\)', Punctuation, '#pop'), + default('descriptor/convert-dots') + ], + 'enclosing-method': [ + (_ws, Text), + (r'(?=[^%s]*\()' % _separator, Text, ('#pop', 'invocation')), + default(('#pop', 'class/convert-dots')) + ], + 'exception': [ + include('default'), + (r'((?:%s[/.])*)(%s)' % (_unqualified_name, _name), + bygroups(Name.Namespace, Name.Exception), '#pop') + ], + 'field': [ + (r'static%s' % _break, Keyword.Reserved, ('#pop', 'static')), + include('default'), + (r'((?:%s[/.](?=[^%s]*[/.]))*)(%s[/.])?(%s)' % + (_unqualified_name, _separator, _unqualified_name, _name), + bygroups(Name.Namespace, Name.Class, Name.Variable.Instance), + '#pop') + ], + 'invocation': [ + include('default'), + (r'((?:%s[/.](?=[^%s(]*[/.]))*)(%s[/.])?(%s)(\()' % + (_unqualified_name, _separator, _unqualified_name, _name), + bygroups(Name.Namespace, Name.Class, Name.Function, Punctuation), + ('#pop', 'descriptor/convert-dots', 'descriptors/convert-dots', + 'descriptor/convert-dots')) + ], + 'label': [ + include('default'), + (_name, Name.Label, '#pop') + ], + 'method': [ + include('default'), + (r'(%s)(\()' % _name, bygroups(Name.Function, Punctuation), + ('#pop', 'descriptor/convert-dots', 'descriptors/convert-dots', + 'descriptor/convert-dots')) + ], + 'no-verification': [ + (r'(locals|method|stack)%s' % _break, Keyword.Reserved, '#pop'), + include('default') + ], + 'static': [ + include('default'), + (r'((?:%s[/.](?=[^%s]*[/.]))*)(%s[/.])?(%s)' % + (_unqualified_name, _separator, _unqualified_name, _name), + bygroups(Name.Namespace, Name.Class, Name.Variable.Class), '#pop') + ], + 'table': [ + (r'\n+', Text), + (r'default%s' % _break, Keyword.Reserved, '#pop'), + include('default'), + (_name, Name.Label) + ], + 'var': [ + include('default'), + (_name, Name.Variable, '#pop') + ], + 'verification': [ + include('default'), + (r'(Double|Float|Integer|Long|Null|Top|UninitializedThis)%s' % + _break, Keyword, '#pop'), + (r'Object%s' % _break, Keyword, ('#pop', 'class/no-dots')), + (r'Uninitialized%s' % _break, Keyword, ('#pop', 'label')) + ] + } + + def analyse_text(text): + score = 0 + if re.search(r'^\s*\.class\s', text, re.MULTILINE): + score += 0.5 + if re.search(r'^\s*[a-z]+_[a-z]+\b', text, re.MULTILINE): + score += 0.3 + if re.search(r'^\s*\.(attribute|bytecode|debug|deprecated|enclosing|' + r'inner|interface|limit|set|signature|stack)\b', text, + re.MULTILINE): + score += 0.6 + return score diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/lisp.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/lisp.py new file mode 100644 index 0000000000000000000000000000000000000000..e258c347bbfc71d79009bd8d79fcba4141296b50 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/lisp.py @@ -0,0 +1,2621 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.lisp + ~~~~~~~~~~~~~~~~~~~~ + + Lexers for Lispy languages. + + :copyright: Copyright 2006-2017 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 + +from pygments.lexers.python import PythonLexer + +__all__ = ['SchemeLexer', 'CommonLispLexer', 'HyLexer', 'RacketLexer', + 'NewLispLexer', 'EmacsLispLexer', 'ShenLexer', 'CPSALexer', + 'XtlangLexer'] + + +class SchemeLexer(RegexLexer): + """ + A Scheme lexer, parsing a stream and outputting the tokens + needed to highlight scheme code. + This lexer could be most probably easily subclassed to parse + other LISP-Dialects like Common Lisp, Emacs Lisp or AutoLisp. + + 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. + + .. versionadded:: 0.6 + """ + name = 'Scheme' + aliases = ['scheme', 'scm'] + filenames = ['*.scm', '*.ss'] + mimetypes = ['text/x-scheme', 'application/x-scheme'] + + # list of known keywords and builtins taken form vim 6.4 scheme.vim + # syntax file. + keywords = ( + 'lambda', 'define', 'if', 'else', 'cond', 'and', 'or', 'case', 'let', + 'let*', 'letrec', 'begin', 'do', 'delay', 'set!', '=>', 'quote', + 'quasiquote', 'unquote', 'unquote-splicing', 'define-syntax', + 'let-syntax', 'letrec-syntax', 'syntax-rules' + ) + builtins = ( + '*', '+', '-', '/', '<', '<=', '=', '>', '>=', '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', 'call-with-current-continuation', 'call-with-input-file', + 'call-with-output-file', 'call-with-values', 'call/cc', 'car', + 'cdaaar', 'cdaadr', 'cdaar', 'cdadar', 'cdaddr', 'cdadr', 'cdar', + 'cddaar', 'cddadr', 'cddar', 'cdddar', 'cddddr', 'cdddr', 'cddr', + 'cdr', 'ceiling', '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?', 'cons', 'cos', 'current-input-port', 'current-output-port', + 'denominator', 'display', 'dynamic-wind', 'eof-object?', 'eq?', + 'equal?', 'eqv?', 'eval', 'even?', 'exact->inexact', 'exact?', 'exp', + 'expt', 'floor', 'for-each', 'force', 'gcd', 'imag-part', + 'inexact->exact', 'inexact?', 'input-port?', 'integer->char', + 'integer?', 'interaction-environment', 'lcm', 'length', 'list', + 'list->string', 'list->vector', 'list-ref', 'list-tail', 'list?', + 'load', 'log', 'magnitude', 'make-polar', 'make-rectangular', + 'make-string', 'make-vector', 'map', 'max', 'member', 'memq', 'memv', + 'min', 'modulo', 'negative?', 'newline', 'not', 'null-environment', + 'null?', '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', 'reverse', 'round', 'scheme-report-environment', + 'set-car!', 'set-cdr!', 'sin', 'sqrt', '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?', 'substring', 'symbol->string', 'symbol?', + 'tan', 'transcript-off', 'transcript-on', 'truncate', 'values', + 'vector', 'vector->list', 'vector-fill!', 'vector-length', + 'vector-ref', 'vector-set!', 'vector?', 'with-input-from-file', + 'with-output-to-file', 'write', 'write-char', 'zero?' + ) + + # 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 + # and going to the end of the line + (r';.*$', Comment.Single), + # multi-line comment + (r'#\|', Comment.Multiline, 'multiline-comment'), + # commented form (entire sexpr folliwng) + (r'#;\s*\(', Comment, 'commented-form'), + # 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+', Text), + + # 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 + ('(%s)' % '|'.join(re.escape(entry) + ' ' for entry in keywords), + 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 + ("(?<=\()(%s)" % '|'.join(re.escape(entry) + ' ' for entry in builtins), + 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), + ], + '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), + ], + } + + +class CommonLispLexer(RegexLexer): + """ + A Common Lisp lexer. + + .. versionadded:: 0.9 + """ + name = 'Common Lisp' + aliases = ['common-lisp', 'cl', 'lisp'] + filenames = ['*.cl', '*.lisp'] + mimetypes = ['text/x-common-lisp'] + + 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 = r'(\|[^|]+\||(?:%s)(?:%s)*)' % (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+', Text), + + # 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 + '\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 + '\*', Name.Variable.Global), + (symbol, Name.Variable), + + # parentheses + (r'\(', Punctuation, 'body'), + (r'\)', Punctuation, '#pop'), + ], + } + + +class HyLexer(RegexLexer): + """ + Lexer for `Hy `_ source code. + + .. versionadded:: 2.0 + """ + name = 'Hy' + aliases = ['hylang'] + filenames = ['*.hy'] + mimetypes = ['text/x-hy', 'application/x-hy'] + + 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'(?!#)[\w!$%*+<=>?/.#-]+' + + 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'[,\s]+', Text), + + # 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). + + .. versionadded:: 1.6 + """ + + name = 'Racket' + aliases = ['racket', 'rkt'] + filenames = ['*.rkt', '*.rktd', '*.rktl'] + mimetypes = ['text/x-racket', 'application/x-racket'] + + # Generated by example.rkt + _keywords = ( + u'#%app', u'#%datum', u'#%declare', u'#%expression', u'#%module-begin', + u'#%plain-app', u'#%plain-lambda', u'#%plain-module-begin', + u'#%printing-module-begin', u'#%provide', u'#%require', + u'#%stratified-body', u'#%top', u'#%top-interaction', + u'#%variable-reference', u'->', u'->*', u'->*m', u'->d', u'->dm', u'->i', + u'->m', u'...', u':do-in', u'==', u'=>', u'_', u'absent', u'abstract', + u'all-defined-out', u'all-from-out', u'and', u'any', u'augment', u'augment*', + u'augment-final', u'augment-final*', u'augride', u'augride*', u'begin', + u'begin-for-syntax', u'begin0', u'case', u'case->', u'case->m', + u'case-lambda', u'class', u'class*', u'class-field-accessor', + u'class-field-mutator', u'class/c', u'class/derived', u'combine-in', + u'combine-out', u'command-line', u'compound-unit', u'compound-unit/infer', + u'cond', u'cons/dc', u'contract', u'contract-out', u'contract-struct', + u'contracted', u'define', u'define-compound-unit', + u'define-compound-unit/infer', u'define-contract-struct', + u'define-custom-hash-types', u'define-custom-set-types', + u'define-for-syntax', u'define-local-member-name', u'define-logger', + u'define-match-expander', u'define-member-name', + u'define-module-boundary-contract', u'define-namespace-anchor', + u'define-opt/c', u'define-sequence-syntax', u'define-serializable-class', + u'define-serializable-class*', u'define-signature', + u'define-signature-form', u'define-struct', u'define-struct/contract', + u'define-struct/derived', u'define-syntax', u'define-syntax-rule', + u'define-syntaxes', u'define-unit', u'define-unit-binding', + u'define-unit-from-context', u'define-unit/contract', + u'define-unit/new-import-export', u'define-unit/s', u'define-values', + u'define-values-for-export', u'define-values-for-syntax', + u'define-values/invoke-unit', u'define-values/invoke-unit/infer', + u'define/augment', u'define/augment-final', u'define/augride', + u'define/contract', u'define/final-prop', u'define/match', + u'define/overment', u'define/override', u'define/override-final', + u'define/private', u'define/public', u'define/public-final', + u'define/pubment', u'define/subexpression-pos-prop', + u'define/subexpression-pos-prop/name', u'delay', u'delay/idle', + u'delay/name', u'delay/strict', u'delay/sync', u'delay/thread', u'do', + u'else', u'except', u'except-in', u'except-out', u'export', u'extends', + u'failure-cont', u'false', u'false/c', u'field', u'field-bound?', u'file', + u'flat-murec-contract', u'flat-rec-contract', u'for', u'for*', u'for*/and', + u'for*/async', u'for*/first', u'for*/fold', u'for*/fold/derived', + u'for*/hash', u'for*/hasheq', u'for*/hasheqv', u'for*/last', u'for*/list', + u'for*/lists', u'for*/mutable-set', u'for*/mutable-seteq', + u'for*/mutable-seteqv', u'for*/or', u'for*/product', u'for*/set', + u'for*/seteq', u'for*/seteqv', u'for*/stream', u'for*/sum', u'for*/vector', + u'for*/weak-set', u'for*/weak-seteq', u'for*/weak-seteqv', u'for-label', + u'for-meta', u'for-syntax', u'for-template', u'for/and', u'for/async', + u'for/first', u'for/fold', u'for/fold/derived', u'for/hash', u'for/hasheq', + u'for/hasheqv', u'for/last', u'for/list', u'for/lists', u'for/mutable-set', + u'for/mutable-seteq', u'for/mutable-seteqv', u'for/or', u'for/product', + u'for/set', u'for/seteq', u'for/seteqv', u'for/stream', u'for/sum', + u'for/vector', u'for/weak-set', u'for/weak-seteq', u'for/weak-seteqv', + u'gen:custom-write', u'gen:dict', u'gen:equal+hash', u'gen:set', + u'gen:stream', u'generic', u'get-field', u'hash/dc', u'if', u'implies', + u'import', u'include', u'include-at/relative-to', + u'include-at/relative-to/reader', u'include/reader', u'inherit', + u'inherit-field', u'inherit/inner', u'inherit/super', u'init', + u'init-depend', u'init-field', u'init-rest', u'inner', u'inspect', + u'instantiate', u'interface', u'interface*', u'invariant-assertion', + u'invoke-unit', u'invoke-unit/infer', u'lambda', u'lazy', u'let', u'let*', + u'let*-values', u'let-syntax', u'let-syntaxes', u'let-values', u'let/cc', + u'let/ec', u'letrec', u'letrec-syntax', u'letrec-syntaxes', + u'letrec-syntaxes+values', u'letrec-values', u'lib', u'link', u'local', + u'local-require', u'log-debug', u'log-error', u'log-fatal', u'log-info', + u'log-warning', u'match', u'match*', u'match*/derived', u'match-define', + u'match-define-values', u'match-lambda', u'match-lambda*', + u'match-lambda**', u'match-let', u'match-let*', u'match-let*-values', + u'match-let-values', u'match-letrec', u'match-letrec-values', + u'match/derived', u'match/values', u'member-name-key', u'mixin', u'module', + u'module*', u'module+', u'nand', u'new', u'nor', u'object-contract', + u'object/c', u'only', u'only-in', u'only-meta-in', u'open', u'opt/c', u'or', + u'overment', u'overment*', u'override', u'override*', u'override-final', + u'override-final*', u'parameterize', u'parameterize*', + u'parameterize-break', u'parametric->/c', u'place', u'place*', + u'place/context', u'planet', u'prefix', u'prefix-in', u'prefix-out', + u'private', u'private*', u'prompt-tag/c', u'protect-out', u'provide', + u'provide-signature-elements', u'provide/contract', u'public', u'public*', + u'public-final', u'public-final*', u'pubment', u'pubment*', u'quasiquote', + u'quasisyntax', u'quasisyntax/loc', u'quote', u'quote-syntax', + u'quote-syntax/prune', u'recontract-out', u'recursive-contract', + u'relative-in', u'rename', u'rename-in', u'rename-inner', u'rename-out', + u'rename-super', u'require', u'send', u'send*', u'send+', u'send-generic', + u'send/apply', u'send/keyword-apply', u'set!', u'set!-values', + u'set-field!', u'shared', u'stream', u'stream*', u'stream-cons', u'struct', + u'struct*', u'struct-copy', u'struct-field-index', u'struct-out', + u'struct/c', u'struct/ctc', u'struct/dc', u'submod', u'super', + u'super-instantiate', u'super-make-object', u'super-new', u'syntax', + u'syntax-case', u'syntax-case*', u'syntax-id-rules', u'syntax-rules', + u'syntax/loc', u'tag', u'this', u'this%', u'thunk', u'thunk*', u'time', + u'unconstrained-domain->', u'unit', u'unit-from-context', u'unit/c', + u'unit/new-import-export', u'unit/s', u'unless', u'unquote', + u'unquote-splicing', u'unsyntax', u'unsyntax-splicing', u'values/drop', + u'when', u'with-continuation-mark', u'with-contract', + u'with-contract-continuation-mark', u'with-handlers', u'with-handlers*', + u'with-method', u'with-syntax', u'λ' + ) + + # Generated by example.rkt + _builtins = ( + u'*', u'*list/c', u'+', u'-', u'/', u'<', u'', u'>/c', u'>=', u'>=/c', u'abort-current-continuation', u'abs', + u'absolute-path?', u'acos', u'add-between', u'add1', u'alarm-evt', + u'always-evt', u'and/c', u'andmap', u'angle', u'any/c', u'append', u'append*', + u'append-map', u'apply', u'argmax', u'argmin', u'arithmetic-shift', + u'arity-at-least', u'arity-at-least-value', u'arity-at-least?', + u'arity-checking-wrapper', u'arity-includes?', u'arity=?', + u'arrow-contract-info', u'arrow-contract-info-accepts-arglist', + u'arrow-contract-info-chaperone-procedure', + u'arrow-contract-info-check-first-order', u'arrow-contract-info?', + u'asin', u'assf', u'assoc', u'assq', u'assv', u'atan', + u'bad-number-of-results', u'banner', u'base->-doms/c', u'base->-rngs/c', + u'base->?', u'between/c', u'bitwise-and', u'bitwise-bit-field', + u'bitwise-bit-set?', u'bitwise-ior', u'bitwise-not', u'bitwise-xor', + u'blame-add-car-context', u'blame-add-cdr-context', u'blame-add-context', + u'blame-add-missing-party', u'blame-add-nth-arg-context', + u'blame-add-range-context', u'blame-add-unknown-context', + u'blame-context', u'blame-contract', u'blame-fmt->-string', + u'blame-missing-party?', u'blame-negative', u'blame-original?', + u'blame-positive', u'blame-replace-negative', u'blame-source', + u'blame-swap', u'blame-swapped?', u'blame-update', u'blame-value', + u'blame?', u'boolean=?', u'boolean?', u'bound-identifier=?', u'box', + u'box-cas!', u'box-immutable', u'box-immutable/c', u'box/c', u'box?', + u'break-enabled', u'break-parameterization?', u'break-thread', + u'build-chaperone-contract-property', u'build-compound-type-name', + u'build-contract-property', u'build-flat-contract-property', + u'build-list', u'build-path', u'build-path/convention-type', + u'build-string', u'build-vector', u'byte-pregexp', u'byte-pregexp?', + u'byte-ready?', u'byte-regexp', u'byte-regexp?', u'byte?', u'bytes', + u'bytes->immutable-bytes', u'bytes->list', u'bytes->path', + u'bytes->path-element', u'bytes->string/latin-1', u'bytes->string/locale', + u'bytes->string/utf-8', u'bytes-append', u'bytes-append*', + u'bytes-close-converter', u'bytes-convert', u'bytes-convert-end', + u'bytes-converter?', u'bytes-copy', u'bytes-copy!', + u'bytes-environment-variable-name?', u'bytes-fill!', u'bytes-join', + u'bytes-length', u'bytes-no-nuls?', u'bytes-open-converter', u'bytes-ref', + u'bytes-set!', u'bytes-utf-8-index', u'bytes-utf-8-length', + u'bytes-utf-8-ref', u'bytes?', u'bytes?', u'caaaar', + u'caaadr', u'caaar', u'caadar', u'caaddr', u'caadr', u'caar', u'cadaar', + u'cadadr', u'cadar', u'caddar', u'cadddr', u'caddr', u'cadr', + u'call-in-nested-thread', u'call-with-atomic-output-file', + u'call-with-break-parameterization', + u'call-with-composable-continuation', u'call-with-continuation-barrier', + u'call-with-continuation-prompt', u'call-with-current-continuation', + u'call-with-default-reading-parameterization', + u'call-with-escape-continuation', u'call-with-exception-handler', + u'call-with-file-lock/timeout', u'call-with-immediate-continuation-mark', + u'call-with-input-bytes', u'call-with-input-file', + u'call-with-input-file*', u'call-with-input-string', + u'call-with-output-bytes', u'call-with-output-file', + u'call-with-output-file*', u'call-with-output-string', + u'call-with-parameterization', u'call-with-semaphore', + u'call-with-semaphore/enable-break', u'call-with-values', u'call/cc', + u'call/ec', u'car', u'cartesian-product', u'cdaaar', u'cdaadr', u'cdaar', + u'cdadar', u'cdaddr', u'cdadr', u'cdar', u'cddaar', u'cddadr', u'cddar', + u'cdddar', u'cddddr', u'cdddr', u'cddr', u'cdr', u'ceiling', u'channel-get', + u'channel-put', u'channel-put-evt', u'channel-put-evt?', + u'channel-try-get', u'channel/c', u'channel?', u'chaperone-box', + u'chaperone-channel', u'chaperone-continuation-mark-key', + u'chaperone-contract-property?', u'chaperone-contract?', u'chaperone-evt', + u'chaperone-hash', u'chaperone-hash-set', u'chaperone-of?', + u'chaperone-procedure', u'chaperone-procedure*', u'chaperone-prompt-tag', + u'chaperone-struct', u'chaperone-struct-type', u'chaperone-vector', + u'chaperone?', u'char->integer', u'char-alphabetic?', u'char-blank?', + u'char-ci<=?', u'char-ci=?', u'char-ci>?', + u'char-downcase', u'char-foldcase', u'char-general-category', + u'char-graphic?', u'char-in', u'char-in/c', u'char-iso-control?', + u'char-lower-case?', u'char-numeric?', u'char-punctuation?', + u'char-ready?', u'char-symbolic?', u'char-title-case?', u'char-titlecase', + u'char-upcase', u'char-upper-case?', u'char-utf-8-length', + u'char-whitespace?', u'char<=?', u'char=?', u'char>?', + u'char?', u'check-duplicate-identifier', u'check-duplicates', + u'checked-procedure-check-and-extract', u'choice-evt', + u'class->interface', u'class-info', u'class-seal', u'class-unseal', + u'class?', u'cleanse-path', u'close-input-port', u'close-output-port', + u'coerce-chaperone-contract', u'coerce-chaperone-contracts', + u'coerce-contract', u'coerce-contract/f', u'coerce-contracts', + u'coerce-flat-contract', u'coerce-flat-contracts', u'collect-garbage', + u'collection-file-path', u'collection-path', u'combinations', u'compile', + u'compile-allow-set!-undefined', u'compile-context-preservation-enabled', + u'compile-enforce-module-constants', u'compile-syntax', + u'compiled-expression-recompile', u'compiled-expression?', + u'compiled-module-expression?', u'complete-path?', u'complex?', u'compose', + u'compose1', u'conjoin', u'conjugate', u'cons', u'cons/c', u'cons?', u'const', + u'continuation-mark-key/c', u'continuation-mark-key?', + u'continuation-mark-set->context', u'continuation-mark-set->list', + u'continuation-mark-set->list*', u'continuation-mark-set-first', + u'continuation-mark-set?', u'continuation-marks', + u'continuation-prompt-available?', u'continuation-prompt-tag?', + u'continuation?', u'contract-continuation-mark-key', + u'contract-custom-write-property-proc', u'contract-exercise', + u'contract-first-order', u'contract-first-order-passes?', + u'contract-late-neg-projection', u'contract-name', u'contract-proc', + u'contract-projection', u'contract-property?', + u'contract-random-generate', u'contract-random-generate-fail', + u'contract-random-generate-fail?', + u'contract-random-generate-get-current-environment', + u'contract-random-generate-stash', u'contract-random-generate/choose', + u'contract-stronger?', u'contract-struct-exercise', + u'contract-struct-generate', u'contract-struct-late-neg-projection', + u'contract-struct-list-contract?', u'contract-val-first-projection', + u'contract?', u'convert-stream', u'copy-directory/files', u'copy-file', + u'copy-port', u'cos', u'cosh', u'count', u'current-blame-format', + u'current-break-parameterization', u'current-code-inspector', + u'current-command-line-arguments', u'current-compile', + u'current-compiled-file-roots', u'current-continuation-marks', + u'current-contract-region', u'current-custodian', u'current-directory', + u'current-directory-for-user', u'current-drive', + u'current-environment-variables', u'current-error-port', u'current-eval', + u'current-evt-pseudo-random-generator', + u'current-force-delete-permissions', u'current-future', + u'current-gc-milliseconds', u'current-get-interaction-input-port', + u'current-inexact-milliseconds', u'current-input-port', + u'current-inspector', u'current-library-collection-links', + u'current-library-collection-paths', u'current-load', + u'current-load-extension', u'current-load-relative-directory', + u'current-load/use-compiled', u'current-locale', u'current-logger', + u'current-memory-use', u'current-milliseconds', + u'current-module-declare-name', u'current-module-declare-source', + u'current-module-name-resolver', u'current-module-path-for-load', + u'current-namespace', u'current-output-port', u'current-parameterization', + u'current-plumber', u'current-preserved-thread-cell-values', + u'current-print', u'current-process-milliseconds', u'current-prompt-read', + u'current-pseudo-random-generator', u'current-read-interaction', + u'current-reader-guard', u'current-readtable', u'current-seconds', + u'current-security-guard', u'current-subprocess-custodian-mode', + u'current-thread', u'current-thread-group', + u'current-thread-initial-stack-size', + u'current-write-relative-directory', u'curry', u'curryr', + u'custodian-box-value', u'custodian-box?', u'custodian-limit-memory', + u'custodian-managed-list', u'custodian-memory-accounting-available?', + u'custodian-require-memory', u'custodian-shutdown-all', u'custodian?', + u'custom-print-quotable-accessor', u'custom-print-quotable?', + u'custom-write-accessor', u'custom-write-property-proc', u'custom-write?', + u'date', u'date*', u'date*-nanosecond', u'date*-time-zone-name', u'date*?', + u'date-day', u'date-dst?', u'date-hour', u'date-minute', u'date-month', + u'date-second', u'date-time-zone-offset', u'date-week-day', u'date-year', + u'date-year-day', u'date?', u'datum->syntax', u'datum-intern-literal', + u'default-continuation-prompt-tag', u'degrees->radians', + u'delete-directory', u'delete-directory/files', u'delete-file', + u'denominator', u'dict->list', u'dict-can-functional-set?', + u'dict-can-remove-keys?', u'dict-clear', u'dict-clear!', u'dict-copy', + u'dict-count', u'dict-empty?', u'dict-for-each', u'dict-has-key?', + u'dict-implements/c', u'dict-implements?', u'dict-iter-contract', + u'dict-iterate-first', u'dict-iterate-key', u'dict-iterate-next', + u'dict-iterate-value', u'dict-key-contract', u'dict-keys', u'dict-map', + u'dict-mutable?', u'dict-ref', u'dict-ref!', u'dict-remove', + u'dict-remove!', u'dict-set', u'dict-set!', u'dict-set*', u'dict-set*!', + u'dict-update', u'dict-update!', u'dict-value-contract', u'dict-values', + u'dict?', u'directory-exists?', u'directory-list', u'disjoin', u'display', + u'display-lines', u'display-lines-to-file', u'display-to-file', + u'displayln', u'double-flonum?', u'drop', u'drop-common-prefix', + u'drop-right', u'dropf', u'dropf-right', u'dump-memory-stats', + u'dup-input-port', u'dup-output-port', u'dynamic->*', u'dynamic-get-field', + u'dynamic-object/c', u'dynamic-place', u'dynamic-place*', + u'dynamic-require', u'dynamic-require-for-syntax', u'dynamic-send', + u'dynamic-set-field!', u'dynamic-wind', u'eighth', u'empty', + u'empty-sequence', u'empty-stream', u'empty?', + u'environment-variables-copy', u'environment-variables-names', + u'environment-variables-ref', u'environment-variables-set!', + u'environment-variables?', u'eof', u'eof-evt', u'eof-object?', + u'ephemeron-value', u'ephemeron?', u'eprintf', u'eq-contract-val', + u'eq-contract?', u'eq-hash-code', u'eq?', u'equal-contract-val', + u'equal-contract?', u'equal-hash-code', u'equal-secondary-hash-code', + u'equal<%>', u'equal?', u'equal?/recur', u'eqv-hash-code', u'eqv?', u'error', + u'error-display-handler', u'error-escape-handler', + u'error-print-context-length', u'error-print-source-location', + u'error-print-width', u'error-value->string-handler', u'eval', + u'eval-jit-enabled', u'eval-syntax', u'even?', u'evt/c', u'evt?', + u'exact->inexact', u'exact-ceiling', u'exact-floor', u'exact-integer?', + u'exact-nonnegative-integer?', u'exact-positive-integer?', u'exact-round', + u'exact-truncate', u'exact?', u'executable-yield-handler', u'exit', + u'exit-handler', u'exn', u'exn-continuation-marks', u'exn-message', + u'exn:break', u'exn:break-continuation', u'exn:break:hang-up', + u'exn:break:hang-up?', u'exn:break:terminate', u'exn:break:terminate?', + u'exn:break?', u'exn:fail', u'exn:fail:contract', + u'exn:fail:contract:arity', u'exn:fail:contract:arity?', + u'exn:fail:contract:blame', u'exn:fail:contract:blame-object', + u'exn:fail:contract:blame?', u'exn:fail:contract:continuation', + u'exn:fail:contract:continuation?', u'exn:fail:contract:divide-by-zero', + u'exn:fail:contract:divide-by-zero?', + u'exn:fail:contract:non-fixnum-result', + u'exn:fail:contract:non-fixnum-result?', u'exn:fail:contract:variable', + u'exn:fail:contract:variable-id', u'exn:fail:contract:variable?', + u'exn:fail:contract?', u'exn:fail:filesystem', + u'exn:fail:filesystem:errno', u'exn:fail:filesystem:errno-errno', + u'exn:fail:filesystem:errno?', u'exn:fail:filesystem:exists', + u'exn:fail:filesystem:exists?', u'exn:fail:filesystem:missing-module', + u'exn:fail:filesystem:missing-module-path', + u'exn:fail:filesystem:missing-module?', u'exn:fail:filesystem:version', + u'exn:fail:filesystem:version?', u'exn:fail:filesystem?', + u'exn:fail:network', u'exn:fail:network:errno', + u'exn:fail:network:errno-errno', u'exn:fail:network:errno?', + u'exn:fail:network?', u'exn:fail:object', u'exn:fail:object?', + u'exn:fail:out-of-memory', u'exn:fail:out-of-memory?', u'exn:fail:read', + u'exn:fail:read-srclocs', u'exn:fail:read:eof', u'exn:fail:read:eof?', + u'exn:fail:read:non-char', u'exn:fail:read:non-char?', u'exn:fail:read?', + u'exn:fail:syntax', u'exn:fail:syntax-exprs', + u'exn:fail:syntax:missing-module', + u'exn:fail:syntax:missing-module-path', + u'exn:fail:syntax:missing-module?', u'exn:fail:syntax:unbound', + u'exn:fail:syntax:unbound?', u'exn:fail:syntax?', u'exn:fail:unsupported', + u'exn:fail:unsupported?', u'exn:fail:user', u'exn:fail:user?', + u'exn:fail?', u'exn:misc:match?', u'exn:missing-module-accessor', + u'exn:missing-module?', u'exn:srclocs-accessor', u'exn:srclocs?', u'exn?', + u'exp', u'expand', u'expand-once', u'expand-syntax', u'expand-syntax-once', + u'expand-syntax-to-top-form', u'expand-to-top-form', u'expand-user-path', + u'explode-path', u'expt', u'externalizable<%>', u'failure-result/c', + u'false?', u'field-names', u'fifth', u'file->bytes', u'file->bytes-lines', + u'file->lines', u'file->list', u'file->string', u'file->value', + u'file-exists?', u'file-name-from-path', u'file-or-directory-identity', + u'file-or-directory-modify-seconds', u'file-or-directory-permissions', + u'file-position', u'file-position*', u'file-size', + u'file-stream-buffer-mode', u'file-stream-port?', u'file-truncate', + u'filename-extension', u'filesystem-change-evt', + u'filesystem-change-evt-cancel', u'filesystem-change-evt?', + u'filesystem-root-list', u'filter', u'filter-map', u'filter-not', + u'filter-read-input-port', u'find-executable-path', u'find-files', + u'find-library-collection-links', u'find-library-collection-paths', + u'find-relative-path', u'find-system-path', u'findf', u'first', + u'first-or/c', u'fixnum?', u'flat-contract', u'flat-contract-predicate', + u'flat-contract-property?', u'flat-contract?', u'flat-named-contract', + u'flatten', u'floating-point-bytes->real', u'flonum?', u'floor', + u'flush-output', u'fold-files', u'foldl', u'foldr', u'for-each', u'force', + u'format', u'fourth', u'fprintf', u'free-identifier=?', + u'free-label-identifier=?', u'free-template-identifier=?', + u'free-transformer-identifier=?', u'fsemaphore-count', u'fsemaphore-post', + u'fsemaphore-try-wait?', u'fsemaphore-wait', u'fsemaphore?', u'future', + u'future?', u'futures-enabled?', u'gcd', u'generate-member-key', + u'generate-temporaries', u'generic-set?', u'generic?', u'gensym', + u'get-output-bytes', u'get-output-string', u'get-preference', + u'get/build-late-neg-projection', u'get/build-val-first-projection', + u'getenv', u'global-port-print-handler', u'group-by', u'group-execute-bit', + u'group-read-bit', u'group-write-bit', u'guard-evt', u'handle-evt', + u'handle-evt?', u'has-blame?', u'has-contract?', u'hash', u'hash->list', + u'hash-clear', u'hash-clear!', u'hash-copy', u'hash-copy-clear', + u'hash-count', u'hash-empty?', u'hash-eq?', u'hash-equal?', u'hash-eqv?', + u'hash-for-each', u'hash-has-key?', u'hash-iterate-first', + u'hash-iterate-key', u'hash-iterate-key+value', u'hash-iterate-next', + u'hash-iterate-pair', u'hash-iterate-value', u'hash-keys', u'hash-map', + u'hash-placeholder?', u'hash-ref', u'hash-ref!', u'hash-remove', + u'hash-remove!', u'hash-set', u'hash-set!', u'hash-set*', u'hash-set*!', + u'hash-update', u'hash-update!', u'hash-values', u'hash-weak?', u'hash/c', + u'hash?', u'hasheq', u'hasheqv', u'identifier-binding', + u'identifier-binding-symbol', u'identifier-label-binding', + u'identifier-prune-lexical-context', + u'identifier-prune-to-source-module', + u'identifier-remove-from-definition-context', + u'identifier-template-binding', u'identifier-transformer-binding', + u'identifier?', u'identity', u'if/c', u'imag-part', u'immutable?', + u'impersonate-box', u'impersonate-channel', + u'impersonate-continuation-mark-key', u'impersonate-hash', + u'impersonate-hash-set', u'impersonate-procedure', + u'impersonate-procedure*', u'impersonate-prompt-tag', + u'impersonate-struct', u'impersonate-vector', u'impersonator-contract?', + u'impersonator-ephemeron', u'impersonator-of?', + u'impersonator-prop:application-mark', u'impersonator-prop:blame', + u'impersonator-prop:contracted', + u'impersonator-property-accessor-procedure?', u'impersonator-property?', + u'impersonator?', u'implementation?', u'implementation?/c', u'in-bytes', + u'in-bytes-lines', u'in-combinations', u'in-cycle', u'in-dict', + u'in-dict-keys', u'in-dict-pairs', u'in-dict-values', u'in-directory', + u'in-hash', u'in-hash-keys', u'in-hash-pairs', u'in-hash-values', + u'in-immutable-hash', u'in-immutable-hash-keys', + u'in-immutable-hash-pairs', u'in-immutable-hash-values', + u'in-immutable-set', u'in-indexed', u'in-input-port-bytes', + u'in-input-port-chars', u'in-lines', u'in-list', u'in-mlist', + u'in-mutable-hash', u'in-mutable-hash-keys', u'in-mutable-hash-pairs', + u'in-mutable-hash-values', u'in-mutable-set', u'in-naturals', + u'in-parallel', u'in-permutations', u'in-port', u'in-producer', u'in-range', + u'in-sequences', u'in-set', u'in-slice', u'in-stream', u'in-string', + u'in-syntax', u'in-value', u'in-values*-sequence', u'in-values-sequence', + u'in-vector', u'in-weak-hash', u'in-weak-hash-keys', u'in-weak-hash-pairs', + u'in-weak-hash-values', u'in-weak-set', u'inexact->exact', + u'inexact-real?', u'inexact?', u'infinite?', u'input-port-append', + u'input-port?', u'inspector?', u'instanceof/c', u'integer->char', + u'integer->integer-bytes', u'integer-bytes->integer', u'integer-in', + u'integer-length', u'integer-sqrt', u'integer-sqrt/remainder', u'integer?', + u'interface->method-names', u'interface-extension?', u'interface?', + u'internal-definition-context-binding-identifiers', + u'internal-definition-context-introduce', + u'internal-definition-context-seal', u'internal-definition-context?', + u'is-a?', u'is-a?/c', u'keyword->string', u'keyword-apply', u'keywordbytes', u'list->mutable-set', + u'list->mutable-seteq', u'list->mutable-seteqv', u'list->set', + u'list->seteq', u'list->seteqv', u'list->string', u'list->vector', + u'list->weak-set', u'list->weak-seteq', u'list->weak-seteqv', + u'list-contract?', u'list-prefix?', u'list-ref', u'list-set', u'list-tail', + u'list-update', u'list/c', u'list?', u'listen-port-number?', u'listof', + u'load', u'load-extension', u'load-on-demand-enabled', u'load-relative', + u'load-relative-extension', u'load/cd', u'load/use-compiled', + u'local-expand', u'local-expand/capture-lifts', + u'local-transformer-expand', u'local-transformer-expand/capture-lifts', + u'locale-string-encoding', u'log', u'log-all-levels', u'log-level-evt', + u'log-level?', u'log-max-level', u'log-message', u'log-receiver?', + u'logger-name', u'logger?', u'magnitude', u'make-arity-at-least', + u'make-base-empty-namespace', u'make-base-namespace', u'make-bytes', + u'make-channel', u'make-chaperone-contract', + u'make-continuation-mark-key', u'make-continuation-prompt-tag', + u'make-contract', u'make-custodian', u'make-custodian-box', + u'make-custom-hash', u'make-custom-hash-types', u'make-custom-set', + u'make-custom-set-types', u'make-date', u'make-date*', + u'make-derived-parameter', u'make-directory', u'make-directory*', + u'make-do-sequence', u'make-empty-namespace', + u'make-environment-variables', u'make-ephemeron', u'make-exn', + u'make-exn:break', u'make-exn:break:hang-up', u'make-exn:break:terminate', + u'make-exn:fail', u'make-exn:fail:contract', + u'make-exn:fail:contract:arity', u'make-exn:fail:contract:blame', + u'make-exn:fail:contract:continuation', + u'make-exn:fail:contract:divide-by-zero', + u'make-exn:fail:contract:non-fixnum-result', + u'make-exn:fail:contract:variable', u'make-exn:fail:filesystem', + u'make-exn:fail:filesystem:errno', u'make-exn:fail:filesystem:exists', + u'make-exn:fail:filesystem:missing-module', + u'make-exn:fail:filesystem:version', u'make-exn:fail:network', + u'make-exn:fail:network:errno', u'make-exn:fail:object', + u'make-exn:fail:out-of-memory', u'make-exn:fail:read', + u'make-exn:fail:read:eof', u'make-exn:fail:read:non-char', + u'make-exn:fail:syntax', u'make-exn:fail:syntax:missing-module', + u'make-exn:fail:syntax:unbound', u'make-exn:fail:unsupported', + u'make-exn:fail:user', u'make-file-or-directory-link', + u'make-flat-contract', u'make-fsemaphore', u'make-generic', + u'make-handle-get-preference-locked', u'make-hash', + u'make-hash-placeholder', u'make-hasheq', u'make-hasheq-placeholder', + u'make-hasheqv', u'make-hasheqv-placeholder', + u'make-immutable-custom-hash', u'make-immutable-hash', + u'make-immutable-hasheq', u'make-immutable-hasheqv', + u'make-impersonator-property', u'make-input-port', + u'make-input-port/read-to-peek', u'make-inspector', + u'make-keyword-procedure', u'make-known-char-range-list', + u'make-limited-input-port', u'make-list', u'make-lock-file-name', + u'make-log-receiver', u'make-logger', u'make-mixin-contract', + u'make-mutable-custom-set', u'make-none/c', u'make-object', + u'make-output-port', u'make-parameter', u'make-parent-directory*', + u'make-phantom-bytes', u'make-pipe', u'make-pipe-with-specials', + u'make-placeholder', u'make-plumber', u'make-polar', u'make-prefab-struct', + u'make-primitive-class', u'make-proj-contract', + u'make-pseudo-random-generator', u'make-reader-graph', u'make-readtable', + u'make-rectangular', u'make-rename-transformer', + u'make-resolved-module-path', u'make-security-guard', u'make-semaphore', + u'make-set!-transformer', u'make-shared-bytes', u'make-sibling-inspector', + u'make-special-comment', u'make-srcloc', u'make-string', + u'make-struct-field-accessor', u'make-struct-field-mutator', + u'make-struct-type', u'make-struct-type-property', + u'make-syntax-delta-introducer', u'make-syntax-introducer', + u'make-temporary-file', u'make-tentative-pretty-print-output-port', + u'make-thread-cell', u'make-thread-group', u'make-vector', + u'make-weak-box', u'make-weak-custom-hash', u'make-weak-custom-set', + u'make-weak-hash', u'make-weak-hasheq', u'make-weak-hasheqv', + u'make-will-executor', u'map', u'match-equality-test', + u'matches-arity-exactly?', u'max', u'mcar', u'mcdr', u'mcons', u'member', + u'member-name-key-hash-code', u'member-name-key=?', u'member-name-key?', + u'memf', u'memq', u'memv', u'merge-input', u'method-in-interface?', u'min', + u'mixin-contract', u'module->exports', u'module->imports', + u'module->language-info', u'module->namespace', + u'module-compiled-cross-phase-persistent?', u'module-compiled-exports', + u'module-compiled-imports', u'module-compiled-language-info', + u'module-compiled-name', u'module-compiled-submodules', + u'module-declared?', u'module-path-index-join', + u'module-path-index-resolve', u'module-path-index-split', + u'module-path-index-submodule', u'module-path-index?', u'module-path?', + u'module-predefined?', u'module-provide-protected?', u'modulo', u'mpair?', + u'mutable-set', u'mutable-seteq', u'mutable-seteqv', u'n->th', + u'nack-guard-evt', u'namespace-anchor->empty-namespace', + u'namespace-anchor->namespace', u'namespace-anchor?', + u'namespace-attach-module', u'namespace-attach-module-declaration', + u'namespace-base-phase', u'namespace-mapped-symbols', + u'namespace-module-identifier', u'namespace-module-registry', + u'namespace-require', u'namespace-require/constant', + u'namespace-require/copy', u'namespace-require/expansion-time', + u'namespace-set-variable-value!', u'namespace-symbol->identifier', + u'namespace-syntax-introduce', u'namespace-undefine-variable!', + u'namespace-unprotect-module', u'namespace-variable-value', u'namespace?', + u'nan?', u'natural-number/c', u'negate', u'negative?', u'never-evt', + u'new-∀/c', u'new-∃/c', u'newline', u'ninth', u'non-empty-listof', + u'non-empty-string?', u'none/c', u'normal-case-path', u'normalize-arity', + u'normalize-path', u'normalized-arity?', u'not', u'not/c', u'null', u'null?', + u'number->string', u'number?', u'numerator', u'object%', u'object->vector', + u'object-info', u'object-interface', u'object-method-arity-includes?', + u'object-name', u'object-or-false=?', u'object=?', u'object?', u'odd?', + u'one-of/c', u'open-input-bytes', u'open-input-file', + u'open-input-output-file', u'open-input-string', u'open-output-bytes', + u'open-output-file', u'open-output-nowhere', u'open-output-string', + u'or/c', u'order-of-magnitude', u'ormap', u'other-execute-bit', + u'other-read-bit', u'other-write-bit', u'output-port?', u'pair?', + u'parameter-procedure=?', u'parameter/c', u'parameter?', + u'parameterization?', u'parse-command-line', u'partition', u'path->bytes', + u'path->complete-path', u'path->directory-path', u'path->string', + u'path-add-suffix', u'path-convention-type', u'path-element->bytes', + u'path-element->string', u'path-element?', u'path-for-some-system?', + u'path-list-string->path-list', u'path-only', u'path-replace-suffix', + u'path-string?', u'pathbytes', u'port->bytes-lines', u'port->lines', + u'port->list', u'port->string', u'port-closed-evt', u'port-closed?', + u'port-commit-peeked', u'port-count-lines!', u'port-count-lines-enabled', + u'port-counts-lines?', u'port-display-handler', u'port-file-identity', + u'port-file-unlock', u'port-next-location', u'port-number?', + u'port-print-handler', u'port-progress-evt', + u'port-provides-progress-evts?', u'port-read-handler', + u'port-try-file-lock?', u'port-write-handler', u'port-writes-atomic?', + u'port-writes-special?', u'port?', u'positive?', u'predicate/c', + u'prefab-key->struct-type', u'prefab-key?', u'prefab-struct-key', + u'preferences-lock-file-mode', u'pregexp', u'pregexp?', u'pretty-display', + u'pretty-format', u'pretty-print', u'pretty-print-.-symbol-without-bars', + u'pretty-print-abbreviate-read-macros', u'pretty-print-columns', + u'pretty-print-current-style-table', u'pretty-print-depth', + u'pretty-print-exact-as-decimal', u'pretty-print-extend-style-table', + u'pretty-print-handler', u'pretty-print-newline', + u'pretty-print-post-print-hook', u'pretty-print-pre-print-hook', + u'pretty-print-print-hook', u'pretty-print-print-line', + u'pretty-print-remap-stylable', u'pretty-print-show-inexactness', + u'pretty-print-size-hook', u'pretty-print-style-table?', + u'pretty-printing', u'pretty-write', u'primitive-closure?', + u'primitive-result-arity', u'primitive?', u'print', u'print-as-expression', + u'print-boolean-long-form', u'print-box', u'print-graph', + u'print-hash-table', u'print-mpair-curly-braces', + u'print-pair-curly-braces', u'print-reader-abbreviations', + u'print-struct', u'print-syntax-width', u'print-unreadable', + u'print-vector-length', u'printable/c', u'printable<%>', u'printf', + u'println', u'procedure->method', u'procedure-arity', + u'procedure-arity-includes/c', u'procedure-arity-includes?', + u'procedure-arity?', u'procedure-closure-contents-eq?', + u'procedure-extract-target', u'procedure-keywords', + u'procedure-reduce-arity', u'procedure-reduce-keyword-arity', + u'procedure-rename', u'procedure-result-arity', u'procedure-specialize', + u'procedure-struct-type?', u'procedure?', u'process', u'process*', + u'process*/ports', u'process/ports', u'processor-count', u'progress-evt?', + u'promise-forced?', u'promise-running?', u'promise/c', u'promise/name?', + u'promise?', u'prop:arity-string', u'prop:arrow-contract', + u'prop:arrow-contract-get-info', u'prop:arrow-contract?', u'prop:blame', + u'prop:chaperone-contract', u'prop:checked-procedure', u'prop:contract', + u'prop:contracted', u'prop:custom-print-quotable', u'prop:custom-write', + u'prop:dict', u'prop:dict/contract', u'prop:equal+hash', u'prop:evt', + u'prop:exn:missing-module', u'prop:exn:srclocs', + u'prop:expansion-contexts', u'prop:flat-contract', + u'prop:impersonator-of', u'prop:input-port', + u'prop:liberal-define-context', u'prop:object-name', + u'prop:opt-chaperone-contract', u'prop:opt-chaperone-contract-get-test', + u'prop:opt-chaperone-contract?', u'prop:orc-contract', + u'prop:orc-contract-get-subcontracts', u'prop:orc-contract?', + u'prop:output-port', u'prop:place-location', u'prop:procedure', + u'prop:recursive-contract', u'prop:recursive-contract-unroll', + u'prop:recursive-contract?', u'prop:rename-transformer', u'prop:sequence', + u'prop:set!-transformer', u'prop:stream', u'proper-subset?', + u'pseudo-random-generator->vector', u'pseudo-random-generator-vector?', + u'pseudo-random-generator?', u'put-preferences', u'putenv', u'quotient', + u'quotient/remainder', u'radians->degrees', u'raise', + u'raise-argument-error', u'raise-arguments-error', u'raise-arity-error', + u'raise-blame-error', u'raise-contract-error', u'raise-mismatch-error', + u'raise-not-cons-blame-error', u'raise-range-error', + u'raise-result-error', u'raise-syntax-error', u'raise-type-error', + u'raise-user-error', u'random', u'random-seed', u'range', u'rational?', + u'rationalize', u'read', u'read-accept-bar-quote', u'read-accept-box', + u'read-accept-compiled', u'read-accept-dot', u'read-accept-graph', + u'read-accept-infix-dot', u'read-accept-lang', u'read-accept-quasiquote', + u'read-accept-reader', u'read-byte', u'read-byte-or-special', + u'read-bytes', u'read-bytes!', u'read-bytes!-evt', u'read-bytes-avail!', + u'read-bytes-avail!*', u'read-bytes-avail!-evt', + u'read-bytes-avail!/enable-break', u'read-bytes-evt', u'read-bytes-line', + u'read-bytes-line-evt', u'read-case-sensitive', u'read-cdot', u'read-char', + u'read-char-or-special', u'read-curly-brace-as-paren', + u'read-curly-brace-with-tag', u'read-decimal-as-inexact', + u'read-eval-print-loop', u'read-language', u'read-line', u'read-line-evt', + u'read-on-demand-source', u'read-square-bracket-as-paren', + u'read-square-bracket-with-tag', u'read-string', u'read-string!', + u'read-string!-evt', u'read-string-evt', u'read-syntax', + u'read-syntax/recursive', u'read/recursive', u'readtable-mapping', + u'readtable?', u'real->decimal-string', u'real->double-flonum', + u'real->floating-point-bytes', u'real->single-flonum', u'real-in', + u'real-part', u'real?', u'reencode-input-port', u'reencode-output-port', + u'regexp', u'regexp-match', u'regexp-match*', u'regexp-match-evt', + u'regexp-match-exact?', u'regexp-match-peek', + u'regexp-match-peek-immediate', u'regexp-match-peek-positions', + u'regexp-match-peek-positions*', + u'regexp-match-peek-positions-immediate', + u'regexp-match-peek-positions-immediate/end', + u'regexp-match-peek-positions/end', u'regexp-match-positions', + u'regexp-match-positions*', u'regexp-match-positions/end', + u'regexp-match/end', u'regexp-match?', u'regexp-max-lookbehind', + u'regexp-quote', u'regexp-replace', u'regexp-replace*', + u'regexp-replace-quote', u'regexp-replaces', u'regexp-split', + u'regexp-try-match', u'regexp?', u'relative-path?', u'relocate-input-port', + u'relocate-output-port', u'remainder', u'remf', u'remf*', u'remove', + u'remove*', u'remove-duplicates', u'remq', u'remq*', u'remv', u'remv*', + u'rename-contract', u'rename-file-or-directory', + u'rename-transformer-target', u'rename-transformer?', u'replace-evt', + u'reroot-path', u'resolve-path', u'resolved-module-path-name', + u'resolved-module-path?', u'rest', u'reverse', u'round', u'second', + u'seconds->date', u'security-guard?', u'semaphore-peek-evt', + u'semaphore-peek-evt?', u'semaphore-post', u'semaphore-try-wait?', + u'semaphore-wait', u'semaphore-wait/enable-break', u'semaphore?', + u'sequence->list', u'sequence->stream', u'sequence-add-between', + u'sequence-andmap', u'sequence-append', u'sequence-count', + u'sequence-filter', u'sequence-fold', u'sequence-for-each', + u'sequence-generate', u'sequence-generate*', u'sequence-length', + u'sequence-map', u'sequence-ormap', u'sequence-ref', u'sequence-tail', + u'sequence/c', u'sequence?', u'set', u'set!-transformer-procedure', + u'set!-transformer?', u'set->list', u'set->stream', u'set-add', u'set-add!', + u'set-box!', u'set-clear', u'set-clear!', u'set-copy', u'set-copy-clear', + u'set-count', u'set-empty?', u'set-eq?', u'set-equal?', u'set-eqv?', + u'set-first', u'set-for-each', u'set-implements/c', u'set-implements?', + u'set-intersect', u'set-intersect!', u'set-map', u'set-mcar!', u'set-mcdr!', + u'set-member?', u'set-mutable?', u'set-phantom-bytes!', + u'set-port-next-location!', u'set-remove', u'set-remove!', u'set-rest', + u'set-some-basic-contracts!', u'set-subtract', u'set-subtract!', + u'set-symmetric-difference', u'set-symmetric-difference!', u'set-union', + u'set-union!', u'set-weak?', u'set/c', u'set=?', u'set?', u'seteq', u'seteqv', + u'seventh', u'sgn', u'shared-bytes', u'shell-execute', u'shrink-path-wrt', + u'shuffle', u'simple-form-path', u'simplify-path', u'sin', + u'single-flonum?', u'sinh', u'sixth', u'skip-projection-wrapper?', u'sleep', + u'some-system-path->string', u'sort', u'special-comment-value', + u'special-comment?', u'special-filter-input-port', u'split-at', + u'split-at-right', u'split-common-prefix', u'split-path', u'splitf-at', + u'splitf-at-right', u'sqr', u'sqrt', u'srcloc', u'srcloc->string', + u'srcloc-column', u'srcloc-line', u'srcloc-position', u'srcloc-source', + u'srcloc-span', u'srcloc?', u'stop-after', u'stop-before', u'stream->list', + u'stream-add-between', u'stream-andmap', u'stream-append', u'stream-count', + u'stream-empty?', u'stream-filter', u'stream-first', u'stream-fold', + u'stream-for-each', u'stream-length', u'stream-map', u'stream-ormap', + u'stream-ref', u'stream-rest', u'stream-tail', u'stream/c', u'stream?', + u'string', u'string->bytes/latin-1', u'string->bytes/locale', + u'string->bytes/utf-8', u'string->immutable-string', u'string->keyword', + u'string->list', u'string->number', u'string->path', + u'string->path-element', u'string->some-system-path', u'string->symbol', + u'string->uninterned-symbol', u'string->unreadable-symbol', + u'string-append', u'string-append*', u'string-ci<=?', u'string-ci=?', u'string-ci>?', u'string-contains?', + u'string-copy', u'string-copy!', u'string-downcase', + u'string-environment-variable-name?', u'string-fill!', u'string-foldcase', + u'string-join', u'string-len/c', u'string-length', u'string-locale-ci?', u'string-locale-downcase', + u'string-locale-upcase', u'string-locale?', u'string-no-nuls?', u'string-normalize-nfc', + u'string-normalize-nfd', u'string-normalize-nfkc', + u'string-normalize-nfkd', u'string-normalize-spaces', u'string-port?', + u'string-prefix?', u'string-ref', u'string-replace', u'string-set!', + u'string-split', u'string-suffix?', u'string-titlecase', u'string-trim', + u'string-upcase', u'string-utf-8-length', u'string<=?', u'string=?', u'string>?', u'string?', u'struct->vector', + u'struct-accessor-procedure?', u'struct-constructor-procedure?', + u'struct-info', u'struct-mutator-procedure?', + u'struct-predicate-procedure?', u'struct-type-info', + u'struct-type-make-constructor', u'struct-type-make-predicate', + u'struct-type-property-accessor-procedure?', u'struct-type-property/c', + u'struct-type-property?', u'struct-type?', u'struct:arity-at-least', + u'struct:arrow-contract-info', u'struct:date', u'struct:date*', + u'struct:exn', u'struct:exn:break', u'struct:exn:break:hang-up', + u'struct:exn:break:terminate', u'struct:exn:fail', + u'struct:exn:fail:contract', u'struct:exn:fail:contract:arity', + u'struct:exn:fail:contract:blame', + u'struct:exn:fail:contract:continuation', + u'struct:exn:fail:contract:divide-by-zero', + u'struct:exn:fail:contract:non-fixnum-result', + u'struct:exn:fail:contract:variable', u'struct:exn:fail:filesystem', + u'struct:exn:fail:filesystem:errno', + u'struct:exn:fail:filesystem:exists', + u'struct:exn:fail:filesystem:missing-module', + u'struct:exn:fail:filesystem:version', u'struct:exn:fail:network', + u'struct:exn:fail:network:errno', u'struct:exn:fail:object', + u'struct:exn:fail:out-of-memory', u'struct:exn:fail:read', + u'struct:exn:fail:read:eof', u'struct:exn:fail:read:non-char', + u'struct:exn:fail:syntax', u'struct:exn:fail:syntax:missing-module', + u'struct:exn:fail:syntax:unbound', u'struct:exn:fail:unsupported', + u'struct:exn:fail:user', u'struct:srcloc', + u'struct:wrapped-extra-arg-arrow', u'struct?', u'sub1', u'subbytes', + u'subclass?', u'subclass?/c', u'subprocess', u'subprocess-group-enabled', + u'subprocess-kill', u'subprocess-pid', u'subprocess-status', + u'subprocess-wait', u'subprocess?', u'subset?', u'substring', u'suggest/c', + u'symbol->string', u'symbol-interned?', u'symbol-unreadable?', u'symboldatum', + u'syntax->list', u'syntax-arm', u'syntax-column', u'syntax-debug-info', + u'syntax-disarm', u'syntax-e', u'syntax-line', + u'syntax-local-bind-syntaxes', u'syntax-local-certifier', + u'syntax-local-context', u'syntax-local-expand-expression', + u'syntax-local-get-shadower', u'syntax-local-identifier-as-binding', + u'syntax-local-introduce', u'syntax-local-lift-context', + u'syntax-local-lift-expression', u'syntax-local-lift-module', + u'syntax-local-lift-module-end-declaration', + u'syntax-local-lift-provide', u'syntax-local-lift-require', + u'syntax-local-lift-values-expression', + u'syntax-local-make-definition-context', + u'syntax-local-make-delta-introducer', + u'syntax-local-module-defined-identifiers', + u'syntax-local-module-exports', + u'syntax-local-module-required-identifiers', u'syntax-local-name', + u'syntax-local-phase-level', u'syntax-local-submodules', + u'syntax-local-transforming-module-provides?', u'syntax-local-value', + u'syntax-local-value/immediate', u'syntax-original?', u'syntax-position', + u'syntax-property', u'syntax-property-preserved?', + u'syntax-property-symbol-keys', u'syntax-protect', u'syntax-rearm', + u'syntax-recertify', u'syntax-shift-phase-level', u'syntax-source', + u'syntax-source-module', u'syntax-span', u'syntax-taint', + u'syntax-tainted?', u'syntax-track-origin', + u'syntax-transforming-module-expression?', + u'syntax-transforming-with-lifts?', u'syntax-transforming?', u'syntax/c', + u'syntax?', u'system', u'system*', u'system*/exit-code', + u'system-big-endian?', u'system-idle-evt', u'system-language+country', + u'system-library-subpath', u'system-path-convention-type', u'system-type', + u'system/exit-code', u'tail-marks-match?', u'take', u'take-common-prefix', + u'take-right', u'takef', u'takef-right', u'tan', u'tanh', + u'tcp-abandon-port', u'tcp-accept', u'tcp-accept-evt', + u'tcp-accept-ready?', u'tcp-accept/enable-break', u'tcp-addresses', + u'tcp-close', u'tcp-connect', u'tcp-connect/enable-break', u'tcp-listen', + u'tcp-listener?', u'tcp-port?', u'tentative-pretty-print-port-cancel', + u'tentative-pretty-print-port-transfer', u'tenth', u'terminal-port?', + u'the-unsupplied-arg', u'third', u'thread', u'thread-cell-ref', + u'thread-cell-set!', u'thread-cell-values?', u'thread-cell?', + u'thread-dead-evt', u'thread-dead?', u'thread-group?', u'thread-receive', + u'thread-receive-evt', u'thread-resume', u'thread-resume-evt', + u'thread-rewind-receive', u'thread-running?', u'thread-send', + u'thread-suspend', u'thread-suspend-evt', u'thread-try-receive', + u'thread-wait', u'thread/suspend-to-kill', u'thread?', u'time-apply', + u'touch', u'transplant-input-port', u'transplant-output-port', u'true', + u'truncate', u'udp-addresses', u'udp-bind!', u'udp-bound?', u'udp-close', + u'udp-connect!', u'udp-connected?', u'udp-multicast-interface', + u'udp-multicast-join-group!', u'udp-multicast-leave-group!', + u'udp-multicast-loopback?', u'udp-multicast-set-interface!', + u'udp-multicast-set-loopback!', u'udp-multicast-set-ttl!', + u'udp-multicast-ttl', u'udp-open-socket', u'udp-receive!', + u'udp-receive!*', u'udp-receive!-evt', u'udp-receive!/enable-break', + u'udp-receive-ready-evt', u'udp-send', u'udp-send*', u'udp-send-evt', + u'udp-send-ready-evt', u'udp-send-to', u'udp-send-to*', u'udp-send-to-evt', + u'udp-send-to/enable-break', u'udp-send/enable-break', u'udp?', u'unbox', + u'uncaught-exception-handler', u'unit?', u'unspecified-dom', + u'unsupplied-arg?', u'use-collection-link-paths', + u'use-compiled-file-paths', u'use-user-specific-search-paths', + u'user-execute-bit', u'user-read-bit', u'user-write-bit', u'value-blame', + u'value-contract', u'values', u'variable-reference->empty-namespace', + u'variable-reference->module-base-phase', + u'variable-reference->module-declaration-inspector', + u'variable-reference->module-path-index', + u'variable-reference->module-source', u'variable-reference->namespace', + u'variable-reference->phase', + u'variable-reference->resolved-module-path', + u'variable-reference-constant?', u'variable-reference?', u'vector', + u'vector->immutable-vector', u'vector->list', + u'vector->pseudo-random-generator', u'vector->pseudo-random-generator!', + u'vector->values', u'vector-append', u'vector-argmax', u'vector-argmin', + u'vector-copy', u'vector-copy!', u'vector-count', u'vector-drop', + u'vector-drop-right', u'vector-fill!', u'vector-filter', + u'vector-filter-not', u'vector-immutable', u'vector-immutable/c', + u'vector-immutableof', u'vector-length', u'vector-map', u'vector-map!', + u'vector-member', u'vector-memq', u'vector-memv', u'vector-ref', + u'vector-set!', u'vector-set*!', u'vector-set-performance-stats!', + u'vector-split-at', u'vector-split-at-right', u'vector-take', + u'vector-take-right', u'vector/c', u'vector?', u'vectorof', u'version', + u'void', u'void?', u'weak-box-value', u'weak-box?', u'weak-set', + u'weak-seteq', u'weak-seteqv', u'will-execute', u'will-executor?', + u'will-register', u'will-try-execute', u'with-input-from-bytes', + u'with-input-from-file', u'with-input-from-string', + u'with-output-to-bytes', u'with-output-to-file', u'with-output-to-string', + u'would-be-future', u'wrap-evt', u'wrapped-extra-arg-arrow', + u'wrapped-extra-arg-arrow-extra-neg-party-argument', + u'wrapped-extra-arg-arrow-real-func', u'wrapped-extra-arg-arrow?', + u'writable<%>', u'write', u'write-byte', u'write-bytes', + u'write-bytes-avail', u'write-bytes-avail*', u'write-bytes-avail-evt', + u'write-bytes-avail/enable-break', u'write-char', u'write-special', + u'write-special-avail*', u'write-special-evt', u'write-string', + u'write-to-file', u'writeln', u'xor', u'zero?', u'~.a', u'~.s', u'~.v', u'~a', + u'~e', u'~r', u'~s', u'~v' + ) + + _opening_parenthesis = r'[([{]' + _closing_parenthesis = r'[)\]}]' + _delimiters = r'()[\]{}",\'`;\s' + _symbol = r'(?u)(?:\|[^|]*\||\\[\w\W]|[^|\\%s]+)+' % _delimiters + _exact_decimal_prefix = r'(?:#e)?(?:#d)?(?:#e)?' + _exponent = r'(?:[defls][-+]?\d+)' + _inexact_simple_no_hashes = r'(?:\d+(?:/\d+|\.\d*)?|\.\d+)' + _inexact_simple = (r'(?:%s|(?:\d+#+(?:\.#*|/\d+#*)?|\.\d+#+|' + r'\d+(?:\.\d*#+|/\d+#+)))' % _inexact_simple_no_hashes) + _inexact_normal_no_hashes = r'(?:%s%s?)' % (_inexact_simple_no_hashes, + _exponent) + _inexact_normal = r'(?:%s%s?)' % (_inexact_simple, _exponent) + _inexact_special = r'(?:(?:inf|nan)\.[0f])' + _inexact_real = r'(?:[-+]?%s|[-+]%s)' % (_inexact_normal, + _inexact_special) + _inexact_unsigned = r'(?:%s|%s)' % (_inexact_normal, _inexact_special) + + tokens = { + 'root': [ + (_closing_parenthesis, Error), + (r'(?!\Z)', Text, 'unquoted-datum') + ], + 'datum': [ + (r'(?s)#;|#![ /]([^\\\n]|\\.)*', Comment), + (u';[^\\n\\r\x85\u2028\u2029]*', Comment.Single), + (r'#\|', Comment.Multiline, 'block-comment'), + + # Whitespaces + (r'(?u)\s+', Text), + + # 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 + (r'(?i)%s[-+]?\d+(?=[%s])' % (_exact_decimal_prefix, _delimiters), + Number.Integer, '#pop'), + (r'(?i)%s[-+]?(\d+(\.\d*)?|\.\d+)([deflst][-+]?\d+)?(?=[%s])' % + (_exact_decimal_prefix, _delimiters), Number.Float, '#pop'), + (r'(?i)%s[-+]?(%s([-+]%s?i)?|[-+]%s?i)(?=[%s])' % + (_exact_decimal_prefix, _inexact_normal_no_hashes, + _inexact_normal_no_hashes, _inexact_normal_no_hashes, + _delimiters), Number, '#pop'), + + # Inexact without explicit #i + (r'(?i)(#d)?(%s([-+]%s?i)?|[-+]%s?i|%s@%s)(?=[%s])' % + (_inexact_real, _inexact_unsigned, _inexact_unsigned, + _inexact_real, _inexact_real, _delimiters), Number.Float, + '#pop'), + + # The remaining extflonums + (r'(?i)(([-+]?%st[-+]?\d+)|[-+](inf|nan)\.t)(?=[%s])' % + (_inexact_simple, _delimiters), Number.Float, '#pop'), + + # #b + (r'(?i)(#[ei])?#b%s' % _symbol, Number.Bin, '#pop'), + + # #o + (r'(?i)(#[ei])?#o%s' % _symbol, Number.Oct, '#pop'), + + # #x + (r'(?i)(#[ei])?#x%s' % _symbol, Number.Hex, '#pop'), + + # #i is always inexact, i.e. float + (r'(?i)(#d)?#i%s' % _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) + (r'#:%s' % _symbol, Keyword.Declaration, '#pop'), + + # Reader extensions + (r'(#lang |#!)(\S+)', + bygroups(Keyword.Namespace, Name.Namespace)), + (r'#reader', Keyword.Namespace, 'quoted-datum'), + + # Other syntax + (r"(?i)\.(?=[%s])|#c[is]|#['`]|#,@?" % _delimiters, Operator), + (r"'|#[s&]|#hash(eqv?)?|#\d*(?=%s)" % _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'), + (r'quote(?=[%s])' % _delimiters, Keyword, + ('#pop', 'quoted-datum')), + (r'`', Operator, ('#pop', 'quasiquoted-datum')), + (r'quasiquote(?=[%s])' % _delimiters, Keyword, + ('#pop', 'quasiquoted-datum')), + (_opening_parenthesis, Punctuation, ('#pop', 'unquoted-list')), + (words(_keywords, prefix='(?u)', suffix='(?=[%s])' % _delimiters), + Keyword, '#pop'), + (words(_builtins, prefix='(?u)', suffix='(?=[%s])' % _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')), + (r'unquote(-splicing)?(?=[%s])' % _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). + + .. versionadded:: 1.5 + """ + + name = 'NewLisp' + aliases = ['newlisp'] + filenames = ['*.lsp', '*.nl', '*.kif'] + mimetypes = ['text/x-newlisp', 'application/x-newlisp'] + + flags = re.IGNORECASE | re.MULTILINE | re.UNICODE + + # 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+', Text), + + # 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. + + .. versionadded:: 2.1 + """ + name = 'EmacsLisp' + aliases = ['emacs', 'elisp', 'emacs-lisp'] + filenames = ['*.el'] + mimetypes = ['text/x-elisp', 'application/x-elisp'] + + 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 = r'((?:%s)(?:%s)*)' % (nonmacro, constituent) + + macros = set(( + '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 = set(( + '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 = set(( + '%', '*', '+', '-', '/', '/=', '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-as-multibyte', 'string-as-unibyte', 'string-bytes', + 'string-collate-equalp', 'string-collate-lessp', 'string-equal', + '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 = set(( + 'defvaralias', 'provide', 'require', + 'with-no-warnings', 'define-widget', 'with-electric-help', + 'throw', 'defalias', 'featurep' + )) + + lambda_list_keywords = set(( + '&allow-other-keys', '&aux', '&body', '&environment', '&key', '&optional', + '&rest', '&whole', + )) + + error_keywords = set(( + '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+', Text), + + # 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 + '\*', Name.Variable.Global), + (symbol, Name.Variable), + + # parentheses + (r'#\(', Operator, 'body'), + (r'\(', Punctuation, 'body'), + (r'\)', Punctuation, '#pop'), + ], + 'string': [ + (r'[^"\\`]+', String), + (r'`%s\'' % symbol, String.Symbol), + (r'`', String), + (r'\\.', String), + (r'\\\n', String), + (r'"', String, '#pop'), + ], + } + + +class ShenLexer(RegexLexer): + """ + Lexer for `Shen `_ source code. + + .. versionadded:: 2.1 + """ + name = 'Shen' + aliases = ['shen'] + filenames = ['*.shen'] + mimetypes = ['text/x-shen', 'application/x-shen'] + + 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 = dict((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 = '%s+' % valid_symbol_chars + symbol_name = r'[a-z!$%%*+,<=>?/.\'@&#_-]%s*' % valid_symbol_chars + variable = r'[A-Z]%s*' % 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+', Text), + (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, 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 + for index, token, value in \ + self._process_declaration(declaration, tokens): + yield index, token, value + 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 + + raise StopIteration + + def _process_signature(self, tokens): + for index, token, value in tokens: + if token == Literal and value == '}': + yield index, Punctuation, value + raise StopIteration + elif token in (Literal, Name.Function): + token = Name.Variable if value.istitle() else Keyword.Type + yield index, token, value + + +class CPSALexer(SchemeLexer): + """ + A CPSA lexer based on the CPSA language as of version 2.2.12 + + .. versionadded:: 2.1 + """ + name = 'CPSA' + aliases = ['cpsa'] + filenames = ['*.cpsa'] + mimetypes = [] + + # 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+', Text), + + # 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) + + .. versionadded:: 2.2 + """ + name = 'xtlang' + aliases = ['extempore'] + filenames = ['*.xtm'] + mimetypes = [] + + 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+', Text), + + # 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') + ], + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/markup.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/markup.py new file mode 100644 index 0000000000000000000000000000000000000000..92dc9e7a6185d7f7cb2f5bcc1e0fcea9242f3a32 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/markup.py @@ -0,0 +1,595 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.markup + ~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for non-HTML markup languages. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexers.html import HtmlLexer, XmlLexer +from pygments.lexers.javascript import JavascriptLexer +from pygments.lexers.css import CssLexer + +from pygments.lexer import RegexLexer, DelegatingLexer, include, bygroups, \ + using, this, do_insertions, default, words +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Generic, Other +from pygments.util import get_bool_opt, ClassNotFound + +__all__ = ['BBCodeLexer', 'MoinWikiLexer', 'RstLexer', 'TexLexer', 'GroffLexer', + 'MozPreprocHashLexer', 'MozPreprocPercentLexer', + 'MozPreprocXulLexer', 'MozPreprocJavascriptLexer', + 'MozPreprocCssLexer', 'MarkdownLexer'] + + +class BBCodeLexer(RegexLexer): + """ + A lexer that highlights BBCode(-like) syntax. + + .. versionadded:: 0.6 + """ + + name = 'BBCode' + aliases = ['bbcode'] + mimetypes = ['text/x-bbcode'] + + tokens = { + 'root': [ + (r'[^[]+', Text), + # tag/end tag begin + (r'\[/?\w+', Keyword, 'tag'), + # stray bracket + (r'\[', Text), + ], + 'tag': [ + (r'\s+', Text), + # attribute with value + (r'(\w+)(=)("?[^\s"\]]+"?)', + bygroups(Name.Attribute, Operator, String)), + # tag argument (a la [color=green]) + (r'(=)("?[^\s"\]]+"?)', + bygroups(Operator, String)), + # tag end + (r'\]', Keyword, '#pop'), + ], + } + + +class MoinWikiLexer(RegexLexer): + """ + For MoinMoin (and Trac) Wiki markup. + + .. versionadded:: 0.7 + """ + + name = 'MoinMoin/Trac Wiki markup' + aliases = ['trac-wiki', 'moin'] + filenames = [] + mimetypes = ['text/x-trac-wiki'] + flags = re.MULTILINE | re.IGNORECASE + + tokens = { + 'root': [ + (r'^#.*$', Comment), + (r'(!)(\S+)', bygroups(Keyword, Text)), # Ignore-next + # Titles + (r'^(=+)([^=]+)(=+)(\s*#.+)?$', + bygroups(Generic.Heading, using(this), Generic.Heading, String)), + # Literal code blocks, with optional shebang + (r'(\{\{\{)(\n#!.+)?', bygroups(Name.Builtin, Name.Namespace), 'codeblock'), + (r'(\'\'\'?|\|\||`|__|~~|\^|,,|::)', Comment), # Formatting + # Lists + (r'^( +)([.*-])( )', bygroups(Text, Name.Builtin, Text)), + (r'^( +)([a-z]{1,5}\.)( )', bygroups(Text, Name.Builtin, Text)), + # Other Formatting + (r'\[\[\w+.*?\]\]', Keyword), # Macro + (r'(\[[^\s\]]+)(\s+[^\]]+?)?(\])', + bygroups(Keyword, String, Keyword)), # Link + (r'^----+$', Keyword), # Horizontal rules + (r'[^\n\'\[{!_~^,|]+', Text), + (r'\n', Text), + (r'.', Text), + ], + 'codeblock': [ + (r'\}\}\}', Name.Builtin, '#pop'), + # these blocks are allowed to be nested in Trac, but not MoinMoin + (r'\{\{\{', Text, '#push'), + (r'[^{}]+', Comment.Preproc), # slurp boring text + (r'.', Comment.Preproc), # allow loose { or } + ], + } + + +class RstLexer(RegexLexer): + """ + For `reStructuredText `_ markup. + + .. versionadded:: 0.7 + + Additional options accepted: + + `handlecodeblocks` + Highlight the contents of ``.. sourcecode:: language``, + ``.. code:: language`` and ``.. code-block:: language`` + directives with a lexer for the given language (default: + ``True``). + + .. versionadded:: 0.8 + """ + name = 'reStructuredText' + aliases = ['rst', 'rest', 'restructuredtext'] + filenames = ['*.rst', '*.rest'] + mimetypes = ["text/x-rst", "text/prs.fallenstein.rst"] + flags = re.MULTILINE + + def _handle_sourcecode(self, match): + from pygments.lexers import get_lexer_by_name + + # section header + yield match.start(1), Punctuation, match.group(1) + yield match.start(2), Text, match.group(2) + yield match.start(3), Operator.Word, match.group(3) + yield match.start(4), Punctuation, match.group(4) + yield match.start(5), Text, match.group(5) + yield match.start(6), Keyword, match.group(6) + yield match.start(7), Text, match.group(7) + + # lookup lexer if wanted and existing + lexer = None + if self.handlecodeblocks: + try: + lexer = get_lexer_by_name(match.group(6).strip()) + except ClassNotFound: + pass + indention = match.group(8) + indention_size = len(indention) + code = (indention + match.group(9) + match.group(10) + match.group(11)) + + # no lexer for this language. handle it like it was a code block + if lexer is None: + yield match.start(8), String, code + return + + # highlight the lines with the lexer. + ins = [] + codelines = code.splitlines(True) + code = '' + for line in codelines: + if len(line) > indention_size: + ins.append((len(code), [(0, Text, line[:indention_size])])) + code += line[indention_size:] + else: + code += line + for item in do_insertions(ins, lexer.get_tokens_unprocessed(code)): + yield item + + # from docutils.parsers.rst.states + closers = u'\'")]}>\u2019\u201d\xbb!?' + unicode_delimiters = u'\u2010\u2011\u2012\u2013\u2014\u00a0' + end_string_suffix = (r'((?=$)|(?=[-/:.,; \n\x00%s%s]))' + % (re.escape(unicode_delimiters), + re.escape(closers))) + + tokens = { + 'root': [ + # Heading with overline + (r'^(=+|-+|`+|:+|\.+|\'+|"+|~+|\^+|_+|\*+|\++|#+)([ \t]*\n)' + r'(.+)(\n)(\1)(\n)', + bygroups(Generic.Heading, Text, Generic.Heading, + Text, Generic.Heading, Text)), + # Plain heading + (r'^(\S.*)(\n)(={3,}|-{3,}|`{3,}|:{3,}|\.{3,}|\'{3,}|"{3,}|' + r'~{3,}|\^{3,}|_{3,}|\*{3,}|\+{3,}|#{3,})(\n)', + bygroups(Generic.Heading, Text, Generic.Heading, Text)), + # Bulleted lists + (r'^(\s*)([-*+])( .+\n(?:\1 .+\n)*)', + bygroups(Text, Number, using(this, state='inline'))), + # Numbered lists + (r'^(\s*)([0-9#ivxlcmIVXLCM]+\.)( .+\n(?:\1 .+\n)*)', + bygroups(Text, Number, using(this, state='inline'))), + (r'^(\s*)(\(?[0-9#ivxlcmIVXLCM]+\))( .+\n(?:\1 .+\n)*)', + bygroups(Text, Number, using(this, state='inline'))), + # Numbered, but keep words at BOL from becoming lists + (r'^(\s*)([A-Z]+\.)( .+\n(?:\1 .+\n)+)', + bygroups(Text, Number, using(this, state='inline'))), + (r'^(\s*)(\(?[A-Za-z]+\))( .+\n(?:\1 .+\n)+)', + bygroups(Text, Number, using(this, state='inline'))), + # Line blocks + (r'^(\s*)(\|)( .+\n(?:\| .+\n)*)', + bygroups(Text, Operator, using(this, state='inline'))), + # Sourcecode directives + (r'^( *\.\.)(\s*)((?:source)?code(?:-block)?)(::)([ \t]*)([^\n]+)' + r'(\n[ \t]*\n)([ \t]+)(.*)(\n)((?:(?:\8.*|)\n)+)', + _handle_sourcecode), + # A directive + (r'^( *\.\.)(\s*)([\w:-]+?)(::)(?:([ \t]*)(.*))', + bygroups(Punctuation, Text, Operator.Word, Punctuation, Text, + using(this, state='inline'))), + # A reference target + (r'^( *\.\.)(\s*)(_(?:[^:\\]|\\.)+:)(.*?)$', + bygroups(Punctuation, Text, Name.Tag, using(this, state='inline'))), + # A footnote/citation target + (r'^( *\.\.)(\s*)(\[.+\])(.*?)$', + bygroups(Punctuation, Text, Name.Tag, using(this, state='inline'))), + # A substitution def + (r'^( *\.\.)(\s*)(\|.+\|)(\s*)([\w:-]+?)(::)(?:([ \t]*)(.*))', + bygroups(Punctuation, Text, Name.Tag, Text, Operator.Word, + Punctuation, Text, using(this, state='inline'))), + # Comments + (r'^ *\.\..*(\n( +.*\n|\n)+)?', Comment.Preproc), + # Field list + (r'^( *)(:[a-zA-Z-]+:)(\s*)$', bygroups(Text, Name.Class, Text)), + (r'^( *)(:.*?:)([ \t]+)(.*?)$', + bygroups(Text, Name.Class, Text, Name.Function)), + # Definition list + (r'^(\S.*(?)(`__?)', # reference with inline target + bygroups(String, String.Interpol, String)), + (r'`.+?`__?', String), # reference + (r'(`.+?`)(:[a-zA-Z0-9:-]+?:)?', + bygroups(Name.Variable, Name.Attribute)), # role + (r'(:[a-zA-Z0-9:-]+?:)(`.+?`)', + bygroups(Name.Attribute, Name.Variable)), # role (content first) + (r'\*\*.+?\*\*', Generic.Strong), # Strong emphasis + (r'\*.+?\*', Generic.Emph), # Emphasis + (r'\[.*?\]_', String), # Footnote or citation + (r'<.+?>', Name.Tag), # Hyperlink + (r'[^\\\n\[*`:]+', Text), + (r'.', Text), + ], + 'literal': [ + (r'[^`]+', String), + (r'``' + end_string_suffix, String, '#pop'), + (r'`', String), + ] + } + + def __init__(self, **options): + self.handlecodeblocks = get_bool_opt(options, 'handlecodeblocks', True) + RegexLexer.__init__(self, **options) + + def analyse_text(text): + if text[:2] == '..' and text[2:3] != '.': + return 0.3 + p1 = text.find("\n") + p2 = text.find("\n", p1 + 1) + if (p2 > -1 and # has two lines + p1 * 2 + 1 == p2 and # they are the same length + text[p1+1] in '-=' and # the next line both starts and ends with + text[p1+1] == text[p2-1]): # ...a sufficiently high header + return 0.5 + + +class TexLexer(RegexLexer): + """ + Lexer for the TeX and LaTeX typesetting languages. + """ + + name = 'TeX' + aliases = ['tex', 'latex'] + filenames = ['*.tex', '*.aux', '*.toc'] + mimetypes = ['text/x-tex', 'text/x-latex'] + + tokens = { + 'general': [ + (r'%.*?\n', Comment), + (r'[{}]', Name.Builtin), + (r'[&_^]', Name.Builtin), + ], + 'root': [ + (r'\\\[', String.Backtick, 'displaymath'), + (r'\\\(', String, 'inlinemath'), + (r'\$\$', String.Backtick, 'displaymath'), + (r'\$', String, 'inlinemath'), + (r'\\([a-zA-Z]+|.)', Keyword, 'command'), + (r'\\$', Keyword), + include('general'), + (r'[^\\$%&_^{}]+', Text), + ], + 'math': [ + (r'\\([a-zA-Z]+|.)', Name.Variable), + include('general'), + (r'[0-9]+', Number), + (r'[-=!+*/()\[\]]', Operator), + (r'[^=!+*/()\[\]\\$%&_^{}0-9-]+', Name.Builtin), + ], + 'inlinemath': [ + (r'\\\)', String, '#pop'), + (r'\$', String, '#pop'), + include('math'), + ], + 'displaymath': [ + (r'\\\]', String, '#pop'), + (r'\$\$', String, '#pop'), + (r'\$', Name.Builtin), + include('math'), + ], + 'command': [ + (r'\[.*?\]', Name.Attribute), + (r'\*', Keyword), + default('#pop'), + ], + } + + def analyse_text(text): + for start in ("\\documentclass", "\\input", "\\documentstyle", + "\\relax"): + if text[:len(start)] == start: + return True + + +class GroffLexer(RegexLexer): + """ + Lexer for the (g)roff typesetting language, supporting groff + extensions. Mainly useful for highlighting manpage sources. + + .. versionadded:: 0.6 + """ + + name = 'Groff' + aliases = ['groff', 'nroff', 'man'] + filenames = ['*.[1234567]', '*.man'] + mimetypes = ['application/x-troff', 'text/troff'] + + tokens = { + 'root': [ + (r'(\.)(\w+)', bygroups(Text, Keyword), 'request'), + (r'\.', Punctuation, 'request'), + # Regular characters, slurp till we find a backslash or newline + (r'[^\\\n]+', Text, 'textline'), + default('textline'), + ], + 'textline': [ + include('escapes'), + (r'[^\\\n]+', Text), + (r'\n', Text, '#pop'), + ], + 'escapes': [ + # groff has many ways to write escapes. + (r'\\"[^\n]*', Comment), + (r'\\[fn]\w', String.Escape), + (r'\\\(.{2}', String.Escape), + (r'\\.\[.*\]', String.Escape), + (r'\\.', String.Escape), + (r'\\\n', Text, 'request'), + ], + 'request': [ + (r'\n', Text, '#pop'), + include('escapes'), + (r'"[^\n"]+"', String.Double), + (r'\d+', Number), + (r'\S+', String), + (r'\s+', Text), + ], + } + + def analyse_text(text): + if text[:1] != '.': + return False + if text[:3] == '.\\"': + return True + if text[:4] == '.TH ': + return True + if text[1:3].isalnum() and text[3].isspace(): + return 0.9 + + +class MozPreprocHashLexer(RegexLexer): + """ + Lexer for Mozilla Preprocessor files (with '#' as the marker). + + Other data is left untouched. + + .. versionadded:: 2.0 + """ + name = 'mozhashpreproc' + aliases = [name] + filenames = [] + mimetypes = [] + + tokens = { + 'root': [ + (r'^#', Comment.Preproc, ('expr', 'exprstart')), + (r'.+', Other), + ], + 'exprstart': [ + (r'(literal)(.*)', bygroups(Comment.Preproc, Text), '#pop:2'), + (words(( + 'define', 'undef', 'if', 'ifdef', 'ifndef', 'else', 'elif', + 'elifdef', 'elifndef', 'endif', 'expand', 'filter', 'unfilter', + 'include', 'includesubst', 'error')), + Comment.Preproc, '#pop'), + ], + 'expr': [ + (words(('!', '!=', '==', '&&', '||')), Operator), + (r'(defined)(\()', bygroups(Keyword, Punctuation)), + (r'\)', Punctuation), + (r'[0-9]+', Number.Decimal), + (r'__\w+?__', Name.Variable), + (r'@\w+?@', Name.Class), + (r'\w+', Name), + (r'\n', Text, '#pop'), + (r'\s+', Text), + (r'\S', Punctuation), + ], + } + + +class MozPreprocPercentLexer(MozPreprocHashLexer): + """ + Lexer for Mozilla Preprocessor files (with '%' as the marker). + + Other data is left untouched. + + .. versionadded:: 2.0 + """ + name = 'mozpercentpreproc' + aliases = [name] + filenames = [] + mimetypes = [] + + tokens = { + 'root': [ + (r'^%', Comment.Preproc, ('expr', 'exprstart')), + (r'.+', Other), + ], + } + + +class MozPreprocXulLexer(DelegatingLexer): + """ + Subclass of the `MozPreprocHashLexer` that highlights unlexed data with the + `XmlLexer`. + + .. versionadded:: 2.0 + """ + name = "XUL+mozpreproc" + aliases = ['xul+mozpreproc'] + filenames = ['*.xul.in'] + mimetypes = [] + + def __init__(self, **options): + super(MozPreprocXulLexer, self).__init__( + XmlLexer, MozPreprocHashLexer, **options) + + +class MozPreprocJavascriptLexer(DelegatingLexer): + """ + Subclass of the `MozPreprocHashLexer` that highlights unlexed data with the + `JavascriptLexer`. + + .. versionadded:: 2.0 + """ + name = "Javascript+mozpreproc" + aliases = ['javascript+mozpreproc'] + filenames = ['*.js.in'] + mimetypes = [] + + def __init__(self, **options): + super(MozPreprocJavascriptLexer, self).__init__( + JavascriptLexer, MozPreprocHashLexer, **options) + + +class MozPreprocCssLexer(DelegatingLexer): + """ + Subclass of the `MozPreprocHashLexer` that highlights unlexed data with the + `CssLexer`. + + .. versionadded:: 2.0 + """ + name = "CSS+mozpreproc" + aliases = ['css+mozpreproc'] + filenames = ['*.css.in'] + mimetypes = [] + + def __init__(self, **options): + super(MozPreprocCssLexer, self).__init__( + CssLexer, MozPreprocPercentLexer, **options) + + +class MarkdownLexer(RegexLexer): + """ + For `Markdown `_ markup. + + .. versionadded:: 2.2 + """ + name = 'markdown' + aliases = ['md'] + filenames = ['*.md'] + mimetypes = ["text/x-markdown"] + flags = re.MULTILINE + + def _handle_codeblock(self, match): + """ + match args: 1:backticks, 2:lang_name, 3:newline, 4:code, 5:backticks + """ + from pygments.lexers import get_lexer_by_name + + # section header + yield match.start(1), String , match.group(1) + yield match.start(2), String , match.group(2) + yield match.start(3), Text , match.group(3) + + # lookup lexer if wanted and existing + lexer = None + if self.handlecodeblocks: + try: + lexer = get_lexer_by_name( match.group(2).strip() ) + except ClassNotFound: + pass + code = match.group(4) + + # no lexer for this language. handle it like it was a code block + if lexer is None: + yield match.start(4), String, code + return + + for item in do_insertions([], lexer.get_tokens_unprocessed(code)): + yield item + + yield match.start(5), String , match.group(5) + + tokens = { + 'root': [ + # heading with pound prefix + (r'^(#)([^#].+\n)', bygroups(Generic.Heading, Text)), + (r'^(#{2,6})(.+\n)', bygroups(Generic.Subheading, Text)), + # task list + (r'^(\s*)([*-] )(\[[ xX]\])( .+\n)', + bygroups(Text, Keyword, Keyword, using(this, state='inline'))), + # bulleted lists + (r'^(\s*)([*-])(\s)(.+\n)', + bygroups(Text, Keyword, Text, using(this, state='inline'))), + # numbered lists + (r'^(\s*)([0-9]+\.)( .+\n)', + bygroups(Text, Keyword, using(this, state='inline'))), + # quote + (r'^(\s*>\s)(.+\n)', bygroups(Keyword, Generic.Emph)), + # text block + (r'^(```\n)([\w\W]*?)(^```$)', bygroups(String, Text, String)), + # code block with language + (r'^(```)(\w+)(\n)([\w\W]*?)(^```$)', _handle_codeblock), + + include('inline'), + ], + 'inline': [ + # escape + (r'\\.', Text), + # italics + (r'(\s)([*_][^*_]+[*_])(\W|\n)', bygroups(Text, Generic.Emph, Text)), + # bold + # warning: the following rule eats internal tags. eg. **foo _bar_ baz** bar is not italics + (r'(\s)((\*\*|__).*\3)((?=\W|\n))', bygroups(Text, Generic.Strong, None, Text)), + # "proper way" (r'(\s)([*_]{2}[^*_]+[*_]{2})((?=\W|\n))', bygroups(Text, Generic.Strong, Text)), + # strikethrough + (r'(\s)(~~[^~]+~~)((?=\W|\n))', bygroups(Text, Generic.Deleted, Text)), + # inline code + (r'`[^`]+`', String.Backtick), + # mentions and topics (twitter and github stuff) + (r'[@#][\w/:]+', Name.Entity), + # (image?) links eg: ![Image of Yaktocat](https://octodex.github.com/images/yaktocat.png) + (r'(!?\[)([^]]+)(\])(\()([^)]+)(\))', bygroups(Text, Name.Tag, Text, Text, Name.Attribute, Text)), + + # general text, must come last! + (r'[^\\\s]+', Text), + (r'.', Text), + ], + } + + def __init__(self, **options): + self.handlecodeblocks = get_bool_opt(options, 'handlecodeblocks', True) + RegexLexer.__init__(self, **options) diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/math.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/math.py new file mode 100644 index 0000000000000000000000000000000000000000..ea0ebee2a777da643726fc943f2ba52d3691760a --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/math.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.math + ~~~~~~~~~~~~~~~~~~~~ + + Just export lexers that were contained in this module. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexers.python import NumPyLexer +from pygments.lexers.matlab import MatlabLexer, MatlabSessionLexer, \ + OctaveLexer, ScilabLexer +from pygments.lexers.julia import JuliaLexer, JuliaConsoleLexer +from pygments.lexers.r import RConsoleLexer, SLexer, RdLexer +from pygments.lexers.modeling import BugsLexer, JagsLexer, StanLexer +from pygments.lexers.idl import IDLLexer +from pygments.lexers.algebra import MuPADLexer + +__all__ = [] diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/matlab.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/matlab.py new file mode 100644 index 0000000000000000000000000000000000000000..56a0f6d6d1d6489b42eae1cebd46ba16b2e2b3ef --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/matlab.py @@ -0,0 +1,663 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.matlab + ~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for Matlab and related languages. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import Lexer, RegexLexer, bygroups, words, do_insertions +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. + + .. versionadded:: 0.10 + """ + name = 'Matlab' + aliases = ['matlab'] + filenames = ['*.m'] + mimetypes = ['text/matlab'] + + # + # These lists are generated automatically. + # Run the following in bash shell: + # + # for f in elfun specfun elmat; do + # echo -n "$f = " + # matlab -nojvm -r "help $f;exit;" | perl -ne \ + # 'push(@c,$1) if /^ (\w+)\s+-/; END {print q{["}.join(q{","},@c).qq{"]\n};}' + # done + # + # elfun: Elementary math functions + # specfun: Special Math functions + # elmat: Elementary matrices and matrix manipulation + # + # taken from Matlab version 7.4.0.336 (R2007a) + # + elfun = ("sin", "sind", "sinh", "asin", "asind", "asinh", "cos", "cosd", "cosh", + "acos", "acosd", "acosh", "tan", "tand", "tanh", "atan", "atand", "atan2", + "atanh", "sec", "secd", "sech", "asec", "asecd", "asech", "csc", "cscd", + "csch", "acsc", "acscd", "acsch", "cot", "cotd", "coth", "acot", "acotd", + "acoth", "hypot", "exp", "expm1", "log", "log1p", "log10", "log2", "pow2", + "realpow", "reallog", "realsqrt", "sqrt", "nthroot", "nextpow2", "abs", + "angle", "complex", "conj", "imag", "real", "unwrap", "isreal", "cplxpair", + "fix", "floor", "ceil", "round", "mod", "rem", "sign") + specfun = ("airy", "besselj", "bessely", "besselh", "besseli", "besselk", "beta", + "betainc", "betaln", "ellipj", "ellipke", "erf", "erfc", "erfcx", + "erfinv", "expint", "gamma", "gammainc", "gammaln", "psi", "legendre", + "cross", "dot", "factor", "isprime", "primes", "gcd", "lcm", "rat", + "rats", "perms", "nchoosek", "factorial", "cart2sph", "cart2pol", + "pol2cart", "sph2cart", "hsv2rgb", "rgb2hsv") + elmat = ("zeros", "ones", "eye", "repmat", "rand", "randn", "linspace", "logspace", + "freqspace", "meshgrid", "accumarray", "size", "length", "ndims", "numel", + "disp", "isempty", "isequal", "isequalwithequalnans", "cat", "reshape", + "diag", "blkdiag", "tril", "triu", "fliplr", "flipud", "flipdim", "rot90", + "find", "end", "sub2ind", "ind2sub", "bsxfun", "ndgrid", "permute", + "ipermute", "shiftdim", "circshift", "squeeze", "isscalar", "isvector", + "ans", "eps", "realmax", "realmin", "pi", "i", "inf", "nan", "isnan", + "isinf", "isfinite", "j", "why", "compan", "gallery", "hadamard", "hankel", + "hilb", "invhilb", "magic", "pascal", "rosser", "toeplitz", "vander", + "wilkinson") + + tokens = { + 'root': [ + # line starting with '!' is sent as a system command. not sure what + # label to use... + (r'^!.*', String.Other), + (r'%\{\s*\n', Comment.Multiline, 'blockcomment'), + (r'%.*$', Comment), + (r'^\s*function', Keyword, 'deffunc'), + + # from 'iskeyword' on version 7.11 (R2010): + (words(( + 'break', 'case', 'catch', 'classdef', 'continue', 'else', 'elseif', + 'end', 'enumerated', 'events', 'for', 'function', 'global', 'if', + 'methods', 'otherwise', 'parfor', 'persistent', 'properties', + 'return', 'spmd', 'switch', 'try', 'while'), suffix=r'\b'), + Keyword), + + ("(" + "|".join(elfun + specfun + elmat) + r')\b', Name.Builtin), + + # line continuation with following comment: + (r'\.\.\..*$', Comment), + + # operators: + (r'-|==|~=|<|>|<=|>=|&&|&|~|\|\|?', Operator), + # operators requiring escape for re: + (r'\.\*|\*|\+|\.\^|\.\\|\.\/|\/|\\', Operator), + + # punctuation: + (r'\[|\]|\(|\)|\{|\}|:|@|\.|,', Punctuation), + (r'=|:|;', Punctuation), + + # quote can be transpose, instead of string: + # (not great, but handles common cases...) + (r'(?<=[\w)\].])\'+', Operator), + + (r'(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?', Number.Float), + (r'\d+[eEf][+-]?[0-9]+', Number.Float), + (r'\d+', Number.Integer), + + (r'(?. + + .. versionadded:: 0.10 + """ + name = 'Matlab session' + aliases = ['matlabsession'] + + def get_tokens_unprocessed(self, text): + mlexer = MatlabLexer(**self.options) + + curcode = '' + insertions = [] + + 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])) + + else: + if curcode: + for item in do_insertions( + insertions, mlexer.get_tokens_unprocessed(curcode)): + yield item + curcode = '' + insertions = [] + + yield match.start(), Generic.Output, line + + if curcode: # or item: + for item in do_insertions( + insertions, mlexer.get_tokens_unprocessed(curcode)): + yield item + + +class OctaveLexer(RegexLexer): + """ + For GNU Octave source code. + + .. versionadded:: 1.5 + """ + name = 'Octave' + aliases = ['octave'] + filenames = ['*.m'] + mimetypes = ['text/octave'] + + # 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': [ + # We should look into multiline comments + (r'[%#].*$', Comment), + (r'^\s*function', 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'(?', '->', '#', + # Modules + ':>', + )) + + nonid_reserved = set(('(', ')', '[', ']', '{', '}', ',', ';', '...', '_')) + + alphanumid_re = r"[a-zA-Z][\w']*" + symbolicid_re = r"[!%&$#+\-/:<=>?@\\~`^|*]+" + + # A character constant is a sequence of the form #s, where s is a string + # constant denoting a string of size one character. This setup just parses + # the entire string as either a String.Double or a String.Char (depending + # on the argument), even if the String.Char is an erronous + # multiple-character string. + def stringy(whatkind): + return [ + (r'[^"\\]', whatkind), + (r'\\[\\"abtnvfr]', String.Escape), + # Control-character notation is used for codes < 32, + # where \^@ == \000 + (r'\\\^[\x40-\x5e]', String.Escape), + # Docs say 'decimal digits' + (r'\\[0-9]{3}', String.Escape), + (r'\\u[0-9a-fA-F]{4}', String.Escape), + (r'\\\s+\\', String.Interpol), + (r'"', whatkind, '#pop'), + ] + + # Callbacks for distinguishing tokens and reserved words + def long_id_callback(self, match): + if match.group(1) in self.alphanumid_reserved: + token = Error + else: + token = Name.Namespace + yield match.start(1), token, match.group(1) + yield match.start(2), Punctuation, match.group(2) + + def end_id_callback(self, match): + if match.group(1) in self.alphanumid_reserved: + token = Error + elif match.group(1) in self.symbolicid_reserved: + token = Error + else: + token = Name + yield match.start(1), token, match.group(1) + + def id_callback(self, match): + str = match.group(1) + if str in self.alphanumid_reserved: + token = Keyword.Reserved + elif str in self.symbolicid_reserved: + token = Punctuation + else: + token = Name + yield match.start(1), token, str + + tokens = { + # Whitespace and comments are (almost) everywhere + 'whitespace': [ + (r'\s+', Text), + (r'\(\*', Comment.Multiline, 'comment'), + ], + + 'delimiters': [ + # This lexer treats these delimiters specially: + # Delimiters define scopes, and the scope is how the meaning of + # the `|' is resolved - is it a case/handle expression, or function + # definition by cases? (This is not how the Definition works, but + # it's how MLton behaves, see http://mlton.org/SMLNJDeviations) + (r'\(|\[|\{', Punctuation, 'main'), + (r'\)|\]|\}', Punctuation, '#pop'), + (r'\b(let|if|local)\b(?!\')', Keyword.Reserved, ('main', 'main')), + (r'\b(struct|sig|while)\b(?!\')', Keyword.Reserved, 'main'), + (r'\b(do|else|end|in|then)\b(?!\')', Keyword.Reserved, '#pop'), + ], + + 'core': [ + # Punctuation that doesn't overlap symbolic identifiers + (r'(%s)' % '|'.join(re.escape(z) for z in nonid_reserved), + Punctuation), + + # Special constants: strings, floats, numbers in decimal and hex + (r'#"', String.Char, 'char'), + (r'"', String.Double, 'string'), + (r'~?0x[0-9a-fA-F]+', Number.Hex), + (r'0wx[0-9a-fA-F]+', Number.Hex), + (r'0w\d+', Number.Integer), + (r'~?\d+\.\d+[eE]~?\d+', Number.Float), + (r'~?\d+\.\d+', Number.Float), + (r'~?\d+[eE]~?\d+', Number.Float), + (r'~?\d+', Number.Integer), + + # Labels + (r'#\s*[1-9][0-9]*', Name.Label), + (r'#\s*(%s)' % alphanumid_re, Name.Label), + (r'#\s+(%s)' % symbolicid_re, Name.Label), + # Some reserved words trigger a special, local lexer state change + (r'\b(datatype|abstype)\b(?!\')', Keyword.Reserved, 'dname'), + (r'(?=\b(exception)\b(?!\'))', Text, ('ename')), + (r'\b(functor|include|open|signature|structure)\b(?!\')', + Keyword.Reserved, 'sname'), + (r'\b(type|eqtype)\b(?!\')', Keyword.Reserved, 'tname'), + + # Regular identifiers, long and otherwise + (r'\'[\w\']*', Name.Decorator), + (r'(%s)(\.)' % alphanumid_re, long_id_callback, "dotted"), + (r'(%s)' % alphanumid_re, id_callback), + (r'(%s)' % symbolicid_re, id_callback), + ], + 'dotted': [ + (r'(%s)(\.)' % alphanumid_re, long_id_callback), + (r'(%s)' % alphanumid_re, end_id_callback, "#pop"), + (r'(%s)' % symbolicid_re, end_id_callback, "#pop"), + (r'\s+', Error), + (r'\S+', Error), + ], + + + # Main parser (prevents errors in files that have scoping errors) + 'root': [ + default('main') + ], + + # In this scope, I expect '|' to not be followed by a function name, + # and I expect 'and' to be followed by a binding site + 'main': [ + include('whitespace'), + + # Special behavior of val/and/fun + (r'\b(val|and)\b(?!\')', Keyword.Reserved, 'vname'), + (r'\b(fun)\b(?!\')', Keyword.Reserved, + ('#pop', 'main-fun', 'fname')), + + include('delimiters'), + include('core'), + (r'\S+', Error), + ], + + # In this scope, I expect '|' and 'and' to be followed by a function + 'main-fun': [ + include('whitespace'), + + (r'\s', Text), + (r'\(\*', Comment.Multiline, 'comment'), + + # Special behavior of val/and/fun + (r'\b(fun|and)\b(?!\')', Keyword.Reserved, 'fname'), + (r'\b(val)\b(?!\')', Keyword.Reserved, + ('#pop', 'main', 'vname')), + + # Special behavior of '|' and '|'-manipulating keywords + (r'\|', Punctuation, 'fname'), + (r'\b(case|handle)\b(?!\')', Keyword.Reserved, + ('#pop', 'main')), + + include('delimiters'), + include('core'), + (r'\S+', Error), + ], + + # Character and string parsers + 'char': stringy(String.Char), + 'string': stringy(String.Double), + + 'breakout': [ + (r'(?=\b(%s)\b(?!\'))' % '|'.join(alphanumid_reserved), Text, '#pop'), + ], + + # Dealing with what comes after module system keywords + 'sname': [ + include('whitespace'), + include('breakout'), + + (r'(%s)' % alphanumid_re, Name.Namespace), + default('#pop'), + ], + + # Dealing with what comes after the 'fun' (or 'and' or '|') keyword + 'fname': [ + include('whitespace'), + (r'\'[\w\']*', Name.Decorator), + (r'\(', Punctuation, 'tyvarseq'), + + (r'(%s)' % alphanumid_re, Name.Function, '#pop'), + (r'(%s)' % symbolicid_re, Name.Function, '#pop'), + + # Ignore interesting function declarations like "fun (x + y) = ..." + default('#pop'), + ], + + # Dealing with what comes after the 'val' (or 'and') keyword + 'vname': [ + include('whitespace'), + (r'\'[\w\']*', Name.Decorator), + (r'\(', Punctuation, 'tyvarseq'), + + (r'(%s)(\s*)(=(?!%s))' % (alphanumid_re, symbolicid_re), + bygroups(Name.Variable, Text, Punctuation), '#pop'), + (r'(%s)(\s*)(=(?!%s))' % (symbolicid_re, symbolicid_re), + bygroups(Name.Variable, Text, Punctuation), '#pop'), + (r'(%s)' % alphanumid_re, Name.Variable, '#pop'), + (r'(%s)' % symbolicid_re, Name.Variable, '#pop'), + + # Ignore interesting patterns like 'val (x, y)' + default('#pop'), + ], + + # Dealing with what comes after the 'type' (or 'and') keyword + 'tname': [ + include('whitespace'), + include('breakout'), + + (r'\'[\w\']*', Name.Decorator), + (r'\(', Punctuation, 'tyvarseq'), + (r'=(?!%s)' % symbolicid_re, Punctuation, ('#pop', 'typbind')), + + (r'(%s)' % alphanumid_re, Keyword.Type), + (r'(%s)' % symbolicid_re, Keyword.Type), + (r'\S+', Error, '#pop'), + ], + + # A type binding includes most identifiers + 'typbind': [ + include('whitespace'), + + (r'\b(and)\b(?!\')', Keyword.Reserved, ('#pop', 'tname')), + + include('breakout'), + include('core'), + (r'\S+', Error, '#pop'), + ], + + # Dealing with what comes after the 'datatype' (or 'and') keyword + 'dname': [ + include('whitespace'), + include('breakout'), + + (r'\'[\w\']*', Name.Decorator), + (r'\(', Punctuation, 'tyvarseq'), + (r'(=)(\s*)(datatype)', + bygroups(Punctuation, Text, Keyword.Reserved), '#pop'), + (r'=(?!%s)' % symbolicid_re, Punctuation, + ('#pop', 'datbind', 'datcon')), + + (r'(%s)' % alphanumid_re, Keyword.Type), + (r'(%s)' % symbolicid_re, Keyword.Type), + (r'\S+', Error, '#pop'), + ], + + # common case - A | B | C of int + 'datbind': [ + include('whitespace'), + + (r'\b(and)\b(?!\')', Keyword.Reserved, ('#pop', 'dname')), + (r'\b(withtype)\b(?!\')', Keyword.Reserved, ('#pop', 'tname')), + (r'\b(of)\b(?!\')', Keyword.Reserved), + + (r'(\|)(\s*)(%s)' % alphanumid_re, + bygroups(Punctuation, Text, Name.Class)), + (r'(\|)(\s+)(%s)' % symbolicid_re, + bygroups(Punctuation, Text, Name.Class)), + + include('breakout'), + include('core'), + (r'\S+', Error), + ], + + # Dealing with what comes after an exception + 'ename': [ + include('whitespace'), + + (r'(exception|and)\b(\s+)(%s)' % alphanumid_re, + bygroups(Keyword.Reserved, Text, Name.Class)), + (r'(exception|and)\b(\s*)(%s)' % symbolicid_re, + bygroups(Keyword.Reserved, Text, Name.Class)), + (r'\b(of)\b(?!\')', Keyword.Reserved), + + include('breakout'), + include('core'), + (r'\S+', Error), + ], + + 'datcon': [ + include('whitespace'), + (r'(%s)' % alphanumid_re, Name.Class, '#pop'), + (r'(%s)' % symbolicid_re, Name.Class, '#pop'), + (r'\S+', Error, '#pop'), + ], + + # Series of type variables + 'tyvarseq': [ + (r'\s', Text), + (r'\(\*', Comment.Multiline, 'comment'), + + (r'\'[\w\']*', Name.Decorator), + (alphanumid_re, Name), + (r',', Punctuation), + (r'\)', Punctuation, '#pop'), + (symbolicid_re, Name), + ], + + 'comment': [ + (r'[^(*)]', Comment.Multiline), + (r'\(\*', Comment.Multiline, '#push'), + (r'\*\)', Comment.Multiline, '#pop'), + (r'[(*)]', Comment.Multiline), + ], + } + + +class OcamlLexer(RegexLexer): + """ + For the OCaml language. + + .. versionadded:: 0.7 + """ + + name = 'OCaml' + aliases = ['ocaml'] + filenames = ['*.ml', '*.mli', '*.mll', '*.mly'] + mimetypes = ['text/x-ocaml'] + + keywords = ( + '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', 'value', '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'\}', '~' + ) + + operators = r'[!$%&*+\./:<=>?@^|~-]' + word_operators = ('and', 'asr', 'land', 'lor', 'lsl', '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'\(\*(?![)])', Comment, 'comment'), + (r'\b(%s)\b' % '|'.join(keywords), Keyword), + (r'(%s)' % '|'.join(keyopts[::-1]), Operator), + (r'(%s|%s)?%s' % (infix_syms, prefix_syms, operators), Operator), + (r'\b(%s)\b' % '|'.join(word_operators), Operator.Word), + (r'\b(%s)\b' % '|'.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'"', 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'), + ], + } + + +class OpaLexer(RegexLexer): + """ + Lexer for the Opa language (http://opalang.org). + + .. versionadded:: 1.5 + """ + + name = 'Opa' + aliases = ['opa'] + filenames = ['*.opa'] + mimetypes = ['text/x-opa'] + + # most of these aren't strictly keywords + # but if you color only real keywords, you might just + # as well not color anything + keywords = ( + 'and', 'as', 'begin', 'case', 'client', 'css', 'database', 'db', 'do', + 'else', 'end', 'external', 'forall', 'function', 'if', 'import', + 'match', 'module', 'or', 'package', 'parser', 'rec', 'server', 'then', + 'type', 'val', 'with', 'xml_parser', + ) + + # matches both stuff and `stuff` + ident_re = r'(([a-zA-Z_]\w*)|(`[^`]*`))' + + op_re = r'[.=\-<>,@~%/+?*&^!]' + punc_re = r'[()\[\],;|]' # '{' and '}' are treated elsewhere + # because they are also used for inserts + + tokens = { + # copied from the caml lexer, should be adapted + 'escape-sequence': [ + (r'\\[\\"\'ntr}]', String.Escape), + (r'\\[0-9]{3}', String.Escape), + (r'\\x[0-9a-fA-F]{2}', String.Escape), + ], + + # factorizing these rules, because they are inserted many times + 'comments': [ + (r'/\*', Comment, 'nested-comment'), + (r'//.*?$', Comment), + ], + 'comments-and-spaces': [ + include('comments'), + (r'\s+', Text), + ], + + 'root': [ + include('comments-and-spaces'), + # keywords + (words(keywords, prefix=r'\b', suffix=r'\b'), Keyword), + # directives + # we could parse the actual set of directives instead of anything + # starting with @, but this is troublesome + # because it needs to be adjusted all the time + # and assuming we parse only sources that compile, it is useless + (r'@' + ident_re + r'\b', Name.Builtin.Pseudo), + + # number literals + (r'-?.[\d]+([eE][+\-]?\d+)', Number.Float), + (r'-?\d+.\d*([eE][+\-]?\d+)', Number.Float), + (r'-?\d+[eE][+\-]?\d+', Number.Float), + (r'0[xX][\da-fA-F]+', Number.Hex), + (r'0[oO][0-7]+', Number.Oct), + (r'0[bB][01]+', Number.Bin), + (r'\d+', Number.Integer), + # color literals + (r'#[\da-fA-F]{3,6}', Number.Integer), + + # string literals + (r'"', String.Double, 'string'), + # char literal, should be checked because this is the regexp from + # the caml lexer + (r"'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2})|.)'", + String.Char), + + # this is meant to deal with embedded exprs in strings + # every time we find a '}' we pop a state so that if we were + # inside a string, we are back in the string state + # as a consequence, we must also push a state every time we find a + # '{' or else we will have errors when parsing {} for instance + (r'\{', Operator, '#push'), + (r'\}', Operator, '#pop'), + + # html literals + # this is a much more strict that the actual parser, + # since a])', String.Single, 'html-open-tag'), + + # db path + # matching the '[_]' in '/a[_]' because it is a part + # of the syntax of the db path definition + # unfortunately, i don't know how to match the ']' in + # /a[1], so this is somewhat inconsistent + (r'[@?!]?(/\w+)+(\[_\])?', Name.Variable), + # putting the same color on <- as on db path, since + # it can be used only to mean Db.write + (r'<-(?!'+op_re+r')', Name.Variable), + + # 'modules' + # although modules are not distinguished by their names as in caml + # the standard library seems to follow the convention that modules + # only area capitalized + (r'\b([A-Z]\w*)(?=\.)', Name.Namespace), + + # operators + # = has a special role because this is the only + # way to syntactic distinguish binding constructions + # unfortunately, this colors the equal in {x=2} too + (r'=(?!'+op_re+r')', Keyword), + (r'(%s)+' % op_re, Operator), + (r'(%s)+' % punc_re, Operator), + + # coercions + (r':', Operator, 'type'), + # type variables + # we need this rule because we don't parse specially type + # definitions so in "type t('a) = ...", "'a" is parsed by 'root' + ("'"+ident_re, Keyword.Type), + + # id literal, #something, or #{expr} + (r'#'+ident_re, String.Single), + (r'#(?=\{)', String.Single), + + # identifiers + # this avoids to color '2' in 'a2' as an integer + (ident_re, Text), + + # default, not sure if that is needed or not + # (r'.', Text), + ], + + # it is quite painful to have to parse types to know where they end + # this is the general rule for a type + # a type is either: + # * -> ty + # * type-with-slash + # * type-with-slash -> ty + # * type-with-slash (, type-with-slash)+ -> ty + # + # the code is pretty funky in here, but this code would roughly + # translate in caml to: + # let rec type stream = + # match stream with + # | [< "->"; stream >] -> type stream + # | [< ""; stream >] -> + # type_with_slash stream + # type_lhs_1 stream; + # and type_1 stream = ... + 'type': [ + include('comments-and-spaces'), + (r'->', Keyword.Type), + default(('#pop', 'type-lhs-1', 'type-with-slash')), + ], + + # parses all the atomic or closed constructions in the syntax of type + # expressions: record types, tuple types, type constructors, basic type + # and type variables + 'type-1': [ + include('comments-and-spaces'), + (r'\(', Keyword.Type, ('#pop', 'type-tuple')), + (r'~?\{', Keyword.Type, ('#pop', 'type-record')), + (ident_re+r'\(', Keyword.Type, ('#pop', 'type-tuple')), + (ident_re, Keyword.Type, '#pop'), + ("'"+ident_re, Keyword.Type), + # this case is not in the syntax but sometimes + # we think we are parsing types when in fact we are parsing + # some css, so we just pop the states until we get back into + # the root state + default('#pop'), + ], + + # type-with-slash is either: + # * type-1 + # * type-1 (/ type-1)+ + 'type-with-slash': [ + include('comments-and-spaces'), + default(('#pop', 'slash-type-1', 'type-1')), + ], + 'slash-type-1': [ + include('comments-and-spaces'), + ('/', Keyword.Type, ('#pop', 'type-1')), + # same remark as above + default('#pop'), + ], + + # we go in this state after having parsed a type-with-slash + # while trying to parse a type + # and at this point we must determine if we are parsing an arrow + # type (in which case we must continue parsing) or not (in which + # case we stop) + 'type-lhs-1': [ + include('comments-and-spaces'), + (r'->', Keyword.Type, ('#pop', 'type')), + (r'(?=,)', Keyword.Type, ('#pop', 'type-arrow')), + default('#pop'), + ], + 'type-arrow': [ + include('comments-and-spaces'), + # the look ahead here allows to parse f(x : int, y : float -> truc) + # correctly + (r',(?=[^:]*?->)', Keyword.Type, 'type-with-slash'), + (r'->', Keyword.Type, ('#pop', 'type')), + # same remark as above + default('#pop'), + ], + + # no need to do precise parsing for tuples and records + # because they are closed constructions, so we can simply + # find the closing delimiter + # note that this function would be not work if the source + # contained identifiers like `{)` (although it could be patched + # to support it) + 'type-tuple': [ + include('comments-and-spaces'), + (r'[^()/*]+', Keyword.Type), + (r'[/*]', Keyword.Type), + (r'\(', Keyword.Type, '#push'), + (r'\)', Keyword.Type, '#pop'), + ], + 'type-record': [ + include('comments-and-spaces'), + (r'[^{}/*]+', Keyword.Type), + (r'[/*]', Keyword.Type), + (r'\{', Keyword.Type, '#push'), + (r'\}', Keyword.Type, '#pop'), + ], + + # 'type-tuple': [ + # include('comments-and-spaces'), + # (r'\)', Keyword.Type, '#pop'), + # default(('#pop', 'type-tuple-1', 'type-1')), + # ], + # 'type-tuple-1': [ + # include('comments-and-spaces'), + # (r',?\s*\)', Keyword.Type, '#pop'), # ,) is a valid end of tuple, in (1,) + # (r',', Keyword.Type, 'type-1'), + # ], + # 'type-record':[ + # include('comments-and-spaces'), + # (r'\}', Keyword.Type, '#pop'), + # (r'~?(?:\w+|`[^`]*`)', Keyword.Type, 'type-record-field-expr'), + # ], + # 'type-record-field-expr': [ + # + # ], + + 'nested-comment': [ + (r'[^/*]+', Comment), + (r'/\*', Comment, '#push'), + (r'\*/', Comment, '#pop'), + (r'[/*]', Comment), + ], + + # the copy pasting between string and single-string + # is kinda sad. Is there a way to avoid that?? + 'string': [ + (r'[^\\"{]+', String.Double), + (r'"', String.Double, '#pop'), + (r'\{', Operator, 'root'), + include('escape-sequence'), + ], + 'single-string': [ + (r'[^\\\'{]+', String.Double), + (r'\'', String.Double, '#pop'), + (r'\{', Operator, 'root'), + include('escape-sequence'), + ], + + # all the html stuff + # can't really reuse some existing html parser + # because we must be able to parse embedded expressions + + # we are in this state after someone parsed the '<' that + # started the html literal + 'html-open-tag': [ + (r'[\w\-:]+', String.Single, ('#pop', 'html-attr')), + (r'>', String.Single, ('#pop', 'html-content')), + ], + + # we are in this state after someone parsed the ' is allowed + (r'[\w\-:]*>', String.Single, '#pop'), + ], + + # we are in this state after having parsed '', String.Single, '#pop'), + (r'>', String.Single, ('#pop', 'html-content')), + ], + + 'html-attr-value': [ + (r"'", String.Single, ('#pop', 'single-string')), + (r'"', String.Single, ('#pop', 'string')), + (r'#'+ident_re, String.Single, '#pop'), + (r'#(?=\{)', String.Single, ('#pop', 'root')), + (r'[^"\'{`=<>]+', String.Single, '#pop'), + (r'\{', Operator, ('#pop', 'root')), # this is a tail call! + ], + + # we should probably deal with '\' escapes here + 'html-content': [ + (r'', Comment, '#pop'), + (r'[^\-]+|-', Comment), + ], + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/monte.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/monte.py new file mode 100644 index 0000000000000000000000000000000000000000..ed6e20f86fc36f564773d0908eef91bdbdfcd334 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/monte.py @@ -0,0 +1,204 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.monte + ~~~~~~~~~~~~~~~~~~~~~ + + Lexer for the Monte programming language. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.token import Comment, Error, Keyword, Name, Number, Operator, \ + Punctuation, String, Whitespace +from pygments.lexer import RegexLexer, include, words + +__all__ = ['MonteLexer'] + + +# `var` handled separately +# `interface` handled separately +_declarations = ['bind', 'def', 'fn', 'object'] +_methods = ['method', 'to'] +_keywords = [ + 'as', 'break', 'catch', 'continue', 'else', 'escape', 'exit', 'exports', + 'extends', 'finally', 'for', 'guards', 'if', 'implements', 'import', + 'in', 'match', 'meta', 'pass', 'return', 'switch', 'try', 'via', 'when', + 'while', +] +_operators = [ + # Unary + '~', '!', + # Binary + '+', '-', '*', '/', '%', '**', '&', '|', '^', '<<', '>>', + # Binary augmented + '+=', '-=', '*=', '/=', '%=', '**=', '&=', '|=', '^=', '<<=', '>>=', + # Comparison + '==', '!=', '<', '<=', '>', '>=', '<=>', + # Patterns and assignment + ':=', '?', '=~', '!~', '=>', + # Calls and sends + '.', '<-', '->', +] +_escape_pattern = ( + r'(?:\\x[0-9a-fA-F]{2}|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|' + r'\\["\'\\bftnr])') +# _char = _escape_chars + [('.', String.Char)] +_identifier = r'[_a-zA-Z]\w*' + +_constants = [ + # Void constants + 'null', + # Bool constants + 'false', 'true', + # Double constants + 'Infinity', 'NaN', + # Special objects + 'M', 'Ref', 'throw', 'traceln', +] + +_guards = [ + 'Any', 'Binding', 'Bool', 'Bytes', 'Char', 'DeepFrozen', 'Double', + 'Empty', 'Int', 'List', 'Map', 'Near', 'NullOk', 'Same', 'Selfless', + 'Set', 'Str', 'SubrangeGuard', 'Transparent', 'Void', +] + +_safeScope = [ + '_accumulateList', '_accumulateMap', '_auditedBy', '_bind', + '_booleanFlow', '_comparer', '_equalizer', '_iterForever', '_loop', + '_makeBytes', '_makeDouble', '_makeFinalSlot', '_makeInt', '_makeList', + '_makeMap', '_makeMessageDesc', '_makeOrderedSpace', '_makeParamDesc', + '_makeProtocolDesc', '_makeSourceSpan', '_makeString', '_makeVarSlot', + '_makeVerbFacet', '_mapExtract', '_matchSame', '_quasiMatcher', + '_slotToBinding', '_splitList', '_suchThat', '_switchFailed', + '_validateFor', 'b__quasiParser', 'eval', 'import', 'm__quasiParser', + 'makeBrandPair', 'makeLazySlot', 'safeScope', 'simple__quasiParser', +] + + +class MonteLexer(RegexLexer): + """ + Lexer for the `Monte `_ programming language. + + .. versionadded:: 2.2 + """ + name = 'Monte' + aliases = ['monte'] + filenames = ['*.mt'] + + tokens = { + 'root': [ + # Comments + (r'#[^\n]*\n', Comment), + + # Docstrings + # Apologies for the non-greedy matcher here. + (r'/\*\*.*?\*/', String.Doc), + + # `var` declarations + (r'\bvar\b', Keyword.Declaration, 'var'), + + # `interface` declarations + (r'\binterface\b', Keyword.Declaration, 'interface'), + + # method declarations + (words(_methods, prefix='\\b', suffix='\\b'), + Keyword, 'method'), + + # All other declarations + (words(_declarations, prefix='\\b', suffix='\\b'), + Keyword.Declaration), + + # Keywords + (words(_keywords, prefix='\\b', suffix='\\b'), Keyword), + + # Literals + ('[+-]?0x[_0-9a-fA-F]+', Number.Hex), + (r'[+-]?[_0-9]+\.[_0-9]*([eE][+-]?[_0-9]+)?', Number.Float), + ('[+-]?[_0-9]+', Number.Integer), + ("'", String.Double, 'char'), + ('"', String.Double, 'string'), + + # Quasiliterals + ('`', String.Backtick, 'ql'), + + # Operators + (words(_operators), Operator), + + # Verb operators + (_identifier + '=', Operator.Word), + + # Safe scope constants + (words(_constants, prefix='\\b', suffix='\\b'), + Keyword.Pseudo), + + # Safe scope guards + (words(_guards, prefix='\\b', suffix='\\b'), Keyword.Type), + + # All other safe scope names + (words(_safeScope, prefix='\\b', suffix='\\b'), + Name.Builtin), + + # Identifiers + (_identifier, Name), + + # Punctuation + (r'\(|\)|\{|\}|\[|\]|:|,', Punctuation), + + # Whitespace + (' +', Whitespace), + + # Definite lexer errors + ('=', Error), + ], + 'char': [ + # It is definitely an error to have a char of width == 0. + ("'", Error, 'root'), + (_escape_pattern, String.Escape, 'charEnd'), + ('.', String.Char, 'charEnd'), + ], + 'charEnd': [ + ("'", String.Char, '#pop:2'), + # It is definitely an error to have a char of width > 1. + ('.', Error), + ], + # The state of things coming into an interface. + 'interface': [ + (' +', Whitespace), + (_identifier, Name.Class, '#pop'), + include('root'), + ], + # The state of things coming into a method. + 'method': [ + (' +', Whitespace), + (_identifier, Name.Function, '#pop'), + include('root'), + ], + 'string': [ + ('"', String.Double, 'root'), + (_escape_pattern, String.Escape), + (r'\n', String.Double), + ('.', String.Double), + ], + 'ql': [ + ('`', String.Backtick, 'root'), + (r'\$' + _escape_pattern, String.Escape), + (r'\$\$', String.Escape), + (r'@@', String.Escape), + (r'\$\{', String.Interpol, 'qlNest'), + (r'@\{', String.Interpol, 'qlNest'), + (r'\$' + _identifier, Name), + ('@' + _identifier, Name), + ('.', String.Backtick), + ], + 'qlNest': [ + (r'\}', String.Interpol, '#pop'), + include('root'), + ], + # The state of things immediately following `var`. + 'var': [ + (' +', Whitespace), + (_identifier, Name.Variable, '#pop'), + include('root'), + ], + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/ncl.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/ncl.py new file mode 100644 index 0000000000000000000000000000000000000000..3ca5135cc1bb1e375af8e05fb2fa1a31be68df9a --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/ncl.py @@ -0,0 +1,894 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.ncl + ~~~~~~~~~~~~~~~~~~~ + + Lexers for NCAR Command Language. + + :copyright: Copyright 2006-2017 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. + + .. versionadded:: 2.2 + """ + name = 'NCL' + aliases = ['ncl'] + filenames = ['*.ncl'] + mimetypes = ['text/ncl'] + 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/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/nit.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/nit.py new file mode 100644 index 0000000000000000000000000000000000000000..21116499d309a6010a6d49e48f6fa6bc551f2eca --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/nit.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.nit + ~~~~~~~~~~~~~~~~~~~ + + Lexer for the Nit language. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, words +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation + +__all__ = ['NitLexer'] + + +class NitLexer(RegexLexer): + """ + For `nit `_ source. + + .. versionadded:: 2.0 + """ + + name = 'Nit' + aliases = ['nit'] + filenames = ['*.nit'] + tokens = { + 'root': [ + (r'#.*?$', Comment.Single), + (words(( + 'package', 'module', 'import', 'class', 'abstract', 'interface', + 'universal', 'enum', 'end', 'fun', 'type', 'init', 'redef', + 'isa', 'do', 'readable', 'writable', 'var', 'intern', 'extern', + 'public', 'protected', 'private', 'intrude', 'if', 'then', + 'else', 'while', 'loop', 'for', 'in', 'and', 'or', 'not', + 'implies', 'return', 'continue', 'break', 'abort', 'assert', + 'new', 'is', 'once', 'super', 'self', 'true', 'false', 'nullable', + 'null', 'as', 'isset', 'label', '__debug__'), suffix=r'(?=[\r\n\t( ])'), + Keyword), + (r'[A-Z]\w*', Name.Class), + (r'"""(([^\'\\]|\\.)|\\r|\\n)*((\{\{?)?(""?\{\{?)*""""*)', String), # Simple long string + (r'\'\'\'(((\\.|[^\'\\])|\\r|\\n)|\'((\\.|[^\'\\])|\\r|\\n)|' + r'\'\'((\\.|[^\'\\])|\\r|\\n))*\'\'\'', String), # Simple long string alt + (r'"""(([^\'\\]|\\.)|\\r|\\n)*((""?)?(\{\{?""?)*\{\{\{\{*)', String), # Start long string + (r'\}\}\}(((\\.|[^\'\\])|\\r|\\n))*(""?)?(\{\{?""?)*\{\{\{\{*', String), # Mid long string + (r'\}\}\}(((\\.|[^\'\\])|\\r|\\n))*(\{\{?)?(""?\{\{?)*""""*', String), # End long string + (r'"(\\.|([^"}{\\]))*"', String), # Simple String + (r'"(\\.|([^"}{\\]))*\{', String), # Start string + (r'\}(\\.|([^"}{\\]))*\{', String), # Mid String + (r'\}(\\.|([^"}{\\]))*"', String), # End String + (r'(\'[^\'\\]\')|(\'\\.\')', String.Char), + (r'[0-9]+', Number.Integer), + (r'[0-9]*.[0-9]+', Number.Float), + (r'0(x|X)[0-9A-Fa-f]+', Number.Hex), + (r'[a-z]\w*', Name), + (r'_\w+', Name.Variable.Instance), + (r'==|!=|<==>|>=|>>|>|<=|<<|<|\+|-|=|/|\*|%|\+=|-=|!|@', Operator), + (r'\(|\)|\[|\]|,|\.\.\.|\.\.|\.|::|:', Punctuation), + (r'`\{[^`]*`\}', Text), # Extern blocks won't be Lexed by Nit + (r'[\r\n\t ]+', Text), + ], + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/nix.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/nix.py new file mode 100644 index 0000000000000000000000000000000000000000..e148c9193886e50d60b4fba27dfac5ecc05f1055 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/nix.py @@ -0,0 +1,136 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.nix + ~~~~~~~~~~~~~~~~~~~ + + Lexers for the NixOS Nix language. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, include +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Literal + +__all__ = ['NixLexer'] + + +class NixLexer(RegexLexer): + """ + For the `Nix language `_. + + .. versionadded:: 2.0 + """ + + name = 'Nix' + aliases = ['nixos', 'nix'] + filenames = ['*.nix'] + mimetypes = ['text/x-nix'] + + flags = re.MULTILINE | re.UNICODE + + keywords = ['rec', 'with', 'let', 'in', 'inherit', 'assert', 'if', + 'else', 'then', '...'] + builtins = ['import', 'abort', 'baseNameOf', 'dirOf', 'isNull', 'builtins', + 'map', 'removeAttrs', 'throw', 'toString', 'derivation'] + operators = ['++', '+', '?', '.', '!', '//', '==', + '!=', '&&', '||', '->', '='] + + punctuations = ["(", ")", "[", "]", ";", "{", "}", ":", ",", "@"] + + tokens = { + 'root': [ + # comments starting with # + (r'#.*$', Comment.Single), + + # multiline comments + (r'/\*', Comment.Multiline, 'comment'), + + # whitespace + (r'\s+', Text), + + # keywords + ('(%s)' % '|'.join(re.escape(entry) + '\\b' for entry in keywords), Keyword), + + # highlight the builtins + ('(%s)' % '|'.join(re.escape(entry) + '\\b' for entry in builtins), + Name.Builtin), + + (r'\b(true|false|null)\b', Name.Constant), + + # operators + ('(%s)' % '|'.join(re.escape(entry) for entry in operators), + Operator), + + # word operators + (r'\b(or|and)\b', Operator.Word), + + # punctuations + ('(%s)' % '|'.join(re.escape(entry) for entry in punctuations), Punctuation), + + # integers + (r'[0-9]+', Number.Integer), + + # strings + (r'"', String.Double, 'doublequote'), + (r"''", String.Single, 'singlequote'), + + # paths + (r'[\w.+-]*(\/[\w.+-]+)+', Literal), + (r'\<[\w.+-]+(\/[\w.+-]+)*\>', Literal), + + # urls + (r'[a-zA-Z][a-zA-Z0-9\+\-\.]*\:[\w%/?:@&=+$,\\.!~*\'-]+', Literal), + + # names of variables + (r'[\w-]+\s*=', String.Symbol), + (r'[a-zA-Z_][\w\'-]*', Text), + + ], + 'comment': [ + (r'[^/*]+', Comment.Multiline), + (r'/\*', Comment.Multiline, '#push'), + (r'\*/', Comment.Multiline, '#pop'), + (r'[*/]', Comment.Multiline), + ], + 'singlequote': [ + (r"'''", String.Escape), + (r"''\$\{", String.Escape), + (r"''\n", String.Escape), + (r"''\r", String.Escape), + (r"''\t", String.Escape), + (r"''", String.Single, '#pop'), + (r'\$\{', String.Interpol, 'antiquote'), + (r"[^']", String.Single), + ], + 'doublequote': [ + (r'\\', String.Escape), + (r'\\"', String.Escape), + (r'\\$\{', String.Escape), + (r'"', String.Double, '#pop'), + (r'\$\{', String.Interpol, 'antiquote'), + (r'[^"]', String.Double), + ], + 'antiquote': [ + (r"\}", String.Interpol, '#pop'), + # TODO: we should probably escape also here ''${ \${ + (r"\$\{", String.Interpol, '#push'), + include('root'), + ], + } + + def analyse_text(text): + rv = 0.0 + # TODO: let/in + if re.search(r'import.+?<[^>]+>', text): + rv += 0.4 + if re.search(r'mkDerivation\s+(\(|\{|rec)', text): + rv += 0.4 + if re.search(r'=\s+mkIf\s+', text): + rv += 0.4 + if re.search(r'\{[a-zA-Z,\s]+\}:', text): + rv += 0.1 + return rv diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/oberon.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/oberon.py new file mode 100644 index 0000000000000000000000000000000000000000..3b5fb3e4ba3e2dc354a34a7924ee787fe857deb7 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/oberon.py @@ -0,0 +1,105 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.oberon + ~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for Oberon family languages. + + :copyright: Copyright 2006-2017 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__ = ['ComponentPascalLexer'] + + +class ComponentPascalLexer(RegexLexer): + """ + For `Component Pascal `_ source code. + + .. versionadded:: 2.1 + """ + name = 'Component Pascal' + aliases = ['componentpascal', 'cp'] + filenames = ['*.cp', '*.cps'] + mimetypes = ['text/x-component-pascal'] + + flags = re.MULTILINE | re.DOTALL + + tokens = { + 'root': [ + include('whitespace'), + include('comments'), + include('punctuation'), + include('numliterals'), + include('strings'), + include('operators'), + include('builtins'), + include('identifiers'), + ], + 'whitespace': [ + (r'\n+', Text), # blank lines + (r'\s+', Text), # whitespace + ], + 'comments': [ + (r'\(\*([^$].*?)\*\)', Comment.Multiline), + # TODO: nested comments (* (* ... *) ... (* ... *) *) not supported! + ], + 'punctuation': [ + (r'[()\[\]{},.:;|]', Punctuation), + ], + 'numliterals': [ + (r'[0-9A-F]+X\b', Number.Hex), # char code + (r'[0-9A-F]+[HL]\b', Number.Hex), # hexadecimal number + (r'[0-9]+\.[0-9]+E[+-][0-9]+', Number.Float), # real number + (r'[0-9]+\.[0-9]+', Number.Float), # real number + (r'[0-9]+', Number.Integer), # decimal whole number + ], + 'strings': [ + (r"'[^\n']*'", String), # single quoted string + (r'"[^\n"]*"', String), # double quoted string + ], + 'operators': [ + # Arithmetic Operators + (r'[+-]', Operator), + (r'[*/]', Operator), + # Relational Operators + (r'[=#<>]', Operator), + # Dereferencing Operator + (r'\^', Operator), + # Logical AND Operator + (r'&', Operator), + # Logical NOT Operator + (r'~', Operator), + # Assignment Symbol + (r':=', Operator), + # Range Constructor + (r'\.\.', Operator), + (r'\$', Operator), + ], + 'identifiers': [ + (r'([a-zA-Z_$][\w$]*)', Name), + ], + 'builtins': [ + (words(( + 'ANYPTR', 'ANYREC', 'BOOLEAN', 'BYTE', 'CHAR', 'INTEGER', 'LONGINT', + 'REAL', 'SET', 'SHORTCHAR', 'SHORTINT', 'SHORTREAL' + ), suffix=r'\b'), Keyword.Type), + (words(( + 'ABS', 'ABSTRACT', 'ARRAY', 'ASH', 'ASSERT', 'BEGIN', 'BITS', 'BY', + 'CAP', 'CASE', 'CHR', 'CLOSE', 'CONST', 'DEC', 'DIV', 'DO', 'ELSE', + 'ELSIF', 'EMPTY', 'END', 'ENTIER', 'EXCL', 'EXIT', 'EXTENSIBLE', 'FOR', + 'HALT', 'IF', 'IMPORT', 'IN', 'INC', 'INCL', 'IS', 'LEN', 'LIMITED', + 'LONG', 'LOOP', 'MAX', 'MIN', 'MOD', 'MODULE', 'NEW', 'ODD', 'OF', + 'OR', 'ORD', 'OUT', 'POINTER', 'PROCEDURE', 'RECORD', 'REPEAT', 'RETURN', + 'SHORT', 'SHORTCHAR', 'SHORTINT', 'SIZE', 'THEN', 'TYPE', 'TO', 'UNTIL', + 'VAR', 'WHILE', 'WITH' + ), suffix=r'\b'), Keyword.Reserved), + (r'(TRUE|FALSE|NIL|INF)\b', Keyword.Constant), + ] + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/other.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/other.py new file mode 100644 index 0000000000000000000000000000000000000000..bfce4c3c4281e142b25bc438f10dbcec610a6c45 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/other.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.other + ~~~~~~~~~~~~~~~~~~~~~ + + Just export lexer classes previously contained in this module. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexers.sql import SqlLexer, MySqlLexer, SqliteConsoleLexer +from pygments.lexers.shell import BashLexer, BashSessionLexer, BatchLexer, \ + TcshLexer +from pygments.lexers.robotframework import RobotFrameworkLexer +from pygments.lexers.testing import GherkinLexer +from pygments.lexers.esoteric import BrainfuckLexer, BefungeLexer, RedcodeLexer +from pygments.lexers.prolog import LogtalkLexer +from pygments.lexers.snobol import SnobolLexer +from pygments.lexers.rebol import RebolLexer +from pygments.lexers.configs import KconfigLexer, Cfengine3Lexer +from pygments.lexers.modeling import ModelicaLexer +from pygments.lexers.scripting import AppleScriptLexer, MOOCodeLexer, \ + HybrisLexer +from pygments.lexers.graphics import PostScriptLexer, GnuplotLexer, \ + AsymptoteLexer, PovrayLexer +from pygments.lexers.business import ABAPLexer, OpenEdgeLexer, \ + GoodDataCLLexer, MaqlLexer +from pygments.lexers.automation import AutoItLexer, AutohotkeyLexer +from pygments.lexers.dsls import ProtoBufLexer, BroLexer, PuppetLexer, \ + MscgenLexer, VGLLexer +from pygments.lexers.basic import CbmBasicV2Lexer +from pygments.lexers.pawn import SourcePawnLexer, PawnLexer +from pygments.lexers.ecl import ECLLexer +from pygments.lexers.urbi import UrbiscriptLexer +from pygments.lexers.smalltalk import SmalltalkLexer, NewspeakLexer +from pygments.lexers.installers import NSISLexer, RPMSpecLexer +from pygments.lexers.textedit import AwkLexer +from pygments.lexers.smv import NuSMVLexer + +__all__ = [] diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/parasail.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/parasail.py new file mode 100644 index 0000000000000000000000000000000000000000..53088023d456f2a4a5c655e948ee42b4d094a604 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/parasail.py @@ -0,0 +1,79 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.parasail + ~~~~~~~~~~~~~~~~~~~~~~~~ + + Lexer for ParaSail. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, include +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Literal + +__all__ = ['ParaSailLexer'] + + +class ParaSailLexer(RegexLexer): + """ + For `ParaSail `_ source code. + + .. versionadded:: 2.1 + """ + + name = 'ParaSail' + aliases = ['parasail'] + filenames = ['*.psi', '*.psl'] + mimetypes = ['text/x-parasail'] + + flags = re.MULTILINE + + tokens = { + 'root': [ + (r'[^\S\n]+', Text), + (r'//.*?\n', Comment.Single), + (r'\b(and|or|xor)=', Operator.Word), + (r'\b(and(\s+then)?|or(\s+else)?|xor|rem|mod|' + r'(is|not)\s+null)\b', + Operator.Word), + # Keywords + (r'\b(abs|abstract|all|block|class|concurrent|const|continue|' + r'each|end|exit|extends|exports|forward|func|global|implements|' + r'import|in|interface|is|lambda|locked|new|not|null|of|op|' + r'optional|private|queued|ref|return|reverse|separate|some|' + r'type|until|var|with|' + # Control flow + r'if|then|else|elsif|case|for|while|loop)\b', + Keyword.Reserved), + (r'(abstract\s+)?(interface|class|op|func|type)', + Keyword.Declaration), + # Literals + (r'"[^"]*"', String), + (r'\\[\'ntrf"0]', String.Escape), + (r'#[a-zA-Z]\w*', Literal), # Enumeration + include('numbers'), + (r"'[^']'", String.Char), + (r'[a-zA-Z]\w*', Name), + # Operators and Punctuation + (r'(<==|==>|<=>|\*\*=|<\|=|<<=|>>=|==|!=|=\?|<=|>=|' + r'\*\*|<<|>>|=>|:=|\+=|-=|\*=|\|=|\||/=|\+|-|\*|/|' + r'\.\.|<\.\.|\.\.<|<\.\.<)', + Operator), + (r'(<|>|\[|\]|\(|\)|\||:|;|,|.|\{|\}|->)', + Punctuation), + (r'\n+', Text), + ], + 'numbers': [ + (r'\d[0-9_]*#[0-9a-fA-F][0-9a-fA-F_]*#', Number.Hex), # any base + (r'0[xX][0-9a-fA-F][0-9a-fA-F_]*', Number.Hex), # C-like hex + (r'0[bB][01][01_]*', Number.Bin), # C-like bin + (r'\d[0-9_]*\.\d[0-9_]*[eE][+-]\d[0-9_]*', # float exp + Number.Float), + (r'\d[0-9_]*\.\d[0-9_]*', Number.Float), # float + (r'\d[0-9_]*', Number.Integer), # integer + ], + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/parsers.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/parsers.py new file mode 100644 index 0000000000000000000000000000000000000000..1f3c9b4d9755b7387180a6bac1343a5369a9380b --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/parsers.py @@ -0,0 +1,835 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.parsers + ~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for parser generators. + + :copyright: Copyright 2006-2017 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', + # 'AntlrCLexer', + 'AntlrCSharpLexer', 'AntlrObjectiveCLexer', + 'AntlrJavaLexer', 'AntlrActionScriptLexer', + 'TreetopLexer', 'EbnfLexer'] + + +class RagelLexer(RegexLexer): + """ + A pure `Ragel `_ lexer. Use this for + fragments of Ragel. For ``.rl`` files, use RagelEmbeddedLexer instead + (or one of the language-specific subclasses). + + .. versionadded:: 1.1 + """ + + name = 'Ragel' + aliases = ['ragel'] + filenames = [] + + 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 quote string + (r"'(\\\\|\\'|[^'])*'", String), # single quote string + (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'"(\\\\|\\"|[^"])*"', # double quote string + r"'(\\\\|\\'|[^'])*'", # single quote string + 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. + + .. versionadded:: 1.1 + """ + + name = 'Embedded Ragel' + aliases = ['ragel-em'] + filenames = ['*.rl'] + + 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'"(\\\\|\\"|[^"])*"', # double quote string + r"'(\\\\|\\'|[^'])*'", # single quote string + 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'"(\\\\|\\"|[^"])*"', # double quote string + r"'(\\\\|\\'|[^'])*'", # single quote string + 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. + + .. versionadded:: 1.1 + """ + + name = 'Ragel in Ruby Host' + aliases = ['ragel-ruby', 'ragel-rb'] + filenames = ['*.rl'] + + def __init__(self, **options): + super(RagelRubyLexer, self).__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. + + .. versionadded:: 1.1 + """ + + name = 'Ragel in C Host' + aliases = ['ragel-c'] + filenames = ['*.rl'] + + def __init__(self, **options): + super(RagelCLexer, self).__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. + + .. versionadded:: 1.1 + """ + + name = 'Ragel in D Host' + aliases = ['ragel-d'] + filenames = ['*.rl'] + + def __init__(self, **options): + super(RagelDLexer, self).__init__(DLexer, RagelEmbeddedLexer, **options) + + def analyse_text(text): + return '@LANG: d' in text + + +class RagelCppLexer(DelegatingLexer): + """ + A lexer for `Ragel`_ in a CPP host file. + + .. versionadded:: 1.1 + """ + + name = 'Ragel in CPP Host' + aliases = ['ragel-cpp'] + filenames = ['*.rl'] + + def __init__(self, **options): + super(RagelCppLexer, self).__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. + + .. versionadded:: 1.1 + """ + + name = 'Ragel in Objective C Host' + aliases = ['ragel-objc'] + filenames = ['*.rl'] + + def __init__(self, **options): + super(RagelObjectiveCLexer, self).__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. + + .. versionadded:: 1.1 + """ + + name = 'Ragel in Java Host' + aliases = ['ragel-java'] + filenames = ['*.rl'] + + def __init__(self, **options): + super(RagelJavaLexer, self).__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. + + .. versionadded:: 1.1 + + .. _ANTLR: http://www.antlr.org/ + """ + + name = 'ANTLR' + aliases = ['antlr'] + filenames = [] + + _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 + ')(\s*)(\{)', + bygroups(Keyword, Whitespace, Name.Variable, Whitespace, + Punctuation), 'action'), + # exception + (r'(catch|finally)\b', Keyword, 'exception'), + # action + (r'(@' + _id + ')(\s*)(::)?(\s*)(' + _id + ')(\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 + ')(\s*)(;)', + bygroups(Keyword, Whitespace, Name.Label, Whitespace, Punctuation)), + # ruleAction + (r'(@' + _id + ')(\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), + (r'"(\\\\|\\"|[^"])*"', String), + (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 + + ')?(\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, '\*')) + ')(\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'"(\\\\|\\"|[^"])*"', # double quote string + r"'(\\\\|\\'|[^'])*'", # single quote string + 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'"(\\\\|\\"|[^"])*"', # double quote string + r"'(\\\\|\\'|[^'])*'", # single quote string + 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 + +# TH: I'm not aware of any language features of C++ that will cause +# incorrect lexing of C files. Antlr doesn't appear to make a distinction, +# so just assume they're C++. No idea how to make Objective C work in the +# future. + +# class AntlrCLexer(DelegatingLexer): +# """ +# ANTLR with C Target +# +# .. versionadded:: 1.1 +# """ +# +# name = 'ANTLR With C Target' +# aliases = ['antlr-c'] +# filenames = ['*.G', '*.g'] +# +# def __init__(self, **options): +# super(AntlrCLexer, self).__init__(CLexer, AntlrLexer, **options) +# +# def analyse_text(text): +# return re.match(r'^\s*language\s*=\s*C\s*;', text) + + +class AntlrCppLexer(DelegatingLexer): + """ + `ANTLR`_ with CPP Target + + .. versionadded:: 1.1 + """ + + name = 'ANTLR With CPP Target' + aliases = ['antlr-cpp'] + filenames = ['*.G', '*.g'] + + def __init__(self, **options): + super(AntlrCppLexer, self).__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 + + .. versionadded:: 1.1 + """ + + name = 'ANTLR With ObjectiveC Target' + aliases = ['antlr-objc'] + filenames = ['*.G', '*.g'] + + def __init__(self, **options): + super(AntlrObjectiveCLexer, self).__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 + + .. versionadded:: 1.1 + """ + + name = 'ANTLR With C# Target' + aliases = ['antlr-csharp', 'antlr-c#'] + filenames = ['*.G', '*.g'] + + def __init__(self, **options): + super(AntlrCSharpLexer, self).__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 + + .. versionadded:: 1.1 + """ + + name = 'ANTLR With Python Target' + aliases = ['antlr-python'] + filenames = ['*.G', '*.g'] + + def __init__(self, **options): + super(AntlrPythonLexer, self).__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 + + .. versionadded:: 1. + """ + + name = 'ANTLR With Java Target' + aliases = ['antlr-java'] + filenames = ['*.G', '*.g'] + + def __init__(self, **options): + super(AntlrJavaLexer, self).__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 + + .. versionadded:: 1.1 + """ + + name = 'ANTLR With Ruby Target' + aliases = ['antlr-ruby', 'antlr-rb'] + filenames = ['*.G', '*.g'] + + def __init__(self, **options): + super(AntlrRubyLexer, self).__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 + + .. versionadded:: 1.1 + """ + + name = 'ANTLR With Perl Target' + aliases = ['antlr-perl'] + filenames = ['*.G', '*.g'] + + def __init__(self, **options): + super(AntlrPerlLexer, self).__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 + + .. versionadded:: 1.1 + """ + + name = 'ANTLR With ActionScript Target' + aliases = ['antlr-as', 'antlr-actionscript'] + filenames = ['*.G', '*.g'] + + def __init__(self, **options): + from pygments.lexers.actionscript import ActionScriptLexer + super(AntlrActionScriptLexer, self).__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 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. + + .. versionadded:: 1.6 + """ + + name = 'Treetop' + aliases = ['treetop'] + filenames = ['*.treetop', '*.tt'] + + def __init__(self, **options): + super(TreetopLexer, self).__init__(RubyLexer, TreetopBaseLexer, **options) + + +class EbnfLexer(RegexLexer): + """ + Lexer for `ISO/IEC 14977 EBNF + `_ + grammars. + + .. versionadded:: 2.0 + """ + + name = 'EBNF' + aliases = ['ebnf'] + filenames = ['*.ebnf'] + mimetypes = ['text/x-ebnf'] + + 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/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/perl.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/perl.py new file mode 100644 index 0000000000000000000000000000000000000000..4d5ab3b385ac0003dc0fc2d1524df51b62e0a599 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/perl.py @@ -0,0 +1,620 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.perl + ~~~~~~~~~~~~~~~~~~~~ + + Lexers for Perl and related languages. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, ExtendedRegexLexer, include, bygroups, \ + using, this, default, words +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation +from pygments.util import shebang_matches + +__all__ = ['PerlLexer', 'Perl6Lexer'] + + +class PerlLexer(RegexLexer): + """ + For `Perl `_ source code. + """ + + name = 'Perl' + aliases = ['perl', 'pl'] + filenames = ['*.pl', '*.pm', '*.t'] + mimetypes = ['text/x-perl', 'application/x-perl'] + + flags = re.DOTALL | re.MULTILINE + # TODO: give this to a perl guy who knows how to parse perl... + tokens = { + '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'\A\#!.+?$', Comment.Hashbang), + (r'\#.*?$', Comment.Single), + (r'^=[a-zA-Z0-9]+\s+.*?\n=cut', Comment.Multiline), + (words(( + 'case', 'continue', 'do', 'else', 'elsif', 'for', 'foreach', + 'if', 'last', 'my', 'next', 'our', 'redo', 'reset', 'then', + 'unless', 'until', 'while', 'print', 'new', 'BEGIN', + 'CHECK', 'INIT', 'END', 'return'), suffix=r'\b'), + Keyword), + (r'(format)(\s+)(\w+)(\s*)(=)(\s*\n)', + bygroups(Keyword, Text, Name, Text, Punctuation, Text), 'format'), + (r'(eq|lt|gt|le|ge|ne|not|and|or|cmp)\b', Operator.Word), + # common delimiters + (r's/(\\\\|\\[^\\]|[^\\/])*/(\\\\|\\[^\\]|[^\\/])*/[egimosx]*', + String.Regex), + (r's!(\\\\|\\!|[^!])*!(\\\\|\\!|[^!])*![egimosx]*', String.Regex), + (r's\\(\\\\|[^\\])*\\(\\\\|[^\\])*\\[egimosx]*', String.Regex), + (r's@(\\\\|\\[^\\]|[^\\@])*@(\\\\|\\[^\\]|[^\\@])*@[egimosx]*', + String.Regex), + (r's%(\\\\|\\[^\\]|[^\\%])*%(\\\\|\\[^\\]|[^\\%])*%[egimosx]*', + String.Regex), + # balanced delimiters + (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'), + (r'((?<==~)|(?<=\())\s*/(\\\\|\\[^\\]|[^\\/])*/[gcimosx]*', + String.Regex), + (r'\s+', Text), + (words(( + 'abs', 'accept', 'alarm', 'atan2', 'bind', 'binmode', 'bless', 'caller', 'chdir', + 'chmod', 'chomp', 'chop', 'chown', 'chr', 'chroot', 'close', 'closedir', 'connect', + 'continue', 'cos', 'crypt', 'dbmclose', 'dbmopen', 'defined', 'delete', 'die', + 'dump', 'each', 'endgrent', 'endhostent', 'endnetent', 'endprotoent', + 'endpwent', 'endservent', 'eof', 'eval', 'exec', 'exists', 'exit', 'exp', 'fcntl', + 'fileno', 'flock', 'fork', 'format', 'formline', 'getc', 'getgrent', 'getgrgid', + 'getgrnam', 'gethostbyaddr', 'gethostbyname', 'gethostent', 'getlogin', + 'getnetbyaddr', 'getnetbyname', 'getnetent', 'getpeername', 'getpgrp', + 'getppid', 'getpriority', 'getprotobyname', 'getprotobynumber', + 'getprotoent', 'getpwent', 'getpwnam', 'getpwuid', 'getservbyname', + 'getservbyport', 'getservent', 'getsockname', 'getsockopt', 'glob', 'gmtime', + 'goto', 'grep', 'hex', 'import', 'index', 'int', 'ioctl', 'join', 'keys', 'kill', 'last', + 'lc', 'lcfirst', 'length', 'link', 'listen', 'local', 'localtime', 'log', 'lstat', + 'map', 'mkdir', 'msgctl', 'msgget', 'msgrcv', 'msgsnd', 'my', 'next', 'oct', 'open', + 'opendir', 'ord', 'our', 'pack', 'pipe', 'pop', 'pos', 'printf', + 'prototype', 'push', 'quotemeta', 'rand', 'read', 'readdir', + 'readline', 'readlink', 'readpipe', 'recv', 'redo', 'ref', 'rename', + 'reverse', 'rewinddir', 'rindex', 'rmdir', 'scalar', 'seek', 'seekdir', + 'select', 'semctl', 'semget', 'semop', 'send', 'setgrent', 'sethostent', 'setnetent', + 'setpgrp', 'setpriority', 'setprotoent', 'setpwent', 'setservent', + 'setsockopt', 'shift', 'shmctl', 'shmget', 'shmread', 'shmwrite', 'shutdown', + 'sin', 'sleep', 'socket', 'socketpair', 'sort', 'splice', 'split', 'sprintf', 'sqrt', + 'srand', 'stat', 'study', 'substr', 'symlink', 'syscall', 'sysopen', 'sysread', + 'sysseek', 'system', 'syswrite', 'tell', 'telldir', 'tie', 'tied', 'time', 'times', 'tr', + 'truncate', 'uc', 'ucfirst', 'umask', 'undef', 'unlink', 'unpack', 'unshift', 'untie', + 'utime', 'values', 'vec', 'wait', 'waitpid', 'wantarray', 'warn', 'write'), suffix=r'\b'), + Name.Builtin), + (r'((__(DATA|DIE|WARN)__)|(STD(IN|OUT|ERR)))\b', Name.Builtin.Pseudo), + (r'(<<)([\'"]?)([a-zA-Z_]\w*)(\2;?\n.*?\n)(\3)(\n)', + bygroups(String, String, String.Delimiter, String, String.Delimiter, Text)), + (r'__END__', Comment.Preproc, 'end-part'), + (r'\$\^[ADEFHILMOPSTWX]', Name.Variable.Global), + (r"\$[\\\"\[\]'&`+*.,;=%~?@$!<>(^|/-](?!\w)", Name.Variable.Global), + (r'[$@%#]+', Name.Variable, 'varname'), + (r'0_?[0-7]+(_[0-7]+)*', Number.Oct), + (r'0x[0-9A-Fa-f]+(_[0-9A-Fa-f]+)*', Number.Hex), + (r'0b[01]+(_[01]+)*', Number.Bin), + (r'(?i)(\d*(_\d*)*\.\d+(_\d*)*|\d+(_\d*)*\.\d+(_\d*)*)(e[+-]?\d+)?', + Number.Float), + (r'(?i)\d+(_\d*)*e[+-]?\d+(_\d*)*', Number.Float), + (r'\d+(_\d+)*', Number.Integer), + (r"'(\\\\|\\[^\\]|[^'\\])*'", String), + (r'"(\\\\|\\[^\\]|[^"\\])*"', String), + (r'`(\\\\|\\[^\\]|[^`\\])*`', String.Backtick), + (r'<([^\s>]+)>', String.Regex), + (r'(q|qq|qw|qr|qx)\{', String.Other, 'cb-string'), + (r'(q|qq|qw|qr|qx)\(', String.Other, 'rb-string'), + (r'(q|qq|qw|qr|qx)\[', String.Other, 'sb-string'), + (r'(q|qq|qw|qr|qx)\<', String.Other, 'lt-string'), + (r'(q|qq|qw|qr|qx)([\W_])(.|\n)*?\2', String.Other), + (r'(package)(\s+)([a-zA-Z_]\w*(?:::[a-zA-Z_]\w*)*)', + bygroups(Keyword, Text, Name.Namespace)), + (r'(use|require|no)(\s+)([a-zA-Z_]\w*(?:::[a-zA-Z_]\w*)*)', + bygroups(Keyword, Text, Name.Namespace)), + (r'(sub)(\s+)', bygroups(Keyword, Text), 'funcname'), + (words(( + 'no', 'package', 'require', 'use'), suffix=r'\b'), + Keyword), + (r'(\[\]|\*\*|::|<<|>>|>=|<=>|<=|={3}|!=|=~|' + r'!~|&&?|\|\||\.{1,3})', Operator), + (r'[-+/*%=<>&^|!\\~]=?', Operator), + (r'[()\[\]:;,<>/?{}]', Punctuation), # yes, there's no shortage + # of punctuation in Perl! + (r'(?=\w)', Name, 'name'), + ], + 'format': [ + (r'\.\n', String.Interpol, '#pop'), + (r'[^\n]*\n', String.Interpol), + ], + 'varname': [ + (r'\s+', Text), + (r'\{', Punctuation, '#pop'), # hash syntax? + (r'\)|,', Punctuation, '#pop'), # argument specifier + (r'\w+::', Name.Namespace), + (r'[\w:]+', Name.Variable, '#pop'), + ], + 'name': [ + (r'[a-zA-Z_]\w*(::[a-zA-Z_]\w*)*(::)?(?=\s*->)', Name.Namespace, '#pop'), + (r'[a-zA-Z_]\w*(::[a-zA-Z_]\w*)*::', Name.Namespace, '#pop'), + (r'[\w:]+', Name, '#pop'), + (r'[A-Z_]+(?=\W)', Name.Constant, '#pop'), + (r'(?=\W)', Text, '#pop'), + ], + 'funcname': [ + (r'[a-zA-Z_]\w*[!?]?', Name.Function), + (r'\s+', Text), + # argument declaration + (r'(\([$@%]*\))(\s*)', bygroups(Punctuation, Text)), + (r';', Punctuation, '#pop'), + (r'.*?\{', Punctuation, '#pop'), + ], + 'cb-string': [ + (r'\\[{}\\]', String.Other), + (r'\\', String.Other), + (r'\{', String.Other, 'cb-string'), + (r'\}', String.Other, '#pop'), + (r'[^{}\\]+', String.Other) + ], + 'rb-string': [ + (r'\\[()\\]', String.Other), + (r'\\', String.Other), + (r'\(', String.Other, 'rb-string'), + (r'\)', String.Other, '#pop'), + (r'[^()]+', String.Other) + ], + 'sb-string': [ + (r'\\[\[\]\\]', String.Other), + (r'\\', String.Other), + (r'\[', String.Other, 'sb-string'), + (r'\]', String.Other, '#pop'), + (r'[^\[\]]+', String.Other) + ], + 'lt-string': [ + (r'\\[<>\\]', String.Other), + (r'\\', String.Other), + (r'\<', String.Other, 'lt-string'), + (r'\>', String.Other, '#pop'), + (r'[^<>]+', String.Other) + ], + 'end-part': [ + (r'.+', Comment.Preproc, '#pop') + ] + } + + def analyse_text(text): + if shebang_matches(text, r'perl'): + return True + if re.search('(?:my|our)\s+[$@%(]', text): + return 0.9 + + +class Perl6Lexer(ExtendedRegexLexer): + """ + For `Perl 6 `_ source code. + + .. versionadded:: 2.0 + """ + + name = 'Perl6' + aliases = ['perl6', 'pl6'] + filenames = ['*.pl', '*.pm', '*.nqp', '*.p6', '*.6pl', '*.p6l', '*.pl6', + '*.6pm', '*.p6m', '*.pm6', '*.t'] + mimetypes = ['text/x-perl6', 'application/x-perl6'] + flags = re.MULTILINE | re.DOTALL | re.UNICODE + + PERL6_IDENTIFIER_RANGE = "['\w:-]" + + PERL6_KEYWORDS = ( + 'BEGIN', 'CATCH', 'CHECK', 'CONTROL', 'END', 'ENTER', 'FIRST', 'INIT', + 'KEEP', 'LAST', 'LEAVE', 'NEXT', 'POST', 'PRE', 'START', 'TEMP', + 'UNDO', 'as', 'assoc', 'async', 'augment', 'binary', 'break', 'but', + 'cached', 'category', 'class', 'constant', 'contend', 'continue', + 'copy', 'deep', 'default', 'defequiv', 'defer', 'die', 'do', 'else', + 'elsif', 'enum', 'equiv', 'exit', 'export', 'fail', 'fatal', 'for', + 'gather', 'given', 'goto', 'grammar', 'handles', 'has', 'if', 'inline', + 'irs', 'is', 'last', 'leave', 'let', 'lift', 'loop', 'looser', 'macro', + 'make', 'maybe', 'method', 'module', 'multi', 'my', 'next', 'of', + 'ofs', 'only', 'oo', 'ors', 'our', 'package', 'parsed', 'prec', + 'proto', 'readonly', 'redo', 'ref', 'regex', 'reparsed', 'repeat', + 'require', 'required', 'return', 'returns', 'role', 'rule', 'rw', + 'self', 'slang', 'state', 'sub', 'submethod', 'subset', 'supersede', + 'take', 'temp', 'tighter', 'token', 'trusts', 'try', 'unary', + 'unless', 'until', 'use', 'warn', 'when', 'where', 'while', 'will', + ) + + PERL6_BUILTINS = ( + 'ACCEPTS', 'HOW', 'REJECTS', 'VAR', 'WHAT', 'WHENCE', 'WHERE', 'WHICH', + 'WHO', 'abs', 'acos', 'acosec', 'acosech', 'acosh', 'acotan', 'acotanh', + 'all', 'any', 'approx', 'arity', 'asec', 'asech', 'asin', 'asinh', + 'assuming', 'atan', 'atan2', 'atanh', 'attr', 'bless', 'body', 'by', + 'bytes', 'caller', 'callsame', 'callwith', 'can', 'capitalize', 'cat', + 'ceiling', 'chars', 'chmod', 'chomp', 'chop', 'chr', 'chroot', + 'circumfix', 'cis', 'classify', 'clone', 'close', 'cmp_ok', 'codes', + 'comb', 'connect', 'contains', 'context', 'cos', 'cosec', 'cosech', + 'cosh', 'cotan', 'cotanh', 'count', 'defined', 'delete', 'diag', + 'dies_ok', 'does', 'e', 'each', 'eager', 'elems', 'end', 'eof', 'eval', + 'eval_dies_ok', 'eval_elsewhere', 'eval_lives_ok', 'evalfile', 'exists', + 'exp', 'first', 'flip', 'floor', 'flunk', 'flush', 'fmt', 'force_todo', + 'fork', 'from', 'getc', 'gethost', 'getlogin', 'getpeername', 'getpw', + 'gmtime', 'graphs', 'grep', 'hints', 'hyper', 'im', 'index', 'infix', + 'invert', 'is_approx', 'is_deeply', 'isa', 'isa_ok', 'isnt', 'iterator', + 'join', 'key', 'keys', 'kill', 'kv', 'lastcall', 'lazy', 'lc', 'lcfirst', + 'like', 'lines', 'link', 'lives_ok', 'localtime', 'log', 'log10', 'map', + 'max', 'min', 'minmax', 'name', 'new', 'nextsame', 'nextwith', 'nfc', + 'nfd', 'nfkc', 'nfkd', 'nok_error', 'nonce', 'none', 'normalize', 'not', + 'nothing', 'ok', 'once', 'one', 'open', 'opendir', 'operator', 'ord', + 'p5chomp', 'p5chop', 'pack', 'pair', 'pairs', 'pass', 'perl', 'pi', + 'pick', 'plan', 'plan_ok', 'polar', 'pop', 'pos', 'postcircumfix', + 'postfix', 'pred', 'prefix', 'print', 'printf', 'push', 'quasi', + 'quotemeta', 'rand', 're', 'read', 'readdir', 'readline', 'reduce', + 'reverse', 'rewind', 'rewinddir', 'rindex', 'roots', 'round', + 'roundrobin', 'run', 'runinstead', 'sameaccent', 'samecase', 'say', + 'sec', 'sech', 'sech', 'seek', 'shape', 'shift', 'sign', 'signature', + 'sin', 'sinh', 'skip', 'skip_rest', 'sleep', 'slurp', 'sort', 'splice', + 'split', 'sprintf', 'sqrt', 'srand', 'strand', 'subst', 'substr', 'succ', + 'sum', 'symlink', 'tan', 'tanh', 'throws_ok', 'time', 'times', 'to', + 'todo', 'trim', 'trim_end', 'trim_start', 'true', 'truncate', 'uc', + 'ucfirst', 'undef', 'undefine', 'uniq', 'unlike', 'unlink', 'unpack', + 'unpolar', 'unshift', 'unwrap', 'use_ok', 'value', 'values', 'vec', + 'version_lt', 'void', 'wait', 'want', 'wrap', 'write', 'zip', + ) + + PERL6_BUILTIN_CLASSES = ( + 'Abstraction', 'Any', 'AnyChar', 'Array', 'Associative', 'Bag', 'Bit', + 'Blob', 'Block', 'Bool', 'Buf', 'Byte', 'Callable', 'Capture', 'Char', 'Class', + 'Code', 'Codepoint', 'Comparator', 'Complex', 'Decreasing', 'Exception', + 'Failure', 'False', 'Grammar', 'Grapheme', 'Hash', 'IO', 'Increasing', + 'Int', 'Junction', 'KeyBag', 'KeyExtractor', 'KeyHash', 'KeySet', + 'KitchenSink', 'List', 'Macro', 'Mapping', 'Match', 'Matcher', 'Method', + 'Module', 'Num', 'Object', 'Ordered', 'Ordering', 'OrderingPair', + 'Package', 'Pair', 'Positional', 'Proxy', 'Range', 'Rat', 'Regex', + 'Role', 'Routine', 'Scalar', 'Seq', 'Set', 'Signature', 'Str', 'StrLen', + 'StrPos', 'Sub', 'Submethod', 'True', 'UInt', 'Undef', 'Version', 'Void', + 'Whatever', 'bit', 'bool', 'buf', 'buf1', 'buf16', 'buf2', 'buf32', + 'buf4', 'buf64', 'buf8', 'complex', 'int', 'int1', 'int16', 'int2', + 'int32', 'int4', 'int64', 'int8', 'num', 'rat', 'rat1', 'rat16', 'rat2', + 'rat32', 'rat4', 'rat64', 'rat8', 'uint', 'uint1', 'uint16', 'uint2', + 'uint32', 'uint4', 'uint64', 'uint8', 'utf16', 'utf32', 'utf8', + ) + + PERL6_OPERATORS = ( + 'X', 'Z', 'after', 'also', 'and', 'andthen', 'before', 'cmp', 'div', + 'eq', 'eqv', 'extra', 'ff', 'fff', 'ge', 'gt', 'le', 'leg', 'lt', 'm', + 'mm', 'mod', 'ne', 'or', 'orelse', 'rx', 's', 'tr', 'x', 'xor', 'xx', + '++', '--', '**', '!', '+', '-', '~', '?', '|', '||', '+^', '~^', '?^', + '^', '*', '/', '%', '%%', '+&', '+<', '+>', '~&', '~<', '~>', '?&', + 'gcd', 'lcm', '+', '-', '+|', '+^', '~|', '~^', '?|', '?^', + '~', '&', '^', 'but', 'does', '<=>', '..', '..^', '^..', '^..^', + '!=', '==', '<', '<=', '>', '>=', '~~', '===', '!eqv', + '&&', '||', '^^', '//', 'min', 'max', '??', '!!', 'ff', 'fff', 'so', + 'not', '<==', '==>', '<<==', '==>>', + ) + + # Perl 6 has a *lot* of possible bracketing characters + # this list was lifted from STD.pm6 (https://github.com/perl6/std) + PERL6_BRACKETS = { + u'\u0028': u'\u0029', u'\u003c': u'\u003e', u'\u005b': u'\u005d', + u'\u007b': u'\u007d', u'\u00ab': u'\u00bb', u'\u0f3a': u'\u0f3b', + u'\u0f3c': u'\u0f3d', u'\u169b': u'\u169c', u'\u2018': u'\u2019', + u'\u201a': u'\u2019', u'\u201b': u'\u2019', u'\u201c': u'\u201d', + u'\u201e': u'\u201d', u'\u201f': u'\u201d', u'\u2039': u'\u203a', + u'\u2045': u'\u2046', u'\u207d': u'\u207e', u'\u208d': u'\u208e', + u'\u2208': u'\u220b', u'\u2209': u'\u220c', u'\u220a': u'\u220d', + u'\u2215': u'\u29f5', u'\u223c': u'\u223d', u'\u2243': u'\u22cd', + u'\u2252': u'\u2253', u'\u2254': u'\u2255', u'\u2264': u'\u2265', + u'\u2266': u'\u2267', u'\u2268': u'\u2269', u'\u226a': u'\u226b', + u'\u226e': u'\u226f', u'\u2270': u'\u2271', u'\u2272': u'\u2273', + u'\u2274': u'\u2275', u'\u2276': u'\u2277', u'\u2278': u'\u2279', + u'\u227a': u'\u227b', u'\u227c': u'\u227d', u'\u227e': u'\u227f', + u'\u2280': u'\u2281', u'\u2282': u'\u2283', u'\u2284': u'\u2285', + u'\u2286': u'\u2287', u'\u2288': u'\u2289', u'\u228a': u'\u228b', + u'\u228f': u'\u2290', u'\u2291': u'\u2292', u'\u2298': u'\u29b8', + u'\u22a2': u'\u22a3', u'\u22a6': u'\u2ade', u'\u22a8': u'\u2ae4', + u'\u22a9': u'\u2ae3', u'\u22ab': u'\u2ae5', u'\u22b0': u'\u22b1', + u'\u22b2': u'\u22b3', u'\u22b4': u'\u22b5', u'\u22b6': u'\u22b7', + u'\u22c9': u'\u22ca', u'\u22cb': u'\u22cc', u'\u22d0': u'\u22d1', + u'\u22d6': u'\u22d7', u'\u22d8': u'\u22d9', u'\u22da': u'\u22db', + u'\u22dc': u'\u22dd', u'\u22de': u'\u22df', u'\u22e0': u'\u22e1', + u'\u22e2': u'\u22e3', u'\u22e4': u'\u22e5', u'\u22e6': u'\u22e7', + u'\u22e8': u'\u22e9', u'\u22ea': u'\u22eb', u'\u22ec': u'\u22ed', + u'\u22f0': u'\u22f1', u'\u22f2': u'\u22fa', u'\u22f3': u'\u22fb', + u'\u22f4': u'\u22fc', u'\u22f6': u'\u22fd', u'\u22f7': u'\u22fe', + u'\u2308': u'\u2309', u'\u230a': u'\u230b', u'\u2329': u'\u232a', + u'\u23b4': u'\u23b5', u'\u2768': u'\u2769', u'\u276a': u'\u276b', + u'\u276c': u'\u276d', u'\u276e': u'\u276f', u'\u2770': u'\u2771', + u'\u2772': u'\u2773', u'\u2774': u'\u2775', u'\u27c3': u'\u27c4', + u'\u27c5': u'\u27c6', u'\u27d5': u'\u27d6', u'\u27dd': u'\u27de', + u'\u27e2': u'\u27e3', u'\u27e4': u'\u27e5', u'\u27e6': u'\u27e7', + u'\u27e8': u'\u27e9', u'\u27ea': u'\u27eb', u'\u2983': u'\u2984', + u'\u2985': u'\u2986', u'\u2987': u'\u2988', u'\u2989': u'\u298a', + u'\u298b': u'\u298c', u'\u298d': u'\u298e', u'\u298f': u'\u2990', + u'\u2991': u'\u2992', u'\u2993': u'\u2994', u'\u2995': u'\u2996', + u'\u2997': u'\u2998', u'\u29c0': u'\u29c1', u'\u29c4': u'\u29c5', + u'\u29cf': u'\u29d0', u'\u29d1': u'\u29d2', u'\u29d4': u'\u29d5', + u'\u29d8': u'\u29d9', u'\u29da': u'\u29db', u'\u29f8': u'\u29f9', + u'\u29fc': u'\u29fd', u'\u2a2b': u'\u2a2c', u'\u2a2d': u'\u2a2e', + u'\u2a34': u'\u2a35', u'\u2a3c': u'\u2a3d', u'\u2a64': u'\u2a65', + u'\u2a79': u'\u2a7a', u'\u2a7d': u'\u2a7e', u'\u2a7f': u'\u2a80', + u'\u2a81': u'\u2a82', u'\u2a83': u'\u2a84', u'\u2a8b': u'\u2a8c', + u'\u2a91': u'\u2a92', u'\u2a93': u'\u2a94', u'\u2a95': u'\u2a96', + u'\u2a97': u'\u2a98', u'\u2a99': u'\u2a9a', u'\u2a9b': u'\u2a9c', + u'\u2aa1': u'\u2aa2', u'\u2aa6': u'\u2aa7', u'\u2aa8': u'\u2aa9', + u'\u2aaa': u'\u2aab', u'\u2aac': u'\u2aad', u'\u2aaf': u'\u2ab0', + u'\u2ab3': u'\u2ab4', u'\u2abb': u'\u2abc', u'\u2abd': u'\u2abe', + u'\u2abf': u'\u2ac0', u'\u2ac1': u'\u2ac2', u'\u2ac3': u'\u2ac4', + u'\u2ac5': u'\u2ac6', u'\u2acd': u'\u2ace', u'\u2acf': u'\u2ad0', + u'\u2ad1': u'\u2ad2', u'\u2ad3': u'\u2ad4', u'\u2ad5': u'\u2ad6', + u'\u2aec': u'\u2aed', u'\u2af7': u'\u2af8', u'\u2af9': u'\u2afa', + u'\u2e02': u'\u2e03', u'\u2e04': u'\u2e05', u'\u2e09': u'\u2e0a', + u'\u2e0c': u'\u2e0d', u'\u2e1c': u'\u2e1d', u'\u2e20': u'\u2e21', + u'\u3008': u'\u3009', u'\u300a': u'\u300b', u'\u300c': u'\u300d', + u'\u300e': u'\u300f', u'\u3010': u'\u3011', u'\u3014': u'\u3015', + u'\u3016': u'\u3017', u'\u3018': u'\u3019', u'\u301a': u'\u301b', + u'\u301d': u'\u301e', u'\ufd3e': u'\ufd3f', u'\ufe17': u'\ufe18', + u'\ufe35': u'\ufe36', u'\ufe37': u'\ufe38', u'\ufe39': u'\ufe3a', + u'\ufe3b': u'\ufe3c', u'\ufe3d': u'\ufe3e', u'\ufe3f': u'\ufe40', + u'\ufe41': u'\ufe42', u'\ufe43': u'\ufe44', u'\ufe47': u'\ufe48', + u'\ufe59': u'\ufe5a', u'\ufe5b': u'\ufe5c', u'\ufe5d': u'\ufe5e', + u'\uff08': u'\uff09', u'\uff1c': u'\uff1e', u'\uff3b': u'\uff3d', + u'\uff5b': u'\uff5d', u'\uff5f': u'\uff60', u'\uff62': u'\uff63', + } + + def _build_word_match(words, boundary_regex_fragment=None, prefix='', suffix=''): + if boundary_regex_fragment is None: + return r'\b(' + prefix + r'|'.join(re.escape(x) for x in words) + \ + suffix + r')\b' + else: + return r'(? 0: + next_open_pos = text.find(opening_chars, search_pos + n_chars) + next_close_pos = text.find(closing_chars, search_pos + n_chars) + + if next_close_pos == -1: + next_close_pos = len(text) + nesting_level = 0 + elif next_open_pos != -1 and next_open_pos < next_close_pos: + nesting_level += 1 + search_pos = next_open_pos + else: # next_close_pos < next_open_pos + nesting_level -= 1 + search_pos = next_close_pos + + end_pos = next_close_pos + + if end_pos < 0: # if we didn't find a closer, just highlight the + # rest of the text in this class + end_pos = len(text) + + if adverbs is not None and re.search(r':to\b', adverbs): + heredoc_terminator = text[match.start('delimiter') + n_chars:end_pos] + end_heredoc = re.search(r'^\s*' + re.escape(heredoc_terminator) + + r'\s*$', text[end_pos:], re.MULTILINE) + + if end_heredoc: + end_pos += end_heredoc.end() + else: + end_pos = len(text) + + yield match.start(), token_class, text[match.start():end_pos + n_chars] + context.pos = end_pos + n_chars + + return callback + + def opening_brace_callback(lexer, match, context): + stack = context.stack + + yield match.start(), Text, context.text[match.start():match.end()] + context.pos = match.end() + + # if we encounter an opening brace and we're one level + # below a token state, it means we need to increment + # the nesting level for braces so we know later when + # we should return to the token rules. + if len(stack) > 2 and stack[-2] == 'token': + context.perl6_token_nesting_level += 1 + + def closing_brace_callback(lexer, match, context): + stack = context.stack + + yield match.start(), Text, context.text[match.start():match.end()] + context.pos = match.end() + + # if we encounter a free closing brace and we're one level + # below a token state, it means we need to check the nesting + # level to see if we need to return to the token state. + if len(stack) > 2 and stack[-2] == 'token': + context.perl6_token_nesting_level -= 1 + if context.perl6_token_nesting_level == 0: + stack.pop() + + def embedded_perl6_callback(lexer, match, context): + context.perl6_token_nesting_level = 1 + yield match.start(), Text, context.text[match.start():match.end()] + context.pos = match.end() + context.stack.append('root') + + # If you're modifying these rules, be careful if you need to process '{' or '}' + # characters. We have special logic for processing these characters (due to the fact + # that you can nest Perl 6 code in regex blocks), so if you need to process one of + # them, make sure you also process the corresponding one! + tokens = { + 'common': [ + (r'#[`|=](?P(?P[' + ''.join(PERL6_BRACKETS) + r'])(?P=first_char)*)', + brackets_callback(Comment.Multiline)), + (r'#[^\n]*$', Comment.Singleline), + (r'^(\s*)=begin\s+(\w+)\b.*?^\1=end\s+\2', Comment.Multiline), + (r'^(\s*)=for.*?\n\s*?\n', Comment.Multiline), + (r'^=.*?\n\s*?\n', Comment.Multiline), + (r'(regex|token|rule)(\s*' + PERL6_IDENTIFIER_RANGE + '+:sym)', + bygroups(Keyword, Name), 'token-sym-brackets'), + (r'(regex|token|rule)(?!' + PERL6_IDENTIFIER_RANGE + ')(\s*' + PERL6_IDENTIFIER_RANGE + '+)?', + bygroups(Keyword, Name), 'pre-token'), + # deal with a special case in the Perl 6 grammar (role q { ... }) + (r'(role)(\s+)(q)(\s*)', bygroups(Keyword, Text, Name, Text)), + (_build_word_match(PERL6_KEYWORDS, PERL6_IDENTIFIER_RANGE), Keyword), + (_build_word_match(PERL6_BUILTIN_CLASSES, PERL6_IDENTIFIER_RANGE, suffix='(?::[UD])?'), + Name.Builtin), + (_build_word_match(PERL6_BUILTINS, PERL6_IDENTIFIER_RANGE), Name.Builtin), + # copied from PerlLexer + (r'[$@%&][.^:?=!~]?' + PERL6_IDENTIFIER_RANGE + u'+(?:<<.*?>>|<.*?>|«.*?»)*', + Name.Variable), + (r'\$[!/](?:<<.*?>>|<.*?>|«.*?»)*', Name.Variable.Global), + (r'::\?\w+', Name.Variable.Global), + (r'[$@%&]\*' + PERL6_IDENTIFIER_RANGE + u'+(?:<<.*?>>|<.*?>|«.*?»)*', + Name.Variable.Global), + (r'\$(?:<.*?>)+', Name.Variable), + (r'(?:q|qq|Q)[a-zA-Z]?\s*(?P:[\w\s:]+)?\s*(?P(?P[^0-9a-zA-Z:\s])' + r'(?P=first_char)*)', brackets_callback(String)), + # copied from PerlLexer + (r'0_?[0-7]+(_[0-7]+)*', Number.Oct), + (r'0x[0-9A-Fa-f]+(_[0-9A-Fa-f]+)*', Number.Hex), + (r'0b[01]+(_[01]+)*', Number.Bin), + (r'(?i)(\d*(_\d*)*\.\d+(_\d*)*|\d+(_\d*)*\.\d+(_\d*)*)(e[+-]?\d+)?', + Number.Float), + (r'(?i)\d+(_\d*)*e[+-]?\d+(_\d*)*', Number.Float), + (r'\d+(_\d+)*', Number.Integer), + (r'(?<=~~)\s*/(?:\\\\|\\/|.)*?/', String.Regex), + (r'(?<=[=(,])\s*/(?:\\\\|\\/|.)*?/', String.Regex), + (r'm\w+(?=\()', Name), + (r'(?:m|ms|rx)\s*(?P:[\w\s:]+)?\s*(?P(?P[^\w:\s])' + r'(?P=first_char)*)', brackets_callback(String.Regex)), + (r'(?:s|ss|tr)\s*(?::[\w\s:]+)?\s*/(?:\\\\|\\/|.)*?/(?:\\\\|\\/|.)*?/', + String.Regex), + (r'<[^\s=].*?\S>', String), + (_build_word_match(PERL6_OPERATORS), Operator), + (r'\w' + PERL6_IDENTIFIER_RANGE + '*', Name), + (r"'(\\\\|\\[^\\]|[^'\\])*'", String), + (r'"(\\\\|\\[^\\]|[^"\\])*"', String), + ], + 'root': [ + include('common'), + (r'\{', opening_brace_callback), + (r'\}', closing_brace_callback), + (r'.+?', Text), + ], + 'pre-token': [ + include('common'), + (r'\{', Text, ('#pop', 'token')), + (r'.+?', Text), + ], + 'token-sym-brackets': [ + (r'(?P(?P[' + ''.join(PERL6_BRACKETS) + '])(?P=first_char)*)', + brackets_callback(Name), ('#pop', 'pre-token')), + default(('#pop', 'pre-token')), + ], + 'token': [ + (r'\}', Text, '#pop'), + (r'(?<=:)(?:my|our|state|constant|temp|let).*?;', using(this)), + # make sure that quotes in character classes aren't treated as strings + (r'<(?:[-!?+.]\s*)?\[.*?\]>', String.Regex), + # make sure that '#' characters in quotes aren't treated as comments + (r"(?my|our)\s+)?(?:module|class|role|enum|grammar)', line) + if class_decl: + if saw_perl_decl or class_decl.group('scope') is not None: + return True + rating = 0.05 + continue + break + + return rating + + def __init__(self, **options): + super(Perl6Lexer, self).__init__(**options) + self.encoding = options.get('encoding', 'utf-8') diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/praat.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/praat.py new file mode 100644 index 0000000000000000000000000000000000000000..1a38a9e8f75abbd74946ae4fca630d7dcf3316df --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/praat.py @@ -0,0 +1,294 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.praat + ~~~~~~~~~~~~~~~~~~~~~ + + Lexer for Praat + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, words, bygroups, include +from pygments.token import Name, Text, Comment, Keyword, String, Punctuation, Number, \ + Operator + +__all__ = ['PraatLexer'] + + +class PraatLexer(RegexLexer): + """ + For `Praat `_ scripts. + + .. versionadded:: 2.1 + """ + + name = 'Praat' + aliases = ['praat'] + filenames = ['*.praat', '*.proc', '*.psc'] + + keywords = ( + 'if', 'then', 'else', 'elsif', 'elif', 'endif', 'fi', 'for', 'from', 'to', + 'endfor', 'endproc', 'while', 'endwhile', 'repeat', 'until', 'select', 'plus', + 'minus', 'demo', 'assert', 'stopwatch', 'nocheck', 'nowarn', 'noprogress', + 'editor', 'endeditor', 'clearinfo', + ) + + functions_string = ( + 'backslashTrigraphsToUnicode', 'chooseDirectory', 'chooseReadFile', + 'chooseWriteFile', 'date', 'demoKey', 'do', 'environment', 'extractLine', + 'extractWord', 'fixed', 'info', 'left', 'mid', 'percent', 'readFile', 'replace', + 'replace_regex', 'right', 'selected', 'string', 'unicodeToBackslashTrigraphs', + ) + + functions_numeric = ( + 'abs', 'appendFile', 'appendFileLine', 'appendInfo', 'appendInfoLine', 'arccos', + 'arccosh', 'arcsin', 'arcsinh', 'arctan', 'arctan2', 'arctanh', 'barkToHertz', + 'beginPause', 'beginSendPraat', 'besselI', 'besselK', 'beta', 'beta2', + 'binomialP', 'binomialQ', 'boolean', 'ceiling', 'chiSquareP', 'chiSquareQ', + 'choice', 'comment', 'cos', 'cosh', 'createDirectory', 'deleteFile', + 'demoClicked', 'demoClickedIn', 'demoCommandKeyPressed', + 'demoExtraControlKeyPressed', 'demoInput', 'demoKeyPressed', + 'demoOptionKeyPressed', 'demoShiftKeyPressed', 'demoShow', 'demoWaitForInput', + 'demoWindowTitle', 'demoX', 'demoY', 'differenceLimensToPhon', 'do', 'editor', + 'endPause', 'endSendPraat', 'endsWith', 'erb', 'erbToHertz', 'erf', 'erfc', + 'exitScript', 'exp', 'extractNumber', 'fileReadable', 'fisherP', 'fisherQ', + 'floor', 'gaussP', 'gaussQ', 'hertzToBark', 'hertzToErb', 'hertzToMel', + 'hertzToSemitones', 'imax', 'imin', 'incompleteBeta', 'incompleteGammaP', 'index', + 'index_regex', 'invBinomialP', 'invBinomialQ', 'invChiSquareQ', 'invFisherQ', + 'invGaussQ', 'invSigmoid', 'invStudentQ', 'length', 'ln', 'lnBeta', 'lnGamma', + 'log10', 'log2', 'max', 'melToHertz', 'min', 'minusObject', 'natural', 'number', + 'numberOfColumns', 'numberOfRows', 'numberOfSelected', 'objectsAreIdentical', + 'option', 'optionMenu', 'pauseScript', 'phonToDifferenceLimens', 'plusObject', + 'positive', 'randomBinomial', 'randomGauss', 'randomInteger', 'randomPoisson', + 'randomUniform', 'real', 'readFile', 'removeObject', 'rindex', 'rindex_regex', + 'round', 'runScript', 'runSystem', 'runSystem_nocheck', 'selectObject', + 'selected', 'semitonesToHertz', 'sentencetext', 'sigmoid', 'sin', 'sinc', + 'sincpi', 'sinh', 'soundPressureToPhon', 'sqrt', 'startsWith', 'studentP', + 'studentQ', 'tan', 'tanh', 'variableExists', 'word', 'writeFile', 'writeFileLine', + 'writeInfo', 'writeInfoLine', + ) + + functions_array = ( + 'linear', 'randomGauss', 'randomInteger', 'randomUniform', 'zero', + ) + + objects = ( + 'Activation', 'AffineTransform', 'AmplitudeTier', 'Art', 'Artword', + 'Autosegment', 'BarkFilter', 'BarkSpectrogram', 'CCA', 'Categories', + 'Cepstrogram', 'Cepstrum', 'Cepstrumc', 'ChebyshevSeries', 'ClassificationTable', + 'Cochleagram', 'Collection', 'ComplexSpectrogram', 'Configuration', 'Confusion', + 'ContingencyTable', 'Corpus', 'Correlation', 'Covariance', + 'CrossCorrelationTable', 'CrossCorrelationTables', 'DTW', 'DataModeler', + 'Diagonalizer', 'Discriminant', 'Dissimilarity', 'Distance', 'Distributions', + 'DurationTier', 'EEG', 'ERP', 'ERPTier', 'EditCostsTable', 'EditDistanceTable', + 'Eigen', 'Excitation', 'Excitations', 'ExperimentMFC', 'FFNet', 'FeatureWeights', + 'FileInMemory', 'FilesInMemory', 'Formant', 'FormantFilter', 'FormantGrid', + 'FormantModeler', 'FormantPoint', 'FormantTier', 'GaussianMixture', 'HMM', + 'HMM_Observation', 'HMM_ObservationSequence', 'HMM_State', 'HMM_StateSequence', + 'Harmonicity', 'ISpline', 'Index', 'Intensity', 'IntensityTier', 'IntervalTier', + 'KNN', 'KlattGrid', 'KlattTable', 'LFCC', 'LPC', 'Label', 'LegendreSeries', + 'LinearRegression', 'LogisticRegression', 'LongSound', 'Ltas', 'MFCC', 'MSpline', + 'ManPages', 'Manipulation', 'Matrix', 'MelFilter', 'MelSpectrogram', + 'MixingMatrix', 'Movie', 'Network', 'OTGrammar', 'OTHistory', 'OTMulti', 'PCA', + 'PairDistribution', 'ParamCurve', 'Pattern', 'Permutation', 'Photo', 'Pitch', + 'PitchModeler', 'PitchTier', 'PointProcess', 'Polygon', 'Polynomial', + 'PowerCepstrogram', 'PowerCepstrum', 'Procrustes', 'RealPoint', 'RealTier', + 'ResultsMFC', 'Roots', 'SPINET', 'SSCP', 'SVD', 'Salience', 'ScalarProduct', + 'Similarity', 'SimpleString', 'SortedSetOfString', 'Sound', 'Speaker', + 'Spectrogram', 'Spectrum', 'SpectrumTier', 'SpeechSynthesizer', 'SpellingChecker', + 'Strings', 'StringsIndex', 'Table', 'TableOfReal', 'TextGrid', 'TextInterval', + 'TextPoint', 'TextTier', 'Tier', 'Transition', 'VocalTract', 'VocalTractTier', + 'Weight', 'WordList', + ) + + variables_numeric = ( + 'macintosh', 'windows', 'unix', 'praatVersion', 'pi', 'e', 'undefined', + ) + + variables_string = ( + 'praatVersion', 'tab', 'shellDirectory', 'homeDirectory', + 'preferencesDirectory', 'newline', 'temporaryDirectory', + 'defaultDirectory', + ) + + tokens = { + 'root': [ + (r'(\s+)(#.*?$)', bygroups(Text, Comment.Single)), + (r'^#.*?$', Comment.Single), + (r';[^\n]*', Comment.Single), + (r'\s+', Text), + + (r'\bprocedure\b', Keyword, 'procedure_definition'), + (r'\bcall\b', Keyword, 'procedure_call'), + (r'@', Name.Function, 'procedure_call'), + + include('function_call'), + + (words(keywords, suffix=r'\b'), Keyword), + + (r'(\bform\b)(\s+)([^\n]+)', + bygroups(Keyword, Text, String), 'old_form'), + + (r'(print(?:line|tab)?|echo|exit|asserterror|pause|send(?:praat|socket)|' + r'include|execute|system(?:_nocheck)?)(\s+)', + bygroups(Keyword, Text), 'string_unquoted'), + + (r'(goto|label)(\s+)(\w+)', bygroups(Keyword, Text, Name.Label)), + + include('variable_name'), + include('number'), + + (r'"', String, 'string'), + + (words((objects), suffix=r'(?=\s+\S+\n)'), Name.Class, 'string_unquoted'), + + (r'\b[A-Z]', Keyword, 'command'), + (r'(\.{3}|[)(,])', Punctuation), + ], + 'command': [ + (r'( ?[\w()-]+ ?)', Keyword), + (r"'(?=.*')", String.Interpol, 'string_interpolated'), + (r'\.{3}', Keyword, ('#pop', 'old_arguments')), + (r':', Keyword, ('#pop', 'comma_list')), + (r'\s', Text, '#pop'), + ], + 'procedure_call': [ + (r'\s+', Text), + (r'([\w.]+)(:|\s*\()', + bygroups(Name.Function, Text), '#pop'), + (r'([\w.]+)', Name.Function, ('#pop', 'old_arguments')), + ], + 'procedure_definition': [ + (r'\s', Text), + (r'([\w.]+)(\s*?[(:])', + bygroups(Name.Function, Text), '#pop'), + (r'([\w.]+)([^\n]*)', + bygroups(Name.Function, Text), '#pop'), + ], + 'function_call': [ + (words(functions_string, suffix=r'\$(?=\s*[:(])'), Name.Function, 'function'), + (words(functions_array, suffix=r'#(?=\s*[:(])'), Name.Function, 'function'), + (words(functions_numeric, suffix=r'(?=\s*[:(])'), Name.Function, 'function'), + ], + 'function': [ + (r'\s+', Text), + (r':', Punctuation, ('#pop', 'comma_list')), + (r'\s*\(', Punctuation, ('#pop', 'comma_list')), + ], + 'comma_list': [ + (r'(\s*\n\s*)(\.{3})', bygroups(Text, Punctuation)), + + (r'(\s*[])\n])', Text, '#pop'), + + (r'\s+', Text), + (r'"', String, 'string'), + (r'\b(if|then|else|fi|endif)\b', Keyword), + + include('function_call'), + include('variable_name'), + include('operator'), + include('number'), + + (r'[()]', Text), + (r',', Punctuation), + ], + 'old_arguments': [ + (r'\n', Text, '#pop'), + + include('variable_name'), + include('operator'), + include('number'), + + (r'"', String, 'string'), + (r'[^\n]', Text), + ], + 'number': [ + (r'\n', Text, '#pop'), + (r'\b\d+(\.\d*)?([eE][-+]?\d+)?%?', Number), + ], + 'object_attributes': [ + (r'\.?(n(col|row)|[xy]min|[xy]max|[nd][xy])\b', Name.Builtin, '#pop'), + (r'(\.?(?:col|row)\$)(\[)', + bygroups(Name.Builtin, Text), 'variable_name'), + (r'(\$?)(\[)', + bygroups(Name.Builtin, Text), ('#pop', 'comma_list')), + ], + 'variable_name': [ + include('operator'), + include('number'), + + (words(variables_string, suffix=r'\$'), Name.Variable.Global), + (words(variables_numeric, suffix=r'\b'), Name.Variable.Global), + + (r'\bObject_\w+', Name.Builtin, 'object_attributes'), + (words(objects, prefix=r'\b', suffix=r'_\w+'), + Name.Builtin, 'object_attributes'), + + (r"\b(Object_)(')", + bygroups(Name.Builtin, String.Interpol), + ('object_attributes', 'string_interpolated')), + (words(objects, prefix=r'\b', suffix=r"(_)(')"), + bygroups(Name.Builtin, Name.Builtin, String.Interpol), + ('object_attributes', 'string_interpolated')), + + (r'\.?_?[a-z][\w.]*(\$|#)?', Text), + (r'[\[\]]', Punctuation, 'comma_list'), + (r"'(?=.*')", String.Interpol, 'string_interpolated'), + ], + 'operator': [ + (r'([+\/*<>=!-]=?|[&*|][&*|]?|\^|<>)', Operator), + (r'(?', Punctuation), + (r'"(?:\\x[0-9a-fA-F]+\\|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|' + r'\\[0-7]+\\|\\["\nabcefnrstv]|[^\\"])*"', 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)), + (u'([a-z\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]' + u'[\w$\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]*)' + u'(\\s*)(:-|-->)', + bygroups(Name.Function, Text, Operator)), # function defn + (u'([a-z\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]' + u'[\w$\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]*)' + u'(\\s*)(\\()', + bygroups(Name.Function, Text, Punctuation)), + (u'[a-z\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]' + u'[\w$\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]*', + String.Atom), # atom, characters + # This one includes ! + (u'[#&*+\\-./:<=>?@\\\\^~\u00a1-\u00bf\u2010-\u303f]+', + String.Atom), # atom, graphics + (r'[A-Z_]\w*', Name.Variable), + (u'\\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): + return ':-' in text + + +class LogtalkLexer(RegexLexer): + """ + For `Logtalk `_ source code. + + .. versionadded:: 0.10 + """ + + name = 'Logtalk' + aliases = ['logtalk'] + filenames = ['*.lgt', '*.logtalk'] + mimetypes = ['text/x-logtalk'] + + 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_]\w*)', Name.Variable), + # Event handlers + (r'(after|before)(?=[(])', Keyword), + # Message forwarding handler + (r'forward(?=[(])', Keyword), + # Execution-context methods + (r'(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'(current|set)_logtalk_flag(?=[(])', Keyword), + # Compiling, loading, and library paths + (r'logtalk_(compile|l(ibrary_path|oad|oad_context)|make)(?=[(])', 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)\b', Keyword), + # All solutions + (r'((bag|set)of|f(ind|or)all)(?=[(])', Keyword), + # Multi-threading meta-predicates + (r'threaded(_(call|once|ignore|exit|peek|wait|notify))?(?=[(])', 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)|' + r'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), + # Arithemtic evaluation + (r'\bis\b', Keyword), + # Arithemtic 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 arithemtic 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), + # Strings + (r'"(\\\\|\\"|[^"])*"', String), + # Ponctuation + (r'[()\[\],.|]', Text), + # Atoms + (r"[a-z]\w*", Text), + (r"'", String, 'quoted_atom'), + ], + + 'quoted_atom': [ + (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)|' + r'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]\w*(?=[(])', Text, 'root'), + (r'[a-z]\w*[.]', 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_]\w*)', Name.Variable), + # Atoms + (r"[a-z]\w*", Text), + (r"'", String, 'quoted_atom'), + # Strings + (r'"(\\\\|\\"|[^"])*"', String), + # End of entity-opening directive + (r'([)]\.)', Text, 'root'), + # Scope operator + (r'(::)', Operator), + # Ponctuation + (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('^:-\s[a-z]', text, re.M): + return 0.9 + else: + return 0.0 diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/r.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/r.py new file mode 100644 index 0000000000000000000000000000000000000000..dce6196943ab17dac8ba92e0340ee1718d3b5f09 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/r.py @@ -0,0 +1,453 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.r + ~~~~~~~~~~~~~~~~~ + + Lexers for the R/S languages. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import Lexer, RegexLexer, include, words, do_insertions +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Generic + +__all__ = ['RConsoleLexer', 'SLexer', 'RdLexer'] + + +line_re = re.compile('.*?\n') + + +class RConsoleLexer(Lexer): + """ + For R console transcripts or R CMD BATCH output files. + """ + + name = 'RConsole' + aliases = ['rconsole', 'rout'] + filenames = ['*.Rout'] + + def get_tokens_unprocessed(self, text): + slexer = SLexer(**self.options) + + current_code_block = '' + insertions = [] + + for match in line_re.finditer(text): + line = match.group() + if line.startswith('>') or line.startswith('+'): + # Colorize the prompt as such, + # then put rest of line into current_code_block + insertions.append((len(current_code_block), + [(0, Generic.Prompt, line[:2])])) + current_code_block += line[2:] + else: + # We have reached a non-prompt line! + # If we have stored prompt lines, need to process them first. + if current_code_block: + # Weave together the prompts and highlight code. + for item in do_insertions( + insertions, slexer.get_tokens_unprocessed(current_code_block)): + yield item + # Reset vars for next code block. + current_code_block = '' + insertions = [] + # Now process the actual line itself, this is output from R. + yield match.start(), Generic.Output, line + + # If we happen to end on a code block with nothing after it, need to + # process the last code block. This is neither elegant nor DRY so + # should be changed. + if current_code_block: + for item in do_insertions( + insertions, slexer.get_tokens_unprocessed(current_code_block)): + yield item + + +class SLexer(RegexLexer): + """ + For S, S-plus, and R source code. + + .. versionadded:: 0.10 + """ + + name = 'S' + aliases = ['splus', 's', 'r'] + filenames = ['*.S', '*.R', '.Rhistory', '.Rprofile', '.Renviron'] + mimetypes = ['text/S-plus', 'text/S', 'text/x-r-source', 'text/x-r', + 'text/x-R', 'text/x-r-history', 'text/x-r-profile'] + + builtins_base = ( + 'Arg', 'Conj', 'Cstack_info', 'Encoding', 'FALSE', + 'Filter', 'Find', 'I', 'ISOdate', 'ISOdatetime', 'Im', 'Inf', + 'La.svd', 'Map', 'Math.Date', 'Math.POSIXt', 'Math.data.frame', + 'Math.difftime', 'Math.factor', 'Mod', 'NA_character_', + 'NA_complex_', 'NA_real_', 'NCOL', 'NROW', 'NULLNA_integer_', 'NaN', + 'Negate', 'NextMethod', 'Ops.Date', 'Ops.POSIXt', 'Ops.data.frame', + 'Ops.difftime', 'Ops.factor', 'Ops.numeric_version', 'Ops.ordered', + 'Position', 'R.Version', 'R.home', 'R.version', 'R.version.string', + 'RNGkind', 'RNGversion', 'R_system_version', 'Re', 'Recall', + 'Reduce', 'Summary.Date', 'Summary.POSIXct', 'Summary.POSIXlt', + 'Summary.data.frame', 'Summary.difftime', 'Summary.factor', + 'Summary.numeric_version', 'Summary.ordered', 'Sys.Date', + 'Sys.chmod', 'Sys.getenv', 'Sys.getlocale', 'Sys.getpid', + 'Sys.glob', 'Sys.info', 'Sys.localeconv', 'Sys.readlink', + 'Sys.setFileTime', 'Sys.setenv', 'Sys.setlocale', 'Sys.sleep', + 'Sys.time', 'Sys.timezone', 'Sys.umask', 'Sys.unsetenv', + 'Sys.which', 'TRUE', 'UseMethod', 'Vectorize', 'abbreviate', 'abs', + 'acos', 'acosh', 'addNA', 'addTaskCallback', 'agrep', 'alist', + 'all', 'all.equal', 'all.equal.POSIXct', 'all.equal.character', + 'all.equal.default', 'all.equal.factor', 'all.equal.formula', + 'all.equal.language', 'all.equal.list', 'all.equal.numeric', + 'all.equal.raw', 'all.names', 'all.vars', 'any', 'anyDuplicated', + 'anyDuplicated.array', 'anyDuplicated.data.frame', + 'anyDuplicated.default', 'anyDuplicated.matrix', 'aperm', + 'aperm.default', 'aperm.table', 'append', 'apply', 'args', + 'arrayInd', 'as.Date', 'as.Date.POSIXct', 'as.Date.POSIXlt', + 'as.Date.character', 'as.Date.date', 'as.Date.dates', + 'as.Date.default', 'as.Date.factor', 'as.Date.numeric', + 'as.POSIXct', 'as.POSIXct.Date', 'as.POSIXct.POSIXlt', + 'as.POSIXct.date', 'as.POSIXct.dates', 'as.POSIXct.default', + 'as.POSIXct.numeric', 'as.POSIXlt', 'as.POSIXlt.Date', + 'as.POSIXlt.POSIXct', 'as.POSIXlt.character', 'as.POSIXlt.date', + 'as.POSIXlt.dates', 'as.POSIXlt.default', 'as.POSIXlt.factor', + 'as.POSIXlt.numeric', 'as.array', 'as.array.default', 'as.call', + 'as.character', 'as.character.Date', 'as.character.POSIXt', + 'as.character.condition', 'as.character.default', + 'as.character.error', 'as.character.factor', 'as.character.hexmode', + 'as.character.numeric_version', 'as.character.octmode', + 'as.character.srcref', 'as.complex', 'as.data.frame', + 'as.data.frame.AsIs', 'as.data.frame.Date', 'as.data.frame.POSIXct', + 'as.data.frame.POSIXlt', 'as.data.frame.array', + 'as.data.frame.character', 'as.data.frame.complex', + 'as.data.frame.data.frame', 'as.data.frame.default', + 'as.data.frame.difftime', 'as.data.frame.factor', + 'as.data.frame.integer', 'as.data.frame.list', + 'as.data.frame.logical', 'as.data.frame.matrix', + 'as.data.frame.model.matrix', 'as.data.frame.numeric', + 'as.data.frame.numeric_version', 'as.data.frame.ordered', + 'as.data.frame.raw', 'as.data.frame.table', 'as.data.frame.ts', + 'as.data.frame.vector', 'as.difftime', 'as.double', + 'as.double.POSIXlt', 'as.double.difftime', 'as.environment', + 'as.expression', 'as.expression.default', 'as.factor', + 'as.function', 'as.function.default', 'as.hexmode', 'as.integer', + 'as.list', 'as.list.Date', 'as.list.POSIXct', 'as.list.data.frame', + 'as.list.default', 'as.list.environment', 'as.list.factor', + 'as.list.function', 'as.list.numeric_version', 'as.logical', + 'as.logical.factor', 'as.matrix', 'as.matrix.POSIXlt', + 'as.matrix.data.frame', 'as.matrix.default', 'as.matrix.noquote', + 'as.name', 'as.null', 'as.null.default', 'as.numeric', + 'as.numeric_version', 'as.octmode', 'as.ordered', + 'as.package_version', 'as.pairlist', 'as.qr', 'as.raw', 'as.single', + 'as.single.default', 'as.symbol', 'as.table', 'as.table.default', + 'as.vector', 'as.vector.factor', 'asNamespace', 'asS3', 'asS4', + 'asin', 'asinh', 'assign', 'atan', 'atan2', 'atanh', + 'attachNamespace', 'attr', 'attr.all.equal', 'attributes', + 'autoload', 'autoloader', 'backsolve', 'baseenv', 'basename', + 'besselI', 'besselJ', 'besselK', 'besselY', 'beta', + 'bindingIsActive', 'bindingIsLocked', 'bindtextdomain', 'bitwAnd', + 'bitwNot', 'bitwOr', 'bitwShiftL', 'bitwShiftR', 'bitwXor', 'body', + 'bquote', 'browser', 'browserCondition', 'browserSetDebug', + 'browserText', 'builtins', 'by', 'by.data.frame', 'by.default', + 'bzfile', 'c.Date', 'c.POSIXct', 'c.POSIXlt', 'c.noquote', + 'c.numeric_version', 'call', 'callCC', 'capabilities', 'casefold', + 'cat', 'category', 'cbind', 'cbind.data.frame', 'ceiling', + 'char.expand', 'charToRaw', 'charmatch', 'chartr', 'check_tzones', + 'chol', 'chol.default', 'chol2inv', 'choose', 'class', + 'clearPushBack', 'close', 'close.connection', 'close.srcfile', + 'close.srcfilealias', 'closeAllConnections', 'col', 'colMeans', + 'colSums', 'colnames', 'commandArgs', 'comment', 'computeRestarts', + 'conditionCall', 'conditionCall.condition', 'conditionMessage', + 'conditionMessage.condition', 'conflicts', 'contributors', 'cos', + 'cosh', 'crossprod', 'cummax', 'cummin', 'cumprod', 'cumsum', 'cut', + 'cut.Date', 'cut.POSIXt', 'cut.default', 'dQuote', 'data.class', + 'data.matrix', 'date', 'debug', 'debugonce', + 'default.stringsAsFactors', 'delayedAssign', 'deparse', 'det', + 'determinant', 'determinant.matrix', 'dget', 'diag', 'diff', + 'diff.Date', 'diff.POSIXt', 'diff.default', 'difftime', 'digamma', + 'dim', 'dim.data.frame', 'dimnames', 'dimnames.data.frame', 'dir', + 'dir.create', 'dirname', 'do.call', 'dput', 'drop', 'droplevels', + 'droplevels.data.frame', 'droplevels.factor', 'dump', 'duplicated', + 'duplicated.POSIXlt', 'duplicated.array', 'duplicated.data.frame', + 'duplicated.default', 'duplicated.matrix', + 'duplicated.numeric_version', 'dyn.load', 'dyn.unload', 'eapply', + 'eigen', 'else', 'emptyenv', 'enc2native', 'enc2utf8', + 'encodeString', 'enquote', 'env.profile', 'environment', + 'environmentIsLocked', 'environmentName', 'eval', 'eval.parent', + 'evalq', 'exists', 'exp', 'expand.grid', 'expm1', 'expression', + 'factor', 'factorial', 'fifo', 'file', 'file.access', 'file.append', + 'file.choose', 'file.copy', 'file.create', 'file.exists', + 'file.info', 'file.link', 'file.path', 'file.remove', 'file.rename', + 'file.show', 'file.symlink', 'find.package', 'findInterval', + 'findPackageEnv', 'findRestart', 'floor', 'flush', + 'flush.connection', 'force', 'formals', 'format', + 'format.AsIs', 'format.Date', 'format.POSIXct', 'format.POSIXlt', + 'format.data.frame', 'format.default', 'format.difftime', + 'format.factor', 'format.hexmode', 'format.info', + 'format.libraryIQR', 'format.numeric_version', 'format.octmode', + 'format.packageInfo', 'format.pval', 'format.summaryDefault', + 'formatC', 'formatDL', 'forwardsolve', 'gamma', 'gc', 'gc.time', + 'gcinfo', 'gctorture', 'gctorture2', 'get', 'getAllConnections', + 'getCallingDLL', 'getCallingDLLe', 'getConnection', + 'getDLLRegisteredRoutines', 'getDLLRegisteredRoutines.DLLInfo', + 'getDLLRegisteredRoutines.character', 'getElement', + 'getExportedValue', 'getHook', 'getLoadedDLLs', 'getNamespace', + 'getNamespaceExports', 'getNamespaceImports', 'getNamespaceInfo', + 'getNamespaceName', 'getNamespaceUsers', 'getNamespaceVersion', + 'getNativeSymbolInfo', 'getOption', 'getRversion', 'getSrcLines', + 'getTaskCallbackNames', 'geterrmessage', 'gettext', 'gettextf', + 'getwd', 'gl', 'globalenv', 'gregexpr', 'grep', 'grepRaw', 'grepl', + 'gsub', 'gzcon', 'gzfile', 'head', 'iconv', 'iconvlist', + 'icuSetCollate', 'identical', 'identity', 'ifelse', 'importIntoEnv', + 'in', 'inherits', 'intToBits', 'intToUtf8', 'interaction', 'interactive', + 'intersect', 'inverse.rle', 'invisible', 'invokeRestart', + 'invokeRestartInteractively', 'is.R', 'is.array', 'is.atomic', + 'is.call', 'is.character', 'is.complex', 'is.data.frame', + 'is.double', 'is.element', 'is.environment', 'is.expression', + 'is.factor', 'is.finite', 'is.function', 'is.infinite', + 'is.integer', 'is.language', 'is.list', 'is.loaded', 'is.logical', + 'is.matrix', 'is.na', 'is.na.POSIXlt', 'is.na.data.frame', + 'is.na.numeric_version', 'is.name', 'is.nan', 'is.null', + 'is.numeric', 'is.numeric.Date', 'is.numeric.POSIXt', + 'is.numeric.difftime', 'is.numeric_version', 'is.object', + 'is.ordered', 'is.package_version', 'is.pairlist', 'is.primitive', + 'is.qr', 'is.raw', 'is.recursive', 'is.single', 'is.symbol', + 'is.table', 'is.unsorted', 'is.vector', 'isBaseNamespace', + 'isIncomplete', 'isNamespace', 'isOpen', 'isRestart', 'isS4', + 'isSeekable', 'isSymmetric', 'isSymmetric.matrix', 'isTRUE', + 'isatty', 'isdebugged', 'jitter', 'julian', 'julian.Date', + 'julian.POSIXt', 'kappa', 'kappa.default', 'kappa.lm', 'kappa.qr', + 'kronecker', 'l10n_info', 'labels', 'labels.default', 'lapply', + 'lazyLoad', 'lazyLoadDBexec', 'lazyLoadDBfetch', 'lbeta', 'lchoose', + 'length', 'length.POSIXlt', 'letters', 'levels', 'levels.default', + 'lfactorial', 'lgamma', 'library.dynam', 'library.dynam.unload', + 'licence', 'license', 'list.dirs', 'list.files', 'list2env', 'load', + 'loadNamespace', 'loadedNamespaces', 'loadingNamespaceInfo', + 'local', 'lockBinding', 'lockEnvironment', 'log', 'log10', 'log1p', + 'log2', 'logb', 'lower.tri', 'ls', 'make.names', 'make.unique', + 'makeActiveBinding', 'mapply', 'margin.table', 'mat.or.vec', + 'match', 'match.arg', 'match.call', 'match.fun', 'max', 'max.col', + 'mean', 'mean.Date', 'mean.POSIXct', 'mean.POSIXlt', 'mean.default', + 'mean.difftime', 'mem.limits', 'memCompress', 'memDecompress', + 'memory.profile', 'merge', 'merge.data.frame', 'merge.default', + 'message', 'mget', 'min', 'missing', 'mode', 'month.abb', + 'month.name', 'months', 'months.Date', 'months.POSIXt', + 'months.abb', 'months.nameletters', 'names', 'names.POSIXlt', + 'namespaceExport', 'namespaceImport', 'namespaceImportClasses', + 'namespaceImportFrom', 'namespaceImportMethods', 'nargs', 'nchar', + 'ncol', 'new.env', 'ngettext', 'nlevels', 'noquote', 'norm', + 'normalizePath', 'nrow', 'numeric_version', 'nzchar', 'objects', + 'oldClass', 'on.exit', 'open', 'open.connection', 'open.srcfile', + 'open.srcfilealias', 'open.srcfilecopy', 'options', 'order', + 'ordered', 'outer', 'packBits', 'packageEvent', + 'packageHasNamespace', 'packageStartupMessage', 'package_version', + 'pairlist', 'parent.env', 'parent.frame', 'parse', + 'parseNamespaceFile', 'paste', 'paste0', 'path.expand', + 'path.package', 'pipe', 'pmatch', 'pmax', 'pmax.int', 'pmin', + 'pmin.int', 'polyroot', 'pos.to.env', 'pretty', 'pretty.default', + 'prettyNum', 'print', 'print.AsIs', 'print.DLLInfo', + 'print.DLLInfoList', 'print.DLLRegisteredRoutines', 'print.Date', + 'print.NativeRoutineList', 'print.POSIXct', 'print.POSIXlt', + 'print.by', 'print.condition', 'print.connection', + 'print.data.frame', 'print.default', 'print.difftime', + 'print.factor', 'print.function', 'print.hexmode', + 'print.libraryIQR', 'print.listof', 'print.noquote', + 'print.numeric_version', 'print.octmode', 'print.packageInfo', + 'print.proc_time', 'print.restart', 'print.rle', + 'print.simple.list', 'print.srcfile', 'print.srcref', + 'print.summary.table', 'print.summaryDefault', 'print.table', + 'print.warnings', 'prmatrix', 'proc.time', 'prod', 'prop.table', + 'provideDimnames', 'psigamma', 'pushBack', 'pushBackLength', 'q', + 'qr', 'qr.Q', 'qr.R', 'qr.X', 'qr.coef', 'qr.default', 'qr.fitted', + 'qr.qty', 'qr.qy', 'qr.resid', 'qr.solve', 'quarters', + 'quarters.Date', 'quarters.POSIXt', 'quit', 'quote', 'range', + 'range.default', 'rank', 'rapply', 'raw', 'rawConnection', + 'rawConnectionValue', 'rawShift', 'rawToBits', 'rawToChar', 'rbind', + 'rbind.data.frame', 'rcond', 'read.dcf', 'readBin', 'readChar', + 'readLines', 'readRDS', 'readRenviron', 'readline', 'reg.finalizer', + 'regexec', 'regexpr', 'registerS3method', 'registerS3methods', + 'regmatches', 'remove', 'removeTaskCallback', 'rep', 'rep.Date', + 'rep.POSIXct', 'rep.POSIXlt', 'rep.factor', 'rep.int', + 'rep.numeric_version', 'rep_len', 'replace', 'replicate', + 'requireNamespace', 'restartDescription', 'restartFormals', + 'retracemem', 'rev', 'rev.default', 'rle', 'rm', 'round', + 'round.Date', 'round.POSIXt', 'row', 'row.names', + 'row.names.data.frame', 'row.names.default', 'rowMeans', 'rowSums', + 'rownames', 'rowsum', 'rowsum.data.frame', 'rowsum.default', + 'sQuote', 'sample', 'sample.int', 'sapply', 'save', 'save.image', + 'saveRDS', 'scale', 'scale.default', 'scan', 'search', + 'searchpaths', 'seek', 'seek.connection', 'seq', 'seq.Date', + 'seq.POSIXt', 'seq.default', 'seq.int', 'seq_along', 'seq_len', + 'sequence', 'serialize', 'set.seed', 'setHook', 'setNamespaceInfo', + 'setSessionTimeLimit', 'setTimeLimit', 'setdiff', 'setequal', + 'setwd', 'shQuote', 'showConnections', 'sign', 'signalCondition', + 'signif', 'simpleCondition', 'simpleError', 'simpleMessage', + 'simpleWarning', 'simplify2array', 'sin', 'single', + 'sinh', 'sink', 'sink.number', 'slice.index', 'socketConnection', + 'socketSelect', 'solve', 'solve.default', 'solve.qr', 'sort', + 'sort.POSIXlt', 'sort.default', 'sort.int', 'sort.list', 'split', + 'split.Date', 'split.POSIXct', 'split.data.frame', 'split.default', + 'sprintf', 'sqrt', 'srcfile', 'srcfilealias', 'srcfilecopy', + 'srcref', 'standardGeneric', 'stderr', 'stdin', 'stdout', 'stop', + 'stopifnot', 'storage.mode', 'strftime', 'strptime', 'strsplit', + 'strtoi', 'strtrim', 'structure', 'strwrap', 'sub', 'subset', + 'subset.data.frame', 'subset.default', 'subset.matrix', + 'substitute', 'substr', 'substring', 'sum', 'summary', + 'summary.Date', 'summary.POSIXct', 'summary.POSIXlt', + 'summary.connection', 'summary.data.frame', 'summary.default', + 'summary.factor', 'summary.matrix', 'summary.proc_time', + 'summary.srcfile', 'summary.srcref', 'summary.table', + 'suppressMessages', 'suppressPackageStartupMessages', + 'suppressWarnings', 'svd', 'sweep', 'sys.call', 'sys.calls', + 'sys.frame', 'sys.frames', 'sys.function', 'sys.load.image', + 'sys.nframe', 'sys.on.exit', 'sys.parent', 'sys.parents', + 'sys.save.image', 'sys.source', 'sys.status', 'system', + 'system.file', 'system.time', 'system2', 't', 't.data.frame', + 't.default', 'table', 'tabulate', 'tail', 'tan', 'tanh', 'tapply', + 'taskCallbackManager', 'tcrossprod', 'tempdir', 'tempfile', + 'testPlatformEquivalence', 'textConnection', 'textConnectionValue', + 'toString', 'toString.default', 'tolower', 'topenv', 'toupper', + 'trace', 'traceback', 'tracemem', 'tracingState', 'transform', + 'transform.data.frame', 'transform.default', 'trigamma', 'trunc', + 'trunc.Date', 'trunc.POSIXt', 'truncate', 'truncate.connection', + 'try', 'tryCatch', 'typeof', 'unclass', 'undebug', 'union', + 'unique', 'unique.POSIXlt', 'unique.array', 'unique.data.frame', + 'unique.default', 'unique.matrix', 'unique.numeric_version', + 'units', 'units.difftime', 'unix.time', 'unlink', 'unlist', + 'unloadNamespace', 'unlockBinding', 'unname', 'unserialize', + 'unsplit', 'untrace', 'untracemem', 'unz', 'upper.tri', 'url', + 'utf8ToInt', 'vapply', 'version', 'warning', 'warnings', 'weekdays', + 'weekdays.Date', 'weekdays.POSIXt', 'which', 'which.max', + 'which.min', 'with', 'with.default', 'withCallingHandlers', + 'withRestarts', 'withVisible', 'within', 'within.data.frame', + 'within.list', 'write', 'write.dcf', 'writeBin', 'writeChar', + 'writeLines', 'xor', 'xor.hexmode', 'xor.octmode', + 'xpdrows.data.frame', 'xtfrm', 'xtfrm.AsIs', 'xtfrm.Date', + 'xtfrm.POSIXct', 'xtfrm.POSIXlt', 'xtfrm.Surv', 'xtfrm.default', + 'xtfrm.difftime', 'xtfrm.factor', 'xtfrm.numeric_version', 'xzfile', + 'zapsmall' + ) + + tokens = { + 'comments': [ + (r'#.*$', Comment.Single), + ], + 'valid_name': [ + (r'[a-zA-Z][\w.]*', Text), + # can begin with ., but not if that is followed by a digit + (r'\.[a-zA-Z_][\w.]*', Text), + ], + 'punctuation': [ + (r'\[{1,2}|\]{1,2}|\(|\)|;|,', Punctuation), + ], + 'keywords': [ + (words(builtins_base, suffix=r'(?![\w. =])'), + Keyword.Pseudo), + (r'(if|else|for|while|repeat|in|next|break|return|switch|function)' + r'(?![\w.])', + Keyword.Reserved), + (r'(array|category|character|complex|double|function|integer|list|' + r'logical|matrix|numeric|vector|data.frame|c)' + r'(?![\w.])', + Keyword.Type), + (r'(library|require|attach|detach|source)' + r'(?![\w.])', + Keyword.Namespace) + ], + 'operators': [ + (r'<>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|\?', Operator), + (r'\*|\+|\^|/|!|%[^%]*%|=|~|\$|@|:{1,3}', Operator) + ], + 'builtin_symbols': [ + (r'(NULL|NA(_(integer|real|complex|character)_)?|' + r'letters|LETTERS|Inf|TRUE|FALSE|NaN|pi|\.\.(\.|[0-9]+))' + r'(?![\w.])', + Keyword.Constant), + (r'(T|F)\b', Name.Builtin.Pseudo), + ], + 'numbers': [ + # hex number + (r'0[xX][a-fA-F0-9]+([pP][0-9]+)?[Li]?', Number.Hex), + # decimal number + (r'[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+|\.)([eE][+-]?[0-9]+)?[Li]?', + Number), + ], + 'statements': [ + include('comments'), + # whitespaces + (r'\s+', Text), + (r'`.*?`', String.Backtick), + (r'\'', String, 'string_squote'), + (r'\"', String, 'string_dquote'), + include('builtin_symbols'), + include('numbers'), + include('keywords'), + include('punctuation'), + include('operators'), + include('valid_name'), + ], + 'root': [ + include('statements'), + # blocks: + (r'\{|\}', Punctuation), + # (r'\{', Punctuation, 'block'), + (r'.', Text), + ], + # 'block': [ + # include('statements'), + # ('\{', Punctuation, '#push'), + # ('\}', Punctuation, '#pop') + # ], + 'string_squote': [ + (r'([^\'\\]|\\.)*\'', String, '#pop'), + ], + 'string_dquote': [ + (r'([^"\\]|\\.)*"', String, '#pop'), + ], + } + + def analyse_text(text): + if re.search(r'[a-z0-9_\])\s]<-(?!-)', text): + return 0.11 + + +class RdLexer(RegexLexer): + """ + Pygments Lexer for R documentation (Rd) files + + This is a very minimal implementation, highlighting little more + than the macros. A description of Rd syntax is found in `Writing R + Extensions `_ + and `Parsing Rd files `_. + + .. versionadded:: 1.6 + """ + name = 'Rd' + aliases = ['rd'] + filenames = ['*.Rd'] + mimetypes = ['text/x-r-doc'] + + # To account for verbatim / LaTeX-like / and R-like areas + # would require parsing. + tokens = { + 'root': [ + # catch escaped brackets and percent sign + (r'\\[\\{}%]', String.Escape), + # comments + (r'%.*$', Comment), + # special macros with no arguments + (r'\\(?:cr|l?dots|R|tab)\b', Keyword.Constant), + # macros + (r'\\[a-zA-Z]+\b', Keyword), + # special preprocessor macros + (r'^\s*#(?:ifn?def|endif).*\b', Comment.Preproc), + # non-escaped brackets + (r'[{}]', Name.Builtin), + # everything else + (r'[^\\%\n{}]+', Text), + (r'.', Text), + ] + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/rdf.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/rdf.py new file mode 100644 index 0000000000000000000000000000000000000000..d0f8778adf2ae7d3b7e248e106865ee12158b309 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/rdf.py @@ -0,0 +1,270 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.rdf + ~~~~~~~~~~~~~~~~~~~ + + Lexers for semantic web and RDF query languages and markup. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, bygroups, default +from pygments.token import Keyword, Punctuation, String, Number, Operator, Generic, \ + Whitespace, Name, Literal, Comment, Text + +__all__ = ['SparqlLexer', 'TurtleLexer'] + + +class SparqlLexer(RegexLexer): + """ + Lexer for `SPARQL `_ query language. + + .. versionadded:: 2.0 + """ + name = 'SPARQL' + aliases = ['sparql'] + filenames = ['*.rq', '*.sparql'] + mimetypes = ['application/sparql-query'] + + # character group definitions :: + + PN_CHARS_BASE_GRP = (u'a-zA-Z' + u'\u00c0-\u00d6' + u'\u00d8-\u00f6' + u'\u00f8-\u02ff' + u'\u0370-\u037d' + u'\u037f-\u1fff' + u'\u200c-\u200d' + u'\u2070-\u218f' + u'\u2c00-\u2fef' + u'\u3001-\ud7ff' + u'\uf900-\ufdcf' + u'\ufdf0-\ufffd') + + PN_CHARS_U_GRP = (PN_CHARS_BASE_GRP + '_') + + PN_CHARS_GRP = (PN_CHARS_U_GRP + + r'\-' + + r'0-9' + + u'\u00b7' + + u'\u0300-\u036f' + + u'\u203f-\u2040') + + HEX_GRP = '0-9A-Fa-f' + + PN_LOCAL_ESC_CHARS_GRP = r' _~.\-!$&"()*+,;=/?#@%' + + # terminal productions :: + + PN_CHARS_BASE = '[' + PN_CHARS_BASE_GRP + ']' + + PN_CHARS_U = '[' + PN_CHARS_U_GRP + ']' + + PN_CHARS = '[' + PN_CHARS_GRP + ']' + + HEX = '[' + HEX_GRP + ']' + + PN_LOCAL_ESC_CHARS = '[' + PN_LOCAL_ESC_CHARS_GRP + ']' + + IRIREF = r'<(?:[^<>"{}|^`\\\x00-\x20])*>' + + BLANK_NODE_LABEL = '_:[0-9' + PN_CHARS_U_GRP + '](?:[' + PN_CHARS_GRP + \ + '.]*' + PN_CHARS + ')?' + + PN_PREFIX = PN_CHARS_BASE + '(?:[' + PN_CHARS_GRP + '.]*' + PN_CHARS + ')?' + + VARNAME = u'[0-9' + PN_CHARS_U_GRP + '][' + PN_CHARS_U_GRP + \ + u'0-9\u00b7\u0300-\u036f\u203f-\u2040]*' + + PERCENT = '%' + HEX + HEX + + PN_LOCAL_ESC = r'\\' + PN_LOCAL_ESC_CHARS + + PLX = '(?:' + PERCENT + ')|(?:' + PN_LOCAL_ESC + ')' + + PN_LOCAL = ('(?:[' + PN_CHARS_U_GRP + ':0-9' + ']|' + PLX + ')' + + '(?:(?:[' + PN_CHARS_GRP + '.:]|' + PLX + ')*(?:[' + + PN_CHARS_GRP + ':]|' + PLX + '))?') + + EXPONENT = r'[eE][+-]?\d+' + + # Lexer token definitions :: + + tokens = { + 'root': [ + (r'\s+', Text), + # keywords :: + (r'((?i)select|construct|describe|ask|where|filter|group\s+by|minus|' + r'distinct|reduced|from\s+named|from|order\s+by|desc|asc|limit|' + r'offset|bindings|load|clear|drop|create|add|move|copy|' + r'insert\s+data|delete\s+data|delete\s+where|delete|insert|' + r'using\s+named|using|graph|default|named|all|optional|service|' + r'silent|bind|union|not\s+in|in|as|having|to|prefix|base)\b', Keyword), + (r'(a)\b', Keyword), + # IRIs :: + ('(' + IRIREF + ')', Name.Label), + # blank nodes :: + ('(' + BLANK_NODE_LABEL + ')', Name.Label), + # # variables :: + ('[?$]' + VARNAME, Name.Variable), + # prefixed names :: + (r'(' + PN_PREFIX + ')?(\:)(' + PN_LOCAL + ')?', + bygroups(Name.Namespace, Punctuation, Name.Tag)), + # function names :: + (r'((?i)str|lang|langmatches|datatype|bound|iri|uri|bnode|rand|abs|' + r'ceil|floor|round|concat|strlen|ucase|lcase|encode_for_uri|' + r'contains|strstarts|strends|strbefore|strafter|year|month|day|' + r'hours|minutes|seconds|timezone|tz|now|md5|sha1|sha256|sha384|' + r'sha512|coalesce|if|strlang|strdt|sameterm|isiri|isuri|isblank|' + r'isliteral|isnumeric|regex|substr|replace|exists|not\s+exists|' + r'count|sum|min|max|avg|sample|group_concat|separator)\b', + Name.Function), + # boolean literals :: + (r'(true|false)', Keyword.Constant), + # double literals :: + (r'[+\-]?(\d+\.\d*' + EXPONENT + '|\.?\d+' + EXPONENT + ')', Number.Float), + # decimal literals :: + (r'[+\-]?(\d+\.\d*|\.\d+)', Number.Float), + # integer literals :: + (r'[+\-]?\d+', Number.Integer), + # operators :: + (r'(\|\||&&|=|\*|\-|\+|/|!=|<=|>=|!|<|>)', Operator), + # punctuation characters :: + (r'[(){}.;,:^\[\]]', Punctuation), + # line comments :: + (r'#[^\n]*', Comment), + # strings :: + (r'"""', String, 'triple-double-quoted-string'), + (r'"', String, 'single-double-quoted-string'), + (r"'''", String, 'triple-single-quoted-string'), + (r"'", String, 'single-single-quoted-string'), + ], + 'triple-double-quoted-string': [ + (r'"""', String, 'end-of-string'), + (r'[^\\]+', String), + (r'\\', String, 'string-escape'), + ], + 'single-double-quoted-string': [ + (r'"', String, 'end-of-string'), + (r'[^"\\\n]+', String), + (r'\\', String, 'string-escape'), + ], + 'triple-single-quoted-string': [ + (r"'''", String, 'end-of-string'), + (r'[^\\]+', String), + (r'\\', String.Escape, 'string-escape'), + ], + 'single-single-quoted-string': [ + (r"'", String, 'end-of-string'), + (r"[^'\\\n]+", String), + (r'\\', String, 'string-escape'), + ], + 'string-escape': [ + (r'u' + HEX + '{4}', String.Escape, '#pop'), + (r'U' + HEX + '{8}', String.Escape, '#pop'), + (r'.', String.Escape, '#pop'), + ], + 'end-of-string': [ + (r'(@)([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)', + bygroups(Operator, Name.Function), '#pop:2'), + (r'\^\^', Operator, '#pop:2'), + default('#pop:2'), + ], + } + + +class TurtleLexer(RegexLexer): + """ + Lexer for `Turtle `_ data language. + + .. versionadded:: 2.1 + """ + name = 'Turtle' + aliases = ['turtle'] + filenames = ['*.ttl'] + mimetypes = ['text/turtle', 'application/x-turtle'] + + flags = re.IGNORECASE + + patterns = { + 'PNAME_NS': r'((?:[a-z][\w-]*)?\:)', # Simplified character range + 'IRIREF': r'(<[^<>"{}|^`\\\x00-\x20]*>)' + } + + # PNAME_NS PN_LOCAL (with simplified character range) + patterns['PrefixedName'] = r'%(PNAME_NS)s([a-z][\w-]*)' % patterns + + tokens = { + 'root': [ + (r'\s+', Whitespace), + + # Base / prefix + (r'(@base|BASE)(\s+)%(IRIREF)s(\s*)(\.?)' % patterns, + bygroups(Keyword, Whitespace, Name.Variable, Whitespace, + Punctuation)), + (r'(@prefix|PREFIX)(\s+)%(PNAME_NS)s(\s+)%(IRIREF)s(\s*)(\.?)' % patterns, + bygroups(Keyword, Whitespace, Name.Namespace, Whitespace, + Name.Variable, Whitespace, Punctuation)), + + # The shorthand predicate 'a' + (r'(?<=\s)a(?=\s)', Keyword.Type), + + # IRIREF + (r'%(IRIREF)s' % patterns, Name.Variable), + + # PrefixedName + (r'%(PrefixedName)s' % patterns, + bygroups(Name.Namespace, Name.Tag)), + + # Comment + (r'#[^\n]+', Comment), + + (r'\b(true|false)\b', Literal), + (r'[+\-]?\d*\.\d+', Number.Float), + (r'[+\-]?\d*(:?\.\d+)?E[+\-]?\d+', Number.Float), + (r'[+\-]?\d+', Number.Integer), + (r'[\[\](){}.;,:^]', Punctuation), + + (r'"""', String, 'triple-double-quoted-string'), + (r'"', String, 'single-double-quoted-string'), + (r"'''", String, 'triple-single-quoted-string'), + (r"'", String, 'single-single-quoted-string'), + ], + 'triple-double-quoted-string': [ + (r'"""', String, 'end-of-string'), + (r'[^\\]+', String), + (r'\\', String, 'string-escape'), + ], + 'single-double-quoted-string': [ + (r'"', String, 'end-of-string'), + (r'[^"\\\n]+', String), + (r'\\', String, 'string-escape'), + ], + 'triple-single-quoted-string': [ + (r"'''", String, 'end-of-string'), + (r'[^\\]+', String), + (r'\\', String, 'string-escape'), + ], + 'single-single-quoted-string': [ + (r"'", String, 'end-of-string'), + (r"[^'\\\n]+", String), + (r'\\', String, 'string-escape'), + ], + 'string-escape': [ + (r'.', String, '#pop'), + ], + 'end-of-string': [ + (r'(@)([a-z]+(:?-[a-z0-9]+)*)', + bygroups(Operator, Generic.Emph), '#pop:2'), + + (r'(\^\^)%(IRIREF)s' % patterns, bygroups(Operator, Generic.Emph), '#pop:2'), + (r'(\^\^)%(PrefixedName)s' % patterns, + bygroups(Operator, Generic.Emph, Generic.Emph), '#pop:2'), + + default('#pop:2'), + + ], + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/rebol.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/rebol.py new file mode 100644 index 0000000000000000000000000000000000000000..f3d00200d02bb8ae825497b243b93ba8da6f500d --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/rebol.py @@ -0,0 +1,431 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.rebol + ~~~~~~~~~~~~~~~~~~~~~ + + Lexers for the REBOL and related languages. + + :copyright: Copyright 2006-2017 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, Generic, Whitespace + +__all__ = ['RebolLexer', 'RedLexer'] + + +class RebolLexer(RegexLexer): + """ + A `REBOL `_ lexer. + + .. versionadded:: 1.1 + """ + name = 'REBOL' + aliases = ['rebol'] + filenames = ['*.r', '*.r3', '*.reb'] + mimetypes = ['text/x-rebol'] + + flags = re.IGNORECASE | re.MULTILINE + + escape_re = r'(?:\^\([0-9a-f]{1,4}\)*)' + + def word_callback(lexer, match): + word = match.group() + + if re.match(".*:$", word): + yield match.start(), Generic.Subheading, word + elif re.match( + r'(native|alias|all|any|as-string|as-binary|bind|bound\?|case|' + r'catch|checksum|comment|debase|dehex|exclude|difference|disarm|' + r'either|else|enbase|foreach|remove-each|form|free|get|get-env|if|' + r'in|intersect|loop|minimum-of|maximum-of|mold|new-line|' + r'new-line\?|not|now|prin|print|reduce|compose|construct|repeat|' + r'reverse|save|script\?|set|shift|switch|throw|to-hex|trace|try|' + r'type\?|union|unique|unless|unprotect|unset|until|use|value\?|' + r'while|compress|decompress|secure|open|close|read|read-io|' + r'write-io|write|update|query|wait|input\?|exp|log-10|log-2|' + r'log-e|square-root|cosine|sine|tangent|arccosine|arcsine|' + r'arctangent|protect|lowercase|uppercase|entab|detab|connected\?|' + r'browse|launch|stats|get-modes|set-modes|to-local-file|' + r'to-rebol-file|encloak|decloak|create-link|do-browser|bind\?|' + r'hide|draw|show|size-text|textinfo|offset-to-caret|' + r'caret-to-offset|local-request-file|rgb-to-hsv|hsv-to-rgb|' + r'crypt-strength\?|dh-make-key|dh-generate-key|dh-compute-key|' + r'dsa-make-key|dsa-generate-key|dsa-make-signature|' + r'dsa-verify-signature|rsa-make-key|rsa-generate-key|' + r'rsa-encrypt)$', word): + yield match.start(), Name.Builtin, word + elif re.match( + r'(add|subtract|multiply|divide|remainder|power|and~|or~|xor~|' + r'minimum|maximum|negate|complement|absolute|random|head|tail|' + r'next|back|skip|at|pick|first|second|third|fourth|fifth|sixth|' + r'seventh|eighth|ninth|tenth|last|path|find|select|make|to|copy\*|' + r'insert|remove|change|poke|clear|trim|sort|min|max|abs|cp|' + r'copy)$', word): + yield match.start(), Name.Function, word + elif re.match( + r'(error|source|input|license|help|install|echo|Usage|with|func|' + r'throw-on-error|function|does|has|context|probe|\?\?|as-pair|' + r'mod|modulo|round|repend|about|set-net|append|join|rejoin|reform|' + r'remold|charset|array|replace|move|extract|forskip|forall|alter|' + r'first+|also|take|for|forever|dispatch|attempt|what-dir|' + r'change-dir|clean-path|list-dir|dirize|rename|split-path|delete|' + r'make-dir|delete-dir|in-dir|confirm|dump-obj|upgrade|what|' + r'build-tag|process-source|build-markup|decode-cgi|read-cgi|' + r'write-user|save-user|set-user-name|protect-system|parse-xml|' + r'cvs-date|cvs-version|do-boot|get-net-info|desktop|layout|' + r'scroll-para|get-face|alert|set-face|uninstall|unfocus|' + r'request-dir|center-face|do-events|net-error|decode-url|' + r'parse-header|parse-header-date|parse-email-addrs|import-email|' + r'send|build-attach-body|resend|show-popup|hide-popup|open-events|' + r'find-key-face|do-face|viewtop|confine|find-window|' + r'insert-event-func|remove-event-func|inform|dump-pane|dump-face|' + r'flag-face|deflag-face|clear-fields|read-net|vbug|path-thru|' + r'read-thru|load-thru|do-thru|launch-thru|load-image|' + r'request-download|do-face-alt|set-font|set-para|get-style|' + r'set-style|make-face|stylize|choose|hilight-text|hilight-all|' + r'unlight-text|focus|scroll-drag|clear-face|reset-face|scroll-face|' + r'resize-face|load-stock|load-stock-block|notify|request|flash|' + r'request-color|request-pass|request-text|request-list|' + r'request-date|request-file|dbug|editor|link-relative-path|' + r'emailer|parse-error)$', word): + yield match.start(), Keyword.Namespace, word + elif re.match( + r'(halt|quit|do|load|q|recycle|call|run|ask|parse|view|unview|' + r'return|exit|break)$', word): + yield match.start(), Name.Exception, word + elif re.match('REBOL$', word): + yield match.start(), Generic.Heading, word + elif re.match("to-.*", word): + yield match.start(), Keyword, word + elif re.match('(\+|-|\*|/|//|\*\*|and|or|xor|=\?|=|==|<>|<|>|<=|>=)$', + word): + yield match.start(), Operator, word + elif re.match(".*\?$", word): + yield match.start(), Keyword, word + elif re.match(".*\!$", word): + yield match.start(), Keyword.Type, word + elif re.match("'.*", word): + yield match.start(), Name.Variable.Instance, word # lit-word + elif re.match("#.*", word): + yield match.start(), Name.Label, word # issue + elif re.match("%.*", word): + yield match.start(), Name.Decorator, word # file + else: + yield match.start(), Name.Variable, word + + tokens = { + 'root': [ + (r'[^R]+', Comment), + (r'REBOL\s+\[', Generic.Strong, 'script'), + (r'R', Comment) + ], + 'script': [ + (r'\s+', Text), + (r'#"', String.Char, 'char'), + (r'#\{[0-9a-f]*\}', Number.Hex), + (r'2#\{', Number.Hex, 'bin2'), + (r'64#\{[0-9a-z+/=\s]*\}', Number.Hex), + (r'"', String, 'string'), + (r'\{', String, 'string2'), + (r';#+.*\n', Comment.Special), + (r';\*+.*\n', Comment.Preproc), + (r';.*\n', Comment), + (r'%"', Name.Decorator, 'stringFile'), + (r'%[^(^{")\s\[\]]+', Name.Decorator), + (r'[+-]?([a-z]{1,3})?\$\d+(\.\d+)?', Number.Float), # money + (r'[+-]?\d+\:\d+(\:\d+)?(\.\d+)?', String.Other), # time + (r'\d+[\-/][0-9a-z]+[\-/]\d+(\/\d+\:\d+((\:\d+)?' + r'([.\d+]?([+-]?\d+:\d+)?)?)?)?', String.Other), # date + (r'\d+(\.\d+)+\.\d+', Keyword.Constant), # tuple + (r'\d+X\d+', Keyword.Constant), # pair + (r'[+-]?\d+(\'\d+)?([.,]\d*)?E[+-]?\d+', Number.Float), + (r'[+-]?\d+(\'\d+)?[.,]\d*', Number.Float), + (r'[+-]?\d+(\'\d+)?', Number), + (r'[\[\]()]', Generic.Strong), + (r'[a-z]+[^(^{"\s:)]*://[^(^{"\s)]*', Name.Decorator), # url + (r'mailto:[^(^{"@\s)]+@[^(^{"@\s)]+', Name.Decorator), # url + (r'[^(^{"@\s)]+@[^(^{"@\s)]+', Name.Decorator), # email + (r'comment\s"', Comment, 'commentString1'), + (r'comment\s\{', Comment, 'commentString2'), + (r'comment\s\[', Comment, 'commentBlock'), + (r'comment\s[^(\s{"\[]+', Comment), + (r'/[^(^{")\s/[\]]*', Name.Attribute), + (r'([^(^{")\s/[\]]+)(?=[:({"\s/\[\]])', word_callback), + (r'<[\w:.-]*>', Name.Tag), + (r'<[^(<>\s")]+', Name.Tag, 'tag'), + (r'([^(^{")\s]+)', Text), + ], + 'string': [ + (r'[^(^")]+', String), + (escape_re, String.Escape), + (r'[(|)]+', String), + (r'\^.', String.Escape), + (r'"', String, '#pop'), + ], + 'string2': [ + (r'[^(^{})]+', String), + (escape_re, String.Escape), + (r'[(|)]+', String), + (r'\^.', String.Escape), + (r'\{', String, '#push'), + (r'\}', String, '#pop'), + ], + 'stringFile': [ + (r'[^(^")]+', Name.Decorator), + (escape_re, Name.Decorator), + (r'\^.', Name.Decorator), + (r'"', Name.Decorator, '#pop'), + ], + 'char': [ + (escape_re + '"', String.Char, '#pop'), + (r'\^."', String.Char, '#pop'), + (r'."', String.Char, '#pop'), + ], + 'tag': [ + (escape_re, Name.Tag), + (r'"', Name.Tag, 'tagString'), + (r'[^(<>\r\n")]+', Name.Tag), + (r'>', Name.Tag, '#pop'), + ], + 'tagString': [ + (r'[^(^")]+', Name.Tag), + (escape_re, Name.Tag), + (r'[(|)]+', Name.Tag), + (r'\^.', Name.Tag), + (r'"', Name.Tag, '#pop'), + ], + 'tuple': [ + (r'(\d+\.)+', Keyword.Constant), + (r'\d+', Keyword.Constant, '#pop'), + ], + 'bin2': [ + (r'\s+', Number.Hex), + (r'([01]\s*){8}', Number.Hex), + (r'\}', Number.Hex, '#pop'), + ], + 'commentString1': [ + (r'[^(^")]+', Comment), + (escape_re, Comment), + (r'[(|)]+', Comment), + (r'\^.', Comment), + (r'"', Comment, '#pop'), + ], + 'commentString2': [ + (r'[^(^{})]+', Comment), + (escape_re, Comment), + (r'[(|)]+', Comment), + (r'\^.', Comment), + (r'\{', Comment, '#push'), + (r'\}', Comment, '#pop'), + ], + 'commentBlock': [ + (r'\[', Comment, '#push'), + (r'\]', Comment, '#pop'), + (r'"', Comment, "commentString1"), + (r'\{', Comment, "commentString2"), + (r'[^(\[\]"{)]+', Comment), + ], + } + + def analyse_text(text): + """ + Check if code contains REBOL header and so it probably not R code + """ + if re.match(r'^\s*REBOL\s*\[', text, re.IGNORECASE): + # The code starts with REBOL header + return 1.0 + elif re.search(r'\s*REBOL\s*[', text, re.IGNORECASE): + # The code contains REBOL header but also some text before it + return 0.5 + + +class RedLexer(RegexLexer): + """ + A `Red-language `_ lexer. + + .. versionadded:: 2.0 + """ + name = 'Red' + aliases = ['red', 'red/system'] + filenames = ['*.red', '*.reds'] + mimetypes = ['text/x-red', 'text/x-red-system'] + + flags = re.IGNORECASE | re.MULTILINE + + escape_re = r'(?:\^\([0-9a-f]{1,4}\)*)' + + def word_callback(lexer, match): + word = match.group() + + if re.match(".*:$", word): + yield match.start(), Generic.Subheading, word + elif re.match(r'(if|unless|either|any|all|while|until|loop|repeat|' + r'foreach|forall|func|function|does|has|switch|' + r'case|reduce|compose|get|set|print|prin|equal\?|' + r'not-equal\?|strict-equal\?|lesser\?|greater\?|lesser-or-equal\?|' + r'greater-or-equal\?|same\?|not|type\?|stats|' + r'bind|union|replace|charset|routine)$', word): + yield match.start(), Name.Builtin, word + elif re.match(r'(make|random|reflect|to|form|mold|absolute|add|divide|multiply|negate|' + r'power|remainder|round|subtract|even\?|odd\?|and~|complement|or~|xor~|' + r'append|at|back|change|clear|copy|find|head|head\?|index\?|insert|' + r'length\?|next|pick|poke|remove|reverse|select|sort|skip|swap|tail|tail\?|' + r'take|trim|create|close|delete|modify|open|open\?|query|read|rename|' + r'update|write)$', word): + yield match.start(), Name.Function, word + elif re.match(r'(yes|on|no|off|true|false|tab|cr|lf|newline|escape|slash|sp|space|null|' + r'none|crlf|dot|null-byte)$', word): + yield match.start(), Name.Builtin.Pseudo, word + elif re.match(r'(#system-global|#include|#enum|#define|#either|#if|#import|#export|' + r'#switch|#default|#get-definition)$', word): + yield match.start(), Keyword.Namespace, word + elif re.match(r'(system|halt|quit|quit-return|do|load|q|recycle|call|run|ask|parse|' + r'raise-error|return|exit|break|alias|push|pop|probe|\?\?|spec-of|body-of|' + r'quote|forever)$', word): + yield match.start(), Name.Exception, word + elif re.match(r'(action\?|block\?|char\?|datatype\?|file\?|function\?|get-path\?|zero\?|' + r'get-word\?|integer\?|issue\?|lit-path\?|lit-word\?|logic\?|native\?|' + r'op\?|paren\?|path\?|refinement\?|set-path\?|set-word\?|string\?|unset\?|' + r'any-struct\?|none\?|word\?|any-series\?)$', word): + yield match.start(), Keyword, word + elif re.match(r'(JNICALL|stdcall|cdecl|infix)$', word): + yield match.start(), Keyword.Namespace, word + elif re.match("to-.*", word): + yield match.start(), Keyword, word + elif re.match('(\+|-\*\*|-|\*\*|//|/|\*|and|or|xor|=\?|===|==|=|<>|<=|>=|' + '<<<|>>>|<<|>>|<|>%)$', word): + yield match.start(), Operator, word + elif re.match(".*\!$", word): + yield match.start(), Keyword.Type, word + elif re.match("'.*", word): + yield match.start(), Name.Variable.Instance, word # lit-word + elif re.match("#.*", word): + yield match.start(), Name.Label, word # issue + elif re.match("%.*", word): + yield match.start(), Name.Decorator, word # file + elif re.match(":.*", word): + yield match.start(), Generic.Subheading, word # get-word + else: + yield match.start(), Name.Variable, word + + tokens = { + 'root': [ + (r'[^R]+', Comment), + (r'Red/System\s+\[', Generic.Strong, 'script'), + (r'Red\s+\[', Generic.Strong, 'script'), + (r'R', Comment) + ], + 'script': [ + (r'\s+', Text), + (r'#"', String.Char, 'char'), + (r'#\{[0-9a-f\s]*\}', Number.Hex), + (r'2#\{', Number.Hex, 'bin2'), + (r'64#\{[0-9a-z+/=\s]*\}', Number.Hex), + (r'([0-9a-f]+)(h)((\s)|(?=[\[\]{}"()]))', + bygroups(Number.Hex, Name.Variable, Whitespace)), + (r'"', String, 'string'), + (r'\{', String, 'string2'), + (r';#+.*\n', Comment.Special), + (r';\*+.*\n', Comment.Preproc), + (r';.*\n', Comment), + (r'%"', Name.Decorator, 'stringFile'), + (r'%[^(^{")\s\[\]]+', Name.Decorator), + (r'[+-]?([a-z]{1,3})?\$\d+(\.\d+)?', Number.Float), # money + (r'[+-]?\d+\:\d+(\:\d+)?(\.\d+)?', String.Other), # time + (r'\d+[\-/][0-9a-z]+[\-/]\d+(/\d+:\d+((:\d+)?' + r'([\.\d+]?([+-]?\d+:\d+)?)?)?)?', String.Other), # date + (r'\d+(\.\d+)+\.\d+', Keyword.Constant), # tuple + (r'\d+X\d+', Keyword.Constant), # pair + (r'[+-]?\d+(\'\d+)?([.,]\d*)?E[+-]?\d+', Number.Float), + (r'[+-]?\d+(\'\d+)?[.,]\d*', Number.Float), + (r'[+-]?\d+(\'\d+)?', Number), + (r'[\[\]()]', Generic.Strong), + (r'[a-z]+[^(^{"\s:)]*://[^(^{"\s)]*', Name.Decorator), # url + (r'mailto:[^(^{"@\s)]+@[^(^{"@\s)]+', Name.Decorator), # url + (r'[^(^{"@\s)]+@[^(^{"@\s)]+', Name.Decorator), # email + (r'comment\s"', Comment, 'commentString1'), + (r'comment\s\{', Comment, 'commentString2'), + (r'comment\s\[', Comment, 'commentBlock'), + (r'comment\s[^(\s{"\[]+', Comment), + (r'/[^(^{^")\s/[\]]*', Name.Attribute), + (r'([^(^{^")\s/[\]]+)(?=[:({"\s/\[\]])', word_callback), + (r'<[\w:.-]*>', Name.Tag), + (r'<[^(<>\s")]+', Name.Tag, 'tag'), + (r'([^(^{")\s]+)', Text), + ], + 'string': [ + (r'[^(^")]+', String), + (escape_re, String.Escape), + (r'[(|)]+', String), + (r'\^.', String.Escape), + (r'"', String, '#pop'), + ], + 'string2': [ + (r'[^(^{})]+', String), + (escape_re, String.Escape), + (r'[(|)]+', String), + (r'\^.', String.Escape), + (r'\{', String, '#push'), + (r'\}', String, '#pop'), + ], + 'stringFile': [ + (r'[^(^")]+', Name.Decorator), + (escape_re, Name.Decorator), + (r'\^.', Name.Decorator), + (r'"', Name.Decorator, '#pop'), + ], + 'char': [ + (escape_re + '"', String.Char, '#pop'), + (r'\^."', String.Char, '#pop'), + (r'."', String.Char, '#pop'), + ], + 'tag': [ + (escape_re, Name.Tag), + (r'"', Name.Tag, 'tagString'), + (r'[^(<>\r\n")]+', Name.Tag), + (r'>', Name.Tag, '#pop'), + ], + 'tagString': [ + (r'[^(^")]+', Name.Tag), + (escape_re, Name.Tag), + (r'[(|)]+', Name.Tag), + (r'\^.', Name.Tag), + (r'"', Name.Tag, '#pop'), + ], + 'tuple': [ + (r'(\d+\.)+', Keyword.Constant), + (r'\d+', Keyword.Constant, '#pop'), + ], + 'bin2': [ + (r'\s+', Number.Hex), + (r'([01]\s*){8}', Number.Hex), + (r'\}', Number.Hex, '#pop'), + ], + 'commentString1': [ + (r'[^(^")]+', Comment), + (escape_re, Comment), + (r'[(|)]+', Comment), + (r'\^.', Comment), + (r'"', Comment, '#pop'), + ], + 'commentString2': [ + (r'[^(^{})]+', Comment), + (escape_re, Comment), + (r'[(|)]+', Comment), + (r'\^.', Comment), + (r'\{', Comment, '#push'), + (r'\}', Comment, '#pop'), + ], + 'commentBlock': [ + (r'\[', Comment, '#push'), + (r'\]', Comment, '#pop'), + (r'"', Comment, "commentString1"), + (r'\{', Comment, "commentString2"), + (r'[^(\[\]"{)]+', Comment), + ], + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/resource.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/resource.py new file mode 100644 index 0000000000000000000000000000000000000000..f7494904769ee25ccb089ce8adcbe328d527300e --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/resource.py @@ -0,0 +1,85 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.resource + ~~~~~~~~~~~~~~~~~~~~~~~~ + + Lexer for resource definition files. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, bygroups, words +from pygments.token import Comment, String, Number, Operator, Text, \ + Keyword, Name + +__all__ = ['ResourceLexer'] + + +class ResourceLexer(RegexLexer): + """Lexer for `ICU Resource bundles + `_. + + .. versionadded:: 2.0 + """ + name = 'ResourceBundle' + aliases = ['resource', 'resourcebundle'] + filenames = ['*.txt'] + + _types = (':table', ':array', ':string', ':bin', ':import', ':intvector', + ':int', ':alias') + + flags = re.MULTILINE | re.IGNORECASE + tokens = { + 'root': [ + (r'//.*?$', Comment), + (r'"', String, 'string'), + (r'-?\d+', Number.Integer), + (r'[,{}]', Operator), + (r'([^\s{:]+)(\s*)(%s?)' % '|'.join(_types), + bygroups(Name, Text, Keyword)), + (r'\s+', Text), + (words(_types), Keyword), + ], + 'string': [ + (r'(\\x[0-9a-f]{2}|\\u[0-9a-f]{4}|\\U00[0-9a-f]{6}|' + r'\\[0-7]{1,3}|\\c.|\\[abtnvfre\'"?\\]|\\\{|[^"{\\])+', String), + (r'\{', String.Escape, 'msgname'), + (r'"', String, '#pop') + ], + 'msgname': [ + (r'([^{},]+)(\s*)', bygroups(Name, String.Escape), ('#pop', 'message')) + ], + 'message': [ + (r'\{', String.Escape, 'msgname'), + (r'\}', String.Escape, '#pop'), + (r'(,)(\s*)([a-z]+)(\s*\})', + bygroups(Operator, String.Escape, Keyword, String.Escape), '#pop'), + (r'(,)(\s*)([a-z]+)(\s*)(,)(\s*)(offset)(\s*)(:)(\s*)(-?\d+)(\s*)', + bygroups(Operator, String.Escape, Keyword, String.Escape, Operator, + String.Escape, Operator.Word, String.Escape, Operator, + String.Escape, Number.Integer, String.Escape), 'choice'), + (r'(,)(\s*)([a-z]+)(\s*)(,)(\s*)', + bygroups(Operator, String.Escape, Keyword, String.Escape, Operator, + String.Escape), 'choice'), + (r'\s+', String.Escape) + ], + 'choice': [ + (r'(=|<|>|<=|>=|!=)(-?\d+)(\s*\{)', + bygroups(Operator, Number.Integer, String.Escape), 'message'), + (r'([a-z]+)(\s*\{)', bygroups(Keyword.Type, String.Escape), 'str'), + (r'\}', String.Escape, ('#pop', '#pop')), + (r'\s+', String.Escape) + ], + 'str': [ + (r'\}', String.Escape, '#pop'), + (r'\{', String.Escape, 'msgname'), + (r'[^{}]+', String) + ] + } + + def analyse_text(text): + if text.startswith('root:table'): + return 1.0 diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/rnc.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/rnc.py new file mode 100644 index 0000000000000000000000000000000000000000..2f2aacdd25a6be42cfc00728496a57f870376fd5 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/rnc.py @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.rnc + ~~~~~~~~~~~~~~~~~~~ + + Lexer for Relax-NG Compact syntax + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Punctuation + +__all__ = ['RNCCompactLexer'] + + +class RNCCompactLexer(RegexLexer): + """ + For `RelaxNG-compact `_ syntax. + + .. versionadded:: 2.2 + """ + + name = 'Relax-NG Compact' + aliases = ['rnc', 'rng-compact'] + filenames = ['*.rnc'] + + tokens = { + 'root': [ + (r'namespace\b', Keyword.Namespace), + (r'(?:default|datatypes)\b', Keyword.Declaration), + (r'##.*$', Comment.Preproc), + (r'#.*$', Comment.Single), + (r'"[^"]*"', String.Double), + # TODO single quoted strings and escape sequences outside of + # double-quoted strings + (r'(?:element|attribute|mixed)\b', Keyword.Declaration, 'variable'), + (r'(text\b|xsd:[^ ]+)', Keyword.Type, 'maybe_xsdattributes'), + (r'[,?&*=|~]|>>', Operator), + (r'[(){}]', Punctuation), + (r'.', Text), + ], + + # a variable has been declared using `element` or `attribute` + 'variable': [ + (r'[^{]+', Name.Variable), + (r'\{', Punctuation, '#pop'), + ], + + # after an xsd: declaration there may be attributes + 'maybe_xsdattributes': [ + (r'\{', Punctuation, 'xsdattributes'), + (r'\}', Punctuation, '#pop'), + (r'.', Text), + ], + + # attributes take the form { key1 = value1 key2 = value2 ... } + 'xsdattributes': [ + (r'[^ =}]', Name.Attribute), + (r'=', Operator), + (r'"[^"]*"', String.Double), + (r'\}', Punctuation, '#pop'), + (r'.', Text), + ], + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/ruby.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/ruby.py new file mode 100644 index 0000000000000000000000000000000000000000..fe750f1a2fb9bd5cadbdf430d8fc548197cdd21f --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/ruby.py @@ -0,0 +1,519 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.ruby + ~~~~~~~~~~~~~~~~~~~~ + + Lexers for Ruby and related languages. + + :copyright: Copyright 2006-2017 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 +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Error, Generic +from pygments.util import shebang_matches + +__all__ = ['RubyLexer', 'RubyConsoleLexer', 'FancyLexer'] + +line_re = re.compile('.*?\n') + + +RUBY_OPERATORS = ( + '*', '**', '-', '+', '-@', '+@', '/', '%', '&', '|', '^', '`', '~', + '[]', '[]=', '<<', '>>', '<', '<>', '<=>', '>', '>=', '==', '===' +) + + +class RubyLexer(ExtendedRegexLexer): + """ + For `Ruby `_ source code. + """ + + name = 'Ruby' + aliases = ['rb', 'ruby', 'duby'] + filenames = ['*.rb', '*.rbw', 'Rakefile', '*.rake', '*.gemspec', + '*.rbx', '*.duby', 'Gemfile'] + mimetypes = ['text/x-ruby', 'application/x-ruby'] + + 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) == '<<-', match.group(3))) + + ctx.pos = match.start(5) + ctx.end = match.end(5) + # this may find other heredocs + for i, t, v in self.get_tokens_unprocessed(context=ctx): + yield i, t, v + 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.Single), + (r':"', String.Symbol, 'simple-sym'), + (r'([a-zA-Z_]\w*)(:)(?!:)', + bygroups(String.Symbol, Punctuation)), # Since Ruby 1.9 + (r'"', String.Double, 'simple-string'), + (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(Text, 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(Text, 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, Text, Name.Namespace)), + (r'(def)(\s+)', bygroups(Keyword, Text), 'funcname'), + (r'def(?=[*%&^`~+-/\[<>=])', Keyword, 'funcname'), + (r'(class)(\s+)', bygroups(Keyword, Text), '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(Text, 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, Text, Operator)), + (r'(0x[0-9A-Fa-f]+(?:_[0-9A-Fa-f]+)*)(\s*)([/?])?', + bygroups(Number.Hex, Text, Operator)), + (r'(0b[01]+(?:_[01]+)*)(\s*)([/?])?', + bygroups(Number.Bin, Text, Operator)), + (r'([\d]+(?:_\d+)*)(\s*)([/?])?', + bygroups(Number.Integer, Text, 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+', Text) + ], + 'funcname': [ + (r'\(', Punctuation, 'defexpr'), + (r'(?:([a-zA-Z_]\w*)(\.))?' + r'([a-zA-Z_]\w*[!?]?|\*\*?|[-+]@?|' + 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 like: + + .. sourcecode:: rbcon + + irb(main):001:0> a = 1 + => 1 + irb(main):002:0> puts a + 1 + => nil + """ + name = 'Ruby irb session' + aliases = ['rbcon', 'irb'] + mimetypes = ['text/x-ruby-shellsession'] + + _prompt_re = re.compile('irb\([a-zA-Z_]\w*\):\d{3}:\d+[>*"\'] ' + '|>> |\?> ') + + 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: + for item in do_insertions( + insertions, rblexer.get_tokens_unprocessed(curcode)): + yield item + curcode = '' + insertions = [] + yield match.start(), Generic.Output, line + if curcode: + for item in do_insertions( + insertions, rblexer.get_tokens_unprocessed(curcode)): + yield item + + +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. + + .. versionadded:: 1.5 + """ + name = 'Fancy' + filenames = ['*.fy', '*.fancypack'] + aliases = ['fancy', 'fy'] + mimetypes = ['text/x-fancysrc'] + + 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+', Text), + + # 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), + ('[A-Z]\w*', Name.Constant), + ('@[a-zA-Z_]\w*', Name.Variable.Instance), + ('@@[a-zA-Z_]\w*', Name.Variable.Class), + ('@@?', Operator), + ('[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, Text, Operator)), + (r'(0[xX][0-9A-Fa-f]+(?:_[0-9A-Fa-f]+)*)(\s*)([/?])?', + bygroups(Number.Hex, Text, Operator)), + (r'(0[bB][01]+(?:_[01]+)*)(\s*)([/?])?', + bygroups(Number.Bin, Text, Operator)), + (r'([\d]+(?:_\d+)*)(\s*)([/?])?', + bygroups(Number.Integer, Text, Operator)), + (r'\d+([eE][+-]?[0-9]+)|\d+\.\d+([eE][+-]?[0-9]+)?', Number.Float), + (r'\d+', Number.Integer) + ] + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/rust.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/rust.py new file mode 100644 index 0000000000000000000000000000000000000000..6914f54d69b96cf009e228e53a3b46dba0bc2649 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/rust.py @@ -0,0 +1,220 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.rust + ~~~~~~~~~~~~~~~~~~~~ + + Lexers for the Rust language. + + :copyright: Copyright 2006-2017 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.10). + + .. versionadded:: 1.6 + """ + name = 'Rust' + filenames = ['*.rs', '*.rs.in'] + aliases = ['rust'] + mimetypes = ['text/rust'] + + keyword_types = ( + words(('u8', 'u16', 'u32', 'u64', 'i8', 'i16', 'i32', 'i64', + 'usize', 'isize', 'f32', 'f64', 'str', 'bool'), + suffix=r'\b'), + Keyword.Type) + + builtin_types = (words(( + # Reexported core operators + 'Copy', 'Send', 'Sized', 'Sync', + 'Drop', 'Fn', 'FnMut', 'FnOnce', + + # Reexported types and traits + 'Box', + 'ToOwned', + 'Clone', + 'PartialEq', 'PartialOrd', 'Eq', 'Ord', + 'AsRef', 'AsMut', 'Into', 'From', + 'Default', + 'Iterator', 'Extend', 'IntoIterator', + 'DoubleEndedIterator', 'ExactSizeIterator', + 'Option', + 'Some', 'None', + 'Result', + 'Ok', 'Err', + 'SliceConcatExt', + 'String', 'ToString', + 'Vec'), suffix=r'\b'), + Name.Builtin) + + 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', 'box', 'const', 'crate', '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', 'alignof', 'become', 'do', 'final', 'macro', + 'offsetof', 'override', 'priv', 'proc', 'pure', 'sizeof', + 'typeof', 'unsized', 'virtual', 'yield'), suffix=r'\b'), + Keyword.Reserved), + (r'(true|false)\b', Keyword.Constant), + (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, Text, Keyword)), + keyword_types, + (r'self\b', Name.Builtin.Pseudo), + # Prelude (taken from Rust’s src/libstd/prelude.rs) + builtin_types, + # Path seperators, so types don't catch them. + (r'::\b', Text), + # Types in positions. + (r'(?::|->)', Text, 'typename'), + # Labels + (r'(break|continue)(\s*)(\'[A-Za-z_]\w*)?', + bygroups(Keyword, Text.Whitespace, Name.Label)), + # Character Literal + (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 Literal + (r'0b[01_]+', Number.Bin, 'number_lit'), + # Octal Literal + (r'0o[0-7_]+', Number.Oct, 'number_lit'), + # Hexadecimal Literal + (r'0[xX][0-9a-fA-F_]+', Number.Hex, 'number_lit'), + # Decimal Literal + (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 Literal + (r'b"', String, 'bytestring'), + (r'"', String, 'string'), + (r'b?r(#*)".*?"\1', String), + + # Lifetime + (r"""'static""", Name.Builtin), + (r"""'[a-zA-Z_]\w*""", Name.Attribute), + + # Operators and Punctuation + (r'[{}()\[\],.;]', Punctuation), + (r'[+\-*/%&|<>^!~@=:?]', Operator), + + # Identifier + (r'[a-zA-Z_]\w*', Name), + + # Attributes + (r'#!?\[', Comment.Preproc, 'attribute['), + # Macros + (r'([A-Za-z_]\w*)(!)(\s*)([A-Za-z_]\w*)?(\s*)(\{)', + bygroups(Comment.Preproc, Punctuation, Whitespace, Name, + Whitespace, Punctuation), 'macro{'), + (r'([A-Za-z_]\w*)(!)(\s*)([A-Za-z_]\w*)?(\()', + bygroups(Comment.Preproc, Punctuation, Whitespace, Name, + Punctuation), 'macro('), + ], + '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+', Text), + (r'[a-zA-Z_]\w*', Name.Namespace, '#pop'), + default('#pop'), + ], + 'funcname': [ + (r'\s+', Text), + (r'[a-zA-Z_]\w*', Name.Function, '#pop'), + default('#pop'), + ], + 'typename': [ + (r'\s+', Text), + (r'&', Keyword.Pseudo), + builtin_types, + keyword_types, + (r'[a-zA-Z_]\w*', Name.Class, '#pop'), + 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'), + ], + 'macro{': [ + (r'\{', Operator, '#push'), + (r'\}', Operator, '#pop'), + ], + 'macro(': [ + (r'\(', Operator, '#push'), + (r'\)', Operator, '#pop'), + ], + 'attribute_common': [ + (r'"', String, 'string'), + (r'\[', Comment.Preproc, 'attribute['), + (r'\(', Comment.Preproc, 'attribute('), + ], + 'attribute[': [ + include('attribute_common'), + (r'\];?', Comment.Preproc, '#pop'), + (r'[^"\]]+', Comment.Preproc), + ], + 'attribute(': [ + include('attribute_common'), + (r'\);?', Comment.Preproc, '#pop'), + (r'[^")]+', Comment.Preproc), + ], + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/sas.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/sas.py new file mode 100644 index 0000000000000000000000000000000000000000..3747ed9ab8af521565d698d2b59e204b48e596d7 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/sas.py @@ -0,0 +1,228 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.sas + ~~~~~~~~~~~~~~~~~~~ + + Lexer for SAS. + + :copyright: Copyright 2006-2017 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. + + .. versionadded:: 2.2 + """ + # Syntax from syntax/sas.vim by James Kidd + + name = 'SAS' + aliases = ['sas'] + filenames = ['*.SAS', '*.sas'] + mimetypes = ['text/x-sas', 'text/sas', 'application/x-sas'] + 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/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/snobol.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/snobol.py new file mode 100644 index 0000000000000000000000000000000000000000..f6e12fd26761d41d16e71260f679a6a86263f7a6 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/snobol.py @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.snobol + ~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for the SNOBOL language. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, bygroups +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation + +__all__ = ['SnobolLexer'] + + +class SnobolLexer(RegexLexer): + """ + Lexer for the SNOBOL4 programming language. + + Recognizes the common ASCII equivalents of the original SNOBOL4 operators. + Does not require spaces around binary operators. + + .. versionadded:: 1.5 + """ + + name = "Snobol" + aliases = ["snobol"] + filenames = ['*.snobol'] + mimetypes = ['text/x-snobol'] + + tokens = { + # root state, start of line + # comments, continuation lines, and directives start in column 1 + # as do labels + 'root': [ + (r'\*.*\n', Comment), + (r'[+.] ', Punctuation, 'statement'), + (r'-.*\n', Comment), + (r'END\s*\n', Name.Label, 'heredoc'), + (r'[A-Za-z$][\w$]*', Name.Label, 'statement'), + (r'\s+', Text, 'statement'), + ], + # statement state, line after continuation or label + 'statement': [ + (r'\s*\n', Text, '#pop'), + (r'\s+', Text), + (r'(?<=[^\w.])(LT|LE|EQ|NE|GE|GT|INTEGER|IDENT|DIFFER|LGT|SIZE|' + r'REPLACE|TRIM|DUPL|REMDR|DATE|TIME|EVAL|APPLY|OPSYN|LOAD|UNLOAD|' + r'LEN|SPAN|BREAK|ANY|NOTANY|TAB|RTAB|REM|POS|RPOS|FAIL|FENCE|' + r'ABORT|ARB|ARBNO|BAL|SUCCEED|INPUT|OUTPUT|TERMINAL)(?=[^\w.])', + Name.Builtin), + (r'[A-Za-z][\w.]*', Name), + # ASCII equivalents of original operators + # | for the EBCDIC equivalent, ! likewise + # \ for EBCDIC negation + (r'\*\*|[?$.!%*/#+\-@|&\\=]', Operator), + (r'"[^"]*"', String), + (r"'[^']*'", String), + # Accept SPITBOL syntax for real numbers + # as well as Macro SNOBOL4 + (r'[0-9]+(?=[^.EeDd])', Number.Integer), + (r'[0-9]+(\.[0-9]*)?([EDed][-+]?[0-9]+)?', Number.Float), + # Goto + (r':', Punctuation, 'goto'), + (r'[()<>,;]', Punctuation), + ], + # Goto block + 'goto': [ + (r'\s*\n', Text, "#pop:2"), + (r'\s+', Text), + (r'F|S', Keyword), + (r'(\()([A-Za-z][\w.]*)(\))', + bygroups(Punctuation, Name.Label, Punctuation)) + ], + # everything after the END statement is basically one + # big heredoc. + 'heredoc': [ + (r'.*\n', String.Heredoc) + ] + } diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/special.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/special.py new file mode 100644 index 0000000000000000000000000000000000000000..6e076b0ce7b5c9c4b963b9995e19d5862b3f4b4b --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/special.py @@ -0,0 +1,103 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.special + ~~~~~~~~~~~~~~~~~~~~~~~ + + Special lexers. + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import Lexer +from pygments.token import Token, Error, Text +from pygments.util import get_choice_opt, text_type, BytesIO + + +__all__ = ['TextLexer', 'RawTokenLexer'] + + +class TextLexer(Lexer): + """ + "Null" lexer, doesn't highlight anything. + """ + name = 'Text only' + aliases = ['text'] + filenames = ['*.txt'] + mimetypes = ['text/plain'] + priority = 0.01 + + def get_tokens_unprocessed(self, text): + yield 0, Text, text + + def analyse_text(text): + return TextLexer.priority + +_ttype_cache = {} + +line_re = re.compile(b'.*?\n') + + +class RawTokenLexer(Lexer): + """ + Recreate a token stream formatted with the `RawTokenFormatter`. This + lexer raises exceptions during parsing if the token stream in the + file is malformed. + + Additional options accepted: + + `compress` + If set to ``"gz"`` or ``"bz2"``, decompress the token stream with + the given compression algorithm before lexing (default: ``""``). + """ + name = 'Raw token data' + aliases = ['raw'] + filenames = [] + mimetypes = ['application/x-pygments-tokens'] + + def __init__(self, **options): + self.compress = get_choice_opt(options, 'compress', + ['', 'none', 'gz', 'bz2'], '') + Lexer.__init__(self, **options) + + def get_tokens(self, text): + if isinstance(text, text_type): + # raw token stream never has any non-ASCII characters + text = text.encode('ascii') + if self.compress == 'gz': + import gzip + gzipfile = gzip.GzipFile('', 'rb', 9, BytesIO(text)) + text = gzipfile.read() + elif self.compress == 'bz2': + import bz2 + text = bz2.decompress(text) + + # do not call Lexer.get_tokens() because we do not want Unicode + # decoding to occur, and stripping is not optional. + text = text.strip(b'\n') + b'\n' + for i, t, v in self.get_tokens_unprocessed(text): + yield t, v + + def get_tokens_unprocessed(self, text): + length = 0 + for match in line_re.finditer(text): + try: + ttypestr, val = match.group().split(b'\t', 1) + except ValueError: + val = match.group().decode('ascii', 'replace') + ttype = Error + else: + ttype = _ttype_cache.get(ttypestr) + if not ttype: + ttype = Token + ttypes = ttypestr.split('.')[1:] + for ttype_ in ttypes: + if not ttype_ or not ttype_[0].isupper(): + raise ValueError('malformed token name') + ttype = getattr(ttype, ttype_) + _ttype_cache[ttypestr] = ttype + val = val[2:-2].decode('unicode-escape') + yield length, ttype, val + length += len(val) diff --git a/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/sql.py b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/sql.py new file mode 100644 index 0000000000000000000000000000000000000000..7507c0fc80f9891ff16378de93a9362f2b17b904 --- /dev/null +++ b/evalkit_cambrian/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/sql.py @@ -0,0 +1,681 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.sql + ~~~~~~~~~~~~~~~~~~~ + + Lexers for various SQL dialects and related interactive sessions. + + Postgres specific lexers: + + `PostgresLexer` + A SQL lexer for the PostgreSQL dialect. Differences w.r.t. the SQL + lexer are: + + - keywords and data types list parsed from the PG docs (run the + `_postgres_builtins` module to update them); + - Content of $-strings parsed using a specific lexer, e.g. the content + of a PL/Python function is parsed using the Python lexer; + - parse PG specific constructs: E-strings, $-strings, U&-strings, + different operators and punctuation. + + `PlPgsqlLexer` + A lexer for the PL/pgSQL language. Adds a few specific construct on + top of the PG SQL lexer (such as <