Add missing keywords to highlightjs for doc generation.

This commit is contained in:
KtorZ 2023-02-22 11:50:31 +01:00
parent c0230a811f
commit 6465af3ae2
No known key found for this signature in database
GPG Key ID: 33173CB6F77F4277
1 changed files with 11 additions and 4 deletions

View File

@ -1,6 +1,6 @@
hljs.registerLanguage("aiken", function (hljs) { hljs.registerLanguage("aiken", function (hljs) {
const KEYWORDS = const KEYWORDS =
"as assert when is const fn if let use opaque pub assert check todo type"; "as when is const validator fn if else let use opaque pub expect trace todo error type";
const COMMAS = { const COMMAS = {
scope: "ponctuation", scope: "ponctuation",
begin: "[, ]+", begin: "[, ]+",
@ -30,11 +30,17 @@ hljs.registerLanguage("aiken", function (hljs) {
}; };
const STRING = { const STRING = {
scope: "string", scope: "string",
variants: [{ begin: /"/, end: /"/ }], variants: [{ begin: /@"/, end: /"/ }],
contains: [hljs.BACKSLASH_ESCAPE], contains: [hljs.BACKSLASH_ESCAPE],
relevance: 0, relevance: 0,
}; };
const BYTE_STRING = { const BYTESTRING = {
scope: "string",
variants: [{ begin: /#?"/, end: /"/ }],
contains: [hljs.BACKSLASH_ESCAPE],
relevance: 0,
};
const BYTEARRAY = {
scope: "string", scope: "string",
variants: [{ begin: /#\[/, end: /\]/ }], variants: [{ begin: /#\[/, end: /\]/ }],
contains: [ contains: [
@ -78,7 +84,8 @@ hljs.registerLanguage("aiken", function (hljs) {
contains: [ contains: [
hljs.C_LINE_COMMENT_MODE, hljs.C_LINE_COMMENT_MODE,
STRING, STRING,
BYTE_STRING, BYTESTRING,
BYTEARRAY,
{ {
scope: "function", scope: "function",
beginKeywords: "fn", beginKeywords: "fn",