Skip to content

Commit 3120ff7

Browse files
committed
Scheme: Add missing lookbehind on number pattern. Fix #702
1 parent 776ab90 commit 3120ff7

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

components/prism-scheme.js

+16-17
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
Prism.languages.scheme = {
2-
'boolean' : /#(t|f){1}/,
3-
'comment' : /;.*/,
4-
'keyword' : {
2+
'boolean' : /#(t|f){1}/,
3+
'comment' : /;.*/,
4+
'keyword' : {
55
pattern : /([(])(define(-syntax|-library|-values)?|(case-)?lambda|let(-values|(rec)?(\*)?)?|else|if|cond|begin|delay|delay-force|parameterize|guard|set!|(quasi-)?quote|syntax-rules)/,
66
lookbehind : true
7-
},
8-
'builtin' : {
7+
},
8+
'builtin' : {
99
pattern : /([(])(cons|car|cdr|null\?|pair\?|boolean\?|eof-object\?|char\?|procedure\?|number\?|port\?|string\?|vector\?|symbol\?|bytevector\?|list|call-with-current-continuation|call\/cc|append|abs|apply|eval)\b/,
1010
lookbehind : true
11-
},
12-
'string' : /(["])(?:(?=(\\?))\2.)*?\1|'[^('|\s)]+/, //thanks http://stackoverflow.com/questions/171480/regex-grabbing-values-between-quotation-marks
13-
'number' : /(\s|\))[-+]?[0-9]*\.?[0-9]+((\s*)[-+]{1}(\s*)[0-9]*\.?[0-9]+i)?/,
14-
'operator': /(\*|\+|\-|%|\/|<=|=>|>=|<|=|>)/,
15-
'function' : {
11+
},
12+
'string' : /(["])(?:(?=(\\?))\2.)*?\1|'[^('|\s)]+/, //thanks http://stackoverflow.com/questions/171480/regex-grabbing-values-between-quotation-marks
13+
'number' : {
14+
pattern: /(\s|\))[-+]?[0-9]*\.?[0-9]+((\s*)[-+]{1}(\s*)[0-9]*\.?[0-9]+i)?/,
15+
lookbehind: true
16+
},
17+
'operator': /(\*|\+|\-|%|\/|<=|=>|>=|<|=|>)/,
18+
'function' : {
1619
pattern : /([(])[^(\s|\))]*\s/,
1720
lookbehind : true
18-
},
19-
'punctuation' : /[()]/
20-
};
21-
22-
23-
24-
21+
},
22+
'punctuation' : /[()]/
23+
};

components/prism-scheme.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)