UNPKG

1.04 kBJavaScriptView Raw
1Prism.languages.scheme = {
2 'comment': /;.*/,
3 'string': {
4 pattern: /"(?:[^"\\]|\\.)*"|'[^()#'\s]+/,
5 greedy: true
6 },
7 'character': {
8 pattern: /#\\(?:[ux][a-fA-F\d]+|[a-zA-Z]+|\S)/,
9 alias: 'string'
10 },
11 'keyword': {
12 pattern: /(\()(?:define(?:-syntax|-library|-values)?|(?:case-)?lambda|let(?:\*|rec)?(?:-values)?|else|if|cond|begin|delay(?:-force)?|parameterize|guard|set!|(?:quasi-)?quote|syntax-rules)(?=[()\s])/,
13 lookbehind: true
14 },
15 'builtin': {
16 pattern: /(\()(?:(?:cons|car|cdr|list|call-with-current-continuation|call\/cc|append|abs|apply|eval)\b|null\?|pair\?|boolean\?|eof-object\?|char\?|procedure\?|number\?|port\?|string\?|vector\?|symbol\?|bytevector\?)(?=[()\s])/,
17 lookbehind: true
18 },
19 'number': {
20 pattern: /([\s()])[-+]?(?:\d+\/\d+|\d*\.?\d+(?:\s*[-+]\s*\d*\.?\d+i)?)\b/,
21 lookbehind: true
22 },
23 'boolean': /#[tf]/,
24 'operator': {
25 pattern: /(\()(?:[-+*%\/]|[<>]=?|=>?)(?=\s|$)/,
26 lookbehind: true
27 },
28 'function': {
29 pattern: /(\()[^()'\s]+(?=[()\s)]|$)/,
30 lookbehind: true
31 },
32 'punctuation': /[()']/
33};