Skip to content

Commit

Permalink
Scheme: Improved boolean (#2316)
Browse files Browse the repository at this point in the history
I noticed that scheme booleans also partially highlighted `#true`, so I fixed that.
  • Loading branch information
RunDevelopment committed Apr 27, 2020
1 parent eb70070 commit e27e65a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/prism-scheme.js
Expand Up @@ -44,7 +44,7 @@ Prism.languages.scheme = {
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()]|$)/,
lookbehind: true
},
'boolean': /#[tf]/,
'boolean': /#[ft](?=[()\s]|$)/,
'operator': {
pattern: /(\()(?:[-+*%\/]|[<>]=?|=>?)(?=\s|$)/,
lookbehind: true
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.

10 changes: 8 additions & 2 deletions tests/languages/scheme/boolean_feature.test
@@ -1,13 +1,19 @@
#t
#f

; not a boolean
#true

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

[
["boolean", "#t"],
["boolean", "#f"]
["boolean", "#f"],

["comment", "; not a boolean"],
"\r\n#true"
]

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

Checks for booleans.
Checks for booleans.

0 comments on commit e27e65a

Please sign in to comment.