Skip to content

Commit

Permalink
Scheme: Use standard char token (#3254)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment committed Dec 10, 2021
1 parent a7bb300 commit 7d740c4
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 108 deletions.
5 changes: 2 additions & 3 deletions components/prism-scheme.js
Expand Up @@ -14,10 +14,9 @@
pattern: /'[^()\[\]#'\s]+/,
greedy: true
},
'character': {
'char': {
pattern: /#\\(?:[ux][a-fA-F\d]+\b|[-a-zA-Z]+\b|[\uD800-\uDBFF][\uDC00-\uDFFF]|\S)/,
greedy: true,
alias: 'string'
greedy: true
},
'lambda-parameter': [
// https://www.cs.cmu.edu/Groups/AI/html/r4rs/r4rs_6.html#SEC30
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.

41 changes: 41 additions & 0 deletions tests/languages/racket/char_feature.test
@@ -0,0 +1,41 @@
#\a ; lowercase letter
#\A ; uppercase letter
#\( ; left parenthesis
#\space ; the space character
#\newline ; the newline character

#\c-a ; Control-a
#\meta-b ; Meta-b
#\c-s-m-h-a ; Control-Meta-Super-Hyper-A

#\; #\' #\"

#\u0041
#\x10FFFF
#\λ
#\)

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

[
["char", "#\\a"], ["comment", "; lowercase letter"],
["char", "#\\A"], ["comment", "; uppercase letter"],
["char", "#\\("], ["comment", "; left parenthesis"],
["char", "#\\space"], ["comment", "; the space character"],
["char", "#\\newline"], ["comment", "; the newline character"],

["char", "#\\c-a"], ["comment", "; Control-a"],
["char", "#\\meta-b"], ["comment", "; Meta-b"],
["char", "#\\c-s-m-h-a"], ["comment", "; Control-Meta-Super-Hyper-A"],

["char", "#\\;"], ["char", "#\\'"], ["char", "#\\\""],

["char", "#\\u0041"],
["char", "#\\x10FFFF"],
["char", "#\\λ"],
["char", "#\\)"]
]

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

Checks for character literals.
51 changes: 0 additions & 51 deletions tests/languages/racket/character_feature.test

This file was deleted.

43 changes: 43 additions & 0 deletions tests/languages/scheme/char_feature.test
@@ -0,0 +1,43 @@
#\a ; lowercase letter
#\A ; uppercase letter
#\( ; left parenthesis
#\space ; the space character
#\newline ; the newline character

#\c-a ; Control-a
#\meta-b ; Meta-b
#\c-s-m-h-a ; Control-Meta-Super-Hyper-A

#\; #\' #\"

#\u0041
#\x10FFFF
#\λ
#\)
#\💩

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

[
["char", "#\\a"], ["comment", "; lowercase letter"],
["char", "#\\A"], ["comment", "; uppercase letter"],
["char", "#\\("], ["comment", "; left parenthesis"],
["char", "#\\space"], ["comment", "; the space character"],
["char", "#\\newline"], ["comment", "; the newline character"],

["char", "#\\c-a"], ["comment", "; Control-a"],
["char", "#\\meta-b"], ["comment", "; Meta-b"],
["char", "#\\c-s-m-h-a"], ["comment", "; Control-Meta-Super-Hyper-A"],

["char", "#\\;"], ["char", "#\\'"], ["char", "#\\\""],

["char", "#\\u0041"],
["char", "#\\x10FFFF"],
["char", "#\\λ"],
["char", "#\\)"],
["char", "#\\💩"]
]

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

Checks for character literals.
53 changes: 0 additions & 53 deletions tests/languages/scheme/character_feature.test

This file was deleted.

0 comments on commit 7d740c4

Please sign in to comment.