2023-10-02 01:41:38 +00:00
|
|
|
Prism.languages.thp = {
|
|
|
|
"comment": [
|
|
|
|
{
|
|
|
|
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
|
|
|
|
lookbehind: true,
|
|
|
|
greedy: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
pattern: /(^|[^\\:])\/\/.*/,
|
|
|
|
lookbehind: true,
|
|
|
|
greedy: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
"string": {
|
|
|
|
pattern: /(["])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
|
|
|
|
greedy: true,
|
|
|
|
},
|
2024-03-13 17:16:29 +00:00
|
|
|
"keyword": /\b(?:case|static|const|enum|loop|use|break|catch|continue|do|else|finally|for|fun|if|in|fn|nil|return|throw|try|while|type|match|with|of|abstract|class|interface|private|pub|map|override|open|init|val|var|mut|clone)\b/,
|
2023-10-02 01:41:38 +00:00
|
|
|
"number": /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
|
|
|
|
"operator": /[<>]=?|[!=]=?=?|--?|\$|\+\+?|&&?|\|\|?|[?*/~^%]/,
|
|
|
|
"punctuation": /[{}[\];(),.]/,
|
|
|
|
"boolean": /\b(?:false|true)\b/,
|
2023-10-05 12:56:34 +00:00
|
|
|
"class-name": /\b[A-Z][a-zA-Z_0-9]*\b/,
|
2023-10-02 01:41:38 +00:00
|
|
|
"variable": /\b[a-z_0-9][a-zA-Z_0-9]+:/,
|
|
|
|
};
|