Added JavaScript support.

This commit is contained in:
GrenderG committed 2017-04-08 03:06:27 +02:00
1 parent 442ea5081b
commit 1eadd67c87
1 file changed
+25
+25
View File
@@ -149,6 +149,7 @@ char* C_HL_extensions[] = {".c", ".h", ".cpp", NULL}; // Array must be terminate
char* JAVA_HL_extensions[] = {".java", NULL}; char* JAVA_HL_extensions[] = {".java", NULL};
char* PYTHON_HL_extensions[] = {".py", NULL}; char* PYTHON_HL_extensions[] = {".py", NULL};
char* BASH_HL_extensions[] = {".sh", NULL}; char* BASH_HL_extensions[] = {".sh", NULL};
char* JS_HL_extensions[] = {".js", ".jsx", NULL};
char* C_HL_keywords[] = { char* C_HL_keywords[] = {
"switch", "if", "while", "for", "break", "continue", "return", "else", "switch", "if", "while", "for", "break", "continue", "return", "else",
@@ -193,6 +194,21 @@ char* BASH_HL_keywords[] = {
"typeset", "ulimit", "umask", "unalias", "unset", "wait", "printf", NULL "typeset", "ulimit", "umask", "unalias", "unset", "wait", "printf", NULL
}; };
char* JS_HL_keywords[] = {
"break", "case", "catch", "class", "const", "continue", "debugger", "default",
"delete", "do", "else", "enum", "export", "extends", "finally", "for", "function",
"if", "implements", "import", "in", "instanceof", "interface", "let", "new",
"package", "private", "protected", "public", "return", "static", "super", "switch",
"this", "throw", "try", "typeof", "var", "void", "while", "with", "yield", "true",
"false", "null", "NaN", "global", "window", "prototype", "constructor", "document",
"isNaN", "arguments", "undefined",
"Infinity|", "Array|", "Object|", "Number|", "String|", "Boolean|", "Function|",
"ArrayBuffer|", "DataView|", "Float32Array|", "Float64Array|", "Int8Array|",
"Int16Array|", "Int32Array|", "Uint8Array|", "Uint8ClampedArray|", "Uint32Array|",
"Date|", "Error|", "Map|", "RegExp|", "Symbol|", "WeakMap|", "WeakSet|", "Set|", NULL
};
struct editor_syntax HL_DB[] = { struct editor_syntax HL_DB[] = {
{ {
"c", "c",
@@ -230,6 +246,15 @@ struct editor_syntax HL_DB[] = {
NULL, NULL,
HL_HIGHLIGHT_NUMBERS | HL_HIGHLIGHT_STRINGS HL_HIGHLIGHT_NUMBERS | HL_HIGHLIGHT_STRINGS
}, },
{
"js",
JS_HL_extensions,
JS_HL_keywords,
"//",
"/*",
"*/",
HL_HIGHLIGHT_NUMBERS | HL_HIGHLIGHT_STRINGS
},
}; };
// Size of the "Hightlight Database" (HL_DB). // Size of the "Hightlight Database" (HL_DB).