Skip to content

Commit

Permalink
Scheme: Added missing special keywords (PrismJS#2304)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment authored and quentinvernot committed Sep 11, 2020
1 parent abf4e30 commit 8840011
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion components/prism-scheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Prism.languages.scheme = {
lookbehind: true
},
'keyword': {
pattern: /(\()(?:define(?:-syntax|-library|-values)?|(?:case-)?lambda|let(?:\*|rec)?(?:-values)?|else|if|cond|begin|delay(?:-force)?|parameterize|guard|set!|(?:quasi-)?quote|syntax-rules)(?=[()\s])/,
pattern: /(\()(?:define(?:-library|-macro|-syntax|-values)?|defmacro|(?:case-)?lambda|let(?:(?:\*|rec)?(?:-values)?|-syntax|rec-syntax)|else|if|cond|begin|delay(?:-force)?|parameterize|guard|set!|(?:quasi-)?quote|syntax-(?:case|rules))(?=[()\s])/,
lookbehind: true
},
'builtin': {
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.

16 changes: 13 additions & 3 deletions tests/languages/scheme/keyword_feature.test
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
(define)
(define-syntax)
(define-library)
(define-macro)
(define-syntax)
(define-values)
(defmacro)
(case-lambda)
(lambda)
(let)
Expand All @@ -22,14 +24,19 @@
(quasi-quote)
(quote)
(syntax-rules)
(syntax-case)
(letrec-syntax)
(let-syntax)

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

[
["punctuation", "("], ["keyword", "define"], ["punctuation", ")"],
["punctuation", "("], ["keyword", "define-syntax"], ["punctuation", ")"],
["punctuation", "("], ["keyword", "define-library"], ["punctuation", ")"],
["punctuation", "("], ["keyword", "define-macro"], ["punctuation", ")"],
["punctuation", "("], ["keyword", "define-syntax"], ["punctuation", ")"],
["punctuation", "("], ["keyword", "define-values"], ["punctuation", ")"],
["punctuation", "("], ["keyword", "defmacro"], ["punctuation", ")"],
["punctuation", "("], ["keyword", "case-lambda"], ["punctuation", ")"],
["punctuation", "("], ["keyword", "lambda"], ["punctuation", ")"],
["punctuation", "("], ["keyword", "let"], ["punctuation", ")"],
Expand All @@ -49,7 +56,10 @@
["punctuation", "("], ["keyword", "set!"], ["punctuation", ")"],
["punctuation", "("], ["keyword", "quasi-quote"], ["punctuation", ")"],
["punctuation", "("], ["keyword", "quote"], ["punctuation", ")"],
["punctuation", "("], ["keyword", "syntax-rules"], ["punctuation", ")"]
["punctuation", "("], ["keyword", "syntax-rules"], ["punctuation", ")"],
["punctuation", "("], ["keyword", "syntax-case"], ["punctuation", ")"],
["punctuation", "("], ["keyword", "letrec-syntax"], ["punctuation", ")"],
["punctuation", "("], ["keyword", "let-syntax"], ["punctuation", ")"]
]

----------------------------------------------------
Expand Down

0 comments on commit 8840011

Please sign in to comment.