Skip to content
Permalink
Browse files
Rip: Use standard char token (#3252)
  • Loading branch information
RunDevelopment committed Dec 10, 2021
1 parent bacf9ae commit 2069ab0c4344b608018b9ebe24c4048fb218feae
Showing with 35 additions and 28 deletions.
  1. +19 −13 components/prism-rip.js
  2. +1 −1 components/prism-rip.min.js
  3. +15 −14 tests/languages/rip/{character_feature.test → char_feature.test}
@@ -1,5 +1,23 @@
Prism.languages.rip = {
'comment': /#.*/,
'comment': {
pattern: /#.*/,
greedy: true
},

'char': {
pattern: /\B`[^\s`'",.:;#\/\\()<>\[\]{}]\b/,
greedy: true
},
'string': {
pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
greedy: true
},

'regex': {
pattern: /(^|[^/])\/(?!\/)(?:\[[^\n\r\]]*\]|\\.|[^/\\\r\n\[])+\/(?=\s*(?:$|[\r\n,.;})]))/,
lookbehind: true,
greedy: true
},

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

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

'character': /\B`[^\s`'",.:;#\/\\()<>\[\]{}]\b/,

'regex': {
pattern: /(^|[^/])\/(?!\/)(?:\[[^\n\r\]]*\]|\\.|[^/\\\r\n\[])+\/(?=\s*(?:$|[\r\n,.;})]))/,
lookbehind: true,
greedy: true
},

'symbol': /:[^\d\s`'",.:;#\/\\()<>\[\]{}][^\s`'",.:;#\/\\()<>\[\]{}]*/,
'string': {
pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
greedy: true
},
'number': /[+-]?\b(?:\d+\.\d+|\d+)\b/,

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

Some generated files are not rendered by default. Learn more.

@@ -1,14 +1,15 @@
`a
`b
`Z
----------------------------------------------------

[
["character", "`a"],
["character", "`b"],
["character", "`Z"]
]

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

Checks for characters.
`a
`b
`Z

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

[
["char", "`a"],
["char", "`b"],
["char", "`Z"]
]

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

Checks for characters.

0 comments on commit 2069ab0

Please sign in to comment.