Skip to content

Commit

Permalink
Scheme: Don't highlight first number of a list as a function. Fix #1331
Browse files Browse the repository at this point in the history
  • Loading branch information
Golmote committed Mar 4, 2018
1 parent eba0235 commit 51bff80
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/prism-scheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Prism.languages.scheme = {
lookbehind : true
},
'number' : {
pattern: /(\s|\))[-+]?\d*\.?\d+(?:\s*[-+]\s*\d*\.?\d+i)?\b/,
pattern: /(\s|[()])[-+]?\d*\.?\d+(?:\s*[-+]\s*\d*\.?\d+i)?\b/,
lookbehind: true
},
'boolean' : /#[tf]/,
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.

12 changes: 12 additions & 0 deletions tests/languages/scheme/issue1331.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(pair? '(1 2))

----------------------------------------------------

[
["punctuation", "("], ["builtin", "pair?"],
["string", "'"], ["punctuation", "("], ["number", "1"], ["number", "2"], ["punctuation", ")"], ["punctuation", ")"]
]

----------------------------------------------------

Tests that first number of a list is not highlighted as a function. See #1331

0 comments on commit 51bff80

Please sign in to comment.