diff options
author | ilezhankin <ilezhankin@yandex-team.ru> | 2022-02-10 16:45:56 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:56 +0300 |
commit | 62a805381e41500fbc7914c37c71ab040a098f4e (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /contrib/python/Pygments/py3/pygments/lexers/lisp.py | |
parent | 1d125034f06575234f83f24f08677955133f140e (diff) | |
download | ydb-62a805381e41500fbc7914c37c71ab040a098f4e.tar.gz |
Restoring authorship annotation for <ilezhankin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/python/Pygments/py3/pygments/lexers/lisp.py')
-rw-r--r-- | contrib/python/Pygments/py3/pygments/lexers/lisp.py | 3100 |
1 files changed, 1550 insertions, 1550 deletions
diff --git a/contrib/python/Pygments/py3/pygments/lexers/lisp.py b/contrib/python/Pygments/py3/pygments/lexers/lisp.py index 00b7b4e2d0..5628e336ca 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/lisp.py +++ b/contrib/python/Pygments/py3/pygments/lexers/lisp.py @@ -1,100 +1,100 @@ -""" - pygments.lexers.lisp - ~~~~~~~~~~~~~~~~~~~~ - - Lexers for Lispy languages. - +""" + pygments.lexers.lisp + ~~~~~~~~~~~~~~~~~~~~ + + Lexers for Lispy languages. + :copyright: Copyright 2006-2021 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', + :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', 'FennelLexer'] - - -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'] - + + +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'] + flags = re.DOTALL | re.MULTILINE - # 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-ci>=?', 'char-ci>?', 'char-downcase', - 'char-lower-case?', 'char-numeric?', 'char-ready?', 'char-upcase', - 'char-upper-case?', 'char-whitespace?', 'char<=?', 'char<?', '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-ci>=?', 'string-ci>?', - 'string-copy', 'string-fill!', 'string-length', 'string-ref', - 'string-set!', 'string<=?', 'string<?', '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!$%&*+,/:<=>?@^~|-]+' - + # 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-ci>=?', 'char-ci>?', 'char-downcase', + 'char-lower-case?', 'char-numeric?', 'char-ready?', 'char-upcase', + 'char-upper-case?', 'char-whitespace?', 'char<=?', 'char<?', '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-ci>=?', 'string-ci>?', + 'string-copy', 'string-fill!', 'string-length', 'string-ref', + 'string-set!', 'string<=?', 'string<?', '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!$%&*+,/:<=>?@^~|-]+' + # The 'scheme-root' state parses as many expressions as needed, always # delegating to the 'scheme-value' state. The latter parses one complete # expression and immediately pops back. This is needed for the LilyPondLexer. @@ -106,67 +106,67 @@ class SchemeLexer(RegexLexer): # work to 'scheme-root'; this is so that LilyPondLexer can inherit # 'scheme-root' and redefine 'root'. - tokens = { - 'root': [ + tokens = { + 'root': [ default('scheme-root'), ], 'scheme-root': [ default('value'), ], 'value': [ - # the comments - # and going to the end of the line + # 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 + # 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, '#pop'), (r'-?\d+', Number.Integer, '#pop'), - # 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 + # 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, "#pop"), (r"'" + valid_name, String.Symbol, "#pop"), (r"#\\([()/'\"._!§$%& ?=+-]|[a-zA-Z0-9]+)", String.Char, "#pop"), - - # constants + + # constants (r'(#t|#f)', Name.Constant, '#pop'), - - # special operators - (r"('|#|`|,@|,|\.)", Operator), - - # highlight the keywords - ('(%s)' % '|'.join(re.escape(entry) + ' ' for entry in keywords), + + # special operators + (r"('|#|`|,@|,|\.)", Operator), + + # highlight the keywords + ('(%s)' % '|'.join(re.escape(entry) + ' ' for entry in keywords), Keyword, '#pop'), - - # first variable in a quoted string like - # '(this is syntactic sugar) + + # first variable in a quoted string like + # '(this is syntactic sugar) (r"(?<='\()" + valid_name, Name.Variable, '#pop'), (r"(?<=#\()" + valid_name, Name.Variable, '#pop'), - - # highlight the builtins + + # highlight the builtins (r"(?<=\()(%s)" % '|'.join(re.escape(entry) + ' ' for entry in builtins), Name.Builtin, '#pop'), - - # the remaining functions + + # the remaining functions (r'(?<=\()' + valid_name, Name.Function, '#pop'), - # find the remaining variables + # find the remaining variables (valid_name, Name.Variable, '#pop'), - - # the famous parentheses! + + # the famous parentheses! # Push scheme-root to enter a state that will parse as many things # as needed in the parentheses. @@ -175,327 +175,327 @@ class SchemeLexer(RegexLexer): # we get back to a state parsing expressions as needed in the # enclosing context. (r'\)|\]', Punctuation, '#pop:3'), - ], - 'multiline-comment': [ - (r'#\|', Comment.Multiline, '#push'), - (r'\|#', Comment.Multiline, '#pop'), - (r'[^|#]+', Comment.Multiline), - (r'[|#]', Comment.Multiline), - ], - 'commented-form': [ - (r'\(', Comment, '#push'), - (r'\)', Comment, '#pop'), - (r'[^()]+', Comment), - ], - } - - -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 + ], + '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 + r'\s*\(', Comment.Preproc, 'commented-form'), - - # read-time conditional - (r'#[+-]', Operator), - - # special operators that should have been parsed already - (r'(,@|,|\.)', Operator), - - # special constants - (r'(t|nil)' + terminated, Name.Constant), - - # functions and variables + + # read-time conditional + (r'#[+-]', Operator), + + # special operators that should have been parsed already + (r'(,@|,|\.)', Operator), + + # special constants + (r'(t|nil)' + terminated, Name.Constant), + + # functions and variables (r'\*' + symbol + r'\*', Name.Variable.Global), - (symbol, Name.Variable), - - # parentheses - (r'\(', Punctuation, 'body'), - (r'\)', Punctuation, '#pop'), - ], - } - - -class HyLexer(RegexLexer): - """ - Lexer for `Hy <http://hylang.org/>`_ 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 + (symbol, Name.Variable), + + # parentheses + (r'\(', Punctuation, 'body'), + (r'\)', Punctuation, '#pop'), + ], + } + + +class HyLexer(RegexLexer): + """ + Lexer for `Hy <http://hylang.org/>`_ 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 + + 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 <http://racket-lang.org/>`_ 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 = ( + (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 <http://racket-lang.org/>`_ 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 = ( '#%app', '#%datum', '#%declare', '#%expression', '#%module-begin', '#%plain-app', '#%plain-lambda', '#%plain-module-begin', '#%printing-module-begin', '#%provide', '#%require', @@ -589,10 +589,10 @@ class RacketLexer(RegexLexer): 'when', 'with-continuation-mark', 'with-contract', 'with-contract-continuation-mark', 'with-handlers', 'with-handlers*', 'with-method', 'with-syntax', 'λ' - ) - - # Generated by example.rkt - _builtins = ( + ) + + # Generated by example.rkt + _builtins = ( '*', '*list/c', '+', '-', '/', '<', '</c', '<=', '<=/c', '=', '=/c', '>', '>/c', '>=', '>=/c', 'abort-current-continuation', 'abs', 'absolute-path?', 'acos', 'add-between', 'add1', 'alarm-evt', @@ -1269,959 +1269,959 @@ class RacketLexer(RegexLexer): 'write-special-avail*', 'write-special-evt', 'write-string', 'write-to-file', 'writeln', 'xor', 'zero?', '~.a', '~.s', '~.v', '~a', '~e', '~r', '~s', '~v' - ) - - _opening_parenthesis = r'[([{]' - _closing_parenthesis = r'[)\]}]' - _delimiters = r'()[\]{}",\'`;\s' + ) + + _opening_parenthesis = r'[([{]' + _closing_parenthesis = r'[)\]}]' + _delimiters = r'()[\]{}",\'`;\s' _symbol = r'(?:\|[^|]*\||\\[\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), + _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), (r';[^\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'#\|', 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'(?iu)(#[ei])?#b%s' % _symbol, Number.Bin, '#pop'), - - # #o + + # #o (r'(?iu)(#[ei])?#o%s' % _symbol, Number.Oct, '#pop'), - - # #x + + # #x (r'(?iu)(#[ei])?#x%s' % _symbol, Number.Hex, '#pop'), - - # #i is always inexact, i.e. float + + # #i is always inexact, i.e. float (r'(?iu)(#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) + + # 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'(?u)#:%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): - """ + + # 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. <http://www.newlisp.org/>`_ source code (version 10.3.0). - - .. versionadded:: 1.5 - """ - - name = 'NewLisp' - aliases = ['newlisp'] + + .. 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 + 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' + + # 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-lisp', 'elisp', 'emacs'] - 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) - + 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 = { - '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', + 'atomic-change-group', 'case', 'block', 'cl-block', 'cl-callf', 'cl-callf2', + 'cl-case', 'cl-decf', 'cl-declaim', 'cl-declare', + 'cl-define-compiler-macro', 'cl-defmacro', 'cl-defstruct', + 'cl-defsubst', 'cl-deftype', 'cl-defun', 'cl-destructuring-bind', + 'cl-do', 'cl-do*', 'cl-do-all-symbols', 'cl-do-symbols', 'cl-dolist', + 'cl-dotimes', 'cl-ecase', 'cl-etypecase', 'eval-when', 'cl-eval-when', 'cl-flet', + 'cl-flet*', 'cl-function', 'cl-incf', 'cl-labels', 'cl-letf', + 'cl-letf*', 'cl-load-time-value', 'cl-locally', 'cl-loop', + 'cl-macrolet', 'cl-multiple-value-bind', 'cl-multiple-value-setq', + 'cl-progv', 'cl-psetf', 'cl-psetq', 'cl-pushnew', 'cl-remf', + 'cl-return', 'cl-return-from', 'cl-rotatef', 'cl-shiftf', + 'cl-symbol-macrolet', 'cl-tagbody', 'cl-the', 'cl-typecase', + 'combine-after-change-calls', 'condition-case-unless-debug', 'decf', + 'declaim', 'declare', 'declare-function', 'def-edebug-spec', + 'defadvice', 'defclass', 'defcustom', 'defface', 'defgeneric', + 'defgroup', 'define-advice', 'define-alternatives', + 'define-compiler-macro', 'define-derived-mode', 'define-generic-mode', + 'define-global-minor-mode', 'define-globalized-minor-mode', + 'define-minor-mode', 'define-modify-macro', + 'define-obsolete-face-alias', 'define-obsolete-function-alias', + 'define-obsolete-variable-alias', 'define-setf-expander', + 'define-skeleton', 'defmacro', 'defmethod', 'defsetf', 'defstruct', + 'defsubst', 'deftheme', 'deftype', 'defun', 'defvar-local', + 'delay-mode-hooks', 'destructuring-bind', 'do', 'do*', + 'do-all-symbols', 'do-symbols', 'dolist', 'dont-compile', 'dotimes', + 'dotimes-with-progress-reporter', 'ecase', 'ert-deftest', 'etypecase', + 'eval-and-compile', 'eval-when-compile', 'flet', 'ignore-errors', + 'incf', 'labels', 'lambda', 'letrec', 'lexical-let', 'lexical-let*', + 'loop', 'multiple-value-bind', 'multiple-value-setq', 'noreturn', + 'oref', 'oref-default', 'oset', 'oset-default', 'pcase', + 'pcase-defmacro', 'pcase-dolist', 'pcase-exhaustive', 'pcase-let', + 'pcase-let*', 'pop', 'psetf', 'psetq', 'push', 'pushnew', 'remf', + 'return', 'rotatef', 'rx', 'save-match-data', 'save-selected-window', + 'save-window-excursion', 'setf', 'setq-local', 'shiftf', + 'track-mouse', 'typecase', 'unless', 'use-package', 'when', + 'while-no-input', 'with-case-table', 'with-category-table', + 'with-coding-priority', 'with-current-buffer', 'with-demoted-errors', + 'with-eval-after-load', 'with-file-modes', 'with-local-quit', + 'with-output-to-string', 'with-output-to-temp-buffer', + 'with-parsed-tramp-file-name', 'with-selected-frame', + 'with-selected-window', 'with-silent-modifications', 'with-slots', + 'with-syntax-table', 'with-temp-buffer', 'with-temp-file', + 'with-temp-message', 'with-timeout', 'with-tramp-connection-property', + 'with-tramp-file-property', 'with-tramp-progress-reporter', + 'with-wrapper-hook', 'load-time-value', 'locally', 'macrolet', 'progv', + 'return-from', } - + special_forms = { - 'and', 'catch', 'cond', 'condition-case', 'defconst', 'defvar', - 'function', 'if', 'interactive', 'let', 'let*', 'or', 'prog1', - 'prog2', 'progn', 'quote', 'save-current-buffer', 'save-excursion', - 'save-restriction', 'setq', 'setq-default', 'subr-arity', - 'unwind-protect', 'while', + 'and', 'catch', 'cond', 'condition-case', 'defconst', 'defvar', + 'function', 'if', 'interactive', 'let', 'let*', 'or', 'prog1', + 'prog2', 'progn', 'quote', 'save-current-buffer', 'save-excursion', + 'save-restriction', 'setq', 'setq-default', 'subr-arity', + 'unwind-protect', 'while', } - + builtin_function = { - '%', '*', '+', '-', '/', '/=', '1+', '1-', '<', '<=', '=', '>', '>=', - 'Snarf-documentation', 'abort-recursive-edit', 'abs', - 'accept-process-output', 'access-file', 'accessible-keymaps', 'acos', - 'active-minibuffer-window', 'add-face-text-property', - 'add-name-to-file', 'add-text-properties', 'all-completions', - 'append', 'apply', 'apropos-internal', 'aref', 'arrayp', 'aset', - 'ash', 'asin', 'assoc', 'assoc-string', 'assq', 'atan', 'atom', - 'autoload', 'autoload-do-load', 'backtrace', 'backtrace--locals', - 'backtrace-debug', 'backtrace-eval', 'backtrace-frame', - 'backward-char', 'backward-prefix-chars', 'barf-if-buffer-read-only', - 'base64-decode-region', 'base64-decode-string', - 'base64-encode-region', 'base64-encode-string', 'beginning-of-line', - 'bidi-find-overridden-directionality', 'bidi-resolved-levels', - 'bitmap-spec-p', 'bobp', 'bolp', 'bool-vector', - 'bool-vector-count-consecutive', 'bool-vector-count-population', - 'bool-vector-exclusive-or', 'bool-vector-intersection', - 'bool-vector-not', 'bool-vector-p', 'bool-vector-set-difference', - 'bool-vector-subsetp', 'bool-vector-union', 'boundp', - 'buffer-base-buffer', 'buffer-chars-modified-tick', - 'buffer-enable-undo', 'buffer-file-name', 'buffer-has-markers-at', - 'buffer-list', 'buffer-live-p', 'buffer-local-value', - 'buffer-local-variables', 'buffer-modified-p', 'buffer-modified-tick', - 'buffer-name', 'buffer-size', 'buffer-string', 'buffer-substring', - 'buffer-substring-no-properties', 'buffer-swap-text', 'bufferp', - 'bury-buffer-internal', 'byte-code', 'byte-code-function-p', - 'byte-to-position', 'byte-to-string', 'byteorder', - 'call-interactively', 'call-last-kbd-macro', 'call-process', - 'call-process-region', 'cancel-kbd-macro-events', 'capitalize', - 'capitalize-region', 'capitalize-word', 'car', 'car-less-than-car', - 'car-safe', 'case-table-p', 'category-docstring', - 'category-set-mnemonics', 'category-table', 'category-table-p', - 'ccl-execute', 'ccl-execute-on-string', 'ccl-program-p', 'cdr', - 'cdr-safe', 'ceiling', 'char-after', 'char-before', - 'char-category-set', 'char-charset', 'char-equal', 'char-or-string-p', - 'char-resolve-modifiers', 'char-syntax', 'char-table-extra-slot', - 'char-table-p', 'char-table-parent', 'char-table-range', - 'char-table-subtype', 'char-to-string', 'char-width', 'characterp', - 'charset-after', 'charset-id-internal', 'charset-plist', - 'charset-priority-list', 'charsetp', 'check-coding-system', - 'check-coding-systems-region', 'clear-buffer-auto-save-failure', - 'clear-charset-maps', 'clear-face-cache', 'clear-font-cache', - 'clear-image-cache', 'clear-string', 'clear-this-command-keys', - 'close-font', 'clrhash', 'coding-system-aliases', - 'coding-system-base', 'coding-system-eol-type', 'coding-system-p', - 'coding-system-plist', 'coding-system-priority-list', - 'coding-system-put', 'color-distance', 'color-gray-p', - 'color-supported-p', 'combine-after-change-execute', - 'command-error-default-function', 'command-remapping', 'commandp', - 'compare-buffer-substrings', 'compare-strings', - 'compare-window-configurations', 'completing-read', - 'compose-region-internal', 'compose-string-internal', - 'composition-get-gstring', 'compute-motion', 'concat', 'cons', - 'consp', 'constrain-to-field', 'continue-process', - 'controlling-tty-p', 'coordinates-in-window-p', 'copy-alist', - 'copy-category-table', 'copy-file', 'copy-hash-table', 'copy-keymap', - 'copy-marker', 'copy-sequence', 'copy-syntax-table', 'copysign', - 'cos', 'current-active-maps', 'current-bidi-paragraph-direction', - 'current-buffer', 'current-case-table', 'current-column', - 'current-global-map', 'current-idle-time', 'current-indentation', - 'current-input-mode', 'current-local-map', 'current-message', - 'current-minor-mode-maps', 'current-time', 'current-time-string', - 'current-time-zone', 'current-window-configuration', - 'cygwin-convert-file-name-from-windows', - 'cygwin-convert-file-name-to-windows', 'daemon-initialized', - 'daemonp', 'dbus--init-bus', 'dbus-get-unique-name', - 'dbus-message-internal', 'debug-timer-check', 'declare-equiv-charset', - 'decode-big5-char', 'decode-char', 'decode-coding-region', - 'decode-coding-string', 'decode-sjis-char', 'decode-time', - 'default-boundp', 'default-file-modes', 'default-printer-name', - 'default-toplevel-value', 'default-value', 'define-category', - 'define-charset-alias', 'define-charset-internal', - 'define-coding-system-alias', 'define-coding-system-internal', - 'define-fringe-bitmap', 'define-hash-table-test', 'define-key', - 'define-prefix-command', 'delete', - 'delete-all-overlays', 'delete-and-extract-region', 'delete-char', - 'delete-directory-internal', 'delete-field', 'delete-file', - 'delete-frame', 'delete-other-windows-internal', 'delete-overlay', - 'delete-process', 'delete-region', 'delete-terminal', - 'delete-window-internal', 'delq', 'describe-buffer-bindings', - 'describe-vector', 'destroy-fringe-bitmap', 'detect-coding-region', - 'detect-coding-string', 'ding', 'directory-file-name', - 'directory-files', 'directory-files-and-attributes', 'discard-input', - 'display-supports-face-attributes-p', 'do-auto-save', 'documentation', - 'documentation-property', 'downcase', 'downcase-region', - 'downcase-word', 'draw-string', 'dump-colors', 'dump-emacs', - 'dump-face', 'dump-frame-glyph-matrix', 'dump-glyph-matrix', - 'dump-glyph-row', 'dump-redisplay-history', 'dump-tool-bar-row', - 'elt', 'emacs-pid', 'encode-big5-char', 'encode-char', - 'encode-coding-region', 'encode-coding-string', 'encode-sjis-char', - 'encode-time', 'end-kbd-macro', 'end-of-line', 'eobp', 'eolp', 'eq', - 'eql', 'equal', 'equal-including-properties', 'erase-buffer', - 'error-message-string', 'eval', 'eval-buffer', 'eval-region', - 'event-convert-list', 'execute-kbd-macro', 'exit-recursive-edit', - 'exp', 'expand-file-name', 'expt', 'external-debugging-output', - 'face-attribute-relative-p', 'face-attributes-as-vector', 'face-font', - 'fboundp', 'fceiling', 'fetch-bytecode', 'ffloor', - 'field-beginning', 'field-end', 'field-string', - 'field-string-no-properties', 'file-accessible-directory-p', - 'file-acl', 'file-attributes', 'file-attributes-lessp', - 'file-directory-p', 'file-executable-p', 'file-exists-p', - 'file-locked-p', 'file-modes', 'file-name-absolute-p', - 'file-name-all-completions', 'file-name-as-directory', - 'file-name-completion', 'file-name-directory', - 'file-name-nondirectory', 'file-newer-than-file-p', 'file-readable-p', - 'file-regular-p', 'file-selinux-context', 'file-symlink-p', - 'file-system-info', 'file-system-info', 'file-writable-p', - 'fillarray', 'find-charset-region', 'find-charset-string', - 'find-coding-systems-region-internal', 'find-composition-internal', - 'find-file-name-handler', 'find-font', 'find-operation-coding-system', - 'float', 'float-time', 'floatp', 'floor', 'fmakunbound', - 'following-char', 'font-at', 'font-drive-otf', 'font-face-attributes', - 'font-family-list', 'font-get', 'font-get-glyphs', - 'font-get-system-font', 'font-get-system-normal-font', 'font-info', - 'font-match-p', 'font-otf-alternates', 'font-put', - 'font-shape-gstring', 'font-spec', 'font-variation-glyphs', - 'font-xlfd-name', 'fontp', 'fontset-font', 'fontset-info', - 'fontset-list', 'fontset-list-all', 'force-mode-line-update', - 'force-window-update', 'format', 'format-mode-line', - 'format-network-address', 'format-time-string', 'forward-char', - 'forward-comment', 'forward-line', 'forward-word', - 'frame-border-width', 'frame-bottom-divider-width', - 'frame-can-run-window-configuration-change-hook', 'frame-char-height', - 'frame-char-width', 'frame-face-alist', 'frame-first-window', - 'frame-focus', 'frame-font-cache', 'frame-fringe-width', 'frame-list', - 'frame-live-p', 'frame-or-buffer-changed-p', 'frame-parameter', - 'frame-parameters', 'frame-pixel-height', 'frame-pixel-width', - 'frame-pointer-visible-p', 'frame-right-divider-width', - 'frame-root-window', 'frame-scroll-bar-height', - 'frame-scroll-bar-width', 'frame-selected-window', 'frame-terminal', - 'frame-text-cols', 'frame-text-height', 'frame-text-lines', - 'frame-text-width', 'frame-total-cols', 'frame-total-lines', - 'frame-visible-p', 'framep', 'frexp', 'fringe-bitmaps-at-pos', - 'fround', 'fset', 'ftruncate', 'funcall', 'funcall-interactively', - 'function-equal', 'functionp', 'gap-position', 'gap-size', - 'garbage-collect', 'gc-status', 'generate-new-buffer-name', 'get', - 'get-buffer', 'get-buffer-create', 'get-buffer-process', - 'get-buffer-window', 'get-byte', 'get-char-property', - 'get-char-property-and-overlay', 'get-file-buffer', 'get-file-char', - 'get-internal-run-time', 'get-load-suffixes', 'get-pos-property', - 'get-process', 'get-screen-color', 'get-text-property', - 'get-unicode-property-internal', 'get-unused-category', - 'get-unused-iso-final-char', 'getenv-internal', 'gethash', - 'gfile-add-watch', 'gfile-rm-watch', 'global-key-binding', - 'gnutls-available-p', 'gnutls-boot', 'gnutls-bye', 'gnutls-deinit', - 'gnutls-error-fatalp', 'gnutls-error-string', 'gnutls-errorp', - 'gnutls-get-initstage', 'gnutls-peer-status', - 'gnutls-peer-status-warning-describe', 'goto-char', 'gpm-mouse-start', - 'gpm-mouse-stop', 'group-gid', 'group-real-gid', - 'handle-save-session', 'handle-switch-frame', 'hash-table-count', - 'hash-table-p', 'hash-table-rehash-size', - 'hash-table-rehash-threshold', 'hash-table-size', 'hash-table-test', - 'hash-table-weakness', 'iconify-frame', 'identity', 'image-flush', - 'image-mask-p', 'image-metadata', 'image-size', 'imagemagick-types', - 'imagep', 'indent-to', 'indirect-function', 'indirect-variable', - 'init-image-library', 'inotify-add-watch', 'inotify-rm-watch', - 'input-pending-p', 'insert', 'insert-and-inherit', - 'insert-before-markers', 'insert-before-markers-and-inherit', - 'insert-buffer-substring', 'insert-byte', 'insert-char', - 'insert-file-contents', 'insert-startup-screen', 'int86', - 'integer-or-marker-p', 'integerp', 'interactive-form', 'intern', - 'intern-soft', 'internal--track-mouse', 'internal-char-font', - 'internal-complete-buffer', 'internal-copy-lisp-face', - 'internal-default-process-filter', - 'internal-default-process-sentinel', 'internal-describe-syntax-value', - 'internal-event-symbol-parse-modifiers', - 'internal-face-x-get-resource', 'internal-get-lisp-face-attribute', - 'internal-lisp-face-attribute-values', 'internal-lisp-face-empty-p', - 'internal-lisp-face-equal-p', 'internal-lisp-face-p', - 'internal-make-lisp-face', 'internal-make-var-non-special', - 'internal-merge-in-global-face', - 'internal-set-alternative-font-family-alist', - 'internal-set-alternative-font-registry-alist', - 'internal-set-font-selection-order', - 'internal-set-lisp-face-attribute', - 'internal-set-lisp-face-attribute-from-resource', - 'internal-show-cursor', 'internal-show-cursor-p', 'interrupt-process', - 'invisible-p', 'invocation-directory', 'invocation-name', 'isnan', - 'iso-charset', 'key-binding', 'key-description', - 'keyboard-coding-system', 'keymap-parent', 'keymap-prompt', 'keymapp', - 'keywordp', 'kill-all-local-variables', 'kill-buffer', 'kill-emacs', - 'kill-local-variable', 'kill-process', 'last-nonminibuffer-frame', - 'lax-plist-get', 'lax-plist-put', 'ldexp', 'length', - 'libxml-parse-html-region', 'libxml-parse-xml-region', - 'line-beginning-position', 'line-end-position', 'line-pixel-height', - 'list', 'list-fonts', 'list-system-processes', 'listp', 'load', - 'load-average', 'local-key-binding', 'local-variable-if-set-p', - 'local-variable-p', 'locale-info', 'locate-file-internal', - 'lock-buffer', 'log', 'logand', 'logb', 'logior', 'lognot', 'logxor', - 'looking-at', 'lookup-image', 'lookup-image-map', 'lookup-key', - 'lower-frame', 'lsh', 'macroexpand', 'make-bool-vector', - 'make-byte-code', 'make-category-set', 'make-category-table', - 'make-char', 'make-char-table', 'make-directory-internal', - 'make-frame-invisible', 'make-frame-visible', 'make-hash-table', - 'make-indirect-buffer', 'make-keymap', 'make-list', - 'make-local-variable', 'make-marker', 'make-network-process', - 'make-overlay', 'make-serial-process', 'make-sparse-keymap', - 'make-string', 'make-symbol', 'make-symbolic-link', 'make-temp-name', - 'make-terminal-frame', 'make-variable-buffer-local', - 'make-variable-frame-local', 'make-vector', 'makunbound', - 'map-char-table', 'map-charset-chars', 'map-keymap', - 'map-keymap-internal', 'mapatoms', 'mapc', 'mapcar', 'mapconcat', - 'maphash', 'mark-marker', 'marker-buffer', 'marker-insertion-type', - 'marker-position', 'markerp', 'match-beginning', 'match-data', - 'match-end', 'matching-paren', 'max', 'max-char', 'md5', 'member', - 'memory-info', 'memory-limit', 'memory-use-counts', 'memq', 'memql', - 'menu-bar-menu-at-x-y', 'menu-or-popup-active-p', - 'menu-or-popup-active-p', 'merge-face-attribute', 'message', - 'message-box', 'message-or-box', 'min', - 'minibuffer-completion-contents', 'minibuffer-contents', - 'minibuffer-contents-no-properties', 'minibuffer-depth', - 'minibuffer-prompt', 'minibuffer-prompt-end', - 'minibuffer-selected-window', 'minibuffer-window', 'minibufferp', - 'minor-mode-key-binding', 'mod', 'modify-category-entry', - 'modify-frame-parameters', 'modify-syntax-entry', - 'mouse-pixel-position', 'mouse-position', 'move-overlay', - 'move-point-visually', 'move-to-column', 'move-to-window-line', - 'msdos-downcase-filename', 'msdos-long-file-names', 'msdos-memget', - 'msdos-memput', 'msdos-mouse-disable', 'msdos-mouse-enable', - 'msdos-mouse-init', 'msdos-mouse-p', 'msdos-remember-default-colors', - 'msdos-set-keyboard', 'msdos-set-mouse-buttons', - 'multibyte-char-to-unibyte', 'multibyte-string-p', 'narrow-to-region', - 'natnump', 'nconc', 'network-interface-info', - 'network-interface-list', 'new-fontset', 'newline-cache-check', - 'next-char-property-change', 'next-frame', 'next-overlay-change', - 'next-property-change', 'next-read-file-uses-dialog-p', - 'next-single-char-property-change', 'next-single-property-change', - 'next-window', 'nlistp', 'nreverse', 'nth', 'nthcdr', 'null', - 'number-or-marker-p', 'number-to-string', 'numberp', - 'open-dribble-file', 'open-font', 'open-termscript', - 'optimize-char-table', 'other-buffer', 'other-window-for-scrolling', - 'overlay-buffer', 'overlay-end', 'overlay-get', 'overlay-lists', - 'overlay-properties', 'overlay-put', 'overlay-recenter', - 'overlay-start', 'overlayp', 'overlays-at', 'overlays-in', - 'parse-partial-sexp', 'play-sound-internal', 'plist-get', - 'plist-member', 'plist-put', 'point', 'point-marker', 'point-max', - 'point-max-marker', 'point-min', 'point-min-marker', - 'pos-visible-in-window-p', 'position-bytes', 'posix-looking-at', - 'posix-search-backward', 'posix-search-forward', 'posix-string-match', - 'posn-at-point', 'posn-at-x-y', 'preceding-char', - 'prefix-numeric-value', 'previous-char-property-change', - 'previous-frame', 'previous-overlay-change', - 'previous-property-change', 'previous-single-char-property-change', - 'previous-single-property-change', 'previous-window', 'prin1', - 'prin1-to-string', 'princ', 'print', 'process-attributes', - 'process-buffer', 'process-coding-system', 'process-command', - 'process-connection', 'process-contact', 'process-datagram-address', - 'process-exit-status', 'process-filter', 'process-filter-multibyte-p', - 'process-id', 'process-inherit-coding-system-flag', 'process-list', - 'process-mark', 'process-name', 'process-plist', - 'process-query-on-exit-flag', 'process-running-child-p', - 'process-send-eof', 'process-send-region', 'process-send-string', - 'process-sentinel', 'process-status', 'process-tty-name', - 'process-type', 'processp', 'profiler-cpu-log', - 'profiler-cpu-running-p', 'profiler-cpu-start', 'profiler-cpu-stop', - 'profiler-memory-log', 'profiler-memory-running-p', - 'profiler-memory-start', 'profiler-memory-stop', 'propertize', - 'purecopy', 'put', 'put-text-property', - 'put-unicode-property-internal', 'puthash', 'query-font', - 'query-fontset', 'quit-process', 'raise-frame', 'random', 'rassoc', - 'rassq', 're-search-backward', 're-search-forward', 'read', - 'read-buffer', 'read-char', 'read-char-exclusive', - 'read-coding-system', 'read-command', 'read-event', - 'read-from-minibuffer', 'read-from-string', 'read-function', - 'read-key-sequence', 'read-key-sequence-vector', - 'read-no-blanks-input', 'read-non-nil-coding-system', 'read-string', - 'read-variable', 'recent-auto-save-p', 'recent-doskeys', - 'recent-keys', 'recenter', 'recursion-depth', 'recursive-edit', - 'redirect-debugging-output', 'redirect-frame-focus', 'redisplay', - 'redraw-display', 'redraw-frame', 'regexp-quote', 'region-beginning', - 'region-end', 'register-ccl-program', 'register-code-conversion-map', - 'remhash', 'remove-list-of-text-properties', 'remove-text-properties', - 'rename-buffer', 'rename-file', 'replace-match', - 'reset-this-command-lengths', 'resize-mini-window-internal', - 'restore-buffer-modified-p', 'resume-tty', 'reverse', 'round', - 'run-hook-with-args', 'run-hook-with-args-until-failure', - 'run-hook-with-args-until-success', 'run-hook-wrapped', 'run-hooks', - 'run-window-configuration-change-hook', 'run-window-scroll-functions', - 'safe-length', 'scan-lists', 'scan-sexps', 'scroll-down', - 'scroll-left', 'scroll-other-window', 'scroll-right', 'scroll-up', - 'search-backward', 'search-forward', 'secure-hash', 'select-frame', - 'select-window', 'selected-frame', 'selected-window', - 'self-insert-command', 'send-string-to-terminal', 'sequencep', - 'serial-process-configure', 'set', 'set-buffer', - 'set-buffer-auto-saved', 'set-buffer-major-mode', - 'set-buffer-modified-p', 'set-buffer-multibyte', 'set-case-table', - 'set-category-table', 'set-char-table-extra-slot', - 'set-char-table-parent', 'set-char-table-range', 'set-charset-plist', - 'set-charset-priority', 'set-coding-system-priority', - 'set-cursor-size', 'set-default', 'set-default-file-modes', - 'set-default-toplevel-value', 'set-file-acl', 'set-file-modes', - 'set-file-selinux-context', 'set-file-times', 'set-fontset-font', - 'set-frame-height', 'set-frame-position', 'set-frame-selected-window', - 'set-frame-size', 'set-frame-width', 'set-fringe-bitmap-face', - 'set-input-interrupt-mode', 'set-input-meta-mode', 'set-input-mode', - 'set-keyboard-coding-system-internal', 'set-keymap-parent', - 'set-marker', 'set-marker-insertion-type', 'set-match-data', - 'set-message-beep', 'set-minibuffer-window', - 'set-mouse-pixel-position', 'set-mouse-position', - 'set-network-process-option', 'set-output-flow-control', - 'set-process-buffer', 'set-process-coding-system', - 'set-process-datagram-address', 'set-process-filter', - 'set-process-filter-multibyte', - 'set-process-inherit-coding-system-flag', 'set-process-plist', - 'set-process-query-on-exit-flag', 'set-process-sentinel', - 'set-process-window-size', 'set-quit-char', - 'set-safe-terminal-coding-system-internal', 'set-screen-color', - 'set-standard-case-table', 'set-syntax-table', - 'set-terminal-coding-system-internal', 'set-terminal-local-value', - 'set-terminal-parameter', 'set-text-properties', 'set-time-zone-rule', - 'set-visited-file-modtime', 'set-window-buffer', - 'set-window-combination-limit', 'set-window-configuration', - 'set-window-dedicated-p', 'set-window-display-table', - 'set-window-fringes', 'set-window-hscroll', 'set-window-margins', - 'set-window-new-normal', 'set-window-new-pixel', - 'set-window-new-total', 'set-window-next-buffers', - 'set-window-parameter', 'set-window-point', 'set-window-prev-buffers', - 'set-window-redisplay-end-trigger', 'set-window-scroll-bars', - 'set-window-start', 'set-window-vscroll', 'setcar', 'setcdr', - 'setplist', 'show-face-resources', 'signal', 'signal-process', 'sin', - 'single-key-description', 'skip-chars-backward', 'skip-chars-forward', - 'skip-syntax-backward', 'skip-syntax-forward', 'sleep-for', 'sort', - 'sort-charsets', 'special-variable-p', 'split-char', - 'split-window-internal', 'sqrt', 'standard-case-table', - 'standard-category-table', 'standard-syntax-table', 'start-kbd-macro', - 'start-process', 'stop-process', 'store-kbd-macro-event', 'string', + '%', '*', '+', '-', '/', '/=', '1+', '1-', '<', '<=', '=', '>', '>=', + 'Snarf-documentation', 'abort-recursive-edit', 'abs', + 'accept-process-output', 'access-file', 'accessible-keymaps', 'acos', + 'active-minibuffer-window', 'add-face-text-property', + 'add-name-to-file', 'add-text-properties', 'all-completions', + 'append', 'apply', 'apropos-internal', 'aref', 'arrayp', 'aset', + 'ash', 'asin', 'assoc', 'assoc-string', 'assq', 'atan', 'atom', + 'autoload', 'autoload-do-load', 'backtrace', 'backtrace--locals', + 'backtrace-debug', 'backtrace-eval', 'backtrace-frame', + 'backward-char', 'backward-prefix-chars', 'barf-if-buffer-read-only', + 'base64-decode-region', 'base64-decode-string', + 'base64-encode-region', 'base64-encode-string', 'beginning-of-line', + 'bidi-find-overridden-directionality', 'bidi-resolved-levels', + 'bitmap-spec-p', 'bobp', 'bolp', 'bool-vector', + 'bool-vector-count-consecutive', 'bool-vector-count-population', + 'bool-vector-exclusive-or', 'bool-vector-intersection', + 'bool-vector-not', 'bool-vector-p', 'bool-vector-set-difference', + 'bool-vector-subsetp', 'bool-vector-union', 'boundp', + 'buffer-base-buffer', 'buffer-chars-modified-tick', + 'buffer-enable-undo', 'buffer-file-name', 'buffer-has-markers-at', + 'buffer-list', 'buffer-live-p', 'buffer-local-value', + 'buffer-local-variables', 'buffer-modified-p', 'buffer-modified-tick', + 'buffer-name', 'buffer-size', 'buffer-string', 'buffer-substring', + 'buffer-substring-no-properties', 'buffer-swap-text', 'bufferp', + 'bury-buffer-internal', 'byte-code', 'byte-code-function-p', + 'byte-to-position', 'byte-to-string', 'byteorder', + 'call-interactively', 'call-last-kbd-macro', 'call-process', + 'call-process-region', 'cancel-kbd-macro-events', 'capitalize', + 'capitalize-region', 'capitalize-word', 'car', 'car-less-than-car', + 'car-safe', 'case-table-p', 'category-docstring', + 'category-set-mnemonics', 'category-table', 'category-table-p', + 'ccl-execute', 'ccl-execute-on-string', 'ccl-program-p', 'cdr', + 'cdr-safe', 'ceiling', 'char-after', 'char-before', + 'char-category-set', 'char-charset', 'char-equal', 'char-or-string-p', + 'char-resolve-modifiers', 'char-syntax', 'char-table-extra-slot', + 'char-table-p', 'char-table-parent', 'char-table-range', + 'char-table-subtype', 'char-to-string', 'char-width', 'characterp', + 'charset-after', 'charset-id-internal', 'charset-plist', + 'charset-priority-list', 'charsetp', 'check-coding-system', + 'check-coding-systems-region', 'clear-buffer-auto-save-failure', + 'clear-charset-maps', 'clear-face-cache', 'clear-font-cache', + 'clear-image-cache', 'clear-string', 'clear-this-command-keys', + 'close-font', 'clrhash', 'coding-system-aliases', + 'coding-system-base', 'coding-system-eol-type', 'coding-system-p', + 'coding-system-plist', 'coding-system-priority-list', + 'coding-system-put', 'color-distance', 'color-gray-p', + 'color-supported-p', 'combine-after-change-execute', + 'command-error-default-function', 'command-remapping', 'commandp', + 'compare-buffer-substrings', 'compare-strings', + 'compare-window-configurations', 'completing-read', + 'compose-region-internal', 'compose-string-internal', + 'composition-get-gstring', 'compute-motion', 'concat', 'cons', + 'consp', 'constrain-to-field', 'continue-process', + 'controlling-tty-p', 'coordinates-in-window-p', 'copy-alist', + 'copy-category-table', 'copy-file', 'copy-hash-table', 'copy-keymap', + 'copy-marker', 'copy-sequence', 'copy-syntax-table', 'copysign', + 'cos', 'current-active-maps', 'current-bidi-paragraph-direction', + 'current-buffer', 'current-case-table', 'current-column', + 'current-global-map', 'current-idle-time', 'current-indentation', + 'current-input-mode', 'current-local-map', 'current-message', + 'current-minor-mode-maps', 'current-time', 'current-time-string', + 'current-time-zone', 'current-window-configuration', + 'cygwin-convert-file-name-from-windows', + 'cygwin-convert-file-name-to-windows', 'daemon-initialized', + 'daemonp', 'dbus--init-bus', 'dbus-get-unique-name', + 'dbus-message-internal', 'debug-timer-check', 'declare-equiv-charset', + 'decode-big5-char', 'decode-char', 'decode-coding-region', + 'decode-coding-string', 'decode-sjis-char', 'decode-time', + 'default-boundp', 'default-file-modes', 'default-printer-name', + 'default-toplevel-value', 'default-value', 'define-category', + 'define-charset-alias', 'define-charset-internal', + 'define-coding-system-alias', 'define-coding-system-internal', + 'define-fringe-bitmap', 'define-hash-table-test', 'define-key', + 'define-prefix-command', 'delete', + 'delete-all-overlays', 'delete-and-extract-region', 'delete-char', + 'delete-directory-internal', 'delete-field', 'delete-file', + 'delete-frame', 'delete-other-windows-internal', 'delete-overlay', + 'delete-process', 'delete-region', 'delete-terminal', + 'delete-window-internal', 'delq', 'describe-buffer-bindings', + 'describe-vector', 'destroy-fringe-bitmap', 'detect-coding-region', + 'detect-coding-string', 'ding', 'directory-file-name', + 'directory-files', 'directory-files-and-attributes', 'discard-input', + 'display-supports-face-attributes-p', 'do-auto-save', 'documentation', + 'documentation-property', 'downcase', 'downcase-region', + 'downcase-word', 'draw-string', 'dump-colors', 'dump-emacs', + 'dump-face', 'dump-frame-glyph-matrix', 'dump-glyph-matrix', + 'dump-glyph-row', 'dump-redisplay-history', 'dump-tool-bar-row', + 'elt', 'emacs-pid', 'encode-big5-char', 'encode-char', + 'encode-coding-region', 'encode-coding-string', 'encode-sjis-char', + 'encode-time', 'end-kbd-macro', 'end-of-line', 'eobp', 'eolp', 'eq', + 'eql', 'equal', 'equal-including-properties', 'erase-buffer', + 'error-message-string', 'eval', 'eval-buffer', 'eval-region', + 'event-convert-list', 'execute-kbd-macro', 'exit-recursive-edit', + 'exp', 'expand-file-name', 'expt', 'external-debugging-output', + 'face-attribute-relative-p', 'face-attributes-as-vector', 'face-font', + 'fboundp', 'fceiling', 'fetch-bytecode', 'ffloor', + 'field-beginning', 'field-end', 'field-string', + 'field-string-no-properties', 'file-accessible-directory-p', + 'file-acl', 'file-attributes', 'file-attributes-lessp', + 'file-directory-p', 'file-executable-p', 'file-exists-p', + 'file-locked-p', 'file-modes', 'file-name-absolute-p', + 'file-name-all-completions', 'file-name-as-directory', + 'file-name-completion', 'file-name-directory', + 'file-name-nondirectory', 'file-newer-than-file-p', 'file-readable-p', + 'file-regular-p', 'file-selinux-context', 'file-symlink-p', + 'file-system-info', 'file-system-info', 'file-writable-p', + 'fillarray', 'find-charset-region', 'find-charset-string', + 'find-coding-systems-region-internal', 'find-composition-internal', + 'find-file-name-handler', 'find-font', 'find-operation-coding-system', + 'float', 'float-time', 'floatp', 'floor', 'fmakunbound', + 'following-char', 'font-at', 'font-drive-otf', 'font-face-attributes', + 'font-family-list', 'font-get', 'font-get-glyphs', + 'font-get-system-font', 'font-get-system-normal-font', 'font-info', + 'font-match-p', 'font-otf-alternates', 'font-put', + 'font-shape-gstring', 'font-spec', 'font-variation-glyphs', + 'font-xlfd-name', 'fontp', 'fontset-font', 'fontset-info', + 'fontset-list', 'fontset-list-all', 'force-mode-line-update', + 'force-window-update', 'format', 'format-mode-line', + 'format-network-address', 'format-time-string', 'forward-char', + 'forward-comment', 'forward-line', 'forward-word', + 'frame-border-width', 'frame-bottom-divider-width', + 'frame-can-run-window-configuration-change-hook', 'frame-char-height', + 'frame-char-width', 'frame-face-alist', 'frame-first-window', + 'frame-focus', 'frame-font-cache', 'frame-fringe-width', 'frame-list', + 'frame-live-p', 'frame-or-buffer-changed-p', 'frame-parameter', + 'frame-parameters', 'frame-pixel-height', 'frame-pixel-width', + 'frame-pointer-visible-p', 'frame-right-divider-width', + 'frame-root-window', 'frame-scroll-bar-height', + 'frame-scroll-bar-width', 'frame-selected-window', 'frame-terminal', + 'frame-text-cols', 'frame-text-height', 'frame-text-lines', + 'frame-text-width', 'frame-total-cols', 'frame-total-lines', + 'frame-visible-p', 'framep', 'frexp', 'fringe-bitmaps-at-pos', + 'fround', 'fset', 'ftruncate', 'funcall', 'funcall-interactively', + 'function-equal', 'functionp', 'gap-position', 'gap-size', + 'garbage-collect', 'gc-status', 'generate-new-buffer-name', 'get', + 'get-buffer', 'get-buffer-create', 'get-buffer-process', + 'get-buffer-window', 'get-byte', 'get-char-property', + 'get-char-property-and-overlay', 'get-file-buffer', 'get-file-char', + 'get-internal-run-time', 'get-load-suffixes', 'get-pos-property', + 'get-process', 'get-screen-color', 'get-text-property', + 'get-unicode-property-internal', 'get-unused-category', + 'get-unused-iso-final-char', 'getenv-internal', 'gethash', + 'gfile-add-watch', 'gfile-rm-watch', 'global-key-binding', + 'gnutls-available-p', 'gnutls-boot', 'gnutls-bye', 'gnutls-deinit', + 'gnutls-error-fatalp', 'gnutls-error-string', 'gnutls-errorp', + 'gnutls-get-initstage', 'gnutls-peer-status', + 'gnutls-peer-status-warning-describe', 'goto-char', 'gpm-mouse-start', + 'gpm-mouse-stop', 'group-gid', 'group-real-gid', + 'handle-save-session', 'handle-switch-frame', 'hash-table-count', + 'hash-table-p', 'hash-table-rehash-size', + 'hash-table-rehash-threshold', 'hash-table-size', 'hash-table-test', + 'hash-table-weakness', 'iconify-frame', 'identity', 'image-flush', + 'image-mask-p', 'image-metadata', 'image-size', 'imagemagick-types', + 'imagep', 'indent-to', 'indirect-function', 'indirect-variable', + 'init-image-library', 'inotify-add-watch', 'inotify-rm-watch', + 'input-pending-p', 'insert', 'insert-and-inherit', + 'insert-before-markers', 'insert-before-markers-and-inherit', + 'insert-buffer-substring', 'insert-byte', 'insert-char', + 'insert-file-contents', 'insert-startup-screen', 'int86', + 'integer-or-marker-p', 'integerp', 'interactive-form', 'intern', + 'intern-soft', 'internal--track-mouse', 'internal-char-font', + 'internal-complete-buffer', 'internal-copy-lisp-face', + 'internal-default-process-filter', + 'internal-default-process-sentinel', 'internal-describe-syntax-value', + 'internal-event-symbol-parse-modifiers', + 'internal-face-x-get-resource', 'internal-get-lisp-face-attribute', + 'internal-lisp-face-attribute-values', 'internal-lisp-face-empty-p', + 'internal-lisp-face-equal-p', 'internal-lisp-face-p', + 'internal-make-lisp-face', 'internal-make-var-non-special', + 'internal-merge-in-global-face', + 'internal-set-alternative-font-family-alist', + 'internal-set-alternative-font-registry-alist', + 'internal-set-font-selection-order', + 'internal-set-lisp-face-attribute', + 'internal-set-lisp-face-attribute-from-resource', + 'internal-show-cursor', 'internal-show-cursor-p', 'interrupt-process', + 'invisible-p', 'invocation-directory', 'invocation-name', 'isnan', + 'iso-charset', 'key-binding', 'key-description', + 'keyboard-coding-system', 'keymap-parent', 'keymap-prompt', 'keymapp', + 'keywordp', 'kill-all-local-variables', 'kill-buffer', 'kill-emacs', + 'kill-local-variable', 'kill-process', 'last-nonminibuffer-frame', + 'lax-plist-get', 'lax-plist-put', 'ldexp', 'length', + 'libxml-parse-html-region', 'libxml-parse-xml-region', + 'line-beginning-position', 'line-end-position', 'line-pixel-height', + 'list', 'list-fonts', 'list-system-processes', 'listp', 'load', + 'load-average', 'local-key-binding', 'local-variable-if-set-p', + 'local-variable-p', 'locale-info', 'locate-file-internal', + 'lock-buffer', 'log', 'logand', 'logb', 'logior', 'lognot', 'logxor', + 'looking-at', 'lookup-image', 'lookup-image-map', 'lookup-key', + 'lower-frame', 'lsh', 'macroexpand', 'make-bool-vector', + 'make-byte-code', 'make-category-set', 'make-category-table', + 'make-char', 'make-char-table', 'make-directory-internal', + 'make-frame-invisible', 'make-frame-visible', 'make-hash-table', + 'make-indirect-buffer', 'make-keymap', 'make-list', + 'make-local-variable', 'make-marker', 'make-network-process', + 'make-overlay', 'make-serial-process', 'make-sparse-keymap', + 'make-string', 'make-symbol', 'make-symbolic-link', 'make-temp-name', + 'make-terminal-frame', 'make-variable-buffer-local', + 'make-variable-frame-local', 'make-vector', 'makunbound', + 'map-char-table', 'map-charset-chars', 'map-keymap', + 'map-keymap-internal', 'mapatoms', 'mapc', 'mapcar', 'mapconcat', + 'maphash', 'mark-marker', 'marker-buffer', 'marker-insertion-type', + 'marker-position', 'markerp', 'match-beginning', 'match-data', + 'match-end', 'matching-paren', 'max', 'max-char', 'md5', 'member', + 'memory-info', 'memory-limit', 'memory-use-counts', 'memq', 'memql', + 'menu-bar-menu-at-x-y', 'menu-or-popup-active-p', + 'menu-or-popup-active-p', 'merge-face-attribute', 'message', + 'message-box', 'message-or-box', 'min', + 'minibuffer-completion-contents', 'minibuffer-contents', + 'minibuffer-contents-no-properties', 'minibuffer-depth', + 'minibuffer-prompt', 'minibuffer-prompt-end', + 'minibuffer-selected-window', 'minibuffer-window', 'minibufferp', + 'minor-mode-key-binding', 'mod', 'modify-category-entry', + 'modify-frame-parameters', 'modify-syntax-entry', + 'mouse-pixel-position', 'mouse-position', 'move-overlay', + 'move-point-visually', 'move-to-column', 'move-to-window-line', + 'msdos-downcase-filename', 'msdos-long-file-names', 'msdos-memget', + 'msdos-memput', 'msdos-mouse-disable', 'msdos-mouse-enable', + 'msdos-mouse-init', 'msdos-mouse-p', 'msdos-remember-default-colors', + 'msdos-set-keyboard', 'msdos-set-mouse-buttons', + 'multibyte-char-to-unibyte', 'multibyte-string-p', 'narrow-to-region', + 'natnump', 'nconc', 'network-interface-info', + 'network-interface-list', 'new-fontset', 'newline-cache-check', + 'next-char-property-change', 'next-frame', 'next-overlay-change', + 'next-property-change', 'next-read-file-uses-dialog-p', + 'next-single-char-property-change', 'next-single-property-change', + 'next-window', 'nlistp', 'nreverse', 'nth', 'nthcdr', 'null', + 'number-or-marker-p', 'number-to-string', 'numberp', + 'open-dribble-file', 'open-font', 'open-termscript', + 'optimize-char-table', 'other-buffer', 'other-window-for-scrolling', + 'overlay-buffer', 'overlay-end', 'overlay-get', 'overlay-lists', + 'overlay-properties', 'overlay-put', 'overlay-recenter', + 'overlay-start', 'overlayp', 'overlays-at', 'overlays-in', + 'parse-partial-sexp', 'play-sound-internal', 'plist-get', + 'plist-member', 'plist-put', 'point', 'point-marker', 'point-max', + 'point-max-marker', 'point-min', 'point-min-marker', + 'pos-visible-in-window-p', 'position-bytes', 'posix-looking-at', + 'posix-search-backward', 'posix-search-forward', 'posix-string-match', + 'posn-at-point', 'posn-at-x-y', 'preceding-char', + 'prefix-numeric-value', 'previous-char-property-change', + 'previous-frame', 'previous-overlay-change', + 'previous-property-change', 'previous-single-char-property-change', + 'previous-single-property-change', 'previous-window', 'prin1', + 'prin1-to-string', 'princ', 'print', 'process-attributes', + 'process-buffer', 'process-coding-system', 'process-command', + 'process-connection', 'process-contact', 'process-datagram-address', + 'process-exit-status', 'process-filter', 'process-filter-multibyte-p', + 'process-id', 'process-inherit-coding-system-flag', 'process-list', + 'process-mark', 'process-name', 'process-plist', + 'process-query-on-exit-flag', 'process-running-child-p', + 'process-send-eof', 'process-send-region', 'process-send-string', + 'process-sentinel', 'process-status', 'process-tty-name', + 'process-type', 'processp', 'profiler-cpu-log', + 'profiler-cpu-running-p', 'profiler-cpu-start', 'profiler-cpu-stop', + 'profiler-memory-log', 'profiler-memory-running-p', + 'profiler-memory-start', 'profiler-memory-stop', 'propertize', + 'purecopy', 'put', 'put-text-property', + 'put-unicode-property-internal', 'puthash', 'query-font', + 'query-fontset', 'quit-process', 'raise-frame', 'random', 'rassoc', + 'rassq', 're-search-backward', 're-search-forward', 'read', + 'read-buffer', 'read-char', 'read-char-exclusive', + 'read-coding-system', 'read-command', 'read-event', + 'read-from-minibuffer', 'read-from-string', 'read-function', + 'read-key-sequence', 'read-key-sequence-vector', + 'read-no-blanks-input', 'read-non-nil-coding-system', 'read-string', + 'read-variable', 'recent-auto-save-p', 'recent-doskeys', + 'recent-keys', 'recenter', 'recursion-depth', 'recursive-edit', + 'redirect-debugging-output', 'redirect-frame-focus', 'redisplay', + 'redraw-display', 'redraw-frame', 'regexp-quote', 'region-beginning', + 'region-end', 'register-ccl-program', 'register-code-conversion-map', + 'remhash', 'remove-list-of-text-properties', 'remove-text-properties', + 'rename-buffer', 'rename-file', 'replace-match', + 'reset-this-command-lengths', 'resize-mini-window-internal', + 'restore-buffer-modified-p', 'resume-tty', 'reverse', 'round', + 'run-hook-with-args', 'run-hook-with-args-until-failure', + 'run-hook-with-args-until-success', 'run-hook-wrapped', 'run-hooks', + 'run-window-configuration-change-hook', 'run-window-scroll-functions', + 'safe-length', 'scan-lists', 'scan-sexps', 'scroll-down', + 'scroll-left', 'scroll-other-window', 'scroll-right', 'scroll-up', + 'search-backward', 'search-forward', 'secure-hash', 'select-frame', + 'select-window', 'selected-frame', 'selected-window', + 'self-insert-command', 'send-string-to-terminal', 'sequencep', + 'serial-process-configure', 'set', 'set-buffer', + 'set-buffer-auto-saved', 'set-buffer-major-mode', + 'set-buffer-modified-p', 'set-buffer-multibyte', 'set-case-table', + 'set-category-table', 'set-char-table-extra-slot', + 'set-char-table-parent', 'set-char-table-range', 'set-charset-plist', + 'set-charset-priority', 'set-coding-system-priority', + 'set-cursor-size', 'set-default', 'set-default-file-modes', + 'set-default-toplevel-value', 'set-file-acl', 'set-file-modes', + 'set-file-selinux-context', 'set-file-times', 'set-fontset-font', + 'set-frame-height', 'set-frame-position', 'set-frame-selected-window', + 'set-frame-size', 'set-frame-width', 'set-fringe-bitmap-face', + 'set-input-interrupt-mode', 'set-input-meta-mode', 'set-input-mode', + 'set-keyboard-coding-system-internal', 'set-keymap-parent', + 'set-marker', 'set-marker-insertion-type', 'set-match-data', + 'set-message-beep', 'set-minibuffer-window', + 'set-mouse-pixel-position', 'set-mouse-position', + 'set-network-process-option', 'set-output-flow-control', + 'set-process-buffer', 'set-process-coding-system', + 'set-process-datagram-address', 'set-process-filter', + 'set-process-filter-multibyte', + 'set-process-inherit-coding-system-flag', 'set-process-plist', + 'set-process-query-on-exit-flag', 'set-process-sentinel', + 'set-process-window-size', 'set-quit-char', + 'set-safe-terminal-coding-system-internal', 'set-screen-color', + 'set-standard-case-table', 'set-syntax-table', + 'set-terminal-coding-system-internal', 'set-terminal-local-value', + 'set-terminal-parameter', 'set-text-properties', 'set-time-zone-rule', + 'set-visited-file-modtime', 'set-window-buffer', + 'set-window-combination-limit', 'set-window-configuration', + 'set-window-dedicated-p', 'set-window-display-table', + 'set-window-fringes', 'set-window-hscroll', 'set-window-margins', + 'set-window-new-normal', 'set-window-new-pixel', + 'set-window-new-total', 'set-window-next-buffers', + 'set-window-parameter', 'set-window-point', 'set-window-prev-buffers', + 'set-window-redisplay-end-trigger', 'set-window-scroll-bars', + 'set-window-start', 'set-window-vscroll', 'setcar', 'setcdr', + 'setplist', 'show-face-resources', 'signal', 'signal-process', 'sin', + 'single-key-description', 'skip-chars-backward', 'skip-chars-forward', + 'skip-syntax-backward', 'skip-syntax-forward', 'sleep-for', 'sort', + 'sort-charsets', 'special-variable-p', 'split-char', + 'split-window-internal', 'sqrt', 'standard-case-table', + 'standard-category-table', 'standard-syntax-table', 'start-kbd-macro', + 'start-process', 'stop-process', 'store-kbd-macro-event', 'string', 'string=', 'string<', 'string>', 'string-as-multibyte', 'string-as-unibyte', 'string-bytes', 'string-collate-equalp', 'string-collate-lessp', 'string-equal', 'string-greaterp', - 'string-lessp', 'string-make-multibyte', 'string-make-unibyte', - 'string-match', 'string-to-char', 'string-to-multibyte', - 'string-to-number', 'string-to-syntax', 'string-to-unibyte', - 'string-width', 'stringp', 'subr-name', 'subrp', - 'subst-char-in-region', 'substitute-command-keys', - 'substitute-in-file-name', 'substring', 'substring-no-properties', - 'suspend-emacs', 'suspend-tty', 'suspicious-object', 'sxhash', - 'symbol-function', 'symbol-name', 'symbol-plist', 'symbol-value', - 'symbolp', 'syntax-table', 'syntax-table-p', 'system-groups', - 'system-move-file-to-trash', 'system-name', 'system-users', 'tan', - 'terminal-coding-system', 'terminal-list', 'terminal-live-p', - 'terminal-local-value', 'terminal-name', 'terminal-parameter', - 'terminal-parameters', 'terpri', 'test-completion', - 'text-char-description', 'text-properties-at', 'text-property-any', - 'text-property-not-all', 'this-command-keys', - 'this-command-keys-vector', 'this-single-command-keys', - 'this-single-command-raw-keys', 'time-add', 'time-less-p', - 'time-subtract', 'tool-bar-get-system-style', 'tool-bar-height', - 'tool-bar-pixel-width', 'top-level', 'trace-redisplay', - 'trace-to-stderr', 'translate-region-internal', 'transpose-regions', - 'truncate', 'try-completion', 'tty-display-color-cells', - 'tty-display-color-p', 'tty-no-underline', - 'tty-suppress-bold-inverse-default-colors', 'tty-top-frame', - 'tty-type', 'type-of', 'undo-boundary', 'unencodable-char-position', - 'unhandled-file-name-directory', 'unibyte-char-to-multibyte', - 'unibyte-string', 'unicode-property-table-internal', 'unify-charset', - 'unintern', 'unix-sync', 'unlock-buffer', 'upcase', 'upcase-initials', - 'upcase-initials-region', 'upcase-region', 'upcase-word', - 'use-global-map', 'use-local-map', 'user-full-name', - 'user-login-name', 'user-real-login-name', 'user-real-uid', - 'user-uid', 'variable-binding-locus', 'vconcat', 'vector', - 'vector-or-char-table-p', 'vectorp', 'verify-visited-file-modtime', - 'vertical-motion', 'visible-frame-list', 'visited-file-modtime', - 'w16-get-clipboard-data', 'w16-selection-exists-p', - 'w16-set-clipboard-data', 'w32-battery-status', - 'w32-default-color-map', 'w32-define-rgb-color', - 'w32-display-monitor-attributes-list', 'w32-frame-menu-bar-size', - 'w32-frame-rect', 'w32-get-clipboard-data', - 'w32-get-codepage-charset', 'w32-get-console-codepage', - 'w32-get-console-output-codepage', 'w32-get-current-locale-id', - 'w32-get-default-locale-id', 'w32-get-keyboard-layout', - 'w32-get-locale-info', 'w32-get-valid-codepages', - 'w32-get-valid-keyboard-layouts', 'w32-get-valid-locale-ids', - 'w32-has-winsock', 'w32-long-file-name', 'w32-reconstruct-hot-key', - 'w32-register-hot-key', 'w32-registered-hot-keys', - 'w32-selection-exists-p', 'w32-send-sys-command', - 'w32-set-clipboard-data', 'w32-set-console-codepage', - 'w32-set-console-output-codepage', 'w32-set-current-locale', - 'w32-set-keyboard-layout', 'w32-set-process-priority', - 'w32-shell-execute', 'w32-short-file-name', 'w32-toggle-lock-key', - 'w32-unload-winsock', 'w32-unregister-hot-key', 'w32-window-exists-p', - 'w32notify-add-watch', 'w32notify-rm-watch', - 'waiting-for-user-input-p', 'where-is-internal', 'widen', - 'widget-apply', 'widget-get', 'widget-put', - 'window-absolute-pixel-edges', 'window-at', 'window-body-height', - 'window-body-width', 'window-bottom-divider-width', 'window-buffer', - 'window-combination-limit', 'window-configuration-frame', - 'window-configuration-p', 'window-dedicated-p', - 'window-display-table', 'window-edges', 'window-end', 'window-frame', - 'window-fringes', 'window-header-line-height', 'window-hscroll', - 'window-inside-absolute-pixel-edges', 'window-inside-edges', - 'window-inside-pixel-edges', 'window-left-child', - 'window-left-column', 'window-line-height', 'window-list', - 'window-list-1', 'window-live-p', 'window-margins', - 'window-minibuffer-p', 'window-mode-line-height', 'window-new-normal', - 'window-new-pixel', 'window-new-total', 'window-next-buffers', - 'window-next-sibling', 'window-normal-size', 'window-old-point', - 'window-parameter', 'window-parameters', 'window-parent', - 'window-pixel-edges', 'window-pixel-height', 'window-pixel-left', - 'window-pixel-top', 'window-pixel-width', 'window-point', - 'window-prev-buffers', 'window-prev-sibling', - 'window-redisplay-end-trigger', 'window-resize-apply', - 'window-resize-apply-total', 'window-right-divider-width', - 'window-scroll-bar-height', 'window-scroll-bar-width', - 'window-scroll-bars', 'window-start', 'window-system', - 'window-text-height', 'window-text-pixel-size', 'window-text-width', - 'window-top-child', 'window-top-line', 'window-total-height', - 'window-total-width', 'window-use-time', 'window-valid-p', - 'window-vscroll', 'windowp', 'write-char', 'write-region', - 'x-backspace-delete-keys-p', 'x-change-window-property', - 'x-change-window-property', 'x-close-connection', - 'x-close-connection', 'x-create-frame', 'x-create-frame', - 'x-delete-window-property', 'x-delete-window-property', - 'x-disown-selection-internal', 'x-display-backing-store', - 'x-display-backing-store', 'x-display-color-cells', - 'x-display-color-cells', 'x-display-grayscale-p', - 'x-display-grayscale-p', 'x-display-list', 'x-display-list', - 'x-display-mm-height', 'x-display-mm-height', 'x-display-mm-width', - 'x-display-mm-width', 'x-display-monitor-attributes-list', - 'x-display-pixel-height', 'x-display-pixel-height', - 'x-display-pixel-width', 'x-display-pixel-width', 'x-display-planes', - 'x-display-planes', 'x-display-save-under', 'x-display-save-under', - 'x-display-screens', 'x-display-screens', 'x-display-visual-class', - 'x-display-visual-class', 'x-family-fonts', 'x-file-dialog', - 'x-file-dialog', 'x-file-dialog', 'x-focus-frame', 'x-frame-geometry', - 'x-frame-geometry', 'x-get-atom-name', 'x-get-resource', - 'x-get-selection-internal', 'x-hide-tip', 'x-hide-tip', - 'x-list-fonts', 'x-load-color-file', 'x-menu-bar-open-internal', - 'x-menu-bar-open-internal', 'x-open-connection', 'x-open-connection', - 'x-own-selection-internal', 'x-parse-geometry', 'x-popup-dialog', - 'x-popup-menu', 'x-register-dnd-atom', 'x-select-font', - 'x-select-font', 'x-selection-exists-p', 'x-selection-owner-p', - 'x-send-client-message', 'x-server-max-request-size', - 'x-server-max-request-size', 'x-server-vendor', 'x-server-vendor', - 'x-server-version', 'x-server-version', 'x-show-tip', 'x-show-tip', - 'x-synchronize', 'x-synchronize', 'x-uses-old-gtk-dialog', - 'x-window-property', 'x-window-property', 'x-wm-set-size-hint', - 'xw-color-defined-p', 'xw-color-defined-p', 'xw-color-values', - 'xw-color-values', 'xw-display-color-p', 'xw-display-color-p', - 'yes-or-no-p', 'zlib-available-p', 'zlib-decompress-region', - 'forward-point', + 'string-lessp', 'string-make-multibyte', 'string-make-unibyte', + 'string-match', 'string-to-char', 'string-to-multibyte', + 'string-to-number', 'string-to-syntax', 'string-to-unibyte', + 'string-width', 'stringp', 'subr-name', 'subrp', + 'subst-char-in-region', 'substitute-command-keys', + 'substitute-in-file-name', 'substring', 'substring-no-properties', + 'suspend-emacs', 'suspend-tty', 'suspicious-object', 'sxhash', + 'symbol-function', 'symbol-name', 'symbol-plist', 'symbol-value', + 'symbolp', 'syntax-table', 'syntax-table-p', 'system-groups', + 'system-move-file-to-trash', 'system-name', 'system-users', 'tan', + 'terminal-coding-system', 'terminal-list', 'terminal-live-p', + 'terminal-local-value', 'terminal-name', 'terminal-parameter', + 'terminal-parameters', 'terpri', 'test-completion', + 'text-char-description', 'text-properties-at', 'text-property-any', + 'text-property-not-all', 'this-command-keys', + 'this-command-keys-vector', 'this-single-command-keys', + 'this-single-command-raw-keys', 'time-add', 'time-less-p', + 'time-subtract', 'tool-bar-get-system-style', 'tool-bar-height', + 'tool-bar-pixel-width', 'top-level', 'trace-redisplay', + 'trace-to-stderr', 'translate-region-internal', 'transpose-regions', + 'truncate', 'try-completion', 'tty-display-color-cells', + 'tty-display-color-p', 'tty-no-underline', + 'tty-suppress-bold-inverse-default-colors', 'tty-top-frame', + 'tty-type', 'type-of', 'undo-boundary', 'unencodable-char-position', + 'unhandled-file-name-directory', 'unibyte-char-to-multibyte', + 'unibyte-string', 'unicode-property-table-internal', 'unify-charset', + 'unintern', 'unix-sync', 'unlock-buffer', 'upcase', 'upcase-initials', + 'upcase-initials-region', 'upcase-region', 'upcase-word', + 'use-global-map', 'use-local-map', 'user-full-name', + 'user-login-name', 'user-real-login-name', 'user-real-uid', + 'user-uid', 'variable-binding-locus', 'vconcat', 'vector', + 'vector-or-char-table-p', 'vectorp', 'verify-visited-file-modtime', + 'vertical-motion', 'visible-frame-list', 'visited-file-modtime', + 'w16-get-clipboard-data', 'w16-selection-exists-p', + 'w16-set-clipboard-data', 'w32-battery-status', + 'w32-default-color-map', 'w32-define-rgb-color', + 'w32-display-monitor-attributes-list', 'w32-frame-menu-bar-size', + 'w32-frame-rect', 'w32-get-clipboard-data', + 'w32-get-codepage-charset', 'w32-get-console-codepage', + 'w32-get-console-output-codepage', 'w32-get-current-locale-id', + 'w32-get-default-locale-id', 'w32-get-keyboard-layout', + 'w32-get-locale-info', 'w32-get-valid-codepages', + 'w32-get-valid-keyboard-layouts', 'w32-get-valid-locale-ids', + 'w32-has-winsock', 'w32-long-file-name', 'w32-reconstruct-hot-key', + 'w32-register-hot-key', 'w32-registered-hot-keys', + 'w32-selection-exists-p', 'w32-send-sys-command', + 'w32-set-clipboard-data', 'w32-set-console-codepage', + 'w32-set-console-output-codepage', 'w32-set-current-locale', + 'w32-set-keyboard-layout', 'w32-set-process-priority', + 'w32-shell-execute', 'w32-short-file-name', 'w32-toggle-lock-key', + 'w32-unload-winsock', 'w32-unregister-hot-key', 'w32-window-exists-p', + 'w32notify-add-watch', 'w32notify-rm-watch', + 'waiting-for-user-input-p', 'where-is-internal', 'widen', + 'widget-apply', 'widget-get', 'widget-put', + 'window-absolute-pixel-edges', 'window-at', 'window-body-height', + 'window-body-width', 'window-bottom-divider-width', 'window-buffer', + 'window-combination-limit', 'window-configuration-frame', + 'window-configuration-p', 'window-dedicated-p', + 'window-display-table', 'window-edges', 'window-end', 'window-frame', + 'window-fringes', 'window-header-line-height', 'window-hscroll', + 'window-inside-absolute-pixel-edges', 'window-inside-edges', + 'window-inside-pixel-edges', 'window-left-child', + 'window-left-column', 'window-line-height', 'window-list', + 'window-list-1', 'window-live-p', 'window-margins', + 'window-minibuffer-p', 'window-mode-line-height', 'window-new-normal', + 'window-new-pixel', 'window-new-total', 'window-next-buffers', + 'window-next-sibling', 'window-normal-size', 'window-old-point', + 'window-parameter', 'window-parameters', 'window-parent', + 'window-pixel-edges', 'window-pixel-height', 'window-pixel-left', + 'window-pixel-top', 'window-pixel-width', 'window-point', + 'window-prev-buffers', 'window-prev-sibling', + 'window-redisplay-end-trigger', 'window-resize-apply', + 'window-resize-apply-total', 'window-right-divider-width', + 'window-scroll-bar-height', 'window-scroll-bar-width', + 'window-scroll-bars', 'window-start', 'window-system', + 'window-text-height', 'window-text-pixel-size', 'window-text-width', + 'window-top-child', 'window-top-line', 'window-total-height', + 'window-total-width', 'window-use-time', 'window-valid-p', + 'window-vscroll', 'windowp', 'write-char', 'write-region', + 'x-backspace-delete-keys-p', 'x-change-window-property', + 'x-change-window-property', 'x-close-connection', + 'x-close-connection', 'x-create-frame', 'x-create-frame', + 'x-delete-window-property', 'x-delete-window-property', + 'x-disown-selection-internal', 'x-display-backing-store', + 'x-display-backing-store', 'x-display-color-cells', + 'x-display-color-cells', 'x-display-grayscale-p', + 'x-display-grayscale-p', 'x-display-list', 'x-display-list', + 'x-display-mm-height', 'x-display-mm-height', 'x-display-mm-width', + 'x-display-mm-width', 'x-display-monitor-attributes-list', + 'x-display-pixel-height', 'x-display-pixel-height', + 'x-display-pixel-width', 'x-display-pixel-width', 'x-display-planes', + 'x-display-planes', 'x-display-save-under', 'x-display-save-under', + 'x-display-screens', 'x-display-screens', 'x-display-visual-class', + 'x-display-visual-class', 'x-family-fonts', 'x-file-dialog', + 'x-file-dialog', 'x-file-dialog', 'x-focus-frame', 'x-frame-geometry', + 'x-frame-geometry', 'x-get-atom-name', 'x-get-resource', + 'x-get-selection-internal', 'x-hide-tip', 'x-hide-tip', + 'x-list-fonts', 'x-load-color-file', 'x-menu-bar-open-internal', + 'x-menu-bar-open-internal', 'x-open-connection', 'x-open-connection', + 'x-own-selection-internal', 'x-parse-geometry', 'x-popup-dialog', + 'x-popup-menu', 'x-register-dnd-atom', 'x-select-font', + 'x-select-font', 'x-selection-exists-p', 'x-selection-owner-p', + 'x-send-client-message', 'x-server-max-request-size', + 'x-server-max-request-size', 'x-server-vendor', 'x-server-vendor', + 'x-server-version', 'x-server-version', 'x-show-tip', 'x-show-tip', + 'x-synchronize', 'x-synchronize', 'x-uses-old-gtk-dialog', + 'x-window-property', 'x-window-property', 'x-wm-set-size-hint', + 'xw-color-defined-p', 'xw-color-defined-p', 'xw-color-values', + 'xw-color-values', 'xw-display-color-p', 'xw-display-color-p', + 'yes-or-no-p', 'zlib-available-p', 'zlib-decompress-region', + 'forward-point', } - + builtin_function_highlighted = { - 'defvaralias', 'provide', 'require', - 'with-no-warnings', 'define-widget', 'with-electric-help', - 'throw', 'defalias', 'featurep' + 'defvaralias', 'provide', 'require', + 'with-no-warnings', 'define-widget', 'with-electric-help', + 'throw', 'defalias', 'featurep' } - + lambda_list_keywords = { - '&allow-other-keys', '&aux', '&body', '&environment', '&key', '&optional', - '&rest', '&whole', + '&allow-other-keys', '&aux', '&body', '&environment', '&key', '&optional', + '&rest', '&whole', } - + error_keywords = { - 'cl-assert', 'cl-check-type', 'error', 'signal', - 'user-error', 'warn', + '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 + + 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 + r'\*', 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 <http://shenlanguage.org/>`_ source code. - - .. versionadded:: 2.1 - """ - name = 'Shen' - aliases = ['shen'] - filenames = ['*.shen'] - mimetypes = ['text/x-shen', 'application/x-shen'] - + (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 <http://shenlanguage.org/>`_ 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', @@ -2248,197 +2248,197 @@ class ShenLexer(RegexLexer): 'verified', 'version', 'warn', 'when', 'write-byte', 'write-to-file', 'y-or-n?', ) - + BUILTINS_ANYWHERE = ('where', 'skip', '>>', '_', '!', '<e>', '<!>') - + MAPPINGS = {s: Keyword for s in DECLARATIONS} - MAPPINGS.update((s, Name.Builtin) for s in BUILTINS) - MAPPINGS.update((s, Keyword) for s in SPECIAL_FORMS) - + 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 + 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 yield from self._process_declaration(declaration, tokens) - opening_paren = value == '(' and token == Punctuation - - def _process_symbols(self, tokens): - opening_paren = False - for index, token, value in tokens: - if opening_paren and token in (Literal, Name.Variable): - token = self.MAPPINGS.get(value, Name.Function) - elif token == Literal and value in self.BUILTINS_ANYWHERE: - token = Name.Builtin - opening_paren = value == '(' and token == Punctuation - yield index, token, value - - def _process_declaration(self, declaration, tokens): - for index, token, value in tokens: - if self._relevant(token): - break - yield index, token, value - - if declaration == 'datatype': - prev_was_colon = False - token = Keyword.Type if token == Literal else token - yield index, token, value - for index, token, value in tokens: - if prev_was_colon and token == Literal: - token = Keyword.Type - yield index, token, value - if self._relevant(token): - prev_was_colon = token == Literal and value == ':' - elif declaration == 'package': - token = Name.Namespace if token == Literal else token - yield index, token, value - elif declaration == 'define': - token = Name.Function if token == Literal else token - yield index, token, value - for index, token, value in tokens: - if self._relevant(token): - break - yield index, token, value - if value == '{' and token == Literal: - yield index, Punctuation, value - for index, token, value in self._process_signature(tokens): - yield index, token, value - else: - yield index, token, value - else: - token = Name.Function if token == Literal else token - yield index, token, value - + opening_paren = value == '(' and token == Punctuation + + def _process_symbols(self, tokens): + opening_paren = False + for index, token, value in tokens: + if opening_paren and token in (Literal, Name.Variable): + token = self.MAPPINGS.get(value, Name.Function) + elif token == Literal and value in self.BUILTINS_ANYWHERE: + token = Name.Builtin + opening_paren = value == '(' and token == Punctuation + yield index, token, value + + def _process_declaration(self, declaration, tokens): + for index, token, value in tokens: + if self._relevant(token): + break + yield index, token, value + + if declaration == 'datatype': + prev_was_colon = False + token = Keyword.Type if token == Literal else token + yield index, token, value + for index, token, value in tokens: + if prev_was_colon and token == Literal: + token = Keyword.Type + yield index, token, value + if self._relevant(token): + prev_was_colon = token == Literal and value == ':' + elif declaration == 'package': + token = Name.Namespace if token == Literal else token + yield index, token, value + elif declaration == 'define': + token = Name.Function if token == Literal else token + yield index, token, value + for index, token, value in tokens: + if self._relevant(token): + break + yield index, token, value + if value == '{' and token == Literal: + yield index, Punctuation, value + for index, token, value in self._process_signature(tokens): + yield index, token, value + else: + yield index, token, value + else: + token = Name.Function if token == Literal else token + yield index, token, value + return - - def _process_signature(self, tokens): - for index, token, value in tokens: - if token == Literal and value == '}': - yield index, Punctuation, value + + def _process_signature(self, tokens): + for index, token, value in tokens: + if token == Literal and value == '}': + yield index, Punctuation, value return - elif token in (Literal, Name.Function): - token = Name.Variable if value.istitle() else Keyword.Type - yield index, token, value - - + elif token in (Literal, Name.Function): + token = Name.Variable if value.istitle() else Keyword.Type + yield index, token, value + + class CPSALexer(RegexLexer): - """ - A CPSA lexer based on the CPSA language as of version 2.2.12 - - .. 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 + """ + 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 + + 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"'" + 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), - ], - } + + # 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): |