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