Skip to content

Commit

Permalink
Scheme: Fixes and simplifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Golmote committed Aug 31, 2015
1 parent daf2597 commit 068704a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 10 additions & 7 deletions components/prism-scheme.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
Prism.languages.scheme = {
'boolean' : /#(t|f){1}/,
'comment' : /;.*/,
'string' : /"(?:[^"\\\r\n]|\\.)*?"|'[^'\s]+/, //thanks http://stackoverflow.com/questions/171480/regex-grabbing-values-between-quotation-marks
'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)/,
pattern : /(\()(?:define(?:-syntax|-library|-values)?|(?:case-)?lambda|let(?:\*|rec)?(?:-values)?|else|if|cond|begin|delay(?:-force)?|parameterize|guard|set!|(?:quasi-)?quote|syntax-rules)/,
lookbehind : true
},
'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/,
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\?)/,
lookbehind : true
},
'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)?/,
pattern: /(\s|\))[-+]?[0-9]*\.?[0-9]+(?:\s*[-+]\s*[0-9]*\.?[0-9]+i)?\b/,
lookbehind: true
},
'boolean' : /#[tf]/,
'operator': {
pattern: /(\()(?:[-+*%\/]|[<>]=?|=>?)/,
lookbehind: true
},
'operator': /(\*|\+|\-|%|\/|<=|=>|>=|<|=|>)/,
'function' : {
pattern : /([(])[^(\s|\))]*\s/,
pattern : /(\()[^\s()]*(?=\s)/,
lookbehind : true
},
'punctuation' : /[()]/
Expand Down
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 068704a

Please sign in to comment.