eric6/ThirdParty/Pygments/pygments/lexers/lisp.py

changeset 6942
2602857055c5
parent 6651
e8f3b5568b21
child 7547
21b0534faebc
equal deleted inserted replaced
6941:f99d60d6b59b 6942:2602857055c5
1 # -*- coding: utf-8 -*-
2 """
3 pygments.lexers.lisp
4 ~~~~~~~~~~~~~~~~~~~~
5
6 Lexers for Lispy languages.
7
8 :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
9 :license: BSD, see LICENSE for details.
10 """
11
12 import re
13
14 from pygments.lexer import RegexLexer, include, bygroups, words, default
15 from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
16 Number, Punctuation, Literal, Error
17
18 from pygments.lexers.python import PythonLexer
19
20 __all__ = ['SchemeLexer', 'CommonLispLexer', 'HyLexer', 'RacketLexer',
21 'NewLispLexer', 'EmacsLispLexer', 'ShenLexer', 'CPSALexer',
22 'XtlangLexer', 'FennelLexer']
23
24
25 class SchemeLexer(RegexLexer):
26 """
27 A Scheme lexer, parsing a stream and outputting the tokens
28 needed to highlight scheme code.
29 This lexer could be most probably easily subclassed to parse
30 other LISP-Dialects like Common Lisp, Emacs Lisp or AutoLisp.
31
32 This parser is checked with pastes from the LISP pastebin
33 at http://paste.lisp.org/ to cover as much syntax as possible.
34
35 It supports the full Scheme syntax as defined in R5RS.
36
37 .. versionadded:: 0.6
38 """
39 name = 'Scheme'
40 aliases = ['scheme', 'scm']
41 filenames = ['*.scm', '*.ss']
42 mimetypes = ['text/x-scheme', 'application/x-scheme']
43
44 # list of known keywords and builtins taken form vim 6.4 scheme.vim
45 # syntax file.
46 keywords = (
47 'lambda', 'define', 'if', 'else', 'cond', 'and', 'or', 'case', 'let',
48 'let*', 'letrec', 'begin', 'do', 'delay', 'set!', '=>', 'quote',
49 'quasiquote', 'unquote', 'unquote-splicing', 'define-syntax',
50 'let-syntax', 'letrec-syntax', 'syntax-rules'
51 )
52 builtins = (
53 '*', '+', '-', '/', '<', '<=', '=', '>', '>=', 'abs', 'acos', 'angle',
54 'append', 'apply', 'asin', 'assoc', 'assq', 'assv', 'atan',
55 'boolean?', 'caaaar', 'caaadr', 'caaar', 'caadar', 'caaddr', 'caadr',
56 'caar', 'cadaar', 'cadadr', 'cadar', 'caddar', 'cadddr', 'caddr',
57 'cadr', 'call-with-current-continuation', 'call-with-input-file',
58 'call-with-output-file', 'call-with-values', 'call/cc', 'car',
59 'cdaaar', 'cdaadr', 'cdaar', 'cdadar', 'cdaddr', 'cdadr', 'cdar',
60 'cddaar', 'cddadr', 'cddar', 'cdddar', 'cddddr', 'cdddr', 'cddr',
61 'cdr', 'ceiling', 'char->integer', 'char-alphabetic?', 'char-ci<=?',
62 'char-ci<?', 'char-ci=?', 'char-ci>=?', 'char-ci>?', 'char-downcase',
63 'char-lower-case?', 'char-numeric?', 'char-ready?', 'char-upcase',
64 'char-upper-case?', 'char-whitespace?', 'char<=?', 'char<?', 'char=?',
65 'char>=?', 'char>?', 'char?', 'close-input-port', 'close-output-port',
66 'complex?', 'cons', 'cos', 'current-input-port', 'current-output-port',
67 'denominator', 'display', 'dynamic-wind', 'eof-object?', 'eq?',
68 'equal?', 'eqv?', 'eval', 'even?', 'exact->inexact', 'exact?', 'exp',
69 'expt', 'floor', 'for-each', 'force', 'gcd', 'imag-part',
70 'inexact->exact', 'inexact?', 'input-port?', 'integer->char',
71 'integer?', 'interaction-environment', 'lcm', 'length', 'list',
72 'list->string', 'list->vector', 'list-ref', 'list-tail', 'list?',
73 'load', 'log', 'magnitude', 'make-polar', 'make-rectangular',
74 'make-string', 'make-vector', 'map', 'max', 'member', 'memq', 'memv',
75 'min', 'modulo', 'negative?', 'newline', 'not', 'null-environment',
76 'null?', 'number->string', 'number?', 'numerator', 'odd?',
77 'open-input-file', 'open-output-file', 'output-port?', 'pair?',
78 'peek-char', 'port?', 'positive?', 'procedure?', 'quotient',
79 'rational?', 'rationalize', 'read', 'read-char', 'real-part', 'real?',
80 'remainder', 'reverse', 'round', 'scheme-report-environment',
81 'set-car!', 'set-cdr!', 'sin', 'sqrt', 'string', 'string->list',
82 'string->number', 'string->symbol', 'string-append', 'string-ci<=?',
83 'string-ci<?', 'string-ci=?', 'string-ci>=?', 'string-ci>?',
84 'string-copy', 'string-fill!', 'string-length', 'string-ref',
85 'string-set!', 'string<=?', 'string<?', 'string=?', 'string>=?',
86 'string>?', 'string?', 'substring', 'symbol->string', 'symbol?',
87 'tan', 'transcript-off', 'transcript-on', 'truncate', 'values',
88 'vector', 'vector->list', 'vector-fill!', 'vector-length',
89 'vector-ref', 'vector-set!', 'vector?', 'with-input-from-file',
90 'with-output-to-file', 'write', 'write-char', 'zero?'
91 )
92
93 # valid names for identifiers
94 # well, names can only not consist fully of numbers
95 # but this should be good enough for now
96 valid_name = r'[\w!$%&*+,/:<=>?@^~|-]+'
97
98 tokens = {
99 'root': [
100 # the comments
101 # and going to the end of the line
102 (r';.*$', Comment.Single),
103 # multi-line comment
104 (r'#\|', Comment.Multiline, 'multiline-comment'),
105 # commented form (entire sexpr folliwng)
106 (r'#;\s*\(', Comment, 'commented-form'),
107 # signifies that the program text that follows is written with the
108 # lexical and datum syntax described in r6rs
109 (r'#!r6rs', Comment),
110
111 # whitespaces - usually not relevant
112 (r'\s+', Text),
113
114 # numbers
115 (r'-?\d+\.\d+', Number.Float),
116 (r'-?\d+', Number.Integer),
117 # support for uncommon kinds of numbers -
118 # have to figure out what the characters mean
119 # (r'(#e|#i|#b|#o|#d|#x)[\d.]+', Number),
120
121 # strings, symbols and characters
122 (r'"(\\\\|\\"|[^"])*"', String),
123 (r"'" + valid_name, String.Symbol),
124 (r"#\\([()/'\"._!§$%& ?=+-]|[a-zA-Z0-9]+)", String.Char),
125
126 # constants
127 (r'(#t|#f)', Name.Constant),
128
129 # special operators
130 (r"('|#|`|,@|,|\.)", Operator),
131
132 # highlight the keywords
133 ('(%s)' % '|'.join(re.escape(entry) + ' ' for entry in keywords),
134 Keyword),
135
136 # first variable in a quoted string like
137 # '(this is syntactic sugar)
138 (r"(?<='\()" + valid_name, Name.Variable),
139 (r"(?<=#\()" + valid_name, Name.Variable),
140
141 # highlight the builtins
142 (r"(?<=\()(%s)" % '|'.join(re.escape(entry) + ' ' for entry in builtins),
143 Name.Builtin),
144
145 # the remaining functions
146 (r'(?<=\()' + valid_name, Name.Function),
147 # find the remaining variables
148 (valid_name, Name.Variable),
149
150 # the famous parentheses!
151 (r'(\(|\))', Punctuation),
152 (r'(\[|\])', Punctuation),
153 ],
154 'multiline-comment': [
155 (r'#\|', Comment.Multiline, '#push'),
156 (r'\|#', Comment.Multiline, '#pop'),
157 (r'[^|#]+', Comment.Multiline),
158 (r'[|#]', Comment.Multiline),
159 ],
160 'commented-form': [
161 (r'\(', Comment, '#push'),
162 (r'\)', Comment, '#pop'),
163 (r'[^()]+', Comment),
164 ],
165 }
166
167
168 class CommonLispLexer(RegexLexer):
169 """
170 A Common Lisp lexer.
171
172 .. versionadded:: 0.9
173 """
174 name = 'Common Lisp'
175 aliases = ['common-lisp', 'cl', 'lisp']
176 filenames = ['*.cl', '*.lisp']
177 mimetypes = ['text/x-common-lisp']
178
179 flags = re.IGNORECASE | re.MULTILINE
180
181 # couple of useful regexes
182
183 # characters that are not macro-characters and can be used to begin a symbol
184 nonmacro = r'\\.|[\w!$%&*+-/<=>?@\[\]^{}~]'
185 constituent = nonmacro + '|[#.:]'
186 terminated = r'(?=[ "()\'\n,;`])' # whitespace or terminating macro characters
187
188 # symbol token, reverse-engineered from hyperspec
189 # Take a deep breath...
190 symbol = r'(\|[^|]+\||(?:%s)(?:%s)*)' % (nonmacro, constituent)
191
192 def __init__(self, **options):
193 from pygments.lexers._cl_builtins import BUILTIN_FUNCTIONS, \
194 SPECIAL_FORMS, MACROS, LAMBDA_LIST_KEYWORDS, DECLARATIONS, \
195 BUILTIN_TYPES, BUILTIN_CLASSES
196 self.builtin_function = BUILTIN_FUNCTIONS
197 self.special_forms = SPECIAL_FORMS
198 self.macros = MACROS
199 self.lambda_list_keywords = LAMBDA_LIST_KEYWORDS
200 self.declarations = DECLARATIONS
201 self.builtin_types = BUILTIN_TYPES
202 self.builtin_classes = BUILTIN_CLASSES
203 RegexLexer.__init__(self, **options)
204
205 def get_tokens_unprocessed(self, text):
206 stack = ['root']
207 for index, token, value in RegexLexer.get_tokens_unprocessed(self, text, stack):
208 if token is Name.Variable:
209 if value in self.builtin_function:
210 yield index, Name.Builtin, value
211 continue
212 if value in self.special_forms:
213 yield index, Keyword, value
214 continue
215 if value in self.macros:
216 yield index, Name.Builtin, value
217 continue
218 if value in self.lambda_list_keywords:
219 yield index, Keyword, value
220 continue
221 if value in self.declarations:
222 yield index, Keyword, value
223 continue
224 if value in self.builtin_types:
225 yield index, Keyword.Type, value
226 continue
227 if value in self.builtin_classes:
228 yield index, Name.Class, value
229 continue
230 yield index, token, value
231
232 tokens = {
233 'root': [
234 default('body'),
235 ],
236 'multiline-comment': [
237 (r'#\|', Comment.Multiline, '#push'), # (cf. Hyperspec 2.4.8.19)
238 (r'\|#', Comment.Multiline, '#pop'),
239 (r'[^|#]+', Comment.Multiline),
240 (r'[|#]', Comment.Multiline),
241 ],
242 'commented-form': [
243 (r'\(', Comment.Preproc, '#push'),
244 (r'\)', Comment.Preproc, '#pop'),
245 (r'[^()]+', Comment.Preproc),
246 ],
247 'body': [
248 # whitespace
249 (r'\s+', Text),
250
251 # single-line comment
252 (r';.*$', Comment.Single),
253
254 # multi-line comment
255 (r'#\|', Comment.Multiline, 'multiline-comment'),
256
257 # encoding comment (?)
258 (r'#\d*Y.*$', Comment.Special),
259
260 # strings and characters
261 (r'"(\\.|\\\n|[^"\\])*"', String),
262 # quoting
263 (r":" + symbol, String.Symbol),
264 (r"::" + symbol, String.Symbol),
265 (r":#" + symbol, String.Symbol),
266 (r"'" + symbol, String.Symbol),
267 (r"'", Operator),
268 (r"`", Operator),
269
270 # decimal numbers
271 (r'[-+]?\d+\.?' + terminated, Number.Integer),
272 (r'[-+]?\d+/\d+' + terminated, Number),
273 (r'[-+]?(\d*\.\d+([defls][-+]?\d+)?|\d+(\.\d*)?[defls][-+]?\d+)' +
274 terminated, Number.Float),
275
276 # sharpsign strings and characters
277 (r"#\\." + terminated, String.Char),
278 (r"#\\" + symbol, String.Char),
279
280 # vector
281 (r'#\(', Operator, 'body'),
282
283 # bitstring
284 (r'#\d*\*[01]*', Literal.Other),
285
286 # uninterned symbol
287 (r'#:' + symbol, String.Symbol),
288
289 # read-time and load-time evaluation
290 (r'#[.,]', Operator),
291
292 # function shorthand
293 (r'#\'', Name.Function),
294
295 # binary rational
296 (r'#b[+-]?[01]+(/[01]+)?', Number.Bin),
297
298 # octal rational
299 (r'#o[+-]?[0-7]+(/[0-7]+)?', Number.Oct),
300
301 # hex rational
302 (r'#x[+-]?[0-9a-f]+(/[0-9a-f]+)?', Number.Hex),
303
304 # radix rational
305 (r'#\d+r[+-]?[0-9a-z]+(/[0-9a-z]+)?', Number),
306
307 # complex
308 (r'(#c)(\()', bygroups(Number, Punctuation), 'body'),
309
310 # array
311 (r'(#\d+a)(\()', bygroups(Literal.Other, Punctuation), 'body'),
312
313 # structure
314 (r'(#s)(\()', bygroups(Literal.Other, Punctuation), 'body'),
315
316 # path
317 (r'#p?"(\\.|[^"])*"', Literal.Other),
318
319 # reference
320 (r'#\d+=', Operator),
321 (r'#\d+#', Operator),
322
323 # read-time comment
324 (r'#+nil' + terminated + r'\s*\(', Comment.Preproc, 'commented-form'),
325
326 # read-time conditional
327 (r'#[+-]', Operator),
328
329 # special operators that should have been parsed already
330 (r'(,@|,|\.)', Operator),
331
332 # special constants
333 (r'(t|nil)' + terminated, Name.Constant),
334
335 # functions and variables
336 (r'\*' + symbol + r'\*', Name.Variable.Global),
337 (symbol, Name.Variable),
338
339 # parentheses
340 (r'\(', Punctuation, 'body'),
341 (r'\)', Punctuation, '#pop'),
342 ],
343 }
344
345
346 class HyLexer(RegexLexer):
347 """
348 Lexer for `Hy <http://hylang.org/>`_ source code.
349
350 .. versionadded:: 2.0
351 """
352 name = 'Hy'
353 aliases = ['hylang']
354 filenames = ['*.hy']
355 mimetypes = ['text/x-hy', 'application/x-hy']
356
357 special_forms = (
358 'cond', 'for', '->', '->>', 'car',
359 'cdr', 'first', 'rest', 'let', 'when', 'unless',
360 'import', 'do', 'progn', 'get', 'slice', 'assoc', 'with-decorator',
361 ',', 'list_comp', 'kwapply', '~', 'is', 'in', 'is-not', 'not-in',
362 'quasiquote', 'unquote', 'unquote-splice', 'quote', '|', '<<=', '>>=',
363 'foreach', 'while',
364 'eval-and-compile', 'eval-when-compile'
365 )
366
367 declarations = (
368 'def', 'defn', 'defun', 'defmacro', 'defclass', 'lambda', 'fn', 'setv'
369 )
370
371 hy_builtins = ()
372
373 hy_core = (
374 'cycle', 'dec', 'distinct', 'drop', 'even?', 'filter', 'inc',
375 'instance?', 'iterable?', 'iterate', 'iterator?', 'neg?',
376 'none?', 'nth', 'numeric?', 'odd?', 'pos?', 'remove', 'repeat',
377 'repeatedly', 'take', 'take_nth', 'take_while', 'zero?'
378 )
379
380 builtins = hy_builtins + hy_core
381
382 # valid names for identifiers
383 # well, names can only not consist fully of numbers
384 # but this should be good enough for now
385 valid_name = r'(?!#)[\w!$%*+<=>?/.#-:]+'
386
387 def _multi_escape(entries):
388 return words(entries, suffix=' ')
389
390 tokens = {
391 'root': [
392 # the comments - always starting with semicolon
393 # and going to the end of the line
394 (r';.*$', Comment.Single),
395
396 # whitespaces - usually not relevant
397 (r'[,\s]+', Text),
398
399 # numbers
400 (r'-?\d+\.\d+', Number.Float),
401 (r'-?\d+', Number.Integer),
402 (r'0[0-7]+j?', Number.Oct),
403 (r'0[xX][a-fA-F0-9]+', Number.Hex),
404
405 # strings, symbols and characters
406 (r'"(\\\\|\\"|[^"])*"', String),
407 (r"'" + valid_name, String.Symbol),
408 (r"\\(.|[a-z]+)", String.Char),
409 (r'^(\s*)([rRuU]{,2}"""(?:.|\n)*?""")', bygroups(Text, String.Doc)),
410 (r"^(\s*)([rRuU]{,2}'''(?:.|\n)*?''')", bygroups(Text, String.Doc)),
411
412 # keywords
413 (r'::?' + valid_name, String.Symbol),
414
415 # special operators
416 (r'~@|[`\'#^~&@]', Operator),
417
418 include('py-keywords'),
419 include('py-builtins'),
420
421 # highlight the special forms
422 (_multi_escape(special_forms), Keyword),
423
424 # Technically, only the special forms are 'keywords'. The problem
425 # is that only treating them as keywords means that things like
426 # 'defn' and 'ns' need to be highlighted as builtins. This is ugly
427 # and weird for most styles. So, as a compromise we're going to
428 # highlight them as Keyword.Declarations.
429 (_multi_escape(declarations), Keyword.Declaration),
430
431 # highlight the builtins
432 (_multi_escape(builtins), Name.Builtin),
433
434 # the remaining functions
435 (r'(?<=\()' + valid_name, Name.Function),
436
437 # find the remaining variables
438 (valid_name, Name.Variable),
439
440 # Hy accepts vector notation
441 (r'(\[|\])', Punctuation),
442
443 # Hy accepts map notation
444 (r'(\{|\})', Punctuation),
445
446 # the famous parentheses!
447 (r'(\(|\))', Punctuation),
448
449 ],
450 'py-keywords': PythonLexer.tokens['keywords'],
451 'py-builtins': PythonLexer.tokens['builtins'],
452 }
453
454 def analyse_text(text):
455 if '(import ' in text or '(defn ' in text:
456 return 0.9
457
458
459 class RacketLexer(RegexLexer):
460 """
461 Lexer for `Racket <http://racket-lang.org/>`_ source code (formerly
462 known as PLT Scheme).
463
464 .. versionadded:: 1.6
465 """
466
467 name = 'Racket'
468 aliases = ['racket', 'rkt']
469 filenames = ['*.rkt', '*.rktd', '*.rktl']
470 mimetypes = ['text/x-racket', 'application/x-racket']
471
472 # Generated by example.rkt
473 _keywords = (
474 u'#%app', u'#%datum', u'#%declare', u'#%expression', u'#%module-begin',
475 u'#%plain-app', u'#%plain-lambda', u'#%plain-module-begin',
476 u'#%printing-module-begin', u'#%provide', u'#%require',
477 u'#%stratified-body', u'#%top', u'#%top-interaction',
478 u'#%variable-reference', u'->', u'->*', u'->*m', u'->d', u'->dm', u'->i',
479 u'->m', u'...', u':do-in', u'==', u'=>', u'_', u'absent', u'abstract',
480 u'all-defined-out', u'all-from-out', u'and', u'any', u'augment', u'augment*',
481 u'augment-final', u'augment-final*', u'augride', u'augride*', u'begin',
482 u'begin-for-syntax', u'begin0', u'case', u'case->', u'case->m',
483 u'case-lambda', u'class', u'class*', u'class-field-accessor',
484 u'class-field-mutator', u'class/c', u'class/derived', u'combine-in',
485 u'combine-out', u'command-line', u'compound-unit', u'compound-unit/infer',
486 u'cond', u'cons/dc', u'contract', u'contract-out', u'contract-struct',
487 u'contracted', u'define', u'define-compound-unit',
488 u'define-compound-unit/infer', u'define-contract-struct',
489 u'define-custom-hash-types', u'define-custom-set-types',
490 u'define-for-syntax', u'define-local-member-name', u'define-logger',
491 u'define-match-expander', u'define-member-name',
492 u'define-module-boundary-contract', u'define-namespace-anchor',
493 u'define-opt/c', u'define-sequence-syntax', u'define-serializable-class',
494 u'define-serializable-class*', u'define-signature',
495 u'define-signature-form', u'define-struct', u'define-struct/contract',
496 u'define-struct/derived', u'define-syntax', u'define-syntax-rule',
497 u'define-syntaxes', u'define-unit', u'define-unit-binding',
498 u'define-unit-from-context', u'define-unit/contract',
499 u'define-unit/new-import-export', u'define-unit/s', u'define-values',
500 u'define-values-for-export', u'define-values-for-syntax',
501 u'define-values/invoke-unit', u'define-values/invoke-unit/infer',
502 u'define/augment', u'define/augment-final', u'define/augride',
503 u'define/contract', u'define/final-prop', u'define/match',
504 u'define/overment', u'define/override', u'define/override-final',
505 u'define/private', u'define/public', u'define/public-final',
506 u'define/pubment', u'define/subexpression-pos-prop',
507 u'define/subexpression-pos-prop/name', u'delay', u'delay/idle',
508 u'delay/name', u'delay/strict', u'delay/sync', u'delay/thread', u'do',
509 u'else', u'except', u'except-in', u'except-out', u'export', u'extends',
510 u'failure-cont', u'false', u'false/c', u'field', u'field-bound?', u'file',
511 u'flat-murec-contract', u'flat-rec-contract', u'for', u'for*', u'for*/and',
512 u'for*/async', u'for*/first', u'for*/fold', u'for*/fold/derived',
513 u'for*/hash', u'for*/hasheq', u'for*/hasheqv', u'for*/last', u'for*/list',
514 u'for*/lists', u'for*/mutable-set', u'for*/mutable-seteq',
515 u'for*/mutable-seteqv', u'for*/or', u'for*/product', u'for*/set',
516 u'for*/seteq', u'for*/seteqv', u'for*/stream', u'for*/sum', u'for*/vector',
517 u'for*/weak-set', u'for*/weak-seteq', u'for*/weak-seteqv', u'for-label',
518 u'for-meta', u'for-syntax', u'for-template', u'for/and', u'for/async',
519 u'for/first', u'for/fold', u'for/fold/derived', u'for/hash', u'for/hasheq',
520 u'for/hasheqv', u'for/last', u'for/list', u'for/lists', u'for/mutable-set',
521 u'for/mutable-seteq', u'for/mutable-seteqv', u'for/or', u'for/product',
522 u'for/set', u'for/seteq', u'for/seteqv', u'for/stream', u'for/sum',
523 u'for/vector', u'for/weak-set', u'for/weak-seteq', u'for/weak-seteqv',
524 u'gen:custom-write', u'gen:dict', u'gen:equal+hash', u'gen:set',
525 u'gen:stream', u'generic', u'get-field', u'hash/dc', u'if', u'implies',
526 u'import', u'include', u'include-at/relative-to',
527 u'include-at/relative-to/reader', u'include/reader', u'inherit',
528 u'inherit-field', u'inherit/inner', u'inherit/super', u'init',
529 u'init-depend', u'init-field', u'init-rest', u'inner', u'inspect',
530 u'instantiate', u'interface', u'interface*', u'invariant-assertion',
531 u'invoke-unit', u'invoke-unit/infer', u'lambda', u'lazy', u'let', u'let*',
532 u'let*-values', u'let-syntax', u'let-syntaxes', u'let-values', u'let/cc',
533 u'let/ec', u'letrec', u'letrec-syntax', u'letrec-syntaxes',
534 u'letrec-syntaxes+values', u'letrec-values', u'lib', u'link', u'local',
535 u'local-require', u'log-debug', u'log-error', u'log-fatal', u'log-info',
536 u'log-warning', u'match', u'match*', u'match*/derived', u'match-define',
537 u'match-define-values', u'match-lambda', u'match-lambda*',
538 u'match-lambda**', u'match-let', u'match-let*', u'match-let*-values',
539 u'match-let-values', u'match-letrec', u'match-letrec-values',
540 u'match/derived', u'match/values', u'member-name-key', u'mixin', u'module',
541 u'module*', u'module+', u'nand', u'new', u'nor', u'object-contract',
542 u'object/c', u'only', u'only-in', u'only-meta-in', u'open', u'opt/c', u'or',
543 u'overment', u'overment*', u'override', u'override*', u'override-final',
544 u'override-final*', u'parameterize', u'parameterize*',
545 u'parameterize-break', u'parametric->/c', u'place', u'place*',
546 u'place/context', u'planet', u'prefix', u'prefix-in', u'prefix-out',
547 u'private', u'private*', u'prompt-tag/c', u'protect-out', u'provide',
548 u'provide-signature-elements', u'provide/contract', u'public', u'public*',
549 u'public-final', u'public-final*', u'pubment', u'pubment*', u'quasiquote',
550 u'quasisyntax', u'quasisyntax/loc', u'quote', u'quote-syntax',
551 u'quote-syntax/prune', u'recontract-out', u'recursive-contract',
552 u'relative-in', u'rename', u'rename-in', u'rename-inner', u'rename-out',
553 u'rename-super', u'require', u'send', u'send*', u'send+', u'send-generic',
554 u'send/apply', u'send/keyword-apply', u'set!', u'set!-values',
555 u'set-field!', u'shared', u'stream', u'stream*', u'stream-cons', u'struct',
556 u'struct*', u'struct-copy', u'struct-field-index', u'struct-out',
557 u'struct/c', u'struct/ctc', u'struct/dc', u'submod', u'super',
558 u'super-instantiate', u'super-make-object', u'super-new', u'syntax',
559 u'syntax-case', u'syntax-case*', u'syntax-id-rules', u'syntax-rules',
560 u'syntax/loc', u'tag', u'this', u'this%', u'thunk', u'thunk*', u'time',
561 u'unconstrained-domain->', u'unit', u'unit-from-context', u'unit/c',
562 u'unit/new-import-export', u'unit/s', u'unless', u'unquote',
563 u'unquote-splicing', u'unsyntax', u'unsyntax-splicing', u'values/drop',
564 u'when', u'with-continuation-mark', u'with-contract',
565 u'with-contract-continuation-mark', u'with-handlers', u'with-handlers*',
566 u'with-method', u'with-syntax', u'λ'
567 )
568
569 # Generated by example.rkt
570 _builtins = (
571 u'*', u'*list/c', u'+', u'-', u'/', u'<', u'</c', u'<=', u'<=/c', u'=', u'=/c',
572 u'>', u'>/c', u'>=', u'>=/c', u'abort-current-continuation', u'abs',
573 u'absolute-path?', u'acos', u'add-between', u'add1', u'alarm-evt',
574 u'always-evt', u'and/c', u'andmap', u'angle', u'any/c', u'append', u'append*',
575 u'append-map', u'apply', u'argmax', u'argmin', u'arithmetic-shift',
576 u'arity-at-least', u'arity-at-least-value', u'arity-at-least?',
577 u'arity-checking-wrapper', u'arity-includes?', u'arity=?',
578 u'arrow-contract-info', u'arrow-contract-info-accepts-arglist',
579 u'arrow-contract-info-chaperone-procedure',
580 u'arrow-contract-info-check-first-order', u'arrow-contract-info?',
581 u'asin', u'assf', u'assoc', u'assq', u'assv', u'atan',
582 u'bad-number-of-results', u'banner', u'base->-doms/c', u'base->-rngs/c',
583 u'base->?', u'between/c', u'bitwise-and', u'bitwise-bit-field',
584 u'bitwise-bit-set?', u'bitwise-ior', u'bitwise-not', u'bitwise-xor',
585 u'blame-add-car-context', u'blame-add-cdr-context', u'blame-add-context',
586 u'blame-add-missing-party', u'blame-add-nth-arg-context',
587 u'blame-add-range-context', u'blame-add-unknown-context',
588 u'blame-context', u'blame-contract', u'blame-fmt->-string',
589 u'blame-missing-party?', u'blame-negative', u'blame-original?',
590 u'blame-positive', u'blame-replace-negative', u'blame-source',
591 u'blame-swap', u'blame-swapped?', u'blame-update', u'blame-value',
592 u'blame?', u'boolean=?', u'boolean?', u'bound-identifier=?', u'box',
593 u'box-cas!', u'box-immutable', u'box-immutable/c', u'box/c', u'box?',
594 u'break-enabled', u'break-parameterization?', u'break-thread',
595 u'build-chaperone-contract-property', u'build-compound-type-name',
596 u'build-contract-property', u'build-flat-contract-property',
597 u'build-list', u'build-path', u'build-path/convention-type',
598 u'build-string', u'build-vector', u'byte-pregexp', u'byte-pregexp?',
599 u'byte-ready?', u'byte-regexp', u'byte-regexp?', u'byte?', u'bytes',
600 u'bytes->immutable-bytes', u'bytes->list', u'bytes->path',
601 u'bytes->path-element', u'bytes->string/latin-1', u'bytes->string/locale',
602 u'bytes->string/utf-8', u'bytes-append', u'bytes-append*',
603 u'bytes-close-converter', u'bytes-convert', u'bytes-convert-end',
604 u'bytes-converter?', u'bytes-copy', u'bytes-copy!',
605 u'bytes-environment-variable-name?', u'bytes-fill!', u'bytes-join',
606 u'bytes-length', u'bytes-no-nuls?', u'bytes-open-converter', u'bytes-ref',
607 u'bytes-set!', u'bytes-utf-8-index', u'bytes-utf-8-length',
608 u'bytes-utf-8-ref', u'bytes<?', u'bytes=?', u'bytes>?', u'bytes?', u'caaaar',
609 u'caaadr', u'caaar', u'caadar', u'caaddr', u'caadr', u'caar', u'cadaar',
610 u'cadadr', u'cadar', u'caddar', u'cadddr', u'caddr', u'cadr',
611 u'call-in-nested-thread', u'call-with-atomic-output-file',
612 u'call-with-break-parameterization',
613 u'call-with-composable-continuation', u'call-with-continuation-barrier',
614 u'call-with-continuation-prompt', u'call-with-current-continuation',
615 u'call-with-default-reading-parameterization',
616 u'call-with-escape-continuation', u'call-with-exception-handler',
617 u'call-with-file-lock/timeout', u'call-with-immediate-continuation-mark',
618 u'call-with-input-bytes', u'call-with-input-file',
619 u'call-with-input-file*', u'call-with-input-string',
620 u'call-with-output-bytes', u'call-with-output-file',
621 u'call-with-output-file*', u'call-with-output-string',
622 u'call-with-parameterization', u'call-with-semaphore',
623 u'call-with-semaphore/enable-break', u'call-with-values', u'call/cc',
624 u'call/ec', u'car', u'cartesian-product', u'cdaaar', u'cdaadr', u'cdaar',
625 u'cdadar', u'cdaddr', u'cdadr', u'cdar', u'cddaar', u'cddadr', u'cddar',
626 u'cdddar', u'cddddr', u'cdddr', u'cddr', u'cdr', u'ceiling', u'channel-get',
627 u'channel-put', u'channel-put-evt', u'channel-put-evt?',
628 u'channel-try-get', u'channel/c', u'channel?', u'chaperone-box',
629 u'chaperone-channel', u'chaperone-continuation-mark-key',
630 u'chaperone-contract-property?', u'chaperone-contract?', u'chaperone-evt',
631 u'chaperone-hash', u'chaperone-hash-set', u'chaperone-of?',
632 u'chaperone-procedure', u'chaperone-procedure*', u'chaperone-prompt-tag',
633 u'chaperone-struct', u'chaperone-struct-type', u'chaperone-vector',
634 u'chaperone?', u'char->integer', u'char-alphabetic?', u'char-blank?',
635 u'char-ci<=?', u'char-ci<?', u'char-ci=?', u'char-ci>=?', u'char-ci>?',
636 u'char-downcase', u'char-foldcase', u'char-general-category',
637 u'char-graphic?', u'char-in', u'char-in/c', u'char-iso-control?',
638 u'char-lower-case?', u'char-numeric?', u'char-punctuation?',
639 u'char-ready?', u'char-symbolic?', u'char-title-case?', u'char-titlecase',
640 u'char-upcase', u'char-upper-case?', u'char-utf-8-length',
641 u'char-whitespace?', u'char<=?', u'char<?', u'char=?', u'char>=?', u'char>?',
642 u'char?', u'check-duplicate-identifier', u'check-duplicates',
643 u'checked-procedure-check-and-extract', u'choice-evt',
644 u'class->interface', u'class-info', u'class-seal', u'class-unseal',
645 u'class?', u'cleanse-path', u'close-input-port', u'close-output-port',
646 u'coerce-chaperone-contract', u'coerce-chaperone-contracts',
647 u'coerce-contract', u'coerce-contract/f', u'coerce-contracts',
648 u'coerce-flat-contract', u'coerce-flat-contracts', u'collect-garbage',
649 u'collection-file-path', u'collection-path', u'combinations', u'compile',
650 u'compile-allow-set!-undefined', u'compile-context-preservation-enabled',
651 u'compile-enforce-module-constants', u'compile-syntax',
652 u'compiled-expression-recompile', u'compiled-expression?',
653 u'compiled-module-expression?', u'complete-path?', u'complex?', u'compose',
654 u'compose1', u'conjoin', u'conjugate', u'cons', u'cons/c', u'cons?', u'const',
655 u'continuation-mark-key/c', u'continuation-mark-key?',
656 u'continuation-mark-set->context', u'continuation-mark-set->list',
657 u'continuation-mark-set->list*', u'continuation-mark-set-first',
658 u'continuation-mark-set?', u'continuation-marks',
659 u'continuation-prompt-available?', u'continuation-prompt-tag?',
660 u'continuation?', u'contract-continuation-mark-key',
661 u'contract-custom-write-property-proc', u'contract-exercise',
662 u'contract-first-order', u'contract-first-order-passes?',
663 u'contract-late-neg-projection', u'contract-name', u'contract-proc',
664 u'contract-projection', u'contract-property?',
665 u'contract-random-generate', u'contract-random-generate-fail',
666 u'contract-random-generate-fail?',
667 u'contract-random-generate-get-current-environment',
668 u'contract-random-generate-stash', u'contract-random-generate/choose',
669 u'contract-stronger?', u'contract-struct-exercise',
670 u'contract-struct-generate', u'contract-struct-late-neg-projection',
671 u'contract-struct-list-contract?', u'contract-val-first-projection',
672 u'contract?', u'convert-stream', u'copy-directory/files', u'copy-file',
673 u'copy-port', u'cos', u'cosh', u'count', u'current-blame-format',
674 u'current-break-parameterization', u'current-code-inspector',
675 u'current-command-line-arguments', u'current-compile',
676 u'current-compiled-file-roots', u'current-continuation-marks',
677 u'current-contract-region', u'current-custodian', u'current-directory',
678 u'current-directory-for-user', u'current-drive',
679 u'current-environment-variables', u'current-error-port', u'current-eval',
680 u'current-evt-pseudo-random-generator',
681 u'current-force-delete-permissions', u'current-future',
682 u'current-gc-milliseconds', u'current-get-interaction-input-port',
683 u'current-inexact-milliseconds', u'current-input-port',
684 u'current-inspector', u'current-library-collection-links',
685 u'current-library-collection-paths', u'current-load',
686 u'current-load-extension', u'current-load-relative-directory',
687 u'current-load/use-compiled', u'current-locale', u'current-logger',
688 u'current-memory-use', u'current-milliseconds',
689 u'current-module-declare-name', u'current-module-declare-source',
690 u'current-module-name-resolver', u'current-module-path-for-load',
691 u'current-namespace', u'current-output-port', u'current-parameterization',
692 u'current-plumber', u'current-preserved-thread-cell-values',
693 u'current-print', u'current-process-milliseconds', u'current-prompt-read',
694 u'current-pseudo-random-generator', u'current-read-interaction',
695 u'current-reader-guard', u'current-readtable', u'current-seconds',
696 u'current-security-guard', u'current-subprocess-custodian-mode',
697 u'current-thread', u'current-thread-group',
698 u'current-thread-initial-stack-size',
699 u'current-write-relative-directory', u'curry', u'curryr',
700 u'custodian-box-value', u'custodian-box?', u'custodian-limit-memory',
701 u'custodian-managed-list', u'custodian-memory-accounting-available?',
702 u'custodian-require-memory', u'custodian-shutdown-all', u'custodian?',
703 u'custom-print-quotable-accessor', u'custom-print-quotable?',
704 u'custom-write-accessor', u'custom-write-property-proc', u'custom-write?',
705 u'date', u'date*', u'date*-nanosecond', u'date*-time-zone-name', u'date*?',
706 u'date-day', u'date-dst?', u'date-hour', u'date-minute', u'date-month',
707 u'date-second', u'date-time-zone-offset', u'date-week-day', u'date-year',
708 u'date-year-day', u'date?', u'datum->syntax', u'datum-intern-literal',
709 u'default-continuation-prompt-tag', u'degrees->radians',
710 u'delete-directory', u'delete-directory/files', u'delete-file',
711 u'denominator', u'dict->list', u'dict-can-functional-set?',
712 u'dict-can-remove-keys?', u'dict-clear', u'dict-clear!', u'dict-copy',
713 u'dict-count', u'dict-empty?', u'dict-for-each', u'dict-has-key?',
714 u'dict-implements/c', u'dict-implements?', u'dict-iter-contract',
715 u'dict-iterate-first', u'dict-iterate-key', u'dict-iterate-next',
716 u'dict-iterate-value', u'dict-key-contract', u'dict-keys', u'dict-map',
717 u'dict-mutable?', u'dict-ref', u'dict-ref!', u'dict-remove',
718 u'dict-remove!', u'dict-set', u'dict-set!', u'dict-set*', u'dict-set*!',
719 u'dict-update', u'dict-update!', u'dict-value-contract', u'dict-values',
720 u'dict?', u'directory-exists?', u'directory-list', u'disjoin', u'display',
721 u'display-lines', u'display-lines-to-file', u'display-to-file',
722 u'displayln', u'double-flonum?', u'drop', u'drop-common-prefix',
723 u'drop-right', u'dropf', u'dropf-right', u'dump-memory-stats',
724 u'dup-input-port', u'dup-output-port', u'dynamic->*', u'dynamic-get-field',
725 u'dynamic-object/c', u'dynamic-place', u'dynamic-place*',
726 u'dynamic-require', u'dynamic-require-for-syntax', u'dynamic-send',
727 u'dynamic-set-field!', u'dynamic-wind', u'eighth', u'empty',
728 u'empty-sequence', u'empty-stream', u'empty?',
729 u'environment-variables-copy', u'environment-variables-names',
730 u'environment-variables-ref', u'environment-variables-set!',
731 u'environment-variables?', u'eof', u'eof-evt', u'eof-object?',
732 u'ephemeron-value', u'ephemeron?', u'eprintf', u'eq-contract-val',
733 u'eq-contract?', u'eq-hash-code', u'eq?', u'equal-contract-val',
734 u'equal-contract?', u'equal-hash-code', u'equal-secondary-hash-code',
735 u'equal<%>', u'equal?', u'equal?/recur', u'eqv-hash-code', u'eqv?', u'error',
736 u'error-display-handler', u'error-escape-handler',
737 u'error-print-context-length', u'error-print-source-location',
738 u'error-print-width', u'error-value->string-handler', u'eval',
739 u'eval-jit-enabled', u'eval-syntax', u'even?', u'evt/c', u'evt?',
740 u'exact->inexact', u'exact-ceiling', u'exact-floor', u'exact-integer?',
741 u'exact-nonnegative-integer?', u'exact-positive-integer?', u'exact-round',
742 u'exact-truncate', u'exact?', u'executable-yield-handler', u'exit',
743 u'exit-handler', u'exn', u'exn-continuation-marks', u'exn-message',
744 u'exn:break', u'exn:break-continuation', u'exn:break:hang-up',
745 u'exn:break:hang-up?', u'exn:break:terminate', u'exn:break:terminate?',
746 u'exn:break?', u'exn:fail', u'exn:fail:contract',
747 u'exn:fail:contract:arity', u'exn:fail:contract:arity?',
748 u'exn:fail:contract:blame', u'exn:fail:contract:blame-object',
749 u'exn:fail:contract:blame?', u'exn:fail:contract:continuation',
750 u'exn:fail:contract:continuation?', u'exn:fail:contract:divide-by-zero',
751 u'exn:fail:contract:divide-by-zero?',
752 u'exn:fail:contract:non-fixnum-result',
753 u'exn:fail:contract:non-fixnum-result?', u'exn:fail:contract:variable',
754 u'exn:fail:contract:variable-id', u'exn:fail:contract:variable?',
755 u'exn:fail:contract?', u'exn:fail:filesystem',
756 u'exn:fail:filesystem:errno', u'exn:fail:filesystem:errno-errno',
757 u'exn:fail:filesystem:errno?', u'exn:fail:filesystem:exists',
758 u'exn:fail:filesystem:exists?', u'exn:fail:filesystem:missing-module',
759 u'exn:fail:filesystem:missing-module-path',
760 u'exn:fail:filesystem:missing-module?', u'exn:fail:filesystem:version',
761 u'exn:fail:filesystem:version?', u'exn:fail:filesystem?',
762 u'exn:fail:network', u'exn:fail:network:errno',
763 u'exn:fail:network:errno-errno', u'exn:fail:network:errno?',
764 u'exn:fail:network?', u'exn:fail:object', u'exn:fail:object?',
765 u'exn:fail:out-of-memory', u'exn:fail:out-of-memory?', u'exn:fail:read',
766 u'exn:fail:read-srclocs', u'exn:fail:read:eof', u'exn:fail:read:eof?',
767 u'exn:fail:read:non-char', u'exn:fail:read:non-char?', u'exn:fail:read?',
768 u'exn:fail:syntax', u'exn:fail:syntax-exprs',
769 u'exn:fail:syntax:missing-module',
770 u'exn:fail:syntax:missing-module-path',
771 u'exn:fail:syntax:missing-module?', u'exn:fail:syntax:unbound',
772 u'exn:fail:syntax:unbound?', u'exn:fail:syntax?', u'exn:fail:unsupported',
773 u'exn:fail:unsupported?', u'exn:fail:user', u'exn:fail:user?',
774 u'exn:fail?', u'exn:misc:match?', u'exn:missing-module-accessor',
775 u'exn:missing-module?', u'exn:srclocs-accessor', u'exn:srclocs?', u'exn?',
776 u'exp', u'expand', u'expand-once', u'expand-syntax', u'expand-syntax-once',
777 u'expand-syntax-to-top-form', u'expand-to-top-form', u'expand-user-path',
778 u'explode-path', u'expt', u'externalizable<%>', u'failure-result/c',
779 u'false?', u'field-names', u'fifth', u'file->bytes', u'file->bytes-lines',
780 u'file->lines', u'file->list', u'file->string', u'file->value',
781 u'file-exists?', u'file-name-from-path', u'file-or-directory-identity',
782 u'file-or-directory-modify-seconds', u'file-or-directory-permissions',
783 u'file-position', u'file-position*', u'file-size',
784 u'file-stream-buffer-mode', u'file-stream-port?', u'file-truncate',
785 u'filename-extension', u'filesystem-change-evt',
786 u'filesystem-change-evt-cancel', u'filesystem-change-evt?',
787 u'filesystem-root-list', u'filter', u'filter-map', u'filter-not',
788 u'filter-read-input-port', u'find-executable-path', u'find-files',
789 u'find-library-collection-links', u'find-library-collection-paths',
790 u'find-relative-path', u'find-system-path', u'findf', u'first',
791 u'first-or/c', u'fixnum?', u'flat-contract', u'flat-contract-predicate',
792 u'flat-contract-property?', u'flat-contract?', u'flat-named-contract',
793 u'flatten', u'floating-point-bytes->real', u'flonum?', u'floor',
794 u'flush-output', u'fold-files', u'foldl', u'foldr', u'for-each', u'force',
795 u'format', u'fourth', u'fprintf', u'free-identifier=?',
796 u'free-label-identifier=?', u'free-template-identifier=?',
797 u'free-transformer-identifier=?', u'fsemaphore-count', u'fsemaphore-post',
798 u'fsemaphore-try-wait?', u'fsemaphore-wait', u'fsemaphore?', u'future',
799 u'future?', u'futures-enabled?', u'gcd', u'generate-member-key',
800 u'generate-temporaries', u'generic-set?', u'generic?', u'gensym',
801 u'get-output-bytes', u'get-output-string', u'get-preference',
802 u'get/build-late-neg-projection', u'get/build-val-first-projection',
803 u'getenv', u'global-port-print-handler', u'group-by', u'group-execute-bit',
804 u'group-read-bit', u'group-write-bit', u'guard-evt', u'handle-evt',
805 u'handle-evt?', u'has-blame?', u'has-contract?', u'hash', u'hash->list',
806 u'hash-clear', u'hash-clear!', u'hash-copy', u'hash-copy-clear',
807 u'hash-count', u'hash-empty?', u'hash-eq?', u'hash-equal?', u'hash-eqv?',
808 u'hash-for-each', u'hash-has-key?', u'hash-iterate-first',
809 u'hash-iterate-key', u'hash-iterate-key+value', u'hash-iterate-next',
810 u'hash-iterate-pair', u'hash-iterate-value', u'hash-keys', u'hash-map',
811 u'hash-placeholder?', u'hash-ref', u'hash-ref!', u'hash-remove',
812 u'hash-remove!', u'hash-set', u'hash-set!', u'hash-set*', u'hash-set*!',
813 u'hash-update', u'hash-update!', u'hash-values', u'hash-weak?', u'hash/c',
814 u'hash?', u'hasheq', u'hasheqv', u'identifier-binding',
815 u'identifier-binding-symbol', u'identifier-label-binding',
816 u'identifier-prune-lexical-context',
817 u'identifier-prune-to-source-module',
818 u'identifier-remove-from-definition-context',
819 u'identifier-template-binding', u'identifier-transformer-binding',
820 u'identifier?', u'identity', u'if/c', u'imag-part', u'immutable?',
821 u'impersonate-box', u'impersonate-channel',
822 u'impersonate-continuation-mark-key', u'impersonate-hash',
823 u'impersonate-hash-set', u'impersonate-procedure',
824 u'impersonate-procedure*', u'impersonate-prompt-tag',
825 u'impersonate-struct', u'impersonate-vector', u'impersonator-contract?',
826 u'impersonator-ephemeron', u'impersonator-of?',
827 u'impersonator-prop:application-mark', u'impersonator-prop:blame',
828 u'impersonator-prop:contracted',
829 u'impersonator-property-accessor-procedure?', u'impersonator-property?',
830 u'impersonator?', u'implementation?', u'implementation?/c', u'in-bytes',
831 u'in-bytes-lines', u'in-combinations', u'in-cycle', u'in-dict',
832 u'in-dict-keys', u'in-dict-pairs', u'in-dict-values', u'in-directory',
833 u'in-hash', u'in-hash-keys', u'in-hash-pairs', u'in-hash-values',
834 u'in-immutable-hash', u'in-immutable-hash-keys',
835 u'in-immutable-hash-pairs', u'in-immutable-hash-values',
836 u'in-immutable-set', u'in-indexed', u'in-input-port-bytes',
837 u'in-input-port-chars', u'in-lines', u'in-list', u'in-mlist',
838 u'in-mutable-hash', u'in-mutable-hash-keys', u'in-mutable-hash-pairs',
839 u'in-mutable-hash-values', u'in-mutable-set', u'in-naturals',
840 u'in-parallel', u'in-permutations', u'in-port', u'in-producer', u'in-range',
841 u'in-sequences', u'in-set', u'in-slice', u'in-stream', u'in-string',
842 u'in-syntax', u'in-value', u'in-values*-sequence', u'in-values-sequence',
843 u'in-vector', u'in-weak-hash', u'in-weak-hash-keys', u'in-weak-hash-pairs',
844 u'in-weak-hash-values', u'in-weak-set', u'inexact->exact',
845 u'inexact-real?', u'inexact?', u'infinite?', u'input-port-append',
846 u'input-port?', u'inspector?', u'instanceof/c', u'integer->char',
847 u'integer->integer-bytes', u'integer-bytes->integer', u'integer-in',
848 u'integer-length', u'integer-sqrt', u'integer-sqrt/remainder', u'integer?',
849 u'interface->method-names', u'interface-extension?', u'interface?',
850 u'internal-definition-context-binding-identifiers',
851 u'internal-definition-context-introduce',
852 u'internal-definition-context-seal', u'internal-definition-context?',
853 u'is-a?', u'is-a?/c', u'keyword->string', u'keyword-apply', u'keyword<?',
854 u'keyword?', u'keywords-match', u'kill-thread', u'last', u'last-pair',
855 u'lcm', u'length', u'liberal-define-context?', u'link-exists?', u'list',
856 u'list*', u'list*of', u'list->bytes', u'list->mutable-set',
857 u'list->mutable-seteq', u'list->mutable-seteqv', u'list->set',
858 u'list->seteq', u'list->seteqv', u'list->string', u'list->vector',
859 u'list->weak-set', u'list->weak-seteq', u'list->weak-seteqv',
860 u'list-contract?', u'list-prefix?', u'list-ref', u'list-set', u'list-tail',
861 u'list-update', u'list/c', u'list?', u'listen-port-number?', u'listof',
862 u'load', u'load-extension', u'load-on-demand-enabled', u'load-relative',
863 u'load-relative-extension', u'load/cd', u'load/use-compiled',
864 u'local-expand', u'local-expand/capture-lifts',
865 u'local-transformer-expand', u'local-transformer-expand/capture-lifts',
866 u'locale-string-encoding', u'log', u'log-all-levels', u'log-level-evt',
867 u'log-level?', u'log-max-level', u'log-message', u'log-receiver?',
868 u'logger-name', u'logger?', u'magnitude', u'make-arity-at-least',
869 u'make-base-empty-namespace', u'make-base-namespace', u'make-bytes',
870 u'make-channel', u'make-chaperone-contract',
871 u'make-continuation-mark-key', u'make-continuation-prompt-tag',
872 u'make-contract', u'make-custodian', u'make-custodian-box',
873 u'make-custom-hash', u'make-custom-hash-types', u'make-custom-set',
874 u'make-custom-set-types', u'make-date', u'make-date*',
875 u'make-derived-parameter', u'make-directory', u'make-directory*',
876 u'make-do-sequence', u'make-empty-namespace',
877 u'make-environment-variables', u'make-ephemeron', u'make-exn',
878 u'make-exn:break', u'make-exn:break:hang-up', u'make-exn:break:terminate',
879 u'make-exn:fail', u'make-exn:fail:contract',
880 u'make-exn:fail:contract:arity', u'make-exn:fail:contract:blame',
881 u'make-exn:fail:contract:continuation',
882 u'make-exn:fail:contract:divide-by-zero',
883 u'make-exn:fail:contract:non-fixnum-result',
884 u'make-exn:fail:contract:variable', u'make-exn:fail:filesystem',
885 u'make-exn:fail:filesystem:errno', u'make-exn:fail:filesystem:exists',
886 u'make-exn:fail:filesystem:missing-module',
887 u'make-exn:fail:filesystem:version', u'make-exn:fail:network',
888 u'make-exn:fail:network:errno', u'make-exn:fail:object',
889 u'make-exn:fail:out-of-memory', u'make-exn:fail:read',
890 u'make-exn:fail:read:eof', u'make-exn:fail:read:non-char',
891 u'make-exn:fail:syntax', u'make-exn:fail:syntax:missing-module',
892 u'make-exn:fail:syntax:unbound', u'make-exn:fail:unsupported',
893 u'make-exn:fail:user', u'make-file-or-directory-link',
894 u'make-flat-contract', u'make-fsemaphore', u'make-generic',
895 u'make-handle-get-preference-locked', u'make-hash',
896 u'make-hash-placeholder', u'make-hasheq', u'make-hasheq-placeholder',
897 u'make-hasheqv', u'make-hasheqv-placeholder',
898 u'make-immutable-custom-hash', u'make-immutable-hash',
899 u'make-immutable-hasheq', u'make-immutable-hasheqv',
900 u'make-impersonator-property', u'make-input-port',
901 u'make-input-port/read-to-peek', u'make-inspector',
902 u'make-keyword-procedure', u'make-known-char-range-list',
903 u'make-limited-input-port', u'make-list', u'make-lock-file-name',
904 u'make-log-receiver', u'make-logger', u'make-mixin-contract',
905 u'make-mutable-custom-set', u'make-none/c', u'make-object',
906 u'make-output-port', u'make-parameter', u'make-parent-directory*',
907 u'make-phantom-bytes', u'make-pipe', u'make-pipe-with-specials',
908 u'make-placeholder', u'make-plumber', u'make-polar', u'make-prefab-struct',
909 u'make-primitive-class', u'make-proj-contract',
910 u'make-pseudo-random-generator', u'make-reader-graph', u'make-readtable',
911 u'make-rectangular', u'make-rename-transformer',
912 u'make-resolved-module-path', u'make-security-guard', u'make-semaphore',
913 u'make-set!-transformer', u'make-shared-bytes', u'make-sibling-inspector',
914 u'make-special-comment', u'make-srcloc', u'make-string',
915 u'make-struct-field-accessor', u'make-struct-field-mutator',
916 u'make-struct-type', u'make-struct-type-property',
917 u'make-syntax-delta-introducer', u'make-syntax-introducer',
918 u'make-temporary-file', u'make-tentative-pretty-print-output-port',
919 u'make-thread-cell', u'make-thread-group', u'make-vector',
920 u'make-weak-box', u'make-weak-custom-hash', u'make-weak-custom-set',
921 u'make-weak-hash', u'make-weak-hasheq', u'make-weak-hasheqv',
922 u'make-will-executor', u'map', u'match-equality-test',
923 u'matches-arity-exactly?', u'max', u'mcar', u'mcdr', u'mcons', u'member',
924 u'member-name-key-hash-code', u'member-name-key=?', u'member-name-key?',
925 u'memf', u'memq', u'memv', u'merge-input', u'method-in-interface?', u'min',
926 u'mixin-contract', u'module->exports', u'module->imports',
927 u'module->language-info', u'module->namespace',
928 u'module-compiled-cross-phase-persistent?', u'module-compiled-exports',
929 u'module-compiled-imports', u'module-compiled-language-info',
930 u'module-compiled-name', u'module-compiled-submodules',
931 u'module-declared?', u'module-path-index-join',
932 u'module-path-index-resolve', u'module-path-index-split',
933 u'module-path-index-submodule', u'module-path-index?', u'module-path?',
934 u'module-predefined?', u'module-provide-protected?', u'modulo', u'mpair?',
935 u'mutable-set', u'mutable-seteq', u'mutable-seteqv', u'n->th',
936 u'nack-guard-evt', u'namespace-anchor->empty-namespace',
937 u'namespace-anchor->namespace', u'namespace-anchor?',
938 u'namespace-attach-module', u'namespace-attach-module-declaration',
939 u'namespace-base-phase', u'namespace-mapped-symbols',
940 u'namespace-module-identifier', u'namespace-module-registry',
941 u'namespace-require', u'namespace-require/constant',
942 u'namespace-require/copy', u'namespace-require/expansion-time',
943 u'namespace-set-variable-value!', u'namespace-symbol->identifier',
944 u'namespace-syntax-introduce', u'namespace-undefine-variable!',
945 u'namespace-unprotect-module', u'namespace-variable-value', u'namespace?',
946 u'nan?', u'natural-number/c', u'negate', u'negative?', u'never-evt',
947 u'new-∀/c', u'new-∃/c', u'newline', u'ninth', u'non-empty-listof',
948 u'non-empty-string?', u'none/c', u'normal-case-path', u'normalize-arity',
949 u'normalize-path', u'normalized-arity?', u'not', u'not/c', u'null', u'null?',
950 u'number->string', u'number?', u'numerator', u'object%', u'object->vector',
951 u'object-info', u'object-interface', u'object-method-arity-includes?',
952 u'object-name', u'object-or-false=?', u'object=?', u'object?', u'odd?',
953 u'one-of/c', u'open-input-bytes', u'open-input-file',
954 u'open-input-output-file', u'open-input-string', u'open-output-bytes',
955 u'open-output-file', u'open-output-nowhere', u'open-output-string',
956 u'or/c', u'order-of-magnitude', u'ormap', u'other-execute-bit',
957 u'other-read-bit', u'other-write-bit', u'output-port?', u'pair?',
958 u'parameter-procedure=?', u'parameter/c', u'parameter?',
959 u'parameterization?', u'parse-command-line', u'partition', u'path->bytes',
960 u'path->complete-path', u'path->directory-path', u'path->string',
961 u'path-add-suffix', u'path-convention-type', u'path-element->bytes',
962 u'path-element->string', u'path-element?', u'path-for-some-system?',
963 u'path-list-string->path-list', u'path-only', u'path-replace-suffix',
964 u'path-string?', u'path<?', u'path?', u'pathlist-closure', u'peek-byte',
965 u'peek-byte-or-special', u'peek-bytes', u'peek-bytes!', u'peek-bytes!-evt',
966 u'peek-bytes-avail!', u'peek-bytes-avail!*', u'peek-bytes-avail!-evt',
967 u'peek-bytes-avail!/enable-break', u'peek-bytes-evt', u'peek-char',
968 u'peek-char-or-special', u'peek-string', u'peek-string!',
969 u'peek-string!-evt', u'peek-string-evt', u'peeking-input-port',
970 u'permutations', u'phantom-bytes?', u'pi', u'pi.f', u'pipe-content-length',
971 u'place-break', u'place-channel', u'place-channel-get',
972 u'place-channel-put', u'place-channel-put/get', u'place-channel?',
973 u'place-dead-evt', u'place-enabled?', u'place-kill', u'place-location?',
974 u'place-message-allowed?', u'place-sleep', u'place-wait', u'place?',
975 u'placeholder-get', u'placeholder-set!', u'placeholder?',
976 u'plumber-add-flush!', u'plumber-flush-all',
977 u'plumber-flush-handle-remove!', u'plumber-flush-handle?', u'plumber?',
978 u'poll-guard-evt', u'port->bytes', u'port->bytes-lines', u'port->lines',
979 u'port->list', u'port->string', u'port-closed-evt', u'port-closed?',
980 u'port-commit-peeked', u'port-count-lines!', u'port-count-lines-enabled',
981 u'port-counts-lines?', u'port-display-handler', u'port-file-identity',
982 u'port-file-unlock', u'port-next-location', u'port-number?',
983 u'port-print-handler', u'port-progress-evt',
984 u'port-provides-progress-evts?', u'port-read-handler',
985 u'port-try-file-lock?', u'port-write-handler', u'port-writes-atomic?',
986 u'port-writes-special?', u'port?', u'positive?', u'predicate/c',
987 u'prefab-key->struct-type', u'prefab-key?', u'prefab-struct-key',
988 u'preferences-lock-file-mode', u'pregexp', u'pregexp?', u'pretty-display',
989 u'pretty-format', u'pretty-print', u'pretty-print-.-symbol-without-bars',
990 u'pretty-print-abbreviate-read-macros', u'pretty-print-columns',
991 u'pretty-print-current-style-table', u'pretty-print-depth',
992 u'pretty-print-exact-as-decimal', u'pretty-print-extend-style-table',
993 u'pretty-print-handler', u'pretty-print-newline',
994 u'pretty-print-post-print-hook', u'pretty-print-pre-print-hook',
995 u'pretty-print-print-hook', u'pretty-print-print-line',
996 u'pretty-print-remap-stylable', u'pretty-print-show-inexactness',
997 u'pretty-print-size-hook', u'pretty-print-style-table?',
998 u'pretty-printing', u'pretty-write', u'primitive-closure?',
999 u'primitive-result-arity', u'primitive?', u'print', u'print-as-expression',
1000 u'print-boolean-long-form', u'print-box', u'print-graph',
1001 u'print-hash-table', u'print-mpair-curly-braces',
1002 u'print-pair-curly-braces', u'print-reader-abbreviations',
1003 u'print-struct', u'print-syntax-width', u'print-unreadable',
1004 u'print-vector-length', u'printable/c', u'printable<%>', u'printf',
1005 u'println', u'procedure->method', u'procedure-arity',
1006 u'procedure-arity-includes/c', u'procedure-arity-includes?',
1007 u'procedure-arity?', u'procedure-closure-contents-eq?',
1008 u'procedure-extract-target', u'procedure-keywords',
1009 u'procedure-reduce-arity', u'procedure-reduce-keyword-arity',
1010 u'procedure-rename', u'procedure-result-arity', u'procedure-specialize',
1011 u'procedure-struct-type?', u'procedure?', u'process', u'process*',
1012 u'process*/ports', u'process/ports', u'processor-count', u'progress-evt?',
1013 u'promise-forced?', u'promise-running?', u'promise/c', u'promise/name?',
1014 u'promise?', u'prop:arity-string', u'prop:arrow-contract',
1015 u'prop:arrow-contract-get-info', u'prop:arrow-contract?', u'prop:blame',
1016 u'prop:chaperone-contract', u'prop:checked-procedure', u'prop:contract',
1017 u'prop:contracted', u'prop:custom-print-quotable', u'prop:custom-write',
1018 u'prop:dict', u'prop:dict/contract', u'prop:equal+hash', u'prop:evt',
1019 u'prop:exn:missing-module', u'prop:exn:srclocs',
1020 u'prop:expansion-contexts', u'prop:flat-contract',
1021 u'prop:impersonator-of', u'prop:input-port',
1022 u'prop:liberal-define-context', u'prop:object-name',
1023 u'prop:opt-chaperone-contract', u'prop:opt-chaperone-contract-get-test',
1024 u'prop:opt-chaperone-contract?', u'prop:orc-contract',
1025 u'prop:orc-contract-get-subcontracts', u'prop:orc-contract?',
1026 u'prop:output-port', u'prop:place-location', u'prop:procedure',
1027 u'prop:recursive-contract', u'prop:recursive-contract-unroll',
1028 u'prop:recursive-contract?', u'prop:rename-transformer', u'prop:sequence',
1029 u'prop:set!-transformer', u'prop:stream', u'proper-subset?',
1030 u'pseudo-random-generator->vector', u'pseudo-random-generator-vector?',
1031 u'pseudo-random-generator?', u'put-preferences', u'putenv', u'quotient',
1032 u'quotient/remainder', u'radians->degrees', u'raise',
1033 u'raise-argument-error', u'raise-arguments-error', u'raise-arity-error',
1034 u'raise-blame-error', u'raise-contract-error', u'raise-mismatch-error',
1035 u'raise-not-cons-blame-error', u'raise-range-error',
1036 u'raise-result-error', u'raise-syntax-error', u'raise-type-error',
1037 u'raise-user-error', u'random', u'random-seed', u'range', u'rational?',
1038 u'rationalize', u'read', u'read-accept-bar-quote', u'read-accept-box',
1039 u'read-accept-compiled', u'read-accept-dot', u'read-accept-graph',
1040 u'read-accept-infix-dot', u'read-accept-lang', u'read-accept-quasiquote',
1041 u'read-accept-reader', u'read-byte', u'read-byte-or-special',
1042 u'read-bytes', u'read-bytes!', u'read-bytes!-evt', u'read-bytes-avail!',
1043 u'read-bytes-avail!*', u'read-bytes-avail!-evt',
1044 u'read-bytes-avail!/enable-break', u'read-bytes-evt', u'read-bytes-line',
1045 u'read-bytes-line-evt', u'read-case-sensitive', u'read-cdot', u'read-char',
1046 u'read-char-or-special', u'read-curly-brace-as-paren',
1047 u'read-curly-brace-with-tag', u'read-decimal-as-inexact',
1048 u'read-eval-print-loop', u'read-language', u'read-line', u'read-line-evt',
1049 u'read-on-demand-source', u'read-square-bracket-as-paren',
1050 u'read-square-bracket-with-tag', u'read-string', u'read-string!',
1051 u'read-string!-evt', u'read-string-evt', u'read-syntax',
1052 u'read-syntax/recursive', u'read/recursive', u'readtable-mapping',
1053 u'readtable?', u'real->decimal-string', u'real->double-flonum',
1054 u'real->floating-point-bytes', u'real->single-flonum', u'real-in',
1055 u'real-part', u'real?', u'reencode-input-port', u'reencode-output-port',
1056 u'regexp', u'regexp-match', u'regexp-match*', u'regexp-match-evt',
1057 u'regexp-match-exact?', u'regexp-match-peek',
1058 u'regexp-match-peek-immediate', u'regexp-match-peek-positions',
1059 u'regexp-match-peek-positions*',
1060 u'regexp-match-peek-positions-immediate',
1061 u'regexp-match-peek-positions-immediate/end',
1062 u'regexp-match-peek-positions/end', u'regexp-match-positions',
1063 u'regexp-match-positions*', u'regexp-match-positions/end',
1064 u'regexp-match/end', u'regexp-match?', u'regexp-max-lookbehind',
1065 u'regexp-quote', u'regexp-replace', u'regexp-replace*',
1066 u'regexp-replace-quote', u'regexp-replaces', u'regexp-split',
1067 u'regexp-try-match', u'regexp?', u'relative-path?', u'relocate-input-port',
1068 u'relocate-output-port', u'remainder', u'remf', u'remf*', u'remove',
1069 u'remove*', u'remove-duplicates', u'remq', u'remq*', u'remv', u'remv*',
1070 u'rename-contract', u'rename-file-or-directory',
1071 u'rename-transformer-target', u'rename-transformer?', u'replace-evt',
1072 u'reroot-path', u'resolve-path', u'resolved-module-path-name',
1073 u'resolved-module-path?', u'rest', u'reverse', u'round', u'second',
1074 u'seconds->date', u'security-guard?', u'semaphore-peek-evt',
1075 u'semaphore-peek-evt?', u'semaphore-post', u'semaphore-try-wait?',
1076 u'semaphore-wait', u'semaphore-wait/enable-break', u'semaphore?',
1077 u'sequence->list', u'sequence->stream', u'sequence-add-between',
1078 u'sequence-andmap', u'sequence-append', u'sequence-count',
1079 u'sequence-filter', u'sequence-fold', u'sequence-for-each',
1080 u'sequence-generate', u'sequence-generate*', u'sequence-length',
1081 u'sequence-map', u'sequence-ormap', u'sequence-ref', u'sequence-tail',
1082 u'sequence/c', u'sequence?', u'set', u'set!-transformer-procedure',
1083 u'set!-transformer?', u'set->list', u'set->stream', u'set-add', u'set-add!',
1084 u'set-box!', u'set-clear', u'set-clear!', u'set-copy', u'set-copy-clear',
1085 u'set-count', u'set-empty?', u'set-eq?', u'set-equal?', u'set-eqv?',
1086 u'set-first', u'set-for-each', u'set-implements/c', u'set-implements?',
1087 u'set-intersect', u'set-intersect!', u'set-map', u'set-mcar!', u'set-mcdr!',
1088 u'set-member?', u'set-mutable?', u'set-phantom-bytes!',
1089 u'set-port-next-location!', u'set-remove', u'set-remove!', u'set-rest',
1090 u'set-some-basic-contracts!', u'set-subtract', u'set-subtract!',
1091 u'set-symmetric-difference', u'set-symmetric-difference!', u'set-union',
1092 u'set-union!', u'set-weak?', u'set/c', u'set=?', u'set?', u'seteq', u'seteqv',
1093 u'seventh', u'sgn', u'shared-bytes', u'shell-execute', u'shrink-path-wrt',
1094 u'shuffle', u'simple-form-path', u'simplify-path', u'sin',
1095 u'single-flonum?', u'sinh', u'sixth', u'skip-projection-wrapper?', u'sleep',
1096 u'some-system-path->string', u'sort', u'special-comment-value',
1097 u'special-comment?', u'special-filter-input-port', u'split-at',
1098 u'split-at-right', u'split-common-prefix', u'split-path', u'splitf-at',
1099 u'splitf-at-right', u'sqr', u'sqrt', u'srcloc', u'srcloc->string',
1100 u'srcloc-column', u'srcloc-line', u'srcloc-position', u'srcloc-source',
1101 u'srcloc-span', u'srcloc?', u'stop-after', u'stop-before', u'stream->list',
1102 u'stream-add-between', u'stream-andmap', u'stream-append', u'stream-count',
1103 u'stream-empty?', u'stream-filter', u'stream-first', u'stream-fold',
1104 u'stream-for-each', u'stream-length', u'stream-map', u'stream-ormap',
1105 u'stream-ref', u'stream-rest', u'stream-tail', u'stream/c', u'stream?',
1106 u'string', u'string->bytes/latin-1', u'string->bytes/locale',
1107 u'string->bytes/utf-8', u'string->immutable-string', u'string->keyword',
1108 u'string->list', u'string->number', u'string->path',
1109 u'string->path-element', u'string->some-system-path', u'string->symbol',
1110 u'string->uninterned-symbol', u'string->unreadable-symbol',
1111 u'string-append', u'string-append*', u'string-ci<=?', u'string-ci<?',
1112 u'string-ci=?', u'string-ci>=?', u'string-ci>?', u'string-contains?',
1113 u'string-copy', u'string-copy!', u'string-downcase',
1114 u'string-environment-variable-name?', u'string-fill!', u'string-foldcase',
1115 u'string-join', u'string-len/c', u'string-length', u'string-locale-ci<?',
1116 u'string-locale-ci=?', u'string-locale-ci>?', u'string-locale-downcase',
1117 u'string-locale-upcase', u'string-locale<?', u'string-locale=?',
1118 u'string-locale>?', u'string-no-nuls?', u'string-normalize-nfc',
1119 u'string-normalize-nfd', u'string-normalize-nfkc',
1120 u'string-normalize-nfkd', u'string-normalize-spaces', u'string-port?',
1121 u'string-prefix?', u'string-ref', u'string-replace', u'string-set!',
1122 u'string-split', u'string-suffix?', u'string-titlecase', u'string-trim',
1123 u'string-upcase', u'string-utf-8-length', u'string<=?', u'string<?',
1124 u'string=?', u'string>=?', u'string>?', u'string?', u'struct->vector',
1125 u'struct-accessor-procedure?', u'struct-constructor-procedure?',
1126 u'struct-info', u'struct-mutator-procedure?',
1127 u'struct-predicate-procedure?', u'struct-type-info',
1128 u'struct-type-make-constructor', u'struct-type-make-predicate',
1129 u'struct-type-property-accessor-procedure?', u'struct-type-property/c',
1130 u'struct-type-property?', u'struct-type?', u'struct:arity-at-least',
1131 u'struct:arrow-contract-info', u'struct:date', u'struct:date*',
1132 u'struct:exn', u'struct:exn:break', u'struct:exn:break:hang-up',
1133 u'struct:exn:break:terminate', u'struct:exn:fail',
1134 u'struct:exn:fail:contract', u'struct:exn:fail:contract:arity',
1135 u'struct:exn:fail:contract:blame',
1136 u'struct:exn:fail:contract:continuation',
1137 u'struct:exn:fail:contract:divide-by-zero',
1138 u'struct:exn:fail:contract:non-fixnum-result',
1139 u'struct:exn:fail:contract:variable', u'struct:exn:fail:filesystem',
1140 u'struct:exn:fail:filesystem:errno',
1141 u'struct:exn:fail:filesystem:exists',
1142 u'struct:exn:fail:filesystem:missing-module',
1143 u'struct:exn:fail:filesystem:version', u'struct:exn:fail:network',
1144 u'struct:exn:fail:network:errno', u'struct:exn:fail:object',
1145 u'struct:exn:fail:out-of-memory', u'struct:exn:fail:read',
1146 u'struct:exn:fail:read:eof', u'struct:exn:fail:read:non-char',
1147 u'struct:exn:fail:syntax', u'struct:exn:fail:syntax:missing-module',
1148 u'struct:exn:fail:syntax:unbound', u'struct:exn:fail:unsupported',
1149 u'struct:exn:fail:user', u'struct:srcloc',
1150 u'struct:wrapped-extra-arg-arrow', u'struct?', u'sub1', u'subbytes',
1151 u'subclass?', u'subclass?/c', u'subprocess', u'subprocess-group-enabled',
1152 u'subprocess-kill', u'subprocess-pid', u'subprocess-status',
1153 u'subprocess-wait', u'subprocess?', u'subset?', u'substring', u'suggest/c',
1154 u'symbol->string', u'symbol-interned?', u'symbol-unreadable?', u'symbol<?',
1155 u'symbol=?', u'symbol?', u'symbols', u'sync', u'sync/enable-break',
1156 u'sync/timeout', u'sync/timeout/enable-break', u'syntax->datum',
1157 u'syntax->list', u'syntax-arm', u'syntax-column', u'syntax-debug-info',
1158 u'syntax-disarm', u'syntax-e', u'syntax-line',
1159 u'syntax-local-bind-syntaxes', u'syntax-local-certifier',
1160 u'syntax-local-context', u'syntax-local-expand-expression',
1161 u'syntax-local-get-shadower', u'syntax-local-identifier-as-binding',
1162 u'syntax-local-introduce', u'syntax-local-lift-context',
1163 u'syntax-local-lift-expression', u'syntax-local-lift-module',
1164 u'syntax-local-lift-module-end-declaration',
1165 u'syntax-local-lift-provide', u'syntax-local-lift-require',
1166 u'syntax-local-lift-values-expression',
1167 u'syntax-local-make-definition-context',
1168 u'syntax-local-make-delta-introducer',
1169 u'syntax-local-module-defined-identifiers',
1170 u'syntax-local-module-exports',
1171 u'syntax-local-module-required-identifiers', u'syntax-local-name',
1172 u'syntax-local-phase-level', u'syntax-local-submodules',
1173 u'syntax-local-transforming-module-provides?', u'syntax-local-value',
1174 u'syntax-local-value/immediate', u'syntax-original?', u'syntax-position',
1175 u'syntax-property', u'syntax-property-preserved?',
1176 u'syntax-property-symbol-keys', u'syntax-protect', u'syntax-rearm',
1177 u'syntax-recertify', u'syntax-shift-phase-level', u'syntax-source',
1178 u'syntax-source-module', u'syntax-span', u'syntax-taint',
1179 u'syntax-tainted?', u'syntax-track-origin',
1180 u'syntax-transforming-module-expression?',
1181 u'syntax-transforming-with-lifts?', u'syntax-transforming?', u'syntax/c',
1182 u'syntax?', u'system', u'system*', u'system*/exit-code',
1183 u'system-big-endian?', u'system-idle-evt', u'system-language+country',
1184 u'system-library-subpath', u'system-path-convention-type', u'system-type',
1185 u'system/exit-code', u'tail-marks-match?', u'take', u'take-common-prefix',
1186 u'take-right', u'takef', u'takef-right', u'tan', u'tanh',
1187 u'tcp-abandon-port', u'tcp-accept', u'tcp-accept-evt',
1188 u'tcp-accept-ready?', u'tcp-accept/enable-break', u'tcp-addresses',
1189 u'tcp-close', u'tcp-connect', u'tcp-connect/enable-break', u'tcp-listen',
1190 u'tcp-listener?', u'tcp-port?', u'tentative-pretty-print-port-cancel',
1191 u'tentative-pretty-print-port-transfer', u'tenth', u'terminal-port?',
1192 u'the-unsupplied-arg', u'third', u'thread', u'thread-cell-ref',
1193 u'thread-cell-set!', u'thread-cell-values?', u'thread-cell?',
1194 u'thread-dead-evt', u'thread-dead?', u'thread-group?', u'thread-receive',
1195 u'thread-receive-evt', u'thread-resume', u'thread-resume-evt',
1196 u'thread-rewind-receive', u'thread-running?', u'thread-send',
1197 u'thread-suspend', u'thread-suspend-evt', u'thread-try-receive',
1198 u'thread-wait', u'thread/suspend-to-kill', u'thread?', u'time-apply',
1199 u'touch', u'transplant-input-port', u'transplant-output-port', u'true',
1200 u'truncate', u'udp-addresses', u'udp-bind!', u'udp-bound?', u'udp-close',
1201 u'udp-connect!', u'udp-connected?', u'udp-multicast-interface',
1202 u'udp-multicast-join-group!', u'udp-multicast-leave-group!',
1203 u'udp-multicast-loopback?', u'udp-multicast-set-interface!',
1204 u'udp-multicast-set-loopback!', u'udp-multicast-set-ttl!',
1205 u'udp-multicast-ttl', u'udp-open-socket', u'udp-receive!',
1206 u'udp-receive!*', u'udp-receive!-evt', u'udp-receive!/enable-break',
1207 u'udp-receive-ready-evt', u'udp-send', u'udp-send*', u'udp-send-evt',
1208 u'udp-send-ready-evt', u'udp-send-to', u'udp-send-to*', u'udp-send-to-evt',
1209 u'udp-send-to/enable-break', u'udp-send/enable-break', u'udp?', u'unbox',
1210 u'uncaught-exception-handler', u'unit?', u'unspecified-dom',
1211 u'unsupplied-arg?', u'use-collection-link-paths',
1212 u'use-compiled-file-paths', u'use-user-specific-search-paths',
1213 u'user-execute-bit', u'user-read-bit', u'user-write-bit', u'value-blame',
1214 u'value-contract', u'values', u'variable-reference->empty-namespace',
1215 u'variable-reference->module-base-phase',
1216 u'variable-reference->module-declaration-inspector',
1217 u'variable-reference->module-path-index',
1218 u'variable-reference->module-source', u'variable-reference->namespace',
1219 u'variable-reference->phase',
1220 u'variable-reference->resolved-module-path',
1221 u'variable-reference-constant?', u'variable-reference?', u'vector',
1222 u'vector->immutable-vector', u'vector->list',
1223 u'vector->pseudo-random-generator', u'vector->pseudo-random-generator!',
1224 u'vector->values', u'vector-append', u'vector-argmax', u'vector-argmin',
1225 u'vector-copy', u'vector-copy!', u'vector-count', u'vector-drop',
1226 u'vector-drop-right', u'vector-fill!', u'vector-filter',
1227 u'vector-filter-not', u'vector-immutable', u'vector-immutable/c',
1228 u'vector-immutableof', u'vector-length', u'vector-map', u'vector-map!',
1229 u'vector-member', u'vector-memq', u'vector-memv', u'vector-ref',
1230 u'vector-set!', u'vector-set*!', u'vector-set-performance-stats!',
1231 u'vector-split-at', u'vector-split-at-right', u'vector-take',
1232 u'vector-take-right', u'vector/c', u'vector?', u'vectorof', u'version',
1233 u'void', u'void?', u'weak-box-value', u'weak-box?', u'weak-set',
1234 u'weak-seteq', u'weak-seteqv', u'will-execute', u'will-executor?',
1235 u'will-register', u'will-try-execute', u'with-input-from-bytes',
1236 u'with-input-from-file', u'with-input-from-string',
1237 u'with-output-to-bytes', u'with-output-to-file', u'with-output-to-string',
1238 u'would-be-future', u'wrap-evt', u'wrapped-extra-arg-arrow',
1239 u'wrapped-extra-arg-arrow-extra-neg-party-argument',
1240 u'wrapped-extra-arg-arrow-real-func', u'wrapped-extra-arg-arrow?',
1241 u'writable<%>', u'write', u'write-byte', u'write-bytes',
1242 u'write-bytes-avail', u'write-bytes-avail*', u'write-bytes-avail-evt',
1243 u'write-bytes-avail/enable-break', u'write-char', u'write-special',
1244 u'write-special-avail*', u'write-special-evt', u'write-string',
1245 u'write-to-file', u'writeln', u'xor', u'zero?', u'~.a', u'~.s', u'~.v', u'~a',
1246 u'~e', u'~r', u'~s', u'~v'
1247 )
1248
1249 _opening_parenthesis = r'[([{]'
1250 _closing_parenthesis = r'[)\]}]'
1251 _delimiters = r'()[\]{}",\'`;\s'
1252 _symbol = r'(?:\|[^|]*\||\\[\w\W]|[^|\\%s]+)+' % _delimiters
1253 _exact_decimal_prefix = r'(?:#e)?(?:#d)?(?:#e)?'
1254 _exponent = r'(?:[defls][-+]?\d+)'
1255 _inexact_simple_no_hashes = r'(?:\d+(?:/\d+|\.\d*)?|\.\d+)'
1256 _inexact_simple = (r'(?:%s|(?:\d+#+(?:\.#*|/\d+#*)?|\.\d+#+|'
1257 r'\d+(?:\.\d*#+|/\d+#+)))' % _inexact_simple_no_hashes)
1258 _inexact_normal_no_hashes = r'(?:%s%s?)' % (_inexact_simple_no_hashes,
1259 _exponent)
1260 _inexact_normal = r'(?:%s%s?)' % (_inexact_simple, _exponent)
1261 _inexact_special = r'(?:(?:inf|nan)\.[0f])'
1262 _inexact_real = r'(?:[-+]?%s|[-+]%s)' % (_inexact_normal,
1263 _inexact_special)
1264 _inexact_unsigned = r'(?:%s|%s)' % (_inexact_normal, _inexact_special)
1265
1266 tokens = {
1267 'root': [
1268 (_closing_parenthesis, Error),
1269 (r'(?!\Z)', Text, 'unquoted-datum')
1270 ],
1271 'datum': [
1272 (r'(?s)#;|#![ /]([^\\\n]|\\.)*', Comment),
1273 (u';[^\\n\\r\x85\u2028\u2029]*', Comment.Single),
1274 (r'#\|', Comment.Multiline, 'block-comment'),
1275
1276 # Whitespaces
1277 (r'(?u)\s+', Text),
1278
1279 # Numbers: Keep in mind Racket reader hash prefixes, which
1280 # can denote the base or the type. These don't map neatly
1281 # onto Pygments token types; some judgment calls here.
1282
1283 # #d or no prefix
1284 (r'(?i)%s[-+]?\d+(?=[%s])' % (_exact_decimal_prefix, _delimiters),
1285 Number.Integer, '#pop'),
1286 (r'(?i)%s[-+]?(\d+(\.\d*)?|\.\d+)([deflst][-+]?\d+)?(?=[%s])' %
1287 (_exact_decimal_prefix, _delimiters), Number.Float, '#pop'),
1288 (r'(?i)%s[-+]?(%s([-+]%s?i)?|[-+]%s?i)(?=[%s])' %
1289 (_exact_decimal_prefix, _inexact_normal_no_hashes,
1290 _inexact_normal_no_hashes, _inexact_normal_no_hashes,
1291 _delimiters), Number, '#pop'),
1292
1293 # Inexact without explicit #i
1294 (r'(?i)(#d)?(%s([-+]%s?i)?|[-+]%s?i|%s@%s)(?=[%s])' %
1295 (_inexact_real, _inexact_unsigned, _inexact_unsigned,
1296 _inexact_real, _inexact_real, _delimiters), Number.Float,
1297 '#pop'),
1298
1299 # The remaining extflonums
1300 (r'(?i)(([-+]?%st[-+]?\d+)|[-+](inf|nan)\.t)(?=[%s])' %
1301 (_inexact_simple, _delimiters), Number.Float, '#pop'),
1302
1303 # #b
1304 (r'(?iu)(#[ei])?#b%s' % _symbol, Number.Bin, '#pop'),
1305
1306 # #o
1307 (r'(?iu)(#[ei])?#o%s' % _symbol, Number.Oct, '#pop'),
1308
1309 # #x
1310 (r'(?iu)(#[ei])?#x%s' % _symbol, Number.Hex, '#pop'),
1311
1312 # #i is always inexact, i.e. float
1313 (r'(?iu)(#d)?#i%s' % _symbol, Number.Float, '#pop'),
1314
1315 # Strings and characters
1316 (r'#?"', String.Double, ('#pop', 'string')),
1317 (r'#<<(.+)\n(^(?!\1$).*$\n)*^\1$', String.Heredoc, '#pop'),
1318 (r'#\\(u[\da-fA-F]{1,4}|U[\da-fA-F]{1,8})', String.Char, '#pop'),
1319 (r'(?is)#\\([0-7]{3}|[a-z]+|.)', String.Char, '#pop'),
1320 (r'(?s)#[pr]x#?"(\\?.)*?"', String.Regex, '#pop'),
1321
1322 # Constants
1323 (r'#(true|false|[tTfF])', Name.Constant, '#pop'),
1324
1325 # Keyword argument names (e.g. #:keyword)
1326 (r'(?u)#:%s' % _symbol, Keyword.Declaration, '#pop'),
1327
1328 # Reader extensions
1329 (r'(#lang |#!)(\S+)',
1330 bygroups(Keyword.Namespace, Name.Namespace)),
1331 (r'#reader', Keyword.Namespace, 'quoted-datum'),
1332
1333 # Other syntax
1334 (r"(?i)\.(?=[%s])|#c[is]|#['`]|#,@?" % _delimiters, Operator),
1335 (r"'|#[s&]|#hash(eqv?)?|#\d*(?=%s)" % _opening_parenthesis,
1336 Operator, ('#pop', 'quoted-datum'))
1337 ],
1338 'datum*': [
1339 (r'`|,@?', Operator),
1340 (_symbol, String.Symbol, '#pop'),
1341 (r'[|\\]', Error),
1342 default('#pop')
1343 ],
1344 'list': [
1345 (_closing_parenthesis, Punctuation, '#pop')
1346 ],
1347 'unquoted-datum': [
1348 include('datum'),
1349 (r'quote(?=[%s])' % _delimiters, Keyword,
1350 ('#pop', 'quoted-datum')),
1351 (r'`', Operator, ('#pop', 'quasiquoted-datum')),
1352 (r'quasiquote(?=[%s])' % _delimiters, Keyword,
1353 ('#pop', 'quasiquoted-datum')),
1354 (_opening_parenthesis, Punctuation, ('#pop', 'unquoted-list')),
1355 (words(_keywords, prefix='(?u)', suffix='(?=[%s])' % _delimiters),
1356 Keyword, '#pop'),
1357 (words(_builtins, prefix='(?u)', suffix='(?=[%s])' % _delimiters),
1358 Name.Builtin, '#pop'),
1359 (_symbol, Name, '#pop'),
1360 include('datum*')
1361 ],
1362 'unquoted-list': [
1363 include('list'),
1364 (r'(?!\Z)', Text, 'unquoted-datum')
1365 ],
1366 'quasiquoted-datum': [
1367 include('datum'),
1368 (r',@?', Operator, ('#pop', 'unquoted-datum')),
1369 (r'unquote(-splicing)?(?=[%s])' % _delimiters, Keyword,
1370 ('#pop', 'unquoted-datum')),
1371 (_opening_parenthesis, Punctuation, ('#pop', 'quasiquoted-list')),
1372 include('datum*')
1373 ],
1374 'quasiquoted-list': [
1375 include('list'),
1376 (r'(?!\Z)', Text, 'quasiquoted-datum')
1377 ],
1378 'quoted-datum': [
1379 include('datum'),
1380 (_opening_parenthesis, Punctuation, ('#pop', 'quoted-list')),
1381 include('datum*')
1382 ],
1383 'quoted-list': [
1384 include('list'),
1385 (r'(?!\Z)', Text, 'quoted-datum')
1386 ],
1387 'block-comment': [
1388 (r'#\|', Comment.Multiline, '#push'),
1389 (r'\|#', Comment.Multiline, '#pop'),
1390 (r'[^#|]+|.', Comment.Multiline)
1391 ],
1392 'string': [
1393 (r'"', String.Double, '#pop'),
1394 (r'(?s)\\([0-7]{1,3}|x[\da-fA-F]{1,2}|u[\da-fA-F]{1,4}|'
1395 r'U[\da-fA-F]{1,8}|.)', String.Escape),
1396 (r'[^\\"]+', String.Double)
1397 ]
1398 }
1399
1400
1401 class NewLispLexer(RegexLexer):
1402 """
1403 For `newLISP. <www.newlisp.org>`_ source code (version 10.3.0).
1404
1405 .. versionadded:: 1.5
1406 """
1407
1408 name = 'NewLisp'
1409 aliases = ['newlisp']
1410 filenames = ['*.lsp', '*.nl', '*.kif']
1411 mimetypes = ['text/x-newlisp', 'application/x-newlisp']
1412
1413 flags = re.IGNORECASE | re.MULTILINE | re.UNICODE
1414
1415 # list of built-in functions for newLISP version 10.3
1416 builtins = (
1417 '^', '--', '-', ':', '!', '!=', '?', '@', '*', '/', '&', '%', '+', '++',
1418 '<', '<<', '<=', '=', '>', '>=', '>>', '|', '~', '$', '$0', '$1', '$10',
1419 '$11', '$12', '$13', '$14', '$15', '$2', '$3', '$4', '$5', '$6', '$7',
1420 '$8', '$9', '$args', '$idx', '$it', '$main-args', 'abort', 'abs',
1421 'acos', 'acosh', 'add', 'address', 'amb', 'and', 'append-file',
1422 'append', 'apply', 'args', 'array-list', 'array?', 'array', 'asin',
1423 'asinh', 'assoc', 'atan', 'atan2', 'atanh', 'atom?', 'base64-dec',
1424 'base64-enc', 'bayes-query', 'bayes-train', 'begin',
1425 'beta', 'betai', 'bind', 'binomial', 'bits', 'callback',
1426 'case', 'catch', 'ceil', 'change-dir', 'char', 'chop', 'Class', 'clean',
1427 'close', 'command-event', 'cond', 'cons', 'constant',
1428 'context?', 'context', 'copy-file', 'copy', 'cos', 'cosh', 'count',
1429 'cpymem', 'crc32', 'crit-chi2', 'crit-z', 'current-line', 'curry',
1430 'date-list', 'date-parse', 'date-value', 'date', 'debug', 'dec',
1431 'def-new', 'default', 'define-macro', 'define',
1432 'delete-file', 'delete-url', 'delete', 'destroy', 'det', 'device',
1433 'difference', 'directory?', 'directory', 'div', 'do-until', 'do-while',
1434 'doargs', 'dolist', 'dostring', 'dotimes', 'dotree', 'dump', 'dup',
1435 'empty?', 'encrypt', 'ends-with', 'env', 'erf', 'error-event',
1436 'eval-string', 'eval', 'exec', 'exists', 'exit', 'exp', 'expand',
1437 'explode', 'extend', 'factor', 'fft', 'file-info', 'file?', 'filter',
1438 'find-all', 'find', 'first', 'flat', 'float?', 'float', 'floor', 'flt',
1439 'fn', 'for-all', 'for', 'fork', 'format', 'fv', 'gammai', 'gammaln',
1440 'gcd', 'get-char', 'get-float', 'get-int', 'get-long', 'get-string',
1441 'get-url', 'global?', 'global', 'if-not', 'if', 'ifft', 'import', 'inc',
1442 'index', 'inf?', 'int', 'integer?', 'integer', 'intersect', 'invert',
1443 'irr', 'join', 'lambda-macro', 'lambda?', 'lambda', 'last-error',
1444 'last', 'legal?', 'length', 'let', 'letex', 'letn',
1445 'list?', 'list', 'load', 'local', 'log', 'lookup',
1446 'lower-case', 'macro?', 'main-args', 'MAIN', 'make-dir', 'map', 'mat',
1447 'match', 'max', 'member', 'min', 'mod', 'module', 'mul', 'multiply',
1448 'NaN?', 'net-accept', 'net-close', 'net-connect', 'net-error',
1449 'net-eval', 'net-interface', 'net-ipv', 'net-listen', 'net-local',
1450 'net-lookup', 'net-packet', 'net-peek', 'net-peer', 'net-ping',
1451 'net-receive-from', 'net-receive-udp', 'net-receive', 'net-select',
1452 'net-send-to', 'net-send-udp', 'net-send', 'net-service',
1453 'net-sessions', 'new', 'nil?', 'nil', 'normal', 'not', 'now', 'nper',
1454 'npv', 'nth', 'null?', 'number?', 'open', 'or', 'ostype', 'pack',
1455 'parse-date', 'parse', 'peek', 'pipe', 'pmt', 'pop-assoc', 'pop',
1456 'post-url', 'pow', 'prefix', 'pretty-print', 'primitive?', 'print',
1457 'println', 'prob-chi2', 'prob-z', 'process', 'prompt-event',
1458 'protected?', 'push', 'put-url', 'pv', 'quote?', 'quote', 'rand',
1459 'random', 'randomize', 'read', 'read-char', 'read-expr', 'read-file',
1460 'read-key', 'read-line', 'read-utf8', 'reader-event',
1461 'real-path', 'receive', 'ref-all', 'ref', 'regex-comp', 'regex',
1462 'remove-dir', 'rename-file', 'replace', 'reset', 'rest', 'reverse',
1463 'rotate', 'round', 'save', 'search', 'seed', 'seek', 'select', 'self',
1464 'semaphore', 'send', 'sequence', 'series', 'set-locale', 'set-ref-all',
1465 'set-ref', 'set', 'setf', 'setq', 'sgn', 'share', 'signal', 'silent',
1466 'sin', 'sinh', 'sleep', 'slice', 'sort', 'source', 'spawn', 'sqrt',
1467 'starts-with', 'string?', 'string', 'sub', 'swap', 'sym', 'symbol?',
1468 'symbols', 'sync', 'sys-error', 'sys-info', 'tan', 'tanh', 'term',
1469 'throw-error', 'throw', 'time-of-day', 'time', 'timer', 'title-case',
1470 'trace-highlight', 'trace', 'transpose', 'Tree', 'trim', 'true?',
1471 'true', 'unicode', 'unify', 'unique', 'unless', 'unpack', 'until',
1472 'upper-case', 'utf8', 'utf8len', 'uuid', 'wait-pid', 'when', 'while',
1473 'write', 'write-char', 'write-file', 'write-line',
1474 'xfer-event', 'xml-error', 'xml-parse', 'xml-type-tags', 'zero?',
1475 )
1476
1477 # valid names
1478 valid_name = r'([\w!$%&*+.,/<=>?@^~|-])+|(\[.*?\])+'
1479
1480 tokens = {
1481 'root': [
1482 # shebang
1483 (r'#!(.*?)$', Comment.Preproc),
1484 # comments starting with semicolon
1485 (r';.*$', Comment.Single),
1486 # comments starting with #
1487 (r'#.*$', Comment.Single),
1488
1489 # whitespace
1490 (r'\s+', Text),
1491
1492 # strings, symbols and characters
1493 (r'"(\\\\|\\"|[^"])*"', String),
1494
1495 # braces
1496 (r'\{', String, "bracestring"),
1497
1498 # [text] ... [/text] delimited strings
1499 (r'\[text\]*', String, "tagstring"),
1500
1501 # 'special' operators...
1502 (r"('|:)", Operator),
1503
1504 # highlight the builtins
1505 (words(builtins, suffix=r'\b'),
1506 Keyword),
1507
1508 # the remaining functions
1509 (r'(?<=\()' + valid_name, Name.Variable),
1510
1511 # the remaining variables
1512 (valid_name, String.Symbol),
1513
1514 # parentheses
1515 (r'(\(|\))', Punctuation),
1516 ],
1517
1518 # braced strings...
1519 'bracestring': [
1520 (r'\{', String, "#push"),
1521 (r'\}', String, "#pop"),
1522 ('[^{}]+', String),
1523 ],
1524
1525 # tagged [text]...[/text] delimited strings...
1526 'tagstring': [
1527 (r'(?s)(.*?)(\[/text\])', String, '#pop'),
1528 ],
1529 }
1530
1531
1532 class EmacsLispLexer(RegexLexer):
1533 """
1534 An ELisp lexer, parsing a stream and outputting the tokens
1535 needed to highlight elisp code.
1536
1537 .. versionadded:: 2.1
1538 """
1539 name = 'EmacsLisp'
1540 aliases = ['emacs', 'elisp', 'emacs-lisp']
1541 filenames = ['*.el']
1542 mimetypes = ['text/x-elisp', 'application/x-elisp']
1543
1544 flags = re.MULTILINE
1545
1546 # couple of useful regexes
1547
1548 # characters that are not macro-characters and can be used to begin a symbol
1549 nonmacro = r'\\.|[\w!$%&*+-/<=>?@^{}~|]'
1550 constituent = nonmacro + '|[#.:]'
1551 terminated = r'(?=[ "()\]\'\n,;`])' # whitespace or terminating macro characters
1552
1553 # symbol token, reverse-engineered from hyperspec
1554 # Take a deep breath...
1555 symbol = r'((?:%s)(?:%s)*)' % (nonmacro, constituent)
1556
1557 macros = set((
1558 'atomic-change-group', 'case', 'block', 'cl-block', 'cl-callf', 'cl-callf2',
1559 'cl-case', 'cl-decf', 'cl-declaim', 'cl-declare',
1560 'cl-define-compiler-macro', 'cl-defmacro', 'cl-defstruct',
1561 'cl-defsubst', 'cl-deftype', 'cl-defun', 'cl-destructuring-bind',
1562 'cl-do', 'cl-do*', 'cl-do-all-symbols', 'cl-do-symbols', 'cl-dolist',
1563 'cl-dotimes', 'cl-ecase', 'cl-etypecase', 'eval-when', 'cl-eval-when', 'cl-flet',
1564 'cl-flet*', 'cl-function', 'cl-incf', 'cl-labels', 'cl-letf',
1565 'cl-letf*', 'cl-load-time-value', 'cl-locally', 'cl-loop',
1566 'cl-macrolet', 'cl-multiple-value-bind', 'cl-multiple-value-setq',
1567 'cl-progv', 'cl-psetf', 'cl-psetq', 'cl-pushnew', 'cl-remf',
1568 'cl-return', 'cl-return-from', 'cl-rotatef', 'cl-shiftf',
1569 'cl-symbol-macrolet', 'cl-tagbody', 'cl-the', 'cl-typecase',
1570 'combine-after-change-calls', 'condition-case-unless-debug', 'decf',
1571 'declaim', 'declare', 'declare-function', 'def-edebug-spec',
1572 'defadvice', 'defclass', 'defcustom', 'defface', 'defgeneric',
1573 'defgroup', 'define-advice', 'define-alternatives',
1574 'define-compiler-macro', 'define-derived-mode', 'define-generic-mode',
1575 'define-global-minor-mode', 'define-globalized-minor-mode',
1576 'define-minor-mode', 'define-modify-macro',
1577 'define-obsolete-face-alias', 'define-obsolete-function-alias',
1578 'define-obsolete-variable-alias', 'define-setf-expander',
1579 'define-skeleton', 'defmacro', 'defmethod', 'defsetf', 'defstruct',
1580 'defsubst', 'deftheme', 'deftype', 'defun', 'defvar-local',
1581 'delay-mode-hooks', 'destructuring-bind', 'do', 'do*',
1582 'do-all-symbols', 'do-symbols', 'dolist', 'dont-compile', 'dotimes',
1583 'dotimes-with-progress-reporter', 'ecase', 'ert-deftest', 'etypecase',
1584 'eval-and-compile', 'eval-when-compile', 'flet', 'ignore-errors',
1585 'incf', 'labels', 'lambda', 'letrec', 'lexical-let', 'lexical-let*',
1586 'loop', 'multiple-value-bind', 'multiple-value-setq', 'noreturn',
1587 'oref', 'oref-default', 'oset', 'oset-default', 'pcase',
1588 'pcase-defmacro', 'pcase-dolist', 'pcase-exhaustive', 'pcase-let',
1589 'pcase-let*', 'pop', 'psetf', 'psetq', 'push', 'pushnew', 'remf',
1590 'return', 'rotatef', 'rx', 'save-match-data', 'save-selected-window',
1591 'save-window-excursion', 'setf', 'setq-local', 'shiftf',
1592 'track-mouse', 'typecase', 'unless', 'use-package', 'when',
1593 'while-no-input', 'with-case-table', 'with-category-table',
1594 'with-coding-priority', 'with-current-buffer', 'with-demoted-errors',
1595 'with-eval-after-load', 'with-file-modes', 'with-local-quit',
1596 'with-output-to-string', 'with-output-to-temp-buffer',
1597 'with-parsed-tramp-file-name', 'with-selected-frame',
1598 'with-selected-window', 'with-silent-modifications', 'with-slots',
1599 'with-syntax-table', 'with-temp-buffer', 'with-temp-file',
1600 'with-temp-message', 'with-timeout', 'with-tramp-connection-property',
1601 'with-tramp-file-property', 'with-tramp-progress-reporter',
1602 'with-wrapper-hook', 'load-time-value', 'locally', 'macrolet', 'progv',
1603 'return-from',
1604 ))
1605
1606 special_forms = set((
1607 'and', 'catch', 'cond', 'condition-case', 'defconst', 'defvar',
1608 'function', 'if', 'interactive', 'let', 'let*', 'or', 'prog1',
1609 'prog2', 'progn', 'quote', 'save-current-buffer', 'save-excursion',
1610 'save-restriction', 'setq', 'setq-default', 'subr-arity',
1611 'unwind-protect', 'while',
1612 ))
1613
1614 builtin_function = set((
1615 '%', '*', '+', '-', '/', '/=', '1+', '1-', '<', '<=', '=', '>', '>=',
1616 'Snarf-documentation', 'abort-recursive-edit', 'abs',
1617 'accept-process-output', 'access-file', 'accessible-keymaps', 'acos',
1618 'active-minibuffer-window', 'add-face-text-property',
1619 'add-name-to-file', 'add-text-properties', 'all-completions',
1620 'append', 'apply', 'apropos-internal', 'aref', 'arrayp', 'aset',
1621 'ash', 'asin', 'assoc', 'assoc-string', 'assq', 'atan', 'atom',
1622 'autoload', 'autoload-do-load', 'backtrace', 'backtrace--locals',
1623 'backtrace-debug', 'backtrace-eval', 'backtrace-frame',
1624 'backward-char', 'backward-prefix-chars', 'barf-if-buffer-read-only',
1625 'base64-decode-region', 'base64-decode-string',
1626 'base64-encode-region', 'base64-encode-string', 'beginning-of-line',
1627 'bidi-find-overridden-directionality', 'bidi-resolved-levels',
1628 'bitmap-spec-p', 'bobp', 'bolp', 'bool-vector',
1629 'bool-vector-count-consecutive', 'bool-vector-count-population',
1630 'bool-vector-exclusive-or', 'bool-vector-intersection',
1631 'bool-vector-not', 'bool-vector-p', 'bool-vector-set-difference',
1632 'bool-vector-subsetp', 'bool-vector-union', 'boundp',
1633 'buffer-base-buffer', 'buffer-chars-modified-tick',
1634 'buffer-enable-undo', 'buffer-file-name', 'buffer-has-markers-at',
1635 'buffer-list', 'buffer-live-p', 'buffer-local-value',
1636 'buffer-local-variables', 'buffer-modified-p', 'buffer-modified-tick',
1637 'buffer-name', 'buffer-size', 'buffer-string', 'buffer-substring',
1638 'buffer-substring-no-properties', 'buffer-swap-text', 'bufferp',
1639 'bury-buffer-internal', 'byte-code', 'byte-code-function-p',
1640 'byte-to-position', 'byte-to-string', 'byteorder',
1641 'call-interactively', 'call-last-kbd-macro', 'call-process',
1642 'call-process-region', 'cancel-kbd-macro-events', 'capitalize',
1643 'capitalize-region', 'capitalize-word', 'car', 'car-less-than-car',
1644 'car-safe', 'case-table-p', 'category-docstring',
1645 'category-set-mnemonics', 'category-table', 'category-table-p',
1646 'ccl-execute', 'ccl-execute-on-string', 'ccl-program-p', 'cdr',
1647 'cdr-safe', 'ceiling', 'char-after', 'char-before',
1648 'char-category-set', 'char-charset', 'char-equal', 'char-or-string-p',
1649 'char-resolve-modifiers', 'char-syntax', 'char-table-extra-slot',
1650 'char-table-p', 'char-table-parent', 'char-table-range',
1651 'char-table-subtype', 'char-to-string', 'char-width', 'characterp',
1652 'charset-after', 'charset-id-internal', 'charset-plist',
1653 'charset-priority-list', 'charsetp', 'check-coding-system',
1654 'check-coding-systems-region', 'clear-buffer-auto-save-failure',
1655 'clear-charset-maps', 'clear-face-cache', 'clear-font-cache',
1656 'clear-image-cache', 'clear-string', 'clear-this-command-keys',
1657 'close-font', 'clrhash', 'coding-system-aliases',
1658 'coding-system-base', 'coding-system-eol-type', 'coding-system-p',
1659 'coding-system-plist', 'coding-system-priority-list',
1660 'coding-system-put', 'color-distance', 'color-gray-p',
1661 'color-supported-p', 'combine-after-change-execute',
1662 'command-error-default-function', 'command-remapping', 'commandp',
1663 'compare-buffer-substrings', 'compare-strings',
1664 'compare-window-configurations', 'completing-read',
1665 'compose-region-internal', 'compose-string-internal',
1666 'composition-get-gstring', 'compute-motion', 'concat', 'cons',
1667 'consp', 'constrain-to-field', 'continue-process',
1668 'controlling-tty-p', 'coordinates-in-window-p', 'copy-alist',
1669 'copy-category-table', 'copy-file', 'copy-hash-table', 'copy-keymap',
1670 'copy-marker', 'copy-sequence', 'copy-syntax-table', 'copysign',
1671 'cos', 'current-active-maps', 'current-bidi-paragraph-direction',
1672 'current-buffer', 'current-case-table', 'current-column',
1673 'current-global-map', 'current-idle-time', 'current-indentation',
1674 'current-input-mode', 'current-local-map', 'current-message',
1675 'current-minor-mode-maps', 'current-time', 'current-time-string',
1676 'current-time-zone', 'current-window-configuration',
1677 'cygwin-convert-file-name-from-windows',
1678 'cygwin-convert-file-name-to-windows', 'daemon-initialized',
1679 'daemonp', 'dbus--init-bus', 'dbus-get-unique-name',
1680 'dbus-message-internal', 'debug-timer-check', 'declare-equiv-charset',
1681 'decode-big5-char', 'decode-char', 'decode-coding-region',
1682 'decode-coding-string', 'decode-sjis-char', 'decode-time',
1683 'default-boundp', 'default-file-modes', 'default-printer-name',
1684 'default-toplevel-value', 'default-value', 'define-category',
1685 'define-charset-alias', 'define-charset-internal',
1686 'define-coding-system-alias', 'define-coding-system-internal',
1687 'define-fringe-bitmap', 'define-hash-table-test', 'define-key',
1688 'define-prefix-command', 'delete',
1689 'delete-all-overlays', 'delete-and-extract-region', 'delete-char',
1690 'delete-directory-internal', 'delete-field', 'delete-file',
1691 'delete-frame', 'delete-other-windows-internal', 'delete-overlay',
1692 'delete-process', 'delete-region', 'delete-terminal',
1693 'delete-window-internal', 'delq', 'describe-buffer-bindings',
1694 'describe-vector', 'destroy-fringe-bitmap', 'detect-coding-region',
1695 'detect-coding-string', 'ding', 'directory-file-name',
1696 'directory-files', 'directory-files-and-attributes', 'discard-input',
1697 'display-supports-face-attributes-p', 'do-auto-save', 'documentation',
1698 'documentation-property', 'downcase', 'downcase-region',
1699 'downcase-word', 'draw-string', 'dump-colors', 'dump-emacs',
1700 'dump-face', 'dump-frame-glyph-matrix', 'dump-glyph-matrix',
1701 'dump-glyph-row', 'dump-redisplay-history', 'dump-tool-bar-row',
1702 'elt', 'emacs-pid', 'encode-big5-char', 'encode-char',
1703 'encode-coding-region', 'encode-coding-string', 'encode-sjis-char',
1704 'encode-time', 'end-kbd-macro', 'end-of-line', 'eobp', 'eolp', 'eq',
1705 'eql', 'equal', 'equal-including-properties', 'erase-buffer',
1706 'error-message-string', 'eval', 'eval-buffer', 'eval-region',
1707 'event-convert-list', 'execute-kbd-macro', 'exit-recursive-edit',
1708 'exp', 'expand-file-name', 'expt', 'external-debugging-output',
1709 'face-attribute-relative-p', 'face-attributes-as-vector', 'face-font',
1710 'fboundp', 'fceiling', 'fetch-bytecode', 'ffloor',
1711 'field-beginning', 'field-end', 'field-string',
1712 'field-string-no-properties', 'file-accessible-directory-p',
1713 'file-acl', 'file-attributes', 'file-attributes-lessp',
1714 'file-directory-p', 'file-executable-p', 'file-exists-p',
1715 'file-locked-p', 'file-modes', 'file-name-absolute-p',
1716 'file-name-all-completions', 'file-name-as-directory',
1717 'file-name-completion', 'file-name-directory',
1718 'file-name-nondirectory', 'file-newer-than-file-p', 'file-readable-p',
1719 'file-regular-p', 'file-selinux-context', 'file-symlink-p',
1720 'file-system-info', 'file-system-info', 'file-writable-p',
1721 'fillarray', 'find-charset-region', 'find-charset-string',
1722 'find-coding-systems-region-internal', 'find-composition-internal',
1723 'find-file-name-handler', 'find-font', 'find-operation-coding-system',
1724 'float', 'float-time', 'floatp', 'floor', 'fmakunbound',
1725 'following-char', 'font-at', 'font-drive-otf', 'font-face-attributes',
1726 'font-family-list', 'font-get', 'font-get-glyphs',
1727 'font-get-system-font', 'font-get-system-normal-font', 'font-info',
1728 'font-match-p', 'font-otf-alternates', 'font-put',
1729 'font-shape-gstring', 'font-spec', 'font-variation-glyphs',
1730 'font-xlfd-name', 'fontp', 'fontset-font', 'fontset-info',
1731 'fontset-list', 'fontset-list-all', 'force-mode-line-update',
1732 'force-window-update', 'format', 'format-mode-line',
1733 'format-network-address', 'format-time-string', 'forward-char',
1734 'forward-comment', 'forward-line', 'forward-word',
1735 'frame-border-width', 'frame-bottom-divider-width',
1736 'frame-can-run-window-configuration-change-hook', 'frame-char-height',
1737 'frame-char-width', 'frame-face-alist', 'frame-first-window',
1738 'frame-focus', 'frame-font-cache', 'frame-fringe-width', 'frame-list',
1739 'frame-live-p', 'frame-or-buffer-changed-p', 'frame-parameter',
1740 'frame-parameters', 'frame-pixel-height', 'frame-pixel-width',
1741 'frame-pointer-visible-p', 'frame-right-divider-width',
1742 'frame-root-window', 'frame-scroll-bar-height',
1743 'frame-scroll-bar-width', 'frame-selected-window', 'frame-terminal',
1744 'frame-text-cols', 'frame-text-height', 'frame-text-lines',
1745 'frame-text-width', 'frame-total-cols', 'frame-total-lines',
1746 'frame-visible-p', 'framep', 'frexp', 'fringe-bitmaps-at-pos',
1747 'fround', 'fset', 'ftruncate', 'funcall', 'funcall-interactively',
1748 'function-equal', 'functionp', 'gap-position', 'gap-size',
1749 'garbage-collect', 'gc-status', 'generate-new-buffer-name', 'get',
1750 'get-buffer', 'get-buffer-create', 'get-buffer-process',
1751 'get-buffer-window', 'get-byte', 'get-char-property',
1752 'get-char-property-and-overlay', 'get-file-buffer', 'get-file-char',
1753 'get-internal-run-time', 'get-load-suffixes', 'get-pos-property',
1754 'get-process', 'get-screen-color', 'get-text-property',
1755 'get-unicode-property-internal', 'get-unused-category',
1756 'get-unused-iso-final-char', 'getenv-internal', 'gethash',
1757 'gfile-add-watch', 'gfile-rm-watch', 'global-key-binding',
1758 'gnutls-available-p', 'gnutls-boot', 'gnutls-bye', 'gnutls-deinit',
1759 'gnutls-error-fatalp', 'gnutls-error-string', 'gnutls-errorp',
1760 'gnutls-get-initstage', 'gnutls-peer-status',
1761 'gnutls-peer-status-warning-describe', 'goto-char', 'gpm-mouse-start',
1762 'gpm-mouse-stop', 'group-gid', 'group-real-gid',
1763 'handle-save-session', 'handle-switch-frame', 'hash-table-count',
1764 'hash-table-p', 'hash-table-rehash-size',
1765 'hash-table-rehash-threshold', 'hash-table-size', 'hash-table-test',
1766 'hash-table-weakness', 'iconify-frame', 'identity', 'image-flush',
1767 'image-mask-p', 'image-metadata', 'image-size', 'imagemagick-types',
1768 'imagep', 'indent-to', 'indirect-function', 'indirect-variable',
1769 'init-image-library', 'inotify-add-watch', 'inotify-rm-watch',
1770 'input-pending-p', 'insert', 'insert-and-inherit',
1771 'insert-before-markers', 'insert-before-markers-and-inherit',
1772 'insert-buffer-substring', 'insert-byte', 'insert-char',
1773 'insert-file-contents', 'insert-startup-screen', 'int86',
1774 'integer-or-marker-p', 'integerp', 'interactive-form', 'intern',
1775 'intern-soft', 'internal--track-mouse', 'internal-char-font',
1776 'internal-complete-buffer', 'internal-copy-lisp-face',
1777 'internal-default-process-filter',
1778 'internal-default-process-sentinel', 'internal-describe-syntax-value',
1779 'internal-event-symbol-parse-modifiers',
1780 'internal-face-x-get-resource', 'internal-get-lisp-face-attribute',
1781 'internal-lisp-face-attribute-values', 'internal-lisp-face-empty-p',
1782 'internal-lisp-face-equal-p', 'internal-lisp-face-p',
1783 'internal-make-lisp-face', 'internal-make-var-non-special',
1784 'internal-merge-in-global-face',
1785 'internal-set-alternative-font-family-alist',
1786 'internal-set-alternative-font-registry-alist',
1787 'internal-set-font-selection-order',
1788 'internal-set-lisp-face-attribute',
1789 'internal-set-lisp-face-attribute-from-resource',
1790 'internal-show-cursor', 'internal-show-cursor-p', 'interrupt-process',
1791 'invisible-p', 'invocation-directory', 'invocation-name', 'isnan',
1792 'iso-charset', 'key-binding', 'key-description',
1793 'keyboard-coding-system', 'keymap-parent', 'keymap-prompt', 'keymapp',
1794 'keywordp', 'kill-all-local-variables', 'kill-buffer', 'kill-emacs',
1795 'kill-local-variable', 'kill-process', 'last-nonminibuffer-frame',
1796 'lax-plist-get', 'lax-plist-put', 'ldexp', 'length',
1797 'libxml-parse-html-region', 'libxml-parse-xml-region',
1798 'line-beginning-position', 'line-end-position', 'line-pixel-height',
1799 'list', 'list-fonts', 'list-system-processes', 'listp', 'load',
1800 'load-average', 'local-key-binding', 'local-variable-if-set-p',
1801 'local-variable-p', 'locale-info', 'locate-file-internal',
1802 'lock-buffer', 'log', 'logand', 'logb', 'logior', 'lognot', 'logxor',
1803 'looking-at', 'lookup-image', 'lookup-image-map', 'lookup-key',
1804 'lower-frame', 'lsh', 'macroexpand', 'make-bool-vector',
1805 'make-byte-code', 'make-category-set', 'make-category-table',
1806 'make-char', 'make-char-table', 'make-directory-internal',
1807 'make-frame-invisible', 'make-frame-visible', 'make-hash-table',
1808 'make-indirect-buffer', 'make-keymap', 'make-list',
1809 'make-local-variable', 'make-marker', 'make-network-process',
1810 'make-overlay', 'make-serial-process', 'make-sparse-keymap',
1811 'make-string', 'make-symbol', 'make-symbolic-link', 'make-temp-name',
1812 'make-terminal-frame', 'make-variable-buffer-local',
1813 'make-variable-frame-local', 'make-vector', 'makunbound',
1814 'map-char-table', 'map-charset-chars', 'map-keymap',
1815 'map-keymap-internal', 'mapatoms', 'mapc', 'mapcar', 'mapconcat',
1816 'maphash', 'mark-marker', 'marker-buffer', 'marker-insertion-type',
1817 'marker-position', 'markerp', 'match-beginning', 'match-data',
1818 'match-end', 'matching-paren', 'max', 'max-char', 'md5', 'member',
1819 'memory-info', 'memory-limit', 'memory-use-counts', 'memq', 'memql',
1820 'menu-bar-menu-at-x-y', 'menu-or-popup-active-p',
1821 'menu-or-popup-active-p', 'merge-face-attribute', 'message',
1822 'message-box', 'message-or-box', 'min',
1823 'minibuffer-completion-contents', 'minibuffer-contents',
1824 'minibuffer-contents-no-properties', 'minibuffer-depth',
1825 'minibuffer-prompt', 'minibuffer-prompt-end',
1826 'minibuffer-selected-window', 'minibuffer-window', 'minibufferp',
1827 'minor-mode-key-binding', 'mod', 'modify-category-entry',
1828 'modify-frame-parameters', 'modify-syntax-entry',
1829 'mouse-pixel-position', 'mouse-position', 'move-overlay',
1830 'move-point-visually', 'move-to-column', 'move-to-window-line',
1831 'msdos-downcase-filename', 'msdos-long-file-names', 'msdos-memget',
1832 'msdos-memput', 'msdos-mouse-disable', 'msdos-mouse-enable',
1833 'msdos-mouse-init', 'msdos-mouse-p', 'msdos-remember-default-colors',
1834 'msdos-set-keyboard', 'msdos-set-mouse-buttons',
1835 'multibyte-char-to-unibyte', 'multibyte-string-p', 'narrow-to-region',
1836 'natnump', 'nconc', 'network-interface-info',
1837 'network-interface-list', 'new-fontset', 'newline-cache-check',
1838 'next-char-property-change', 'next-frame', 'next-overlay-change',
1839 'next-property-change', 'next-read-file-uses-dialog-p',
1840 'next-single-char-property-change', 'next-single-property-change',
1841 'next-window', 'nlistp', 'nreverse', 'nth', 'nthcdr', 'null',
1842 'number-or-marker-p', 'number-to-string', 'numberp',
1843 'open-dribble-file', 'open-font', 'open-termscript',
1844 'optimize-char-table', 'other-buffer', 'other-window-for-scrolling',
1845 'overlay-buffer', 'overlay-end', 'overlay-get', 'overlay-lists',
1846 'overlay-properties', 'overlay-put', 'overlay-recenter',
1847 'overlay-start', 'overlayp', 'overlays-at', 'overlays-in',
1848 'parse-partial-sexp', 'play-sound-internal', 'plist-get',
1849 'plist-member', 'plist-put', 'point', 'point-marker', 'point-max',
1850 'point-max-marker', 'point-min', 'point-min-marker',
1851 'pos-visible-in-window-p', 'position-bytes', 'posix-looking-at',
1852 'posix-search-backward', 'posix-search-forward', 'posix-string-match',
1853 'posn-at-point', 'posn-at-x-y', 'preceding-char',
1854 'prefix-numeric-value', 'previous-char-property-change',
1855 'previous-frame', 'previous-overlay-change',
1856 'previous-property-change', 'previous-single-char-property-change',
1857 'previous-single-property-change', 'previous-window', 'prin1',
1858 'prin1-to-string', 'princ', 'print', 'process-attributes',
1859 'process-buffer', 'process-coding-system', 'process-command',
1860 'process-connection', 'process-contact', 'process-datagram-address',
1861 'process-exit-status', 'process-filter', 'process-filter-multibyte-p',
1862 'process-id', 'process-inherit-coding-system-flag', 'process-list',
1863 'process-mark', 'process-name', 'process-plist',
1864 'process-query-on-exit-flag', 'process-running-child-p',
1865 'process-send-eof', 'process-send-region', 'process-send-string',
1866 'process-sentinel', 'process-status', 'process-tty-name',
1867 'process-type', 'processp', 'profiler-cpu-log',
1868 'profiler-cpu-running-p', 'profiler-cpu-start', 'profiler-cpu-stop',
1869 'profiler-memory-log', 'profiler-memory-running-p',
1870 'profiler-memory-start', 'profiler-memory-stop', 'propertize',
1871 'purecopy', 'put', 'put-text-property',
1872 'put-unicode-property-internal', 'puthash', 'query-font',
1873 'query-fontset', 'quit-process', 'raise-frame', 'random', 'rassoc',
1874 'rassq', 're-search-backward', 're-search-forward', 'read',
1875 'read-buffer', 'read-char', 'read-char-exclusive',
1876 'read-coding-system', 'read-command', 'read-event',
1877 'read-from-minibuffer', 'read-from-string', 'read-function',
1878 'read-key-sequence', 'read-key-sequence-vector',
1879 'read-no-blanks-input', 'read-non-nil-coding-system', 'read-string',
1880 'read-variable', 'recent-auto-save-p', 'recent-doskeys',
1881 'recent-keys', 'recenter', 'recursion-depth', 'recursive-edit',
1882 'redirect-debugging-output', 'redirect-frame-focus', 'redisplay',
1883 'redraw-display', 'redraw-frame', 'regexp-quote', 'region-beginning',
1884 'region-end', 'register-ccl-program', 'register-code-conversion-map',
1885 'remhash', 'remove-list-of-text-properties', 'remove-text-properties',
1886 'rename-buffer', 'rename-file', 'replace-match',
1887 'reset-this-command-lengths', 'resize-mini-window-internal',
1888 'restore-buffer-modified-p', 'resume-tty', 'reverse', 'round',
1889 'run-hook-with-args', 'run-hook-with-args-until-failure',
1890 'run-hook-with-args-until-success', 'run-hook-wrapped', 'run-hooks',
1891 'run-window-configuration-change-hook', 'run-window-scroll-functions',
1892 'safe-length', 'scan-lists', 'scan-sexps', 'scroll-down',
1893 'scroll-left', 'scroll-other-window', 'scroll-right', 'scroll-up',
1894 'search-backward', 'search-forward', 'secure-hash', 'select-frame',
1895 'select-window', 'selected-frame', 'selected-window',
1896 'self-insert-command', 'send-string-to-terminal', 'sequencep',
1897 'serial-process-configure', 'set', 'set-buffer',
1898 'set-buffer-auto-saved', 'set-buffer-major-mode',
1899 'set-buffer-modified-p', 'set-buffer-multibyte', 'set-case-table',
1900 'set-category-table', 'set-char-table-extra-slot',
1901 'set-char-table-parent', 'set-char-table-range', 'set-charset-plist',
1902 'set-charset-priority', 'set-coding-system-priority',
1903 'set-cursor-size', 'set-default', 'set-default-file-modes',
1904 'set-default-toplevel-value', 'set-file-acl', 'set-file-modes',
1905 'set-file-selinux-context', 'set-file-times', 'set-fontset-font',
1906 'set-frame-height', 'set-frame-position', 'set-frame-selected-window',
1907 'set-frame-size', 'set-frame-width', 'set-fringe-bitmap-face',
1908 'set-input-interrupt-mode', 'set-input-meta-mode', 'set-input-mode',
1909 'set-keyboard-coding-system-internal', 'set-keymap-parent',
1910 'set-marker', 'set-marker-insertion-type', 'set-match-data',
1911 'set-message-beep', 'set-minibuffer-window',
1912 'set-mouse-pixel-position', 'set-mouse-position',
1913 'set-network-process-option', 'set-output-flow-control',
1914 'set-process-buffer', 'set-process-coding-system',
1915 'set-process-datagram-address', 'set-process-filter',
1916 'set-process-filter-multibyte',
1917 'set-process-inherit-coding-system-flag', 'set-process-plist',
1918 'set-process-query-on-exit-flag', 'set-process-sentinel',
1919 'set-process-window-size', 'set-quit-char',
1920 'set-safe-terminal-coding-system-internal', 'set-screen-color',
1921 'set-standard-case-table', 'set-syntax-table',
1922 'set-terminal-coding-system-internal', 'set-terminal-local-value',
1923 'set-terminal-parameter', 'set-text-properties', 'set-time-zone-rule',
1924 'set-visited-file-modtime', 'set-window-buffer',
1925 'set-window-combination-limit', 'set-window-configuration',
1926 'set-window-dedicated-p', 'set-window-display-table',
1927 'set-window-fringes', 'set-window-hscroll', 'set-window-margins',
1928 'set-window-new-normal', 'set-window-new-pixel',
1929 'set-window-new-total', 'set-window-next-buffers',
1930 'set-window-parameter', 'set-window-point', 'set-window-prev-buffers',
1931 'set-window-redisplay-end-trigger', 'set-window-scroll-bars',
1932 'set-window-start', 'set-window-vscroll', 'setcar', 'setcdr',
1933 'setplist', 'show-face-resources', 'signal', 'signal-process', 'sin',
1934 'single-key-description', 'skip-chars-backward', 'skip-chars-forward',
1935 'skip-syntax-backward', 'skip-syntax-forward', 'sleep-for', 'sort',
1936 'sort-charsets', 'special-variable-p', 'split-char',
1937 'split-window-internal', 'sqrt', 'standard-case-table',
1938 'standard-category-table', 'standard-syntax-table', 'start-kbd-macro',
1939 'start-process', 'stop-process', 'store-kbd-macro-event', 'string',
1940 'string-as-multibyte', 'string-as-unibyte', 'string-bytes',
1941 'string-collate-equalp', 'string-collate-lessp', 'string-equal',
1942 'string-lessp', 'string-make-multibyte', 'string-make-unibyte',
1943 'string-match', 'string-to-char', 'string-to-multibyte',
1944 'string-to-number', 'string-to-syntax', 'string-to-unibyte',
1945 'string-width', 'stringp', 'subr-name', 'subrp',
1946 'subst-char-in-region', 'substitute-command-keys',
1947 'substitute-in-file-name', 'substring', 'substring-no-properties',
1948 'suspend-emacs', 'suspend-tty', 'suspicious-object', 'sxhash',
1949 'symbol-function', 'symbol-name', 'symbol-plist', 'symbol-value',
1950 'symbolp', 'syntax-table', 'syntax-table-p', 'system-groups',
1951 'system-move-file-to-trash', 'system-name', 'system-users', 'tan',
1952 'terminal-coding-system', 'terminal-list', 'terminal-live-p',
1953 'terminal-local-value', 'terminal-name', 'terminal-parameter',
1954 'terminal-parameters', 'terpri', 'test-completion',
1955 'text-char-description', 'text-properties-at', 'text-property-any',
1956 'text-property-not-all', 'this-command-keys',
1957 'this-command-keys-vector', 'this-single-command-keys',
1958 'this-single-command-raw-keys', 'time-add', 'time-less-p',
1959 'time-subtract', 'tool-bar-get-system-style', 'tool-bar-height',
1960 'tool-bar-pixel-width', 'top-level', 'trace-redisplay',
1961 'trace-to-stderr', 'translate-region-internal', 'transpose-regions',
1962 'truncate', 'try-completion', 'tty-display-color-cells',
1963 'tty-display-color-p', 'tty-no-underline',
1964 'tty-suppress-bold-inverse-default-colors', 'tty-top-frame',
1965 'tty-type', 'type-of', 'undo-boundary', 'unencodable-char-position',
1966 'unhandled-file-name-directory', 'unibyte-char-to-multibyte',
1967 'unibyte-string', 'unicode-property-table-internal', 'unify-charset',
1968 'unintern', 'unix-sync', 'unlock-buffer', 'upcase', 'upcase-initials',
1969 'upcase-initials-region', 'upcase-region', 'upcase-word',
1970 'use-global-map', 'use-local-map', 'user-full-name',
1971 'user-login-name', 'user-real-login-name', 'user-real-uid',
1972 'user-uid', 'variable-binding-locus', 'vconcat', 'vector',
1973 'vector-or-char-table-p', 'vectorp', 'verify-visited-file-modtime',
1974 'vertical-motion', 'visible-frame-list', 'visited-file-modtime',
1975 'w16-get-clipboard-data', 'w16-selection-exists-p',
1976 'w16-set-clipboard-data', 'w32-battery-status',
1977 'w32-default-color-map', 'w32-define-rgb-color',
1978 'w32-display-monitor-attributes-list', 'w32-frame-menu-bar-size',
1979 'w32-frame-rect', 'w32-get-clipboard-data',
1980 'w32-get-codepage-charset', 'w32-get-console-codepage',
1981 'w32-get-console-output-codepage', 'w32-get-current-locale-id',
1982 'w32-get-default-locale-id', 'w32-get-keyboard-layout',
1983 'w32-get-locale-info', 'w32-get-valid-codepages',
1984 'w32-get-valid-keyboard-layouts', 'w32-get-valid-locale-ids',
1985 'w32-has-winsock', 'w32-long-file-name', 'w32-reconstruct-hot-key',
1986 'w32-register-hot-key', 'w32-registered-hot-keys',
1987 'w32-selection-exists-p', 'w32-send-sys-command',
1988 'w32-set-clipboard-data', 'w32-set-console-codepage',
1989 'w32-set-console-output-codepage', 'w32-set-current-locale',
1990 'w32-set-keyboard-layout', 'w32-set-process-priority',
1991 'w32-shell-execute', 'w32-short-file-name', 'w32-toggle-lock-key',
1992 'w32-unload-winsock', 'w32-unregister-hot-key', 'w32-window-exists-p',
1993 'w32notify-add-watch', 'w32notify-rm-watch',
1994 'waiting-for-user-input-p', 'where-is-internal', 'widen',
1995 'widget-apply', 'widget-get', 'widget-put',
1996 'window-absolute-pixel-edges', 'window-at', 'window-body-height',
1997 'window-body-width', 'window-bottom-divider-width', 'window-buffer',
1998 'window-combination-limit', 'window-configuration-frame',
1999 'window-configuration-p', 'window-dedicated-p',
2000 'window-display-table', 'window-edges', 'window-end', 'window-frame',
2001 'window-fringes', 'window-header-line-height', 'window-hscroll',
2002 'window-inside-absolute-pixel-edges', 'window-inside-edges',
2003 'window-inside-pixel-edges', 'window-left-child',
2004 'window-left-column', 'window-line-height', 'window-list',
2005 'window-list-1', 'window-live-p', 'window-margins',
2006 'window-minibuffer-p', 'window-mode-line-height', 'window-new-normal',
2007 'window-new-pixel', 'window-new-total', 'window-next-buffers',
2008 'window-next-sibling', 'window-normal-size', 'window-old-point',
2009 'window-parameter', 'window-parameters', 'window-parent',
2010 'window-pixel-edges', 'window-pixel-height', 'window-pixel-left',
2011 'window-pixel-top', 'window-pixel-width', 'window-point',
2012 'window-prev-buffers', 'window-prev-sibling',
2013 'window-redisplay-end-trigger', 'window-resize-apply',
2014 'window-resize-apply-total', 'window-right-divider-width',
2015 'window-scroll-bar-height', 'window-scroll-bar-width',
2016 'window-scroll-bars', 'window-start', 'window-system',
2017 'window-text-height', 'window-text-pixel-size', 'window-text-width',
2018 'window-top-child', 'window-top-line', 'window-total-height',
2019 'window-total-width', 'window-use-time', 'window-valid-p',
2020 'window-vscroll', 'windowp', 'write-char', 'write-region',
2021 'x-backspace-delete-keys-p', 'x-change-window-property',
2022 'x-change-window-property', 'x-close-connection',
2023 'x-close-connection', 'x-create-frame', 'x-create-frame',
2024 'x-delete-window-property', 'x-delete-window-property',
2025 'x-disown-selection-internal', 'x-display-backing-store',
2026 'x-display-backing-store', 'x-display-color-cells',
2027 'x-display-color-cells', 'x-display-grayscale-p',
2028 'x-display-grayscale-p', 'x-display-list', 'x-display-list',
2029 'x-display-mm-height', 'x-display-mm-height', 'x-display-mm-width',
2030 'x-display-mm-width', 'x-display-monitor-attributes-list',
2031 'x-display-pixel-height', 'x-display-pixel-height',
2032 'x-display-pixel-width', 'x-display-pixel-width', 'x-display-planes',
2033 'x-display-planes', 'x-display-save-under', 'x-display-save-under',
2034 'x-display-screens', 'x-display-screens', 'x-display-visual-class',
2035 'x-display-visual-class', 'x-family-fonts', 'x-file-dialog',
2036 'x-file-dialog', 'x-file-dialog', 'x-focus-frame', 'x-frame-geometry',
2037 'x-frame-geometry', 'x-get-atom-name', 'x-get-resource',
2038 'x-get-selection-internal', 'x-hide-tip', 'x-hide-tip',
2039 'x-list-fonts', 'x-load-color-file', 'x-menu-bar-open-internal',
2040 'x-menu-bar-open-internal', 'x-open-connection', 'x-open-connection',
2041 'x-own-selection-internal', 'x-parse-geometry', 'x-popup-dialog',
2042 'x-popup-menu', 'x-register-dnd-atom', 'x-select-font',
2043 'x-select-font', 'x-selection-exists-p', 'x-selection-owner-p',
2044 'x-send-client-message', 'x-server-max-request-size',
2045 'x-server-max-request-size', 'x-server-vendor', 'x-server-vendor',
2046 'x-server-version', 'x-server-version', 'x-show-tip', 'x-show-tip',
2047 'x-synchronize', 'x-synchronize', 'x-uses-old-gtk-dialog',
2048 'x-window-property', 'x-window-property', 'x-wm-set-size-hint',
2049 'xw-color-defined-p', 'xw-color-defined-p', 'xw-color-values',
2050 'xw-color-values', 'xw-display-color-p', 'xw-display-color-p',
2051 'yes-or-no-p', 'zlib-available-p', 'zlib-decompress-region',
2052 'forward-point',
2053 ))
2054
2055 builtin_function_highlighted = set((
2056 'defvaralias', 'provide', 'require',
2057 'with-no-warnings', 'define-widget', 'with-electric-help',
2058 'throw', 'defalias', 'featurep'
2059 ))
2060
2061 lambda_list_keywords = set((
2062 '&allow-other-keys', '&aux', '&body', '&environment', '&key', '&optional',
2063 '&rest', '&whole',
2064 ))
2065
2066 error_keywords = set((
2067 'cl-assert', 'cl-check-type', 'error', 'signal',
2068 'user-error', 'warn',
2069 ))
2070
2071 def get_tokens_unprocessed(self, text):
2072 stack = ['root']
2073 for index, token, value in RegexLexer.get_tokens_unprocessed(self, text, stack):
2074 if token is Name.Variable:
2075 if value in EmacsLispLexer.builtin_function:
2076 yield index, Name.Function, value
2077 continue
2078 if value in EmacsLispLexer.special_forms:
2079 yield index, Keyword, value
2080 continue
2081 if value in EmacsLispLexer.error_keywords:
2082 yield index, Name.Exception, value
2083 continue
2084 if value in EmacsLispLexer.builtin_function_highlighted:
2085 yield index, Name.Builtin, value
2086 continue
2087 if value in EmacsLispLexer.macros:
2088 yield index, Name.Builtin, value
2089 continue
2090 if value in EmacsLispLexer.lambda_list_keywords:
2091 yield index, Keyword.Pseudo, value
2092 continue
2093 yield index, token, value
2094
2095 tokens = {
2096 'root': [
2097 default('body'),
2098 ],
2099 'body': [
2100 # whitespace
2101 (r'\s+', Text),
2102
2103 # single-line comment
2104 (r';.*$', Comment.Single),
2105
2106 # strings and characters
2107 (r'"', String, 'string'),
2108 (r'\?([^\\]|\\.)', String.Char),
2109 # quoting
2110 (r":" + symbol, Name.Builtin),
2111 (r"::" + symbol, String.Symbol),
2112 (r"'" + symbol, String.Symbol),
2113 (r"'", Operator),
2114 (r"`", Operator),
2115
2116 # decimal numbers
2117 (r'[-+]?\d+\.?' + terminated, Number.Integer),
2118 (r'[-+]?\d+/\d+' + terminated, Number),
2119 (r'[-+]?(\d*\.\d+([defls][-+]?\d+)?|\d+(\.\d*)?[defls][-+]?\d+)' +
2120 terminated, Number.Float),
2121
2122 # vectors
2123 (r'\[|\]', Punctuation),
2124
2125 # uninterned symbol
2126 (r'#:' + symbol, String.Symbol),
2127
2128 # read syntax for char tables
2129 (r'#\^\^?', Operator),
2130
2131 # function shorthand
2132 (r'#\'', Name.Function),
2133
2134 # binary rational
2135 (r'#[bB][+-]?[01]+(/[01]+)?', Number.Bin),
2136
2137 # octal rational
2138 (r'#[oO][+-]?[0-7]+(/[0-7]+)?', Number.Oct),
2139
2140 # hex rational
2141 (r'#[xX][+-]?[0-9a-fA-F]+(/[0-9a-fA-F]+)?', Number.Hex),
2142
2143 # radix rational
2144 (r'#\d+r[+-]?[0-9a-zA-Z]+(/[0-9a-zA-Z]+)?', Number),
2145
2146 # reference
2147 (r'#\d+=', Operator),
2148 (r'#\d+#', Operator),
2149
2150 # special operators that should have been parsed already
2151 (r'(,@|,|\.|:)', Operator),
2152
2153 # special constants
2154 (r'(t|nil)' + terminated, Name.Constant),
2155
2156 # functions and variables
2157 (r'\*' + symbol + r'\*', Name.Variable.Global),
2158 (symbol, Name.Variable),
2159
2160 # parentheses
2161 (r'#\(', Operator, 'body'),
2162 (r'\(', Punctuation, 'body'),
2163 (r'\)', Punctuation, '#pop'),
2164 ],
2165 'string': [
2166 (r'[^"\\`]+', String),
2167 (r'`%s\'' % symbol, String.Symbol),
2168 (r'`', String),
2169 (r'\\.', String),
2170 (r'\\\n', String),
2171 (r'"', String, '#pop'),
2172 ],
2173 }
2174
2175
2176 class ShenLexer(RegexLexer):
2177 """
2178 Lexer for `Shen <http://shenlanguage.org/>`_ source code.
2179
2180 .. versionadded:: 2.1
2181 """
2182 name = 'Shen'
2183 aliases = ['shen']
2184 filenames = ['*.shen']
2185 mimetypes = ['text/x-shen', 'application/x-shen']
2186
2187 DECLARATIONS = (
2188 'datatype', 'define', 'defmacro', 'defprolog', 'defcc',
2189 'synonyms', 'declare', 'package', 'type', 'function',
2190 )
2191
2192 SPECIAL_FORMS = (
2193 'lambda', 'get', 'let', 'if', 'cases', 'cond', 'put', 'time', 'freeze',
2194 'value', 'load', '$', 'protect', 'or', 'and', 'not', 'do', 'output',
2195 'prolog?', 'trap-error', 'error', 'make-string', '/.', 'set', '@p',
2196 '@s', '@v',
2197 )
2198
2199 BUILTINS = (
2200 '==', '=', '*', '+', '-', '/', '<', '>', '>=', '<=', '<-address',
2201 '<-vector', 'abort', 'absvector', 'absvector?', 'address->', 'adjoin',
2202 'append', 'arity', 'assoc', 'bind', 'boolean?', 'bound?', 'call', 'cd',
2203 'close', 'cn', 'compile', 'concat', 'cons', 'cons?', 'cut', 'destroy',
2204 'difference', 'element?', 'empty?', 'enable-type-theory',
2205 'error-to-string', 'eval', 'eval-kl', 'exception', 'explode', 'external',
2206 'fail', 'fail-if', 'file', 'findall', 'fix', 'fst', 'fwhen', 'gensym',
2207 'get-time', 'hash', 'hd', 'hdstr', 'hdv', 'head', 'identical',
2208 'implementation', 'in', 'include', 'include-all-but', 'inferences',
2209 'input', 'input+', 'integer?', 'intern', 'intersection', 'is', 'kill',
2210 'language', 'length', 'limit', 'lineread', 'loaded', 'macro', 'macroexpand',
2211 'map', 'mapcan', 'maxinferences', 'mode', 'n->string', 'nl', 'nth', 'null',
2212 'number?', 'occurrences', 'occurs-check', 'open', 'os', 'out', 'port',
2213 'porters', 'pos', 'pr', 'preclude', 'preclude-all-but', 'print', 'profile',
2214 'profile-results', 'ps', 'quit', 'read', 'read+', 'read-byte', 'read-file',
2215 'read-file-as-bytelist', 'read-file-as-string', 'read-from-string',
2216 'release', 'remove', 'return', 'reverse', 'run', 'save', 'set',
2217 'simple-error', 'snd', 'specialise', 'spy', 'step', 'stinput', 'stoutput',
2218 'str', 'string->n', 'string->symbol', 'string?', 'subst', 'symbol?',
2219 'systemf', 'tail', 'tc', 'tc?', 'thaw', 'tl', 'tlstr', 'tlv', 'track',
2220 'tuple?', 'undefmacro', 'unify', 'unify!', 'union', 'unprofile',
2221 'unspecialise', 'untrack', 'variable?', 'vector', 'vector->', 'vector?',
2222 'verified', 'version', 'warn', 'when', 'write-byte', 'write-to-file',
2223 'y-or-n?',
2224 )
2225
2226 BUILTINS_ANYWHERE = ('where', 'skip', '>>', '_', '!', '<e>', '<!>')
2227
2228 MAPPINGS = dict((s, Keyword) for s in DECLARATIONS)
2229 MAPPINGS.update((s, Name.Builtin) for s in BUILTINS)
2230 MAPPINGS.update((s, Keyword) for s in SPECIAL_FORMS)
2231
2232 valid_symbol_chars = r'[\w!$%*+,<=>?/.\'@&#:-]'
2233 valid_name = '%s+' % valid_symbol_chars
2234 symbol_name = r'[a-z!$%%*+,<=>?/.\'@&#_-]%s*' % valid_symbol_chars
2235 variable = r'[A-Z]%s*' % valid_symbol_chars
2236
2237 tokens = {
2238 'string': [
2239 (r'"', String, '#pop'),
2240 (r'c#\d{1,3};', String.Escape),
2241 (r'~[ARS%]', String.Interpol),
2242 (r'(?s).', String),
2243 ],
2244
2245 'root': [
2246 (r'(?s)\\\*.*?\*\\', Comment.Multiline), # \* ... *\
2247 (r'\\\\.*', Comment.Single), # \\ ...
2248 (r'\s+', Text),
2249 (r'_{5,}', Punctuation),
2250 (r'={5,}', Punctuation),
2251 (r'(;|:=|\||--?>|<--?)', Punctuation),
2252 (r'(:-|:|\{|\})', Literal),
2253 (r'[+-]*\d*\.\d+(e[+-]?\d+)?', Number.Float),
2254 (r'[+-]*\d+', Number.Integer),
2255 (r'"', String, 'string'),
2256 (variable, Name.Variable),
2257 (r'(true|false|<>|\[\])', Keyword.Pseudo),
2258 (symbol_name, Literal),
2259 (r'(\[|\]|\(|\))', Punctuation),
2260 ],
2261 }
2262
2263 def get_tokens_unprocessed(self, text):
2264 tokens = RegexLexer.get_tokens_unprocessed(self, text)
2265 tokens = self._process_symbols(tokens)
2266 tokens = self._process_declarations(tokens)
2267 return tokens
2268
2269 def _relevant(self, token):
2270 return token not in (Text, Comment.Single, Comment.Multiline)
2271
2272 def _process_declarations(self, tokens):
2273 opening_paren = False
2274 for index, token, value in tokens:
2275 yield index, token, value
2276 if self._relevant(token):
2277 if opening_paren and token == Keyword and value in self.DECLARATIONS:
2278 declaration = value
2279 for index, token, value in \
2280 self._process_declaration(declaration, tokens):
2281 yield index, token, value
2282 opening_paren = value == '(' and token == Punctuation
2283
2284 def _process_symbols(self, tokens):
2285 opening_paren = False
2286 for index, token, value in tokens:
2287 if opening_paren and token in (Literal, Name.Variable):
2288 token = self.MAPPINGS.get(value, Name.Function)
2289 elif token == Literal and value in self.BUILTINS_ANYWHERE:
2290 token = Name.Builtin
2291 opening_paren = value == '(' and token == Punctuation
2292 yield index, token, value
2293
2294 def _process_declaration(self, declaration, tokens):
2295 for index, token, value in tokens:
2296 if self._relevant(token):
2297 break
2298 yield index, token, value
2299
2300 if declaration == 'datatype':
2301 prev_was_colon = False
2302 token = Keyword.Type if token == Literal else token
2303 yield index, token, value
2304 for index, token, value in tokens:
2305 if prev_was_colon and token == Literal:
2306 token = Keyword.Type
2307 yield index, token, value
2308 if self._relevant(token):
2309 prev_was_colon = token == Literal and value == ':'
2310 elif declaration == 'package':
2311 token = Name.Namespace if token == Literal else token
2312 yield index, token, value
2313 elif declaration == 'define':
2314 token = Name.Function if token == Literal else token
2315 yield index, token, value
2316 for index, token, value in tokens:
2317 if self._relevant(token):
2318 break
2319 yield index, token, value
2320 if value == '{' and token == Literal:
2321 yield index, Punctuation, value
2322 for index, token, value in self._process_signature(tokens):
2323 yield index, token, value
2324 else:
2325 yield index, token, value
2326 else:
2327 token = Name.Function if token == Literal else token
2328 yield index, token, value
2329
2330 return
2331
2332 def _process_signature(self, tokens):
2333 for index, token, value in tokens:
2334 if token == Literal and value == '}':
2335 yield index, Punctuation, value
2336 return
2337 elif token in (Literal, Name.Function):
2338 token = Name.Variable if value.istitle() else Keyword.Type
2339 yield index, token, value
2340
2341
2342 class CPSALexer(SchemeLexer):
2343 """
2344 A CPSA lexer based on the CPSA language as of version 2.2.12
2345
2346 .. versionadded:: 2.1
2347 """
2348 name = 'CPSA'
2349 aliases = ['cpsa']
2350 filenames = ['*.cpsa']
2351 mimetypes = []
2352
2353 # list of known keywords and builtins taken form vim 6.4 scheme.vim
2354 # syntax file.
2355 _keywords = (
2356 'herald', 'vars', 'defmacro', 'include', 'defprotocol', 'defrole',
2357 'defskeleton', 'defstrand', 'deflistener', 'non-orig', 'uniq-orig',
2358 'pen-non-orig', 'precedes', 'trace', 'send', 'recv', 'name', 'text',
2359 'skey', 'akey', 'data', 'mesg',
2360 )
2361 _builtins = (
2362 'cat', 'enc', 'hash', 'privk', 'pubk', 'invk', 'ltk', 'gen', 'exp',
2363 )
2364
2365 # valid names for identifiers
2366 # well, names can only not consist fully of numbers
2367 # but this should be good enough for now
2368 valid_name = r'[\w!$%&*+,/:<=>?@^~|-]+'
2369
2370 tokens = {
2371 'root': [
2372 # the comments - always starting with semicolon
2373 # and going to the end of the line
2374 (r';.*$', Comment.Single),
2375
2376 # whitespaces - usually not relevant
2377 (r'\s+', Text),
2378
2379 # numbers
2380 (r'-?\d+\.\d+', Number.Float),
2381 (r'-?\d+', Number.Integer),
2382 # support for uncommon kinds of numbers -
2383 # have to figure out what the characters mean
2384 # (r'(#e|#i|#b|#o|#d|#x)[\d.]+', Number),
2385
2386 # strings, symbols and characters
2387 (r'"(\\\\|\\"|[^"])*"', String),
2388 (r"'" + valid_name, String.Symbol),
2389 (r"#\\([()/'\"._!§$%& ?=+-]|[a-zA-Z0-9]+)", String.Char),
2390
2391 # constants
2392 (r'(#t|#f)', Name.Constant),
2393
2394 # special operators
2395 (r"('|#|`|,@|,|\.)", Operator),
2396
2397 # highlight the keywords
2398 (words(_keywords, suffix=r'\b'), Keyword),
2399
2400 # first variable in a quoted string like
2401 # '(this is syntactic sugar)
2402 (r"(?<='\()" + valid_name, Name.Variable),
2403 (r"(?<=#\()" + valid_name, Name.Variable),
2404
2405 # highlight the builtins
2406 (words(_builtins, prefix=r'(?<=\()', suffix=r'\b'), Name.Builtin),
2407
2408 # the remaining functions
2409 (r'(?<=\()' + valid_name, Name.Function),
2410 # find the remaining variables
2411 (valid_name, Name.Variable),
2412
2413 # the famous parentheses!
2414 (r'(\(|\))', Punctuation),
2415 (r'(\[|\])', Punctuation),
2416 ],
2417 }
2418
2419
2420 class XtlangLexer(RegexLexer):
2421 """An xtlang lexer for the `Extempore programming environment
2422 <http://extempore.moso.com.au>`_.
2423
2424 This is a mixture of Scheme and xtlang, really. Keyword lists are
2425 taken from the Extempore Emacs mode
2426 (https://github.com/extemporelang/extempore-emacs-mode)
2427
2428 .. versionadded:: 2.2
2429 """
2430 name = 'xtlang'
2431 aliases = ['extempore']
2432 filenames = ['*.xtm']
2433 mimetypes = []
2434
2435 common_keywords = (
2436 'lambda', 'define', 'if', 'else', 'cond', 'and',
2437 'or', 'let', 'begin', 'set!', 'map', 'for-each',
2438 )
2439 scheme_keywords = (
2440 'do', 'delay', 'quasiquote', 'unquote', 'unquote-splicing', 'eval',
2441 'case', 'let*', 'letrec', 'quote',
2442 )
2443 xtlang_bind_keywords = (
2444 'bind-func', 'bind-val', 'bind-lib', 'bind-type', 'bind-alias',
2445 'bind-poly', 'bind-dylib', 'bind-lib-func', 'bind-lib-val',
2446 )
2447 xtlang_keywords = (
2448 'letz', 'memzone', 'cast', 'convert', 'dotimes', 'doloop',
2449 )
2450 common_functions = (
2451 '*', '+', '-', '/', '<', '<=', '=', '>', '>=', '%', 'abs', 'acos',
2452 'angle', 'append', 'apply', 'asin', 'assoc', 'assq', 'assv',
2453 'atan', 'boolean?', 'caaaar', 'caaadr', 'caaar', 'caadar',
2454 'caaddr', 'caadr', 'caar', 'cadaar', 'cadadr', 'cadar',
2455 'caddar', 'cadddr', 'caddr', 'cadr', 'car', 'cdaaar',
2456 'cdaadr', 'cdaar', 'cdadar', 'cdaddr', 'cdadr', 'cdar',
2457 'cddaar', 'cddadr', 'cddar', 'cdddar', 'cddddr', 'cdddr',
2458 'cddr', 'cdr', 'ceiling', 'cons', 'cos', 'floor', 'length',
2459 'list', 'log', 'max', 'member', 'min', 'modulo', 'not',
2460 'reverse', 'round', 'sin', 'sqrt', 'substring', 'tan',
2461 'println', 'random', 'null?', 'callback', 'now',
2462 )
2463 scheme_functions = (
2464 'call-with-current-continuation', 'call-with-input-file',
2465 'call-with-output-file', 'call-with-values', 'call/cc',
2466 'char->integer', 'char-alphabetic?', 'char-ci<=?', 'char-ci<?',
2467 'char-ci=?', 'char-ci>=?', 'char-ci>?', 'char-downcase',
2468 'char-lower-case?', 'char-numeric?', 'char-ready?',
2469 'char-upcase', 'char-upper-case?', 'char-whitespace?',
2470 'char<=?', 'char<?', 'char=?', 'char>=?', 'char>?', 'char?',
2471 'close-input-port', 'close-output-port', 'complex?',
2472 'current-input-port', 'current-output-port', 'denominator',
2473 'display', 'dynamic-wind', 'eof-object?', 'eq?', 'equal?',
2474 'eqv?', 'even?', 'exact->inexact', 'exact?', 'exp', 'expt',
2475 'force', 'gcd', 'imag-part', 'inexact->exact', 'inexact?',
2476 'input-port?', 'integer->char', 'integer?',
2477 'interaction-environment', 'lcm', 'list->string',
2478 'list->vector', 'list-ref', 'list-tail', 'list?', 'load',
2479 'magnitude', 'make-polar', 'make-rectangular', 'make-string',
2480 'make-vector', 'memq', 'memv', 'negative?', 'newline',
2481 'null-environment', 'number->string', 'number?',
2482 'numerator', 'odd?', 'open-input-file', 'open-output-file',
2483 'output-port?', 'pair?', 'peek-char', 'port?', 'positive?',
2484 'procedure?', 'quotient', 'rational?', 'rationalize', 'read',
2485 'read-char', 'real-part', 'real?',
2486 'remainder', 'scheme-report-environment', 'set-car!', 'set-cdr!',
2487 'string', 'string->list', 'string->number', 'string->symbol',
2488 'string-append', 'string-ci<=?', 'string-ci<?', 'string-ci=?',
2489 'string-ci>=?', 'string-ci>?', 'string-copy', 'string-fill!',
2490 'string-length', 'string-ref', 'string-set!', 'string<=?',
2491 'string<?', 'string=?', 'string>=?', 'string>?', 'string?',
2492 'symbol->string', 'symbol?', 'transcript-off', 'transcript-on',
2493 'truncate', 'values', 'vector', 'vector->list', 'vector-fill!',
2494 'vector-length', 'vector?',
2495 'with-input-from-file', 'with-output-to-file', 'write',
2496 'write-char', 'zero?',
2497 )
2498 xtlang_functions = (
2499 'toString', 'afill!', 'pfill!', 'tfill!', 'tbind', 'vfill!',
2500 'array-fill!', 'pointer-fill!', 'tuple-fill!', 'vector-fill!', 'free',
2501 'array', 'tuple', 'list', '~', 'cset!', 'cref', '&', 'bor',
2502 'ang-names', '<<', '>>', 'nil', 'printf', 'sprintf', 'null', 'now',
2503 'pset!', 'pref-ptr', 'vset!', 'vref', 'aset!', 'aref', 'aref-ptr',
2504 'tset!', 'tref', 'tref-ptr', 'salloc', 'halloc', 'zalloc', 'alloc',
2505 'schedule', 'exp', 'log', 'sin', 'cos', 'tan', 'asin', 'acos', 'atan',
2506 'sqrt', 'expt', 'floor', 'ceiling', 'truncate', 'round',
2507 'llvm_printf', 'push_zone', 'pop_zone', 'memzone', 'callback',
2508 'llvm_sprintf', 'make-array', 'array-set!', 'array-ref',
2509 'array-ref-ptr', 'pointer-set!', 'pointer-ref', 'pointer-ref-ptr',
2510 'stack-alloc', 'heap-alloc', 'zone-alloc', 'make-tuple', 'tuple-set!',
2511 'tuple-ref', 'tuple-ref-ptr', 'closure-set!', 'closure-ref', 'pref',
2512 'pdref', 'impc_null', 'bitcast', 'void', 'ifret', 'ret->', 'clrun->',
2513 'make-env-zone', 'make-env', '<>', 'dtof', 'ftod', 'i1tof',
2514 'i1tod', 'i1toi8', 'i1toi32', 'i1toi64', 'i8tof', 'i8tod',
2515 'i8toi1', 'i8toi32', 'i8toi64', 'i32tof', 'i32tod', 'i32toi1',
2516 'i32toi8', 'i32toi64', 'i64tof', 'i64tod', 'i64toi1',
2517 'i64toi8', 'i64toi32',
2518 )
2519
2520 # valid names for Scheme identifiers (names cannot consist fully
2521 # of numbers, but this should be good enough for now)
2522 valid_scheme_name = r'[\w!$%&*+,/:<=>?@^~|-]+'
2523
2524 # valid characters in xtlang names & types
2525 valid_xtlang_name = r'[\w.!-]+'
2526 valid_xtlang_type = r'[]{}[\w<>,*/|!-]+'
2527
2528 tokens = {
2529 # keep track of when we're exiting the xtlang form
2530 'xtlang': [
2531 (r'\(', Punctuation, '#push'),
2532 (r'\)', Punctuation, '#pop'),
2533
2534 (r'(?<=bind-func\s)' + valid_xtlang_name, Name.Function),
2535 (r'(?<=bind-val\s)' + valid_xtlang_name, Name.Function),
2536 (r'(?<=bind-type\s)' + valid_xtlang_name, Name.Function),
2537 (r'(?<=bind-alias\s)' + valid_xtlang_name, Name.Function),
2538 (r'(?<=bind-poly\s)' + valid_xtlang_name, Name.Function),
2539 (r'(?<=bind-lib\s)' + valid_xtlang_name, Name.Function),
2540 (r'(?<=bind-dylib\s)' + valid_xtlang_name, Name.Function),
2541 (r'(?<=bind-lib-func\s)' + valid_xtlang_name, Name.Function),
2542 (r'(?<=bind-lib-val\s)' + valid_xtlang_name, Name.Function),
2543
2544 # type annotations
2545 (r':' + valid_xtlang_type, Keyword.Type),
2546
2547 # types
2548 (r'(<' + valid_xtlang_type + r'>|\|' + valid_xtlang_type + r'\||/' +
2549 valid_xtlang_type + r'/|' + valid_xtlang_type + r'\*)\**',
2550 Keyword.Type),
2551
2552 # keywords
2553 (words(xtlang_keywords, prefix=r'(?<=\()'), Keyword),
2554
2555 # builtins
2556 (words(xtlang_functions, prefix=r'(?<=\()'), Name.Function),
2557
2558 include('common'),
2559
2560 # variables
2561 (valid_xtlang_name, Name.Variable),
2562 ],
2563 'scheme': [
2564 # quoted symbols
2565 (r"'" + valid_scheme_name, String.Symbol),
2566
2567 # char literals
2568 (r"#\\([()/'\"._!§$%& ?=+-]|[a-zA-Z0-9]+)", String.Char),
2569
2570 # special operators
2571 (r"('|#|`|,@|,|\.)", Operator),
2572
2573 # keywords
2574 (words(scheme_keywords, prefix=r'(?<=\()'), Keyword),
2575
2576 # builtins
2577 (words(scheme_functions, prefix=r'(?<=\()'), Name.Function),
2578
2579 include('common'),
2580
2581 # variables
2582 (valid_scheme_name, Name.Variable),
2583 ],
2584 # common to both xtlang and Scheme
2585 'common': [
2586 # comments
2587 (r';.*$', Comment.Single),
2588
2589 # whitespaces - usually not relevant
2590 (r'\s+', Text),
2591
2592 # numbers
2593 (r'-?\d+\.\d+', Number.Float),
2594 (r'-?\d+', Number.Integer),
2595
2596 # binary/oct/hex literals
2597 (r'(#b|#o|#x)[\d.]+', Number),
2598
2599 # strings
2600 (r'"(\\\\|\\"|[^"])*"', String),
2601
2602 # true/false constants
2603 (r'(#t|#f)', Name.Constant),
2604
2605 # keywords
2606 (words(common_keywords, prefix=r'(?<=\()'), Keyword),
2607
2608 # builtins
2609 (words(common_functions, prefix=r'(?<=\()'), Name.Function),
2610
2611 # the famous parentheses!
2612 (r'(\(|\))', Punctuation),
2613 ],
2614 'root': [
2615 # go into xtlang mode
2616 (words(xtlang_bind_keywords, prefix=r'(?<=\()', suffix=r'\b'),
2617 Keyword, 'xtlang'),
2618
2619 include('scheme')
2620 ],
2621 }
2622
2623
2624 class FennelLexer(RegexLexer):
2625 """A lexer for the `Fennel programming language <https://fennel-lang.org>`_.
2626
2627 Fennel compiles to Lua, so all the Lua builtins are recognized as well
2628 as the special forms that are particular to the Fennel compiler.
2629
2630 .. versionadded:: 2.3
2631 """
2632 name = 'Fennel'
2633 aliases = ['fennel', 'fnl']
2634 filenames = ['*.fnl']
2635
2636 # these two lists are taken from fennel-mode.el:
2637 # https://gitlab.com/technomancy/fennel-mode
2638 # this list is current as of Fennel version 0.1.0.
2639 special_forms = (
2640 u'require-macros', u'eval-compiler',
2641 u'do', u'values', u'if', u'when', u'each', u'for', u'fn', u'lambda',
2642 u'λ', u'set', u'global', u'var', u'local', u'let', u'tset', u'doto',
2643 u'set-forcibly!', u'defn', u'partial', u'while', u'or', u'and', u'true',
2644 u'false', u'nil', u'.', u'+', u'..', u'^', u'-', u'*', u'%', u'/', u'>',
2645 u'<', u'>=', u'<=', u'=', u'~=', u'#', u'...', u':', u'->', u'->>',
2646 )
2647
2648 # Might be nicer to use the list from _lua_builtins.py but it's unclear how?
2649 builtins = (
2650 u'_G', u'_VERSION', u'arg', u'assert', u'bit32', u'collectgarbage',
2651 u'coroutine', u'debug', u'dofile', u'error', u'getfenv',
2652 u'getmetatable', u'io', u'ipairs', u'load', u'loadfile', u'loadstring',
2653 u'math', u'next', u'os', u'package', u'pairs', u'pcall', u'print',
2654 u'rawequal', u'rawget', u'rawlen', u'rawset', u'require', u'select',
2655 u'setfenv', u'setmetatable', u'string', u'table', u'tonumber',
2656 u'tostring', u'type', u'unpack', u'xpcall'
2657 )
2658
2659 # based on the scheme definition, but disallowing leading digits and commas
2660 valid_name = r'[a-zA-Z_!$%&*+/:<=>?@^~|-][\w!$%&*+/:<=>?@^~|\.-]*'
2661
2662 tokens = {
2663 'root': [
2664 # the only comment form is a semicolon; goes to the end of the line
2665 (r';.*$', Comment.Single),
2666
2667 (r'[,\s]+', Text),
2668 (r'-?\d+\.\d+', Number.Float),
2669 (r'-?\d+', Number.Integer),
2670
2671 (r'"(\\\\|\\"|[^"])*"', String),
2672 (r"'(\\\\|\\'|[^'])*'", String),
2673
2674 # these are technically strings, but it's worth visually
2675 # distinguishing them because their intent is different
2676 # from regular strings.
2677 (r':' + valid_name, String.Symbol),
2678
2679 # special forms are keywords
2680 (words(special_forms, suffix=' '), Keyword),
2681 # lua standard library are builtins
2682 (words(builtins, suffix=' '), Name.Builtin),
2683 # special-case the vararg symbol
2684 (r'\.\.\.', Name.Variable),
2685 # regular identifiers
2686 (valid_name, Name.Variable),
2687
2688 # all your normal paired delimiters for your programming enjoyment
2689 (r'(\(|\))', Punctuation),
2690 (r'(\[|\])', Punctuation),
2691 (r'(\{|\})', Punctuation),
2692 ]
2693 }

eric ide

mercurial