Skip to content

Commit

Permalink
Scheme: Add missing lookbehind on number pattern. Fix #702
Browse files Browse the repository at this point in the history
  • Loading branch information
Golmote committed Aug 21, 2015
1 parent 776ab90 commit 3120ff7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
33 changes: 16 additions & 17 deletions components/prism-scheme.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
Prism.languages.scheme = {
'boolean' : /#(t|f){1}/,
'comment' : /;.*/,
'keyword' : {
'boolean' : /#(t|f){1}/,
'comment' : /;.*/,
'keyword' : {
pattern : /([(])(define(-syntax|-library|-values)?|(case-)?lambda|let(-values|(rec)?(\*)?)?|else|if|cond|begin|delay|delay-force|parameterize|guard|set!|(quasi-)?quote|syntax-rules)/,
lookbehind : true
},
'builtin' : {
},
'builtin' : {
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/,
lookbehind : true
},
'string' : /(["])(?:(?=(\\?))\2.)*?\1|'[^('|\s)]+/, //thanks http://stackoverflow.com/questions/171480/regex-grabbing-values-between-quotation-marks
'number' : /(\s|\))[-+]?[0-9]*\.?[0-9]+((\s*)[-+]{1}(\s*)[0-9]*\.?[0-9]+i)?/,
'operator': /(\*|\+|\-|%|\/|<=|=>|>=|<|=|>)/,
'function' : {
},
'string' : /(["])(?:(?=(\\?))\2.)*?\1|'[^('|\s)]+/, //thanks http://stackoverflow.com/questions/171480/regex-grabbing-values-between-quotation-marks
'number' : {
pattern: /(\s|\))[-+]?[0-9]*\.?[0-9]+((\s*)[-+]{1}(\s*)[0-9]*\.?[0-9]+i)?/,
lookbehind: true
},
'operator': /(\*|\+|\-|%|\/|<=|=>|>=|<|=|>)/,
'function' : {
pattern : /([(])[^(\s|\))]*\s/,
lookbehind : true
},
'punctuation' : /[()]/
};




},
'punctuation' : /[()]/
};
2 changes: 1 addition & 1 deletion components/prism-scheme.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3120ff7

Please sign in to comment.