Skip to content

Commit 2069ab0

Browse files
authoredDec 10, 2021
Rip: Use standard char token (#3252)
1 parent bacf9ae commit 2069ab0

File tree

3 files changed

+35
-28
lines changed

3 files changed

+35
-28
lines changed
 

‎components/prism-rip.js

+19-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
Prism.languages.rip = {
2-
'comment': /#.*/,
2+
'comment': {
3+
pattern: /#.*/,
4+
greedy: true
5+
},
6+
7+
'char': {
8+
pattern: /\B`[^\s`'",.:;#\/\\()<>\[\]{}]\b/,
9+
greedy: true
10+
},
11+
'string': {
12+
pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
13+
greedy: true
14+
},
15+
16+
'regex': {
17+
pattern: /(^|[^/])\/(?!\/)(?:\[[^\n\r\]]*\]|\\.|[^/\\\r\n\[])+\/(?=\s*(?:$|[\r\n,.;})]))/,
18+
lookbehind: true,
19+
greedy: true
20+
},
321

422
'keyword': /(?:=>|->)|\b(?:case|catch|class|else|exit|finally|if|raise|return|switch|try)\b/,
523

@@ -11,19 +29,7 @@ Prism.languages.rip = {
1129
'time': /\b\d{2}:\d{2}:\d{2}\b/,
1230
'datetime': /\b\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\b/,
1331

14-
'character': /\B`[^\s`'",.:;#\/\\()<>\[\]{}]\b/,
15-
16-
'regex': {
17-
pattern: /(^|[^/])\/(?!\/)(?:\[[^\n\r\]]*\]|\\.|[^/\\\r\n\[])+\/(?=\s*(?:$|[\r\n,.;})]))/,
18-
lookbehind: true,
19-
greedy: true
20-
},
21-
2232
'symbol': /:[^\d\s`'",.:;#\/\\()<>\[\]{}][^\s`'",.:;#\/\\()<>\[\]{}]*/,
23-
'string': {
24-
pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
25-
greedy: true
26-
},
2733
'number': /[+-]?\b(?:\d+\.\d+|\d+)\b/,
2834

2935
'punctuation': /(?:\.{2,3})|[`,.:;=\/\\()<>\[\]{}]/,

‎components/prism-rip.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
`a
2-
`b
3-
`Z
4-
----------------------------------------------------
5-
6-
[
7-
["character", "`a"],
8-
["character", "`b"],
9-
["character", "`Z"]
10-
]
11-
12-
----------------------------------------------------
13-
14-
Checks for characters.
1+
`a
2+
`b
3+
`Z
4+
5+
----------------------------------------------------
6+
7+
[
8+
["char", "`a"],
9+
["char", "`b"],
10+
["char", "`Z"]
11+
]
12+
13+
----------------------------------------------------
14+
15+
Checks for characters.

0 commit comments

Comments
 (0)
Please sign in to comment.