Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scheme: Use standard char token #3254

Merged
merged 1 commit into from
Dec 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions components/prism-scheme.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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.