]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/es/languages/scheme.js
1 /*! `scheme` grammar compiled for Highlight.js 11.11.1 */
2 var hljsGrammar
= (function () {
7 Description: Scheme is a programming language in the Lisp family.
8 (keywords based on http://community.schemewiki.org/?scheme-keywords)
9 Author: JP Verkamp <me@jverkamp.com>
10 Contributors: Ivan Sagalaev <maniac@softwaremaniacs.org>
12 Website: http://community.schemewiki.org/?what-is-scheme
16 function scheme(hljs
) {
17 const SCHEME_IDENT_RE
= '[^\\(\\)\\[\\]\\{\\}",\'`;#|\\\\\\s]+';
18 const SCHEME_SIMPLE_NUMBER_RE
= '(-|\\+)?\\d+([./]\\d+)?';
19 const SCHEME_COMPLEX_NUMBER_RE
= SCHEME_SIMPLE_NUMBER_RE
+ '[+\\-]' + SCHEME_SIMPLE_NUMBER_RE
+ 'i';
21 $pattern: SCHEME_IDENT_RE
,
23 'case-lambda call/cc class define-class exit-handler field import '
24 + 'inherit init-field interface let*-values let-values let/ec mixin '
25 + 'opt-lambda override protect provide public rename require '
26 + 'require-for-syntax syntax syntax-case syntax-error unit/sig unless '
27 + 'when with-syntax and begin call-with-current-continuation '
28 + 'call-with-input-file call-with-output-file case cond define '
29 + 'define-syntax delay do dynamic-wind else for-each if lambda let let* '
30 + 'let-syntax letrec letrec-syntax map or syntax-rules \' * + , ,@ - ... / '
31 + '; < <= = => > >= ` abs acos angle append apply asin assoc assq assv atan '
32 + 'boolean? caar cadr call-with-input-file call-with-output-file '
33 + 'call-with-values car cdddar cddddr cdr ceiling char->integer '
34 + 'char-alphabetic? char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>? '
35 + 'char-downcase char-lower-case? char-numeric? char-ready? char-upcase '
36 + 'char-upper-case? char-whitespace? char<=? char<? char=? char>=? char>? '
37 + 'char? close-input-port close-output-port complex? cons cos '
38 + 'current-input-port current-output-port denominator display eof-object? '
39 + 'eq? equal? eqv? eval even? exact->inexact exact? exp expt floor '
40 + 'force gcd imag-part inexact->exact inexact? input-port? integer->char '
41 + 'integer? interaction-environment lcm length list list->string '
42 + 'list->vector list-ref list-tail list? load log magnitude make-polar '
43 + 'make-rectangular make-string make-vector max member memq memv min '
44 + 'modulo negative? newline not null-environment null? number->string '
45 + 'number? numerator odd? open-input-file open-output-file output-port? '
46 + 'pair? peek-char port? positive? procedure? quasiquote quote quotient '
47 + 'rational? rationalize read read-char real-part real? remainder reverse '
48 + 'round scheme-report-environment set! set-car! set-cdr! sin sqrt string '
49 + 'string->list string->number string->symbol string-append string-ci<=? '
50 + 'string-ci<? string-ci=? string-ci>=? string-ci>? string-copy '
51 + 'string-fill! string-length string-ref string-set! string<=? string<? '
52 + 'string=? string>=? string>? string? substring symbol->string symbol? '
53 + 'tan transcript-off transcript-on truncate values vector '
54 + 'vector->list vector-fill! vector-length vector-ref vector-set! '
55 + 'with-input-from-file with-output-to-file write write-char zero?'
60 begin: '(#t|#f|#\\\\' + SCHEME_IDENT_RE
+ '|#\\\\.)'
67 begin: SCHEME_SIMPLE_NUMBER_RE
,
71 begin: SCHEME_COMPLEX_NUMBER_RE
,
74 { begin: '#b[0-1]+(/[0-1]+)?' },
75 { begin: '#o[0-7]+(/[0-7]+)?' },
76 { begin: '#x[0-9a-f]+(/[0-9a-f]+)?' }
80 const STRING
= hljs
.QUOTE_STRING_MODE
;
82 const COMMENT_MODES
= [
88 hljs
.COMMENT('#\\|', '\\|#')
92 begin: SCHEME_IDENT_RE
,
96 const QUOTED_IDENT
= {
98 begin: '\'' + SCHEME_IDENT_RE
102 endsWithParent: true,
106 const QUOTED_LIST
= {
130 begin: SCHEME_IDENT_RE,
136 endsWithParent: true,
183 ].concat(COMMENT_MODES);
196 ].concat(COMMENT_MODES)
204 export default hljsGrammar;