Skip to content

Commit

Permalink
Nim: Fixed backtick identifier (#3118)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment committed Oct 5, 2021
1 parent 15cb3b7 commit 75331be
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
3 changes: 2 additions & 1 deletion components/prism-nim.js
Expand Up @@ -16,8 +16,9 @@ Prism.languages.nim = {
}
},
// We don't want to highlight operators inside backticks
'ignore': {
'identifier': {
pattern: /`[^`\r\n]+`/,
greedy: true,
inside: {
'punctuation': /`/
}
Expand Down
2 changes: 1 addition & 1 deletion components/prism-nim.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions tests/languages/nim/identifier_feature.test
@@ -0,0 +1,14 @@
var `var` = 42

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

[
["keyword", "var"],
["identifier", [
["punctuation", "`"],
"var",
["punctuation", "`"]
]],
["operator", "="],
["number", "42"]
]

0 comments on commit 75331be

Please sign in to comment.