Skip to content

Commit

Permalink
Fixed operator-like functions in Scheme (#1467)
Browse files Browse the repository at this point in the history
This fixes operator-like functions in Scheme.
  • Loading branch information
jcubic authored and RunDevelopment committed Mar 3, 2019
1 parent b62e282 commit f8c8add
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
10 changes: 5 additions & 5 deletions components/prism-scheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ Prism.languages.scheme = {
},
'boolean': /#[tf]/,
'operator': {
pattern: /(\()(?:[-+*%\/]|[<>]=?|=>?)/,
pattern: /(\()(?:[-+*%\/]|[<>]=?|=>?)(?=\s|$)/,
lookbehind: true
},
'function': {
pattern: /(\()[^()#'\s]+(?=[()\s)])/,
lookbehind: true
'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.

6 changes: 6 additions & 0 deletions tests/languages/scheme/function_feature.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
(exact? 2)
(inexact->exact 3)
(!fact)
(** 10)
(exact?
(**
(defined foo)

----------------------------------------------------
Expand All @@ -13,6 +16,9 @@
["punctuation", "("], ["function", "exact?"], ["number", "2"], ["punctuation", ")"],
["punctuation", "("], ["function", "inexact->exact"], ["number", "3"], ["punctuation", ")"],
["punctuation", "("], ["function", "!fact"], ["punctuation", ")"],
["punctuation", "("], ["function", "**"], ["number", "10"], ["punctuation", ")"],
["punctuation", "("], ["function", "exact?"],
["punctuation", "("], ["function", "**"],
["punctuation", "("], ["function", "defined"], " foo", ["punctuation", ")"]
]

Expand Down

0 comments on commit f8c8add

Please sign in to comment.