Skip to content

Commit e27e65a

Browse files
Scheme: Improved boolean (#2316)
I noticed that scheme booleans also partially highlighted `#true`, so I fixed that.
1 parent eb70070 commit e27e65a

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

components/prism-scheme.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Prism.languages.scheme = {
4444
pattern: /([\s()])(?:(?:#d(?:#[ei])?|#[ei](?:#d)?)?[+-]?(?:(?:\d*\.?\d+(?:[eE][+-]?\d+)?|\d+\/\d+)(?:[+-](?:\d*\.?\d+(?:[eE][+-]?\d+)?|\d+\/\d+)i)?|(?:\d*\.?\d+(?:[eE][+-]?\d+)?|\d+\/\d+)i)|(?:#[box](?:#[ei])?|#[ei](?:#[box])?)[+-]?(?:[\da-fA-F]+(?:\/[\da-fA-F]+)?(?:[+-][\da-fA-F]+(?:\/[\da-fA-F]+)?i)?|[\da-fA-F]+(?:\/[\da-fA-F]+)?i))(?=[\s()]|$)/,
4545
lookbehind: true
4646
},
47-
'boolean': /#[tf]/,
47+
'boolean': /#[ft](?=[()\s]|$)/,
4848
'operator': {
4949
pattern: /(\()(?:[-+*%\/]|[<>]=?|=>?)(?=\s|$)/,
5050
lookbehind: true

components/prism-scheme.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
#t
22
#f
33

4+
; not a boolean
5+
#true
6+
47
----------------------------------------------------
58

69
[
710
["boolean", "#t"],
8-
["boolean", "#f"]
11+
["boolean", "#f"],
12+
13+
["comment", "; not a boolean"],
14+
"\r\n#true"
915
]
1016

1117
----------------------------------------------------
1218

13-
Checks for booleans.
19+
Checks for booleans.

0 commit comments

Comments
 (0)