Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More โ†’
Socket
Sign inDemoInstall
Socket

markademic

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markademic - npm Package Compare versions

Comparing version 0.20.0 to 0.20.1

201

dist/markademic.js

@@ -18,3 +18,3 @@ import * as Remarkable from 'remarkable';

const C_LINE_COMMENT_MODE = hljs.COMMENT('//', '$', {
const C_LINE_COMMENT_MODE = hljs.COMMENT("//", "$", {
contains: [{

@@ -24,24 +24,24 @@ begin: /\\\n/

});
const DECLTYPE_AUTO_RE = 'decltype\\(auto\\)';
const NAMESPACE_RE = '[a-zA-Z_]\\w*::';
const TEMPLATE_ARGUMENT_RE = '<[^<>]+>';
const FUNCTION_TYPE_RE = '(?!struct)(' + DECLTYPE_AUTO_RE + '|' + regex.optional(NAMESPACE_RE) + '[a-zA-Z_]\\w*' + regex.optional(TEMPLATE_ARGUMENT_RE) + ')';
const DECLTYPE_AUTO_RE = "decltype\\(auto\\)";
const NAMESPACE_RE = "[a-zA-Z_]\\w*::";
const TEMPLATE_ARGUMENT_RE = "<[^<>]+>";
const FUNCTION_TYPE_RE = "(?!struct)(" + DECLTYPE_AUTO_RE + "|" + regex.optional(NAMESPACE_RE) + "[a-zA-Z_]\\w*" + regex.optional(TEMPLATE_ARGUMENT_RE) + ")";
const CPP_PRIMITIVE_TYPES = {
className: 'type',
begin: '\\b[a-z\\d_]*_t\\b'
className: "type",
begin: "\\b[a-z\\d_]*_t\\b"
}; // https://en.cppreference.com/w/cpp/language/escape
// \\ \x \xFF \u2837 \u00323747 \374
const CHARACTER_ESCAPES = '\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)';
const CHARACTER_ESCAPES = "\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)";
const STRINGS = {
className: 'string',
className: "string",
variants: [{
begin: '(u8?|U|L)?"',
end: '"',
illegal: '\\n',
illegal: "\\n",
contains: [hljs.BACKSLASH_ESCAPE]
}, {
begin: "(u8?|U|L)?'(" + CHARACTER_ESCAPES + '|.)',
begin: "(u8?|U|L)?'(" + CHARACTER_ESCAPES + "|.)",
end: "'",
illegal: '.'
illegal: "."
}, hljs.END_SAME_AS_BEGIN({

@@ -53,3 +53,3 @@ begin: /(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,

const NUMBERS = {
className: 'number',
className: "number",
variants: [{

@@ -65,7 +65,7 @@ begin: "\\b(0b[01']+)"

const PREPROCESSOR = {
className: 'meta',
className: "meta",
begin: /#\s*[a-z]+\b/,
end: /$/,
keywords: {
keyword: 'if else elif endif define undef warning error line ' + 'pragma _Pragma ifdef ifndef include'
keyword: "if else elif endif define undef warning error line " + "pragma _Pragma ifdef ifndef include"
},

@@ -76,5 +76,5 @@ contains: [{

}, hljs.inherit(STRINGS, {
className: 'string'
className: "string"
}), {
className: 'string',
className: "string",
begin: /<.*?>/

@@ -84,16 +84,16 @@ }, C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE]

const TITLE_MODE = {
className: 'title',
className: "title",
begin: regex.optional(NAMESPACE_RE) + hljs.IDENT_RE,
relevance: 0
};
const FUNCTION_TITLE = regex.optional(NAMESPACE_RE) + hljs.IDENT_RE + '\\s*\\('; // https://en.cppreference.com/w/cpp/keyword
const FUNCTION_TITLE = regex.optional(NAMESPACE_RE) + hljs.IDENT_RE + "\\s*\\("; // https://en.cppreference.com/w/cpp/keyword
const RESERVED_KEYWORDS = ['alignas', 'alignof', 'and', 'and_eq', 'asm', 'atomic_cancel', 'atomic_commit', 'atomic_noexcept', 'auto', 'bitand', 'bitor', 'break', 'case', 'catch', 'class', 'co_await', 'co_return', 'co_yield', 'compl', 'concept', 'const_cast|10', 'consteval', 'constexpr', 'constinit', 'continue', 'decltype', 'default', 'delete', 'do', 'dynamic_cast|10', 'else', 'enum', 'explicit', 'export', 'extern', 'false', 'final', 'for', 'friend', 'goto', 'if', 'import', 'inline', 'module', 'mutable', 'namespace', 'new', 'noexcept', 'not', 'not_eq', 'nullptr', 'operator', 'or', 'or_eq', 'override', 'private', 'protected', 'public', 'reflexpr', 'register', 'reinterpret_cast|10', 'requires', 'return', 'sizeof', 'static_assert', 'static_cast|10', 'struct', 'switch', 'synchronized', 'template', 'this', 'thread_local', 'throw', 'transaction_safe', 'transaction_safe_dynamic', 'true', 'try', 'typedef', 'typeid', 'typename', 'union', 'using', 'virtual', 'volatile', 'while', 'xor', 'xor_eq']; // https://en.cppreference.com/w/cpp/keyword
const RESERVED_KEYWORDS = ["alignas", "alignof", "and", "and_eq", "asm", "atomic_cancel", "atomic_commit", "atomic_noexcept", "auto", "bitand", "bitor", "break", "case", "catch", "class", "co_await", "co_return", "co_yield", "compl", "concept", "const_cast|10", "consteval", "constexpr", "constinit", "continue", "decltype", "default", "delete", "do", "dynamic_cast|10", "else", "enum", "explicit", "export", "extern", "false", "final", "for", "friend", "goto", "if", "import", "inline", "module", "mutable", "namespace", "new", "noexcept", "not", "not_eq", "nullptr", "operator", "or", "or_eq", "override", "private", "protected", "public", "reflexpr", "register", "reinterpret_cast|10", "requires", "return", "sizeof", "static_assert", "static_cast|10", "struct", "switch", "synchronized", "template", "this", "thread_local", "throw", "transaction_safe", "transaction_safe_dynamic", "true", "try", "typedef", "typeid", "typename", "union", "using", "virtual", "volatile", "while", "xor", "xor_eq"]; // https://en.cppreference.com/w/cpp/keyword
const RESERVED_TYPES = ['bool', 'char', 'char16_t', 'char32_t', 'char8_t', 'double', 'float', 'int', 'long', 'short', 'void', 'wchar_t', 'unsigned', 'signed', 'const', 'static'];
const TYPE_HINTS = ['any', 'auto_ptr', 'barrier', 'binary_semaphore', 'bitset', 'complex', 'condition_variable', 'condition_variable_any', 'counting_semaphore', 'deque', 'false_type', 'future', 'imaginary', 'initializer_list', 'istringstream', 'jthread', 'latch', 'lock_guard', 'multimap', 'multiset', 'mutex', 'optional', 'ostringstream', 'packaged_task', 'pair', 'promise', 'priority_queue', 'queue', 'recursive_mutex', 'recursive_timed_mutex', 'scoped_lock', 'set', 'shared_future', 'shared_lock', 'shared_mutex', 'shared_timed_mutex', 'shared_ptr', 'stack', 'string_view', 'stringstream', 'timed_mutex', 'thread', 'true_type', 'tuple', 'unique_lock', 'unique_ptr', 'unordered_map', 'unordered_multimap', 'unordered_multiset', 'unordered_set', 'variant', 'vector', 'weak_ptr', 'wstring', 'wstring_view'];
const FUNCTION_HINTS = ['abort', 'abs', 'acos', 'apply', 'as_const', 'asin', 'atan', 'atan2', 'calloc', 'ceil', 'cerr', 'cin', 'clog', 'cos', 'cosh', 'cout', 'declval', 'endl', 'exchange', 'exit', 'exp', 'fabs', 'floor', 'fmod', 'forward', 'fprintf', 'fputs', 'free', 'frexp', 'fscanf', 'future', 'invoke', 'isalnum', 'isalpha', 'iscntrl', 'isdigit', 'isgraph', 'islower', 'isprint', 'ispunct', 'isspace', 'isupper', 'isxdigit', 'labs', 'launder', 'ldexp', 'log', 'log10', 'make_pair', 'make_shared', 'make_shared_for_overwrite', 'make_tuple', 'make_unique', 'malloc', 'memchr', 'memcmp', 'memcpy', 'memset', 'modf', 'move', 'pow', 'printf', 'putchar', 'puts', 'realloc', 'scanf', 'sin', 'sinh', 'snprintf', 'sprintf', 'sqrt', 'sscanf', 'std', 'stderr', 'stdin', 'stdout', 'strcat', 'strchr', 'strcmp', 'strcpy', 'strcspn', 'strlen', 'strncat', 'strncmp', 'strncpy', 'strpbrk', 'strrchr', 'strspn', 'strstr', 'swap', 'tan', 'tanh', 'terminate', 'to_underlying', 'tolower', 'toupper', 'vfprintf', 'visit', 'vprintf', 'vsprintf'];
const LITERALS = ['NULL', 'false', 'nullopt', 'nullptr', 'true']; // https://en.cppreference.com/w/cpp/keyword
const RESERVED_TYPES = ["bool", "char", "char16_t", "char32_t", "char8_t", "double", "float", "int", "long", "short", "void", "wchar_t", "unsigned", "signed", "const", "static"];
const TYPE_HINTS = ["any", "auto_ptr", "barrier", "binary_semaphore", "bitset", "complex", "condition_variable", "condition_variable_any", "counting_semaphore", "deque", "false_type", "future", "imaginary", "initializer_list", "istringstream", "jthread", "latch", "lock_guard", "multimap", "multiset", "mutex", "optional", "ostringstream", "packaged_task", "pair", "promise", "priority_queue", "queue", "recursive_mutex", "recursive_timed_mutex", "scoped_lock", "set", "shared_future", "shared_lock", "shared_mutex", "shared_timed_mutex", "shared_ptr", "stack", "string_view", "stringstream", "timed_mutex", "thread", "true_type", "tuple", "unique_lock", "unique_ptr", "unordered_map", "unordered_multimap", "unordered_multiset", "unordered_set", "variant", "vector", "weak_ptr", "wstring", "wstring_view"];
const FUNCTION_HINTS = ["abort", "abs", "acos", "apply", "as_const", "asin", "atan", "atan2", "calloc", "ceil", "cerr", "cin", "clog", "cos", "cosh", "cout", "declval", "endl", "exchange", "exit", "exp", "fabs", "floor", "fmod", "forward", "fprintf", "fputs", "free", "frexp", "fscanf", "future", "invoke", "isalnum", "isalpha", "iscntrl", "isdigit", "isgraph", "islower", "isprint", "ispunct", "isspace", "isupper", "isxdigit", "labs", "launder", "ldexp", "log", "log10", "make_pair", "make_shared", "make_shared_for_overwrite", "make_tuple", "make_unique", "malloc", "memchr", "memcmp", "memcpy", "memset", "modf", "move", "pow", "printf", "putchar", "puts", "realloc", "scanf", "sin", "sinh", "snprintf", "sprintf", "sqrt", "sscanf", "std", "stderr", "stdin", "stdout", "strcat", "strchr", "strcmp", "strcpy", "strcspn", "strlen", "strncat", "strncmp", "strncpy", "strpbrk", "strrchr", "strspn", "strstr", "swap", "tan", "tanh", "terminate", "to_underlying", "tolower", "toupper", "vfprintf", "visit", "vprintf", "vsprintf"];
const LITERALS = ["NULL", "false", "nullopt", "nullptr", "true"]; // https://en.cppreference.com/w/cpp/keyword
const BUILT_IN = ['_Pragma'];
const BUILT_IN = ["_Pragma"];
const CPP_KEYWORDS = {

@@ -107,3 +107,3 @@ type: RESERVED_TYPES,

const FUNCTION_DISPATCH = {
className: 'function.dispatch',
className: "function.dispatch",
relevance: 0,

@@ -128,3 +128,3 @@ keywords: {

}, {
beginKeywords: 'new throw return else',
beginKeywords: "new throw return else",
end: /;/

@@ -137,3 +137,3 @@ }],

keywords: CPP_KEYWORDS,
contains: EXPRESSION_CONTAINS.concat(['self']),
contains: EXPRESSION_CONTAINS.concat(["self"]),
relevance: 0

@@ -144,4 +144,4 @@ }]),

const FUNCTION_DECLARATION = {
className: 'function',
begin: '(' + FUNCTION_TYPE_RE + '[\\*&\\s]+)+' + FUNCTION_TITLE,
className: "function",
begin: "(" + FUNCTION_TYPE_RE + "[\\*&\\s]+)+" + FUNCTION_TITLE,
returnBegin: true,

@@ -178,3 +178,3 @@ end: /[{;=]/,

}, {
className: 'params',
className: "params",
begin: /\(/,

@@ -190,3 +190,3 @@ end: /\)/,

relevance: 0,
contains: ['self', C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, STRINGS, NUMBERS, CPP_PRIMITIVE_TYPES]
contains: ["self", C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, STRINGS, NUMBERS, CPP_PRIMITIVE_TYPES]
}]

@@ -196,17 +196,17 @@ }, CPP_PRIMITIVE_TYPES, C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, PREPROCESSOR]

return {
name: 'C++',
aliases: ['cc', 'c++', 'h++', 'hpp', 'hh', 'hxx', 'cxx'],
name: "C++",
aliases: ["cc", "cpp", "c++", "h++", "hpp", "hh", "hxx", "cxx"],
keywords: CPP_KEYWORDS,
illegal: '</',
illegal: "</",
classNameAliases: {
'function.dispatch': 'built_in'
"function.dispatch": "built_in"
},
contains: [].concat(EXPRESSION_CONTEXT, FUNCTION_DECLARATION, FUNCTION_DISPATCH, EXPRESSION_CONTAINS, [PREPROCESSOR, {
// containers: ie, `vector <int> rooms (9);`
begin: '\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)',
end: '>',
begin: "\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",
end: ">",
keywords: CPP_KEYWORDS,
contains: ['self', CPP_PRIMITIVE_TYPES]
contains: ["self", CPP_PRIMITIVE_TYPES]
}, {
begin: hljs.IDENT_RE + '::',
begin: hljs.IDENT_RE + "::",
keywords: CPP_KEYWORDS

@@ -217,4 +217,4 @@ }, {

className: {
1: 'keyword',
3: 'title.class'
1: "keyword",
3: "title.class"
}

@@ -235,2 +235,3 @@ }])

name: "GLSL",
aliases: ["glsl"],
keywords: {

@@ -378,3 +379,3 @@ keyword: // Statements

const C_LINE_COMMENT_MODE = hljs.COMMENT('//', '$', {
const C_LINE_COMMENT_MODE = hljs.COMMENT("//", "$", {
contains: [{

@@ -384,24 +385,24 @@ begin: /\\\n/

});
const DECLTYPE_AUTO_RE = 'decltype\\(auto\\)';
const NAMESPACE_RE = '[a-zA-Z_]\\w*::';
const TEMPLATE_ARGUMENT_RE = '<[^<>]+>';
const FUNCTION_TYPE_RE = '(?!struct)(' + DECLTYPE_AUTO_RE + '|' + regex.optional(NAMESPACE_RE) + '[a-zA-Z_]\\w*' + regex.optional(TEMPLATE_ARGUMENT_RE) + ')';
const DECLTYPE_AUTO_RE = "decltype\\(auto\\)";
const NAMESPACE_RE = "[a-zA-Z_]\\w*::";
const TEMPLATE_ARGUMENT_RE = "<[^<>]+>";
const FUNCTION_TYPE_RE = "(?!struct)(" + DECLTYPE_AUTO_RE + "|" + regex.optional(NAMESPACE_RE) + "[a-zA-Z_]\\w*" + regex.optional(TEMPLATE_ARGUMENT_RE) + ")";
const CPP_PRIMITIVE_TYPES = {
className: 'type',
begin: '\\b[a-z\\d_]*_t\\b'
className: "type",
begin: "\\b[a-z\\d_]*_t\\b"
}; // https://en.cppreference.com/w/cpp/language/escape
// \\ \x \xFF \u2837 \u00323747 \374
const CHARACTER_ESCAPES = '\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)';
const CHARACTER_ESCAPES = "\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)";
const STRINGS = {
className: 'string',
className: "string",
variants: [{
begin: '(u8?|U|L)?"',
end: '"',
illegal: '\\n',
illegal: "\\n",
contains: [hljs.BACKSLASH_ESCAPE]
}, {
begin: "(u8?|U|L)?'(" + CHARACTER_ESCAPES + '|.)',
begin: "(u8?|U|L)?'(" + CHARACTER_ESCAPES + "|.)",
end: "'",
illegal: '.'
illegal: "."
}, hljs.END_SAME_AS_BEGIN({

@@ -413,3 +414,3 @@ begin: /(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,

const NUMBERS = {
className: 'number',
className: "number",
variants: [{

@@ -425,7 +426,7 @@ begin: "\\b(0b[01']+)"

const PREPROCESSOR = {
className: 'meta',
className: "meta",
begin: /#\s*[a-z]+\b/,
end: /$/,
keywords: {
keyword: 'if else elif endif define undef warning error line ' + 'pragma _Pragma ifdef ifndef include'
keyword: "if else elif endif define undef warning error line " + "pragma _Pragma ifdef ifndef include"
},

@@ -436,5 +437,5 @@ contains: [{

}, hljs.inherit(STRINGS, {
className: 'string'
className: "string"
}), {
className: 'string',
className: "string",
begin: /<.*?>/

@@ -444,17 +445,17 @@ }, C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE]

const TITLE_MODE = {
className: 'title',
className: "title",
begin: regex.optional(NAMESPACE_RE) + hljs.IDENT_RE,
relevance: 0
};
const FUNCTION_TITLE = regex.optional(NAMESPACE_RE) + hljs.IDENT_RE + '\\s*\\('; // https://en.cppreference.com/w/cpp/keyword
const FUNCTION_TITLE = regex.optional(NAMESPACE_RE) + hljs.IDENT_RE + "\\s*\\("; // https://en.cppreference.com/w/cpp/keyword
const RESERVED_KEYWORDS = ['alignas', 'alignof', 'and', 'and_eq', 'asm', 'atomic_cancel', 'atomic_commit', 'atomic_noexcept', 'auto', 'bitand', 'bitor', 'break', 'case', 'catch', 'class', 'co_await', 'co_return', 'co_yield', 'compl', 'concept', 'const_cast|10', 'consteval', 'constexpr', 'constinit', 'continue', 'decltype', 'default', 'delete', 'do', 'dynamic_cast|10', 'else', 'enum', 'explicit', 'export', 'extern', 'false', 'final', 'for', 'friend', 'goto', 'if', 'import', 'inline', 'module', 'mutable', 'namespace', 'new', 'noexcept', 'not', 'not_eq', 'nullptr', 'operator', 'or', 'or_eq', 'override', 'private', 'protected', 'public', 'reflexpr', 'register', 'reinterpret_cast|10', 'requires', 'return', 'sizeof', 'static_assert', 'static_cast|10', 'struct', 'switch', 'synchronized', 'template', 'this', 'thread_local', 'throw', 'transaction_safe', 'transaction_safe_dynamic', 'true', 'try', 'typedef', 'typeid', 'typename', 'union', 'using', 'virtual', 'volatile', 'while', 'xor', 'xor_eq', 'vertex', 'fragment', 'kernel', 'attribute', 'user', 'stage_in', 'buffer', 'vertex_id', 'instance_id', 'thread_position_in_threadgroup', 'threadgroup_position_in_grid', 'thread_index_in_threadgroup', 'thread_position_in_grid', 'threads_per_grid', 'texture', 'texture2d']; // https://en.cppreference.com/w/cpp/keyword
const RESERVED_KEYWORDS = ["alignas", "alignof", "and", "and_eq", "asm", "atomic_cancel", "atomic_commit", "atomic_noexcept", "auto", "bitand", "bitor", "break", "case", "catch", "class", "co_await", "co_return", "co_yield", "compl", "concept", "const_cast|10", "consteval", "constexpr", "constinit", "continue", "decltype", "default", "delete", "do", "dynamic_cast|10", "else", "enum", "explicit", "export", "extern", "false", "final", "for", "friend", "goto", "if", "import", "inline", "module", "mutable", "namespace", "new", "noexcept", "not", "not_eq", "nullptr", "operator", "or", "or_eq", "override", "private", "protected", "public", "reflexpr", "register", "reinterpret_cast|10", "requires", "return", "sizeof", "static_assert", "static_cast|10", "struct", "switch", "synchronized", "template", "this", "thread_local", "throw", "transaction_safe", "transaction_safe_dynamic", "true", "try", "typedef", "typeid", "typename", "union", "using", "virtual", "volatile", "while", "xor", "xor_eq", "vertex", "fragment", "kernel", "attribute", "user", "stage_in", "buffer", "vertex_id", "instance_id", "thread_position_in_threadgroup", "threadgroup_position_in_grid", "thread_index_in_threadgroup", "thread_position_in_grid", "threads_per_grid", "texture", "texture2d"]; // https://en.cppreference.com/w/cpp/keyword
const RESERVED_TYPES = ['bool', 'char', 'char16_t', 'char32_t', 'char8_t', 'double', 'float', 'int', 'long', 'short', 'void', 'wchar_t', 'unsigned', 'signed', 'const', 'constant', 'static', 'threadgroup']; // Data Types
const RESERVED_TYPES = ["bool", "char", "char16_t", "char32_t", "char8_t", "double", "float", "int", "long", "short", "void", "wchar_t", "unsigned", "signed", "const", "constant", "static", "threadgroup"]; // Data Types
RESERVED_TYPES.join(' ') + ' ' + 'Buffer vector matrix sampler SamplerState PixelShader VertexShader ' + 'texture Texture1D Texture1DArray Texture2D Texture2DArray Texture2DMS Texture2DMSArray Texture3D ' + 'TextureCube TextureCubeArray struct typedef';
let matrixBases = 'bool double float half int uint ' + 'min16float min10float min16int min12int min16uint';
let matrixSuffixes = ['', '1', '2', '3', '4', '1x1', '1x2', '1x3', '1x4', '2x1', '2x2', '2x3', '2x4', '3x1', '3x2', '3x3', '3x4', '4x1', '4x2', '4x3', '4x4'];
RESERVED_TYPES.join(" ") + " " + "Buffer vector matrix sampler SamplerState PixelShader VertexShader " + "texture Texture1D Texture1DArray Texture2D Texture2DArray Texture2DMS Texture2DMSArray Texture3D " + "TextureCube TextureCubeArray struct typedef";
let matrixBases = "bool double float half int uint " + "min16float min10float min16int min12int min16uint";
let matrixSuffixes = ["", "1", "2", "3", "4", "1x1", "1x2", "1x3", "1x4", "2x1", "2x2", "2x3", "2x4", "3x1", "3x2", "3x3", "3x4", "4x1", "4x2", "4x3", "4x4"];
for (let base of matrixBases.split(' ')) {
for (let base of matrixBases.split(" ")) {
for (let suffix of matrixSuffixes) {

@@ -465,7 +466,7 @@ RESERVED_TYPES.push(base + suffix);

const TYPE_HINTS = ['any', 'auto_ptr', 'barrier', 'binary_semaphore', 'bitset', 'complex', 'condition_variable', 'condition_variable_any', 'counting_semaphore', 'deque', 'false_type', 'future', 'imaginary', 'initializer_list', 'istringstream', 'jthread', 'latch', 'lock_guard', 'multimap', 'multiset', 'mutex', 'optional', 'ostringstream', 'packaged_task', 'pair', 'promise', 'priority_queue', 'queue', 'recursive_mutex', 'recursive_timed_mutex', 'scoped_lock', 'set', 'shared_future', 'shared_lock', 'shared_mutex', 'shared_timed_mutex', 'shared_ptr', 'stack', 'string_view', 'stringstream', 'timed_mutex', 'thread', 'true_type', 'tuple', 'unique_lock', 'unique_ptr', 'unordered_map', 'unordered_multimap', 'unordered_multiset', 'unordered_set', 'variant', 'vector', 'weak_ptr', 'wstring', 'wstring_view'];
const FUNCTION_HINTS = ['abort', 'abs', 'acos', 'apply', 'as_const', 'asin', 'atan', 'atan2', 'calloc', 'ceil', 'cerr', 'cin', 'clog', 'cos', 'cosh', 'cout', 'declval', 'endl', 'exchange', 'exit', 'exp', 'fabs', 'floor', 'fmod', 'forward', 'fprintf', 'fputs', 'free', 'frexp', 'fscanf', 'future', 'invoke', 'isalnum', 'isalpha', 'iscntrl', 'isdigit', 'isgraph', 'islower', 'isprint', 'ispunct', 'isspace', 'isupper', 'isxdigit', 'labs', 'launder', 'ldexp', 'log', 'log10', 'make_pair', 'make_shared', 'make_shared_for_overwrite', 'make_tuple', 'make_unique', 'malloc', 'memchr', 'memcmp', 'memcpy', 'memset', 'modf', 'move', 'pow', 'printf', 'putchar', 'puts', 'realloc', 'scanf', 'sin', 'sinh', 'snprintf', 'sprintf', 'sqrt', 'sscanf', 'std', 'stderr', 'stdin', 'stdout', 'strcat', 'strchr', 'strcmp', 'strcpy', 'strcspn', 'strlen', 'strncat', 'strncmp', 'strncpy', 'strpbrk', 'strrchr', 'strspn', 'strstr', 'swap', 'tan', 'tanh', 'terminate', 'to_underlying', 'tolower', 'toupper', 'vfprintf', 'visit', 'vprintf', 'vsprintf'];
const LITERALS = ['NULL', 'false', 'nullopt', 'nullptr', 'true']; // https://en.cppreference.com/w/cpp/keyword
const TYPE_HINTS = ["any", "auto_ptr", "barrier", "binary_semaphore", "bitset", "complex", "condition_variable", "condition_variable_any", "counting_semaphore", "deque", "false_type", "future", "imaginary", "initializer_list", "istringstream", "jthread", "latch", "lock_guard", "multimap", "multiset", "mutex", "optional", "ostringstream", "packaged_task", "pair", "promise", "priority_queue", "queue", "recursive_mutex", "recursive_timed_mutex", "scoped_lock", "set", "shared_future", "shared_lock", "shared_mutex", "shared_timed_mutex", "shared_ptr", "stack", "string_view", "stringstream", "timed_mutex", "thread", "true_type", "tuple", "unique_lock", "unique_ptr", "unordered_map", "unordered_multimap", "unordered_multiset", "unordered_set", "variant", "vector", "weak_ptr", "wstring", "wstring_view"];
const FUNCTION_HINTS = ["abort", "abs", "acos", "apply", "as_const", "asin", "atan", "atan2", "calloc", "ceil", "cerr", "cin", "clog", "cos", "cosh", "cout", "declval", "endl", "exchange", "exit", "exp", "fabs", "floor", "fmod", "forward", "fprintf", "fputs", "free", "frexp", "fscanf", "future", "invoke", "isalnum", "isalpha", "iscntrl", "isdigit", "isgraph", "islower", "isprint", "ispunct", "isspace", "isupper", "isxdigit", "labs", "launder", "ldexp", "log", "log10", "make_pair", "make_shared", "make_shared_for_overwrite", "make_tuple", "make_unique", "malloc", "memchr", "memcmp", "memcpy", "memset", "modf", "move", "pow", "printf", "putchar", "puts", "realloc", "scanf", "sin", "sinh", "snprintf", "sprintf", "sqrt", "sscanf", "std", "stderr", "stdin", "stdout", "strcat", "strchr", "strcmp", "strcpy", "strcspn", "strlen", "strncat", "strncmp", "strncpy", "strpbrk", "strrchr", "strspn", "strstr", "swap", "tan", "tanh", "terminate", "to_underlying", "tolower", "toupper", "vfprintf", "visit", "vprintf", "vsprintf"];
const LITERALS = ["NULL", "false", "nullopt", "nullptr", "true"]; // https://en.cppreference.com/w/cpp/keyword
const BUILT_IN = ['_Pragma'];
const BUILT_IN = ["_Pragma"];
const CPP_KEYWORDS = {

@@ -479,3 +480,3 @@ type: RESERVED_TYPES,

const FUNCTION_DISPATCH = {
className: 'function.dispatch',
className: "function.dispatch",
relevance: 0,

@@ -500,3 +501,3 @@ keywords: {

}, {
beginKeywords: 'new throw return else',
beginKeywords: "new throw return else",
end: /;/

@@ -509,3 +510,3 @@ }],

keywords: CPP_KEYWORDS,
contains: EXPRESSION_CONTAINS.concat(['self']),
contains: EXPRESSION_CONTAINS.concat(["self"]),
relevance: 0

@@ -516,4 +517,4 @@ }]),

const FUNCTION_DECLARATION = {
className: 'function',
begin: '(' + FUNCTION_TYPE_RE + '[\\*&\\s]+)+' + FUNCTION_TITLE,
className: "function",
begin: "(" + FUNCTION_TYPE_RE + "[\\*&\\s]+)+" + FUNCTION_TITLE,
returnBegin: true,

@@ -550,3 +551,3 @@ end: /[{;=]/,

}, {
className: 'params',
className: "params",
begin: /\(/,

@@ -562,3 +563,3 @@ end: /\)/,

relevance: 0,
contains: ['self', C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, STRINGS, NUMBERS, CPP_PRIMITIVE_TYPES]
contains: ["self", C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, STRINGS, NUMBERS, CPP_PRIMITIVE_TYPES]
}, {

@@ -569,3 +570,3 @@ begin: /\[\[/,

relevance: 0,
contains: ['self', C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, STRINGS, NUMBERS, CPP_PRIMITIVE_TYPES]
contains: ["self", C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, STRINGS, NUMBERS, CPP_PRIMITIVE_TYPES]
}]

@@ -575,17 +576,17 @@ }, CPP_PRIMITIVE_TYPES, C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, PREPROCESSOR]

return {
name: 'C++',
aliases: ['cc', 'c++', 'h++', 'hpp', 'hh', 'hxx', 'cxx'],
name: "MSL",
aliases: ["msl"],
keywords: CPP_KEYWORDS,
illegal: '</',
illegal: "</",
classNameAliases: {
'function.dispatch': 'built_in'
"function.dispatch": "built_in"
},
contains: [].concat(EXPRESSION_CONTEXT, FUNCTION_DECLARATION, FUNCTION_DISPATCH, EXPRESSION_CONTAINS, [PREPROCESSOR, {
// containers: ie, `vector <int> rooms (9);`
begin: '\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)',
end: '>',
begin: "\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",
end: ">",
keywords: CPP_KEYWORDS,
contains: ['self', CPP_PRIMITIVE_TYPES]
contains: ["self", CPP_PRIMITIVE_TYPES]
}, {
begin: hljs.IDENT_RE + '::',
begin: hljs.IDENT_RE + "::",
keywords: CPP_KEYWORDS

@@ -596,4 +597,4 @@ }, {

className: {
1: 'keyword',
3: 'title.class'
1: "keyword",
3: "title.class"
}

@@ -651,2 +652,8 @@ }])

}
}, {
match: [// extra complexity to deal with `enum class` and `enum struct`
/@(vertex|fragment|compute)/],
className: {
1: "meta-keyword"
}
}]

@@ -677,5 +684,11 @@ };

try {
return highlight(str, {
let result = highlight(str, {
language: lang
}).value;
});
if (result.errorRaised) {
console.error(result.errorRaised.message);
}
return result.value;
} catch (err) {

@@ -864,3 +877,3 @@ console.error(err);

var innerText = input.substr(offset + 4);
var endXml = new RegExp('</' + p1);
var endXml = new RegExp("</" + p1);
var foundEnd = endXml.exec(innerText);

@@ -873,6 +886,6 @@

var reps = 1;
var idText = innerText.replace(/ /g, '-').toLowerCase().trim();
var idText = innerText.replace(/ /g, "-").toLowerCase().trim();
while (nameSet.has(idText)) {
idText = innerText.replace(/ /g, '-').toLowerCase().trim() + reps;
idText = innerText.replace(/ /g, "-").toLowerCase().trim() + reps;
reps++;

@@ -879,0 +892,0 @@ }

@@ -18,3 +18,3 @@ import * as Remarkable from 'remarkable';

const C_LINE_COMMENT_MODE = hljs.COMMENT('//', '$', {
const C_LINE_COMMENT_MODE = hljs.COMMENT("//", "$", {
contains: [{

@@ -24,24 +24,24 @@ begin: /\\\n/

});
const DECLTYPE_AUTO_RE = 'decltype\\(auto\\)';
const NAMESPACE_RE = '[a-zA-Z_]\\w*::';
const TEMPLATE_ARGUMENT_RE = '<[^<>]+>';
const FUNCTION_TYPE_RE = '(?!struct)(' + DECLTYPE_AUTO_RE + '|' + regex.optional(NAMESPACE_RE) + '[a-zA-Z_]\\w*' + regex.optional(TEMPLATE_ARGUMENT_RE) + ')';
const DECLTYPE_AUTO_RE = "decltype\\(auto\\)";
const NAMESPACE_RE = "[a-zA-Z_]\\w*::";
const TEMPLATE_ARGUMENT_RE = "<[^<>]+>";
const FUNCTION_TYPE_RE = "(?!struct)(" + DECLTYPE_AUTO_RE + "|" + regex.optional(NAMESPACE_RE) + "[a-zA-Z_]\\w*" + regex.optional(TEMPLATE_ARGUMENT_RE) + ")";
const CPP_PRIMITIVE_TYPES = {
className: 'type',
begin: '\\b[a-z\\d_]*_t\\b'
className: "type",
begin: "\\b[a-z\\d_]*_t\\b"
}; // https://en.cppreference.com/w/cpp/language/escape
// \\ \x \xFF \u2837 \u00323747 \374
const CHARACTER_ESCAPES = '\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)';
const CHARACTER_ESCAPES = "\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)";
const STRINGS = {
className: 'string',
className: "string",
variants: [{
begin: '(u8?|U|L)?"',
end: '"',
illegal: '\\n',
illegal: "\\n",
contains: [hljs.BACKSLASH_ESCAPE]
}, {
begin: "(u8?|U|L)?'(" + CHARACTER_ESCAPES + '|.)',
begin: "(u8?|U|L)?'(" + CHARACTER_ESCAPES + "|.)",
end: "'",
illegal: '.'
illegal: "."
}, hljs.END_SAME_AS_BEGIN({

@@ -53,3 +53,3 @@ begin: /(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,

const NUMBERS = {
className: 'number',
className: "number",
variants: [{

@@ -65,7 +65,7 @@ begin: "\\b(0b[01']+)"

const PREPROCESSOR = {
className: 'meta',
className: "meta",
begin: /#\s*[a-z]+\b/,
end: /$/,
keywords: {
keyword: 'if else elif endif define undef warning error line ' + 'pragma _Pragma ifdef ifndef include'
keyword: "if else elif endif define undef warning error line " + "pragma _Pragma ifdef ifndef include"
},

@@ -76,5 +76,5 @@ contains: [{

}, hljs.inherit(STRINGS, {
className: 'string'
className: "string"
}), {
className: 'string',
className: "string",
begin: /<.*?>/

@@ -84,16 +84,16 @@ }, C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE]

const TITLE_MODE = {
className: 'title',
className: "title",
begin: regex.optional(NAMESPACE_RE) + hljs.IDENT_RE,
relevance: 0
};
const FUNCTION_TITLE = regex.optional(NAMESPACE_RE) + hljs.IDENT_RE + '\\s*\\('; // https://en.cppreference.com/w/cpp/keyword
const FUNCTION_TITLE = regex.optional(NAMESPACE_RE) + hljs.IDENT_RE + "\\s*\\("; // https://en.cppreference.com/w/cpp/keyword
const RESERVED_KEYWORDS = ['alignas', 'alignof', 'and', 'and_eq', 'asm', 'atomic_cancel', 'atomic_commit', 'atomic_noexcept', 'auto', 'bitand', 'bitor', 'break', 'case', 'catch', 'class', 'co_await', 'co_return', 'co_yield', 'compl', 'concept', 'const_cast|10', 'consteval', 'constexpr', 'constinit', 'continue', 'decltype', 'default', 'delete', 'do', 'dynamic_cast|10', 'else', 'enum', 'explicit', 'export', 'extern', 'false', 'final', 'for', 'friend', 'goto', 'if', 'import', 'inline', 'module', 'mutable', 'namespace', 'new', 'noexcept', 'not', 'not_eq', 'nullptr', 'operator', 'or', 'or_eq', 'override', 'private', 'protected', 'public', 'reflexpr', 'register', 'reinterpret_cast|10', 'requires', 'return', 'sizeof', 'static_assert', 'static_cast|10', 'struct', 'switch', 'synchronized', 'template', 'this', 'thread_local', 'throw', 'transaction_safe', 'transaction_safe_dynamic', 'true', 'try', 'typedef', 'typeid', 'typename', 'union', 'using', 'virtual', 'volatile', 'while', 'xor', 'xor_eq']; // https://en.cppreference.com/w/cpp/keyword
const RESERVED_KEYWORDS = ["alignas", "alignof", "and", "and_eq", "asm", "atomic_cancel", "atomic_commit", "atomic_noexcept", "auto", "bitand", "bitor", "break", "case", "catch", "class", "co_await", "co_return", "co_yield", "compl", "concept", "const_cast|10", "consteval", "constexpr", "constinit", "continue", "decltype", "default", "delete", "do", "dynamic_cast|10", "else", "enum", "explicit", "export", "extern", "false", "final", "for", "friend", "goto", "if", "import", "inline", "module", "mutable", "namespace", "new", "noexcept", "not", "not_eq", "nullptr", "operator", "or", "or_eq", "override", "private", "protected", "public", "reflexpr", "register", "reinterpret_cast|10", "requires", "return", "sizeof", "static_assert", "static_cast|10", "struct", "switch", "synchronized", "template", "this", "thread_local", "throw", "transaction_safe", "transaction_safe_dynamic", "true", "try", "typedef", "typeid", "typename", "union", "using", "virtual", "volatile", "while", "xor", "xor_eq"]; // https://en.cppreference.com/w/cpp/keyword
const RESERVED_TYPES = ['bool', 'char', 'char16_t', 'char32_t', 'char8_t', 'double', 'float', 'int', 'long', 'short', 'void', 'wchar_t', 'unsigned', 'signed', 'const', 'static'];
const TYPE_HINTS = ['any', 'auto_ptr', 'barrier', 'binary_semaphore', 'bitset', 'complex', 'condition_variable', 'condition_variable_any', 'counting_semaphore', 'deque', 'false_type', 'future', 'imaginary', 'initializer_list', 'istringstream', 'jthread', 'latch', 'lock_guard', 'multimap', 'multiset', 'mutex', 'optional', 'ostringstream', 'packaged_task', 'pair', 'promise', 'priority_queue', 'queue', 'recursive_mutex', 'recursive_timed_mutex', 'scoped_lock', 'set', 'shared_future', 'shared_lock', 'shared_mutex', 'shared_timed_mutex', 'shared_ptr', 'stack', 'string_view', 'stringstream', 'timed_mutex', 'thread', 'true_type', 'tuple', 'unique_lock', 'unique_ptr', 'unordered_map', 'unordered_multimap', 'unordered_multiset', 'unordered_set', 'variant', 'vector', 'weak_ptr', 'wstring', 'wstring_view'];
const FUNCTION_HINTS = ['abort', 'abs', 'acos', 'apply', 'as_const', 'asin', 'atan', 'atan2', 'calloc', 'ceil', 'cerr', 'cin', 'clog', 'cos', 'cosh', 'cout', 'declval', 'endl', 'exchange', 'exit', 'exp', 'fabs', 'floor', 'fmod', 'forward', 'fprintf', 'fputs', 'free', 'frexp', 'fscanf', 'future', 'invoke', 'isalnum', 'isalpha', 'iscntrl', 'isdigit', 'isgraph', 'islower', 'isprint', 'ispunct', 'isspace', 'isupper', 'isxdigit', 'labs', 'launder', 'ldexp', 'log', 'log10', 'make_pair', 'make_shared', 'make_shared_for_overwrite', 'make_tuple', 'make_unique', 'malloc', 'memchr', 'memcmp', 'memcpy', 'memset', 'modf', 'move', 'pow', 'printf', 'putchar', 'puts', 'realloc', 'scanf', 'sin', 'sinh', 'snprintf', 'sprintf', 'sqrt', 'sscanf', 'std', 'stderr', 'stdin', 'stdout', 'strcat', 'strchr', 'strcmp', 'strcpy', 'strcspn', 'strlen', 'strncat', 'strncmp', 'strncpy', 'strpbrk', 'strrchr', 'strspn', 'strstr', 'swap', 'tan', 'tanh', 'terminate', 'to_underlying', 'tolower', 'toupper', 'vfprintf', 'visit', 'vprintf', 'vsprintf'];
const LITERALS = ['NULL', 'false', 'nullopt', 'nullptr', 'true']; // https://en.cppreference.com/w/cpp/keyword
const RESERVED_TYPES = ["bool", "char", "char16_t", "char32_t", "char8_t", "double", "float", "int", "long", "short", "void", "wchar_t", "unsigned", "signed", "const", "static"];
const TYPE_HINTS = ["any", "auto_ptr", "barrier", "binary_semaphore", "bitset", "complex", "condition_variable", "condition_variable_any", "counting_semaphore", "deque", "false_type", "future", "imaginary", "initializer_list", "istringstream", "jthread", "latch", "lock_guard", "multimap", "multiset", "mutex", "optional", "ostringstream", "packaged_task", "pair", "promise", "priority_queue", "queue", "recursive_mutex", "recursive_timed_mutex", "scoped_lock", "set", "shared_future", "shared_lock", "shared_mutex", "shared_timed_mutex", "shared_ptr", "stack", "string_view", "stringstream", "timed_mutex", "thread", "true_type", "tuple", "unique_lock", "unique_ptr", "unordered_map", "unordered_multimap", "unordered_multiset", "unordered_set", "variant", "vector", "weak_ptr", "wstring", "wstring_view"];
const FUNCTION_HINTS = ["abort", "abs", "acos", "apply", "as_const", "asin", "atan", "atan2", "calloc", "ceil", "cerr", "cin", "clog", "cos", "cosh", "cout", "declval", "endl", "exchange", "exit", "exp", "fabs", "floor", "fmod", "forward", "fprintf", "fputs", "free", "frexp", "fscanf", "future", "invoke", "isalnum", "isalpha", "iscntrl", "isdigit", "isgraph", "islower", "isprint", "ispunct", "isspace", "isupper", "isxdigit", "labs", "launder", "ldexp", "log", "log10", "make_pair", "make_shared", "make_shared_for_overwrite", "make_tuple", "make_unique", "malloc", "memchr", "memcmp", "memcpy", "memset", "modf", "move", "pow", "printf", "putchar", "puts", "realloc", "scanf", "sin", "sinh", "snprintf", "sprintf", "sqrt", "sscanf", "std", "stderr", "stdin", "stdout", "strcat", "strchr", "strcmp", "strcpy", "strcspn", "strlen", "strncat", "strncmp", "strncpy", "strpbrk", "strrchr", "strspn", "strstr", "swap", "tan", "tanh", "terminate", "to_underlying", "tolower", "toupper", "vfprintf", "visit", "vprintf", "vsprintf"];
const LITERALS = ["NULL", "false", "nullopt", "nullptr", "true"]; // https://en.cppreference.com/w/cpp/keyword
const BUILT_IN = ['_Pragma'];
const BUILT_IN = ["_Pragma"];
const CPP_KEYWORDS = {

@@ -107,3 +107,3 @@ type: RESERVED_TYPES,

const FUNCTION_DISPATCH = {
className: 'function.dispatch',
className: "function.dispatch",
relevance: 0,

@@ -128,3 +128,3 @@ keywords: {

}, {
beginKeywords: 'new throw return else',
beginKeywords: "new throw return else",
end: /;/

@@ -137,3 +137,3 @@ }],

keywords: CPP_KEYWORDS,
contains: EXPRESSION_CONTAINS.concat(['self']),
contains: EXPRESSION_CONTAINS.concat(["self"]),
relevance: 0

@@ -144,4 +144,4 @@ }]),

const FUNCTION_DECLARATION = {
className: 'function',
begin: '(' + FUNCTION_TYPE_RE + '[\\*&\\s]+)+' + FUNCTION_TITLE,
className: "function",
begin: "(" + FUNCTION_TYPE_RE + "[\\*&\\s]+)+" + FUNCTION_TITLE,
returnBegin: true,

@@ -178,3 +178,3 @@ end: /[{;=]/,

}, {
className: 'params',
className: "params",
begin: /\(/,

@@ -190,3 +190,3 @@ end: /\)/,

relevance: 0,
contains: ['self', C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, STRINGS, NUMBERS, CPP_PRIMITIVE_TYPES]
contains: ["self", C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, STRINGS, NUMBERS, CPP_PRIMITIVE_TYPES]
}]

@@ -196,17 +196,17 @@ }, CPP_PRIMITIVE_TYPES, C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, PREPROCESSOR]

return {
name: 'C++',
aliases: ['cc', 'c++', 'h++', 'hpp', 'hh', 'hxx', 'cxx'],
name: "C++",
aliases: ["cc", "cpp", "c++", "h++", "hpp", "hh", "hxx", "cxx"],
keywords: CPP_KEYWORDS,
illegal: '</',
illegal: "</",
classNameAliases: {
'function.dispatch': 'built_in'
"function.dispatch": "built_in"
},
contains: [].concat(EXPRESSION_CONTEXT, FUNCTION_DECLARATION, FUNCTION_DISPATCH, EXPRESSION_CONTAINS, [PREPROCESSOR, {
// containers: ie, `vector <int> rooms (9);`
begin: '\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)',
end: '>',
begin: "\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",
end: ">",
keywords: CPP_KEYWORDS,
contains: ['self', CPP_PRIMITIVE_TYPES]
contains: ["self", CPP_PRIMITIVE_TYPES]
}, {
begin: hljs.IDENT_RE + '::',
begin: hljs.IDENT_RE + "::",
keywords: CPP_KEYWORDS

@@ -217,4 +217,4 @@ }, {

className: {
1: 'keyword',
3: 'title.class'
1: "keyword",
3: "title.class"
}

@@ -235,2 +235,3 @@ }])

name: "GLSL",
aliases: ["glsl"],
keywords: {

@@ -378,3 +379,3 @@ keyword: // Statements

const C_LINE_COMMENT_MODE = hljs.COMMENT('//', '$', {
const C_LINE_COMMENT_MODE = hljs.COMMENT("//", "$", {
contains: [{

@@ -384,24 +385,24 @@ begin: /\\\n/

});
const DECLTYPE_AUTO_RE = 'decltype\\(auto\\)';
const NAMESPACE_RE = '[a-zA-Z_]\\w*::';
const TEMPLATE_ARGUMENT_RE = '<[^<>]+>';
const FUNCTION_TYPE_RE = '(?!struct)(' + DECLTYPE_AUTO_RE + '|' + regex.optional(NAMESPACE_RE) + '[a-zA-Z_]\\w*' + regex.optional(TEMPLATE_ARGUMENT_RE) + ')';
const DECLTYPE_AUTO_RE = "decltype\\(auto\\)";
const NAMESPACE_RE = "[a-zA-Z_]\\w*::";
const TEMPLATE_ARGUMENT_RE = "<[^<>]+>";
const FUNCTION_TYPE_RE = "(?!struct)(" + DECLTYPE_AUTO_RE + "|" + regex.optional(NAMESPACE_RE) + "[a-zA-Z_]\\w*" + regex.optional(TEMPLATE_ARGUMENT_RE) + ")";
const CPP_PRIMITIVE_TYPES = {
className: 'type',
begin: '\\b[a-z\\d_]*_t\\b'
className: "type",
begin: "\\b[a-z\\d_]*_t\\b"
}; // https://en.cppreference.com/w/cpp/language/escape
// \\ \x \xFF \u2837 \u00323747 \374
const CHARACTER_ESCAPES = '\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)';
const CHARACTER_ESCAPES = "\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)";
const STRINGS = {
className: 'string',
className: "string",
variants: [{
begin: '(u8?|U|L)?"',
end: '"',
illegal: '\\n',
illegal: "\\n",
contains: [hljs.BACKSLASH_ESCAPE]
}, {
begin: "(u8?|U|L)?'(" + CHARACTER_ESCAPES + '|.)',
begin: "(u8?|U|L)?'(" + CHARACTER_ESCAPES + "|.)",
end: "'",
illegal: '.'
illegal: "."
}, hljs.END_SAME_AS_BEGIN({

@@ -413,3 +414,3 @@ begin: /(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,

const NUMBERS = {
className: 'number',
className: "number",
variants: [{

@@ -425,7 +426,7 @@ begin: "\\b(0b[01']+)"

const PREPROCESSOR = {
className: 'meta',
className: "meta",
begin: /#\s*[a-z]+\b/,
end: /$/,
keywords: {
keyword: 'if else elif endif define undef warning error line ' + 'pragma _Pragma ifdef ifndef include'
keyword: "if else elif endif define undef warning error line " + "pragma _Pragma ifdef ifndef include"
},

@@ -436,5 +437,5 @@ contains: [{

}, hljs.inherit(STRINGS, {
className: 'string'
className: "string"
}), {
className: 'string',
className: "string",
begin: /<.*?>/

@@ -444,17 +445,17 @@ }, C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE]

const TITLE_MODE = {
className: 'title',
className: "title",
begin: regex.optional(NAMESPACE_RE) + hljs.IDENT_RE,
relevance: 0
};
const FUNCTION_TITLE = regex.optional(NAMESPACE_RE) + hljs.IDENT_RE + '\\s*\\('; // https://en.cppreference.com/w/cpp/keyword
const FUNCTION_TITLE = regex.optional(NAMESPACE_RE) + hljs.IDENT_RE + "\\s*\\("; // https://en.cppreference.com/w/cpp/keyword
const RESERVED_KEYWORDS = ['alignas', 'alignof', 'and', 'and_eq', 'asm', 'atomic_cancel', 'atomic_commit', 'atomic_noexcept', 'auto', 'bitand', 'bitor', 'break', 'case', 'catch', 'class', 'co_await', 'co_return', 'co_yield', 'compl', 'concept', 'const_cast|10', 'consteval', 'constexpr', 'constinit', 'continue', 'decltype', 'default', 'delete', 'do', 'dynamic_cast|10', 'else', 'enum', 'explicit', 'export', 'extern', 'false', 'final', 'for', 'friend', 'goto', 'if', 'import', 'inline', 'module', 'mutable', 'namespace', 'new', 'noexcept', 'not', 'not_eq', 'nullptr', 'operator', 'or', 'or_eq', 'override', 'private', 'protected', 'public', 'reflexpr', 'register', 'reinterpret_cast|10', 'requires', 'return', 'sizeof', 'static_assert', 'static_cast|10', 'struct', 'switch', 'synchronized', 'template', 'this', 'thread_local', 'throw', 'transaction_safe', 'transaction_safe_dynamic', 'true', 'try', 'typedef', 'typeid', 'typename', 'union', 'using', 'virtual', 'volatile', 'while', 'xor', 'xor_eq', 'vertex', 'fragment', 'kernel', 'attribute', 'user', 'stage_in', 'buffer', 'vertex_id', 'instance_id', 'thread_position_in_threadgroup', 'threadgroup_position_in_grid', 'thread_index_in_threadgroup', 'thread_position_in_grid', 'threads_per_grid', 'texture', 'texture2d']; // https://en.cppreference.com/w/cpp/keyword
const RESERVED_KEYWORDS = ["alignas", "alignof", "and", "and_eq", "asm", "atomic_cancel", "atomic_commit", "atomic_noexcept", "auto", "bitand", "bitor", "break", "case", "catch", "class", "co_await", "co_return", "co_yield", "compl", "concept", "const_cast|10", "consteval", "constexpr", "constinit", "continue", "decltype", "default", "delete", "do", "dynamic_cast|10", "else", "enum", "explicit", "export", "extern", "false", "final", "for", "friend", "goto", "if", "import", "inline", "module", "mutable", "namespace", "new", "noexcept", "not", "not_eq", "nullptr", "operator", "or", "or_eq", "override", "private", "protected", "public", "reflexpr", "register", "reinterpret_cast|10", "requires", "return", "sizeof", "static_assert", "static_cast|10", "struct", "switch", "synchronized", "template", "this", "thread_local", "throw", "transaction_safe", "transaction_safe_dynamic", "true", "try", "typedef", "typeid", "typename", "union", "using", "virtual", "volatile", "while", "xor", "xor_eq", "vertex", "fragment", "kernel", "attribute", "user", "stage_in", "buffer", "vertex_id", "instance_id", "thread_position_in_threadgroup", "threadgroup_position_in_grid", "thread_index_in_threadgroup", "thread_position_in_grid", "threads_per_grid", "texture", "texture2d"]; // https://en.cppreference.com/w/cpp/keyword
const RESERVED_TYPES = ['bool', 'char', 'char16_t', 'char32_t', 'char8_t', 'double', 'float', 'int', 'long', 'short', 'void', 'wchar_t', 'unsigned', 'signed', 'const', 'constant', 'static', 'threadgroup']; // Data Types
const RESERVED_TYPES = ["bool", "char", "char16_t", "char32_t", "char8_t", "double", "float", "int", "long", "short", "void", "wchar_t", "unsigned", "signed", "const", "constant", "static", "threadgroup"]; // Data Types
RESERVED_TYPES.join(' ') + ' ' + 'Buffer vector matrix sampler SamplerState PixelShader VertexShader ' + 'texture Texture1D Texture1DArray Texture2D Texture2DArray Texture2DMS Texture2DMSArray Texture3D ' + 'TextureCube TextureCubeArray struct typedef';
let matrixBases = 'bool double float half int uint ' + 'min16float min10float min16int min12int min16uint';
let matrixSuffixes = ['', '1', '2', '3', '4', '1x1', '1x2', '1x3', '1x4', '2x1', '2x2', '2x3', '2x4', '3x1', '3x2', '3x3', '3x4', '4x1', '4x2', '4x3', '4x4'];
RESERVED_TYPES.join(" ") + " " + "Buffer vector matrix sampler SamplerState PixelShader VertexShader " + "texture Texture1D Texture1DArray Texture2D Texture2DArray Texture2DMS Texture2DMSArray Texture3D " + "TextureCube TextureCubeArray struct typedef";
let matrixBases = "bool double float half int uint " + "min16float min10float min16int min12int min16uint";
let matrixSuffixes = ["", "1", "2", "3", "4", "1x1", "1x2", "1x3", "1x4", "2x1", "2x2", "2x3", "2x4", "3x1", "3x2", "3x3", "3x4", "4x1", "4x2", "4x3", "4x4"];
for (let base of matrixBases.split(' ')) {
for (let base of matrixBases.split(" ")) {
for (let suffix of matrixSuffixes) {

@@ -465,7 +466,7 @@ RESERVED_TYPES.push(base + suffix);

const TYPE_HINTS = ['any', 'auto_ptr', 'barrier', 'binary_semaphore', 'bitset', 'complex', 'condition_variable', 'condition_variable_any', 'counting_semaphore', 'deque', 'false_type', 'future', 'imaginary', 'initializer_list', 'istringstream', 'jthread', 'latch', 'lock_guard', 'multimap', 'multiset', 'mutex', 'optional', 'ostringstream', 'packaged_task', 'pair', 'promise', 'priority_queue', 'queue', 'recursive_mutex', 'recursive_timed_mutex', 'scoped_lock', 'set', 'shared_future', 'shared_lock', 'shared_mutex', 'shared_timed_mutex', 'shared_ptr', 'stack', 'string_view', 'stringstream', 'timed_mutex', 'thread', 'true_type', 'tuple', 'unique_lock', 'unique_ptr', 'unordered_map', 'unordered_multimap', 'unordered_multiset', 'unordered_set', 'variant', 'vector', 'weak_ptr', 'wstring', 'wstring_view'];
const FUNCTION_HINTS = ['abort', 'abs', 'acos', 'apply', 'as_const', 'asin', 'atan', 'atan2', 'calloc', 'ceil', 'cerr', 'cin', 'clog', 'cos', 'cosh', 'cout', 'declval', 'endl', 'exchange', 'exit', 'exp', 'fabs', 'floor', 'fmod', 'forward', 'fprintf', 'fputs', 'free', 'frexp', 'fscanf', 'future', 'invoke', 'isalnum', 'isalpha', 'iscntrl', 'isdigit', 'isgraph', 'islower', 'isprint', 'ispunct', 'isspace', 'isupper', 'isxdigit', 'labs', 'launder', 'ldexp', 'log', 'log10', 'make_pair', 'make_shared', 'make_shared_for_overwrite', 'make_tuple', 'make_unique', 'malloc', 'memchr', 'memcmp', 'memcpy', 'memset', 'modf', 'move', 'pow', 'printf', 'putchar', 'puts', 'realloc', 'scanf', 'sin', 'sinh', 'snprintf', 'sprintf', 'sqrt', 'sscanf', 'std', 'stderr', 'stdin', 'stdout', 'strcat', 'strchr', 'strcmp', 'strcpy', 'strcspn', 'strlen', 'strncat', 'strncmp', 'strncpy', 'strpbrk', 'strrchr', 'strspn', 'strstr', 'swap', 'tan', 'tanh', 'terminate', 'to_underlying', 'tolower', 'toupper', 'vfprintf', 'visit', 'vprintf', 'vsprintf'];
const LITERALS = ['NULL', 'false', 'nullopt', 'nullptr', 'true']; // https://en.cppreference.com/w/cpp/keyword
const TYPE_HINTS = ["any", "auto_ptr", "barrier", "binary_semaphore", "bitset", "complex", "condition_variable", "condition_variable_any", "counting_semaphore", "deque", "false_type", "future", "imaginary", "initializer_list", "istringstream", "jthread", "latch", "lock_guard", "multimap", "multiset", "mutex", "optional", "ostringstream", "packaged_task", "pair", "promise", "priority_queue", "queue", "recursive_mutex", "recursive_timed_mutex", "scoped_lock", "set", "shared_future", "shared_lock", "shared_mutex", "shared_timed_mutex", "shared_ptr", "stack", "string_view", "stringstream", "timed_mutex", "thread", "true_type", "tuple", "unique_lock", "unique_ptr", "unordered_map", "unordered_multimap", "unordered_multiset", "unordered_set", "variant", "vector", "weak_ptr", "wstring", "wstring_view"];
const FUNCTION_HINTS = ["abort", "abs", "acos", "apply", "as_const", "asin", "atan", "atan2", "calloc", "ceil", "cerr", "cin", "clog", "cos", "cosh", "cout", "declval", "endl", "exchange", "exit", "exp", "fabs", "floor", "fmod", "forward", "fprintf", "fputs", "free", "frexp", "fscanf", "future", "invoke", "isalnum", "isalpha", "iscntrl", "isdigit", "isgraph", "islower", "isprint", "ispunct", "isspace", "isupper", "isxdigit", "labs", "launder", "ldexp", "log", "log10", "make_pair", "make_shared", "make_shared_for_overwrite", "make_tuple", "make_unique", "malloc", "memchr", "memcmp", "memcpy", "memset", "modf", "move", "pow", "printf", "putchar", "puts", "realloc", "scanf", "sin", "sinh", "snprintf", "sprintf", "sqrt", "sscanf", "std", "stderr", "stdin", "stdout", "strcat", "strchr", "strcmp", "strcpy", "strcspn", "strlen", "strncat", "strncmp", "strncpy", "strpbrk", "strrchr", "strspn", "strstr", "swap", "tan", "tanh", "terminate", "to_underlying", "tolower", "toupper", "vfprintf", "visit", "vprintf", "vsprintf"];
const LITERALS = ["NULL", "false", "nullopt", "nullptr", "true"]; // https://en.cppreference.com/w/cpp/keyword
const BUILT_IN = ['_Pragma'];
const BUILT_IN = ["_Pragma"];
const CPP_KEYWORDS = {

@@ -479,3 +480,3 @@ type: RESERVED_TYPES,

const FUNCTION_DISPATCH = {
className: 'function.dispatch',
className: "function.dispatch",
relevance: 0,

@@ -500,3 +501,3 @@ keywords: {

}, {
beginKeywords: 'new throw return else',
beginKeywords: "new throw return else",
end: /;/

@@ -509,3 +510,3 @@ }],

keywords: CPP_KEYWORDS,
contains: EXPRESSION_CONTAINS.concat(['self']),
contains: EXPRESSION_CONTAINS.concat(["self"]),
relevance: 0

@@ -516,4 +517,4 @@ }]),

const FUNCTION_DECLARATION = {
className: 'function',
begin: '(' + FUNCTION_TYPE_RE + '[\\*&\\s]+)+' + FUNCTION_TITLE,
className: "function",
begin: "(" + FUNCTION_TYPE_RE + "[\\*&\\s]+)+" + FUNCTION_TITLE,
returnBegin: true,

@@ -550,3 +551,3 @@ end: /[{;=]/,

}, {
className: 'params',
className: "params",
begin: /\(/,

@@ -562,3 +563,3 @@ end: /\)/,

relevance: 0,
contains: ['self', C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, STRINGS, NUMBERS, CPP_PRIMITIVE_TYPES]
contains: ["self", C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, STRINGS, NUMBERS, CPP_PRIMITIVE_TYPES]
}, {

@@ -569,3 +570,3 @@ begin: /\[\[/,

relevance: 0,
contains: ['self', C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, STRINGS, NUMBERS, CPP_PRIMITIVE_TYPES]
contains: ["self", C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, STRINGS, NUMBERS, CPP_PRIMITIVE_TYPES]
}]

@@ -575,17 +576,17 @@ }, CPP_PRIMITIVE_TYPES, C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, PREPROCESSOR]

return {
name: 'C++',
aliases: ['cc', 'c++', 'h++', 'hpp', 'hh', 'hxx', 'cxx'],
name: "MSL",
aliases: ["msl"],
keywords: CPP_KEYWORDS,
illegal: '</',
illegal: "</",
classNameAliases: {
'function.dispatch': 'built_in'
"function.dispatch": "built_in"
},
contains: [].concat(EXPRESSION_CONTEXT, FUNCTION_DECLARATION, FUNCTION_DISPATCH, EXPRESSION_CONTAINS, [PREPROCESSOR, {
// containers: ie, `vector <int> rooms (9);`
begin: '\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)',
end: '>',
begin: "\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",
end: ">",
keywords: CPP_KEYWORDS,
contains: ['self', CPP_PRIMITIVE_TYPES]
contains: ["self", CPP_PRIMITIVE_TYPES]
}, {
begin: hljs.IDENT_RE + '::',
begin: hljs.IDENT_RE + "::",
keywords: CPP_KEYWORDS

@@ -596,4 +597,4 @@ }, {

className: {
1: 'keyword',
3: 'title.class'
1: "keyword",
3: "title.class"
}

@@ -651,2 +652,8 @@ }])

}
}, {
match: [// extra complexity to deal with `enum class` and `enum struct`
/@(vertex|fragment|compute)/],
className: {
1: "meta-keyword"
}
}]

@@ -677,5 +684,11 @@ };

try {
return highlight(str, {
let result = highlight(str, {
language: lang
}).value;
});
if (result.errorRaised) {
console.error(result.errorRaised.message);
}
return result.value;
} catch (err) {

@@ -864,3 +877,3 @@ console.error(err);

var innerText = input.substr(offset + 4);
var endXml = new RegExp('</' + p1);
var endXml = new RegExp("</" + p1);
var foundEnd = endXml.exec(innerText);

@@ -873,6 +886,6 @@

var reps = 1;
var idText = innerText.replace(/ /g, '-').toLowerCase().trim();
var idText = innerText.replace(/ /g, "-").toLowerCase().trim();
while (nameSet.has(idText)) {
idText = innerText.replace(/ /g, '-').toLowerCase().trim() + reps;
idText = innerText.replace(/ /g, "-").toLowerCase().trim() + reps;
reps++;

@@ -879,0 +892,0 @@ }

{
"name": "markademic",
"version": "0.20.0",
"version": "0.20.1",
"description": "๐Ÿซ A tool for rendering academically flavored markdown.",

@@ -5,0 +5,0 @@ "typings": "dist/markademic.d.ts",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with โšก๏ธ by Socket Inc