From 7a9e7c75f929c6f72173640d9abd12a4dd926dcb Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Thu, 20 Feb 2025 00:05:33 +0700 Subject: [PATCH] added more files --- Makefile | 4 +- editor_highlight.h | 15 +++ editor_syntax.h | 126 +++++++++++++++++++++ hl_extensions.h | 17 +++ hl_keywords.h | 123 +++++++++++++++++++++ meson.build | 3 +- tte.c | 265 +-------------------------------------------- 7 files changed, 291 insertions(+), 262 deletions(-) create mode 100644 editor_highlight.h create mode 100644 editor_syntax.h create mode 100644 hl_extensions.h create mode 100644 hl_keywords.h diff --git a/Makefile b/Makefile index b0acb6d..225510a 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ DESTDIR=/ tte: tte.c - $(CC) tte.c -o tte -std=c99 + $(CC) tte.c -o tte -std=c99 -I ./ debug: tte.c - $(CC) tte.c -o tte -Wall -Wextra -pedantic -std=c99 -g + $(CC) tte.c -o tte -Wall -Wextra -pedantic -std=c99 -g -I ./ install: tte cp tte $(DESTDIR)/usr/bin/ diff --git a/editor_highlight.h b/editor_highlight.h new file mode 100644 index 0000000..1b349b9 --- /dev/null +++ b/editor_highlight.h @@ -0,0 +1,15 @@ +#ifndef EDITOR_HIGHLIGHT_H +#define EDITOR_HIGHLIGHT_H + +enum editor_highlight { + HL_NORMAL = 0, + HL_SL_COMMENT, + HL_ML_COMMENT, + HL_KEYWORD_1, + HL_KEYWORD_2, + HL_STRING, + HL_NUMBER, + HL_MATCH +}; + +#endif // EDITOR_HIGHLIGHT_H diff --git a/editor_syntax.h b/editor_syntax.h new file mode 100644 index 0000000..8649a1c --- /dev/null +++ b/editor_syntax.h @@ -0,0 +1,126 @@ +#ifndef EDITOR_SYNTAX_H +#define EDITOR_SYNTAX_H + +#include +#include + +#define HL_HIGHLIGHT_NUMBERS (1 << 0) +#define HL_HIGHLIGHT_STRINGS (1 << 1) + +struct editor_syntax { + // file_type field is the name of the filetype that will be displayed + // to the user in the status bar. + char* file_type; + // file_match is an array of strings, where each string contains a + // pattern to match a filename against. If the filename matches, + // then the file will be recognized as having that filetype. + char** file_match; + // This will be a NULL-terminated array of strings, each string containing + // a keyword. To differentiate between the two types of keywords, + // we’ll terminate the second type of keywords with a pipe (|) + // character (also known as a vertical bar). + char** keywords; + // We let each language specify its own single-line comment pattern. + char* singleline_comment_start; + // flags is a bit field that will contain flags for whether to + // highlight numbers and whether to highlight strings for that + // filetype. + char* multiline_comment_start; + char* multiline_comment_end; + int flags; +}; + +struct editor_syntax HL_DB[] = { + { + "c", + C_HL_extensions, + C_HL_keywords, + "//", + "/*", + "*/", + HL_HIGHLIGHT_NUMBERS | HL_HIGHLIGHT_STRINGS + }, + { + "java", + JAVA_HL_extensions, + JAVA_HL_keywords, + "//", + "/*", + "*/", + HL_HIGHLIGHT_NUMBERS | HL_HIGHLIGHT_STRINGS + }, + { + "python", + PYTHON_HL_extensions, + PYTHON_HL_keywords, + "#", + "'''", + "'''", + HL_HIGHLIGHT_NUMBERS | HL_HIGHLIGHT_STRINGS + }, + { + "bash", + BASH_HL_extensions, + BASH_HL_keywords, + "#", + NULL, + NULL, + HL_HIGHLIGHT_NUMBERS | HL_HIGHLIGHT_STRINGS + }, + { + "js", + JS_HL_extensions, + JS_HL_keywords, + "//", + "/*", + "*/", + HL_HIGHLIGHT_NUMBERS | HL_HIGHLIGHT_STRINGS + }, + { + "php", + PHP_HL_extensions, + PHP_HL_keywords, + "//", + "/*", + "*/", + HL_HIGHLIGHT_NUMBERS | HL_HIGHLIGHT_STRINGS + }, + { + "json", + JSON_HL_extensions, + JSON_HL_keywords, + NULL, + NULL, + NULL, + HL_HIGHLIGHT_NUMBERS | HL_HIGHLIGHT_STRINGS + }, + { + "xml", + XML_HL_extensions, + XML_HL_keywords, + NULL, + NULL, + NULL, + HL_HIGHLIGHT_NUMBERS | HL_HIGHLIGHT_STRINGS + }, + { + "sql", + SQL_HL_extensions, + SQL_HL_keywords, + "--", + "/*", + "*/", + HL_HIGHLIGHT_NUMBERS | HL_HIGHLIGHT_STRINGS + }, + { + "ruby", + RUBY_HL_extensions, + RUBY_HL_keywords, + "#", + "=begin", + "=end", + HL_HIGHLIGHT_NUMBERS | HL_HIGHLIGHT_STRINGS + } +}; + +#endif // EDITOR_SYNTAX_H diff --git a/hl_extensions.h b/hl_extensions.h new file mode 100644 index 0000000..ae6e559 --- /dev/null +++ b/hl_extensions.h @@ -0,0 +1,17 @@ +#ifndef HL_EXTENSIONS_H +#define HL_EXTENSIONS_H + +#include + +char* C_HL_extensions[] = {".c", ".h", ".cpp", ".hpp", ".cc", NULL}; // Array must be terminated with NULL. +char* JAVA_HL_extensions[] = {".java", NULL}; +char* PYTHON_HL_extensions[] = {".py",".pyw",".py3",".pyc",".pyo", NULL}; +char* BASH_HL_extensions[] = {".sh", ".bash", ".zsh", NULL}; +char* JS_HL_extensions[] = {".js", ".jsx", NULL}; +char* PHP_HL_extensions[] = {".php",".phtml", NULL}; +char* JSON_HL_extensions[] = {".json", ".jsonp", NULL}; +char* XML_HL_extensions[] = {".xml", NULL}; +char* SQL_HL_extensions[] = {".sql", NULL}; +char* RUBY_HL_extensions[] = {".rb", NULL}; + +#endif // HL_EXTENSIONS_H diff --git a/hl_keywords.h b/hl_keywords.h new file mode 100644 index 0000000..e96cbf9 --- /dev/null +++ b/hl_keywords.h @@ -0,0 +1,123 @@ +#ifndef HL_KEYWORDS_H +#define HL_KEYWORDS_H + +#include + +char* C_HL_keywords[] = { + "switch", "if", "while", "for", "break", "continue", "return", "else", + "struct", "union", "typedef", "static", "enum", "case", "#include", + "volatile", "register", "sizeof", "typedef", "union", "goto", "const", "auto", + "#define", "#if", "#endif", "#error", "#ifdef", "#ifndef", "#undef", + "asm" /* in stdbool.h */ , "bool" , "true" , "fasle" , "inline" , + + // C++ + "class" , "namespace" , "using" , "catch" , "delete" , "explicit" , + "export" , "friend" , "mutable" , "new" , "public" , "protected" , + "private" , "operator" , "this" , "template" , "virtual" , "throw" , + "try" , "typeid" , + + "int|", "long|", "double|", "float|", "char|", "unsigned|", "signed|", + "void|", "bool|", NULL +}; + +char* JAVA_HL_keywords[] = { + "switch", "if", "while", "for", "break", "continue", "return", "else", + "in", "public", "private", "protected", "static", "final", "abstract", + "enum", "class", "case", "try", "catch", "do", "extends", "implements", + "finally", "import", "instanceof", "interface", "new", "package", "super", + "native", "strictfp", + "synchronized", "this", "throw", "throws", "transient", "volatile", + + "byte|", "char|", "double|", "float|", "int|", "long|", "short|", + "boolean|", NULL +}; + +char* PYTHON_HL_keywords[] = { + "and", "as", "assert", "break", "class", "continue", "def", "del", "elif", + "else", "except", "exec", "finally", "for", "from", "global", "if", "import", + "in", "is", "lambda", "not", "or", "pass", "print", "raise", "return", "try", + "while", "with", "yield", + + "buffer|", "bytearray|", "complex|", "False|", "float|", "frozenset|", "int|", + "list|", "long|", "None|", "set|", "str|", "tuple|", "True|", "type|", + "unicode|", "xrange|", NULL +}; + +char* BASH_HL_keywords[] = { + "case", "do", "done", "elif", "else", "esac", "fi", "for", "function", "if", + "in", "select", "then", "time", "until", "while", "alias", "bg", "bind", "break", + "builtin", "cd", "command", "continue", "declare", "dirs", "disown", "echo", + "enable", "eval", "exec", "exit", "export", "fc", "fg", "getopts", "hash", "help", + "history", "jobs", "kill", "let", "local", "logout", "popd", "pushd", "pwd", "read", + "readonly", "return", "set", "shift", "suspend", "test", "times", "trap", "type", + "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 +}; + +char* PHP_HL_keywords[] = { + "__halt_compiler", "break", "clone", "die", "empty", "endswitch", "final", "global", + "include_once", "list", "private", "return", "try", "xor", "abstract", "callable", + "const", "do", "enddeclare", "endwhile", "finally", "goto", "instanceof", "namespace", + "protected", "static", "unset", "yield", "and", "case", "continue", "echo", "endfor", + "eval", "for", "if", "insteadof", "new", "public", "switch", "use", "array", "catch", + "declare", "else", "endforeach", "exit", "foreach", "implements", "interface", "or", + "require", "throw", "var", "as", "class", "default", "elseif", "endif", "extends", + "function", "include", "isset", "print", "require_once", "trait", "while", NULL +}; + +char* JSON_HL_keywords[] = { + NULL +}; + +char* XML_HL_keywords[] = { + NULL +}; + +char* SQL_HL_keywords[] = { + "SELECT", "FROM", "DROP", "CREATE", "TABLE", "DEFAULT", "FOREIGN", "UPDATE", "LOCK", + "INSERT", "INTO", "VALUES", "LOCK", "UNLOCK", "WHERE", "DINSTINCT", "BETWEEN", "NOT", + "NULL", "TO", "ON", "ORDER", "GROUP", "IF", "BY", "HAVING", "USING", "UNION", "UNIQUE", + "AUTO_INCREMENT", "LIKE", "WITH", "INNER", "OUTER", "JOIN", "COLUMN", "DATABASE", "EXISTS", + "NATURAL", "LIMIT", "UNSIGNED", "MAX", "MIN", "PRECISION", "ALTER", "DELETE", "CASCADE", + "PRIMARY", "KEY", "CONSTRAINT", "ENGINE", "CHARSET", "REFERENCES", "WRITE", + + "BIT|", "TINYINT|", "BOOL|", "BOOLEAN|", "SMALLINT|", "MEDIUMINT|", "INT|", "INTEGER|", + "BIGINT|", "DOUBLE|", "DECIMAL|", "DEC|" "FLOAT|", "DATE|", "DATETIME|", "TIMESTAMP|", + "TIME|", "YEAR|", "CHAR|", "VARCHAR|", "TEXT|", "ENUM|", "SET|", "BLOB|", "VARBINARY|", + "TINYBLOB|", "TINYTEXT|", "MEDIUMBLOB|", "MEDIUMTEXT|", "LONGTEXT|", + + "select", "from", "drop", "create", "table", "default", "foreign", "update", "lock", + "insert", "into", "values", "lock", "unlock", "where", "dinstinct", "between", "not", + "null", "to", "on", "order", "group", "if", "by", "having", "using", "union", "unique", + "auto_increment", "like", "with", "inner", "outer", "join", "column", "database", "exists", + "natural", "limit", "unsigned", "max", "min", "precision", "alter", "delete", "cascade", + "primary", "key", "constraint", "engine", "charset", "references", "write", + + "bit|", "tinyint|", "bool|", "boolean|", "smallint|", "mediumint|", "int|", "integer|", + "bigint|", "double|", "decimal|", "dec|" "float|", "date|", "datetime|", "timestamp|", + "time|", "year|", "char|", "varchar|", "text|", "enum|", "set|", "blob|", "varbinary|", + "tinyblob|", "tinytext|", "mediumblob|", "mediumtext|", "longtext|", NULL +}; + +char* RUBY_HL_keywords[] = { + "__ENCODING__", "__LINE__", "__FILE__", "BEGIN", "END", "alias", "and", "begin", "break", + "case", "class", "def", "defined?", "do", "else", "elsif", "end", "ensure", "for", "if", + "in", "module", "next", "not", "or", "redo", "rescue", "retry", "return", "self", "super", + "then", "undef", "unless", "until", "when", "while", "yield", NULL +}; + +#endif // HL_KEYWORDS_H diff --git a/meson.build b/meson.build index 8e667c9..cecea58 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,6 @@ project('tte', 'c', default_options : ['c_std=c99']) executable( 'tte', - 'tte.c' + 'tte.c', + include_directories: include_directories('./') ) diff --git a/tte.c b/tte.c index e69716e..60da038 100644 --- a/tte.c +++ b/tte.c @@ -42,6 +42,10 @@ #include #include #include +#include +#include +#include +#include /*** Define section ***/ @@ -57,8 +61,8 @@ // Times to press Ctrl-Q before exiting #define TTE_QUIT_TIMES 2 // Highlight flags -#define HL_HIGHLIGHT_NUMBERS (1 << 0) -#define HL_HIGHLIGHT_STRINGS (1 << 1) +// #define HL_HIGHLIGHT_NUMBERS (1 << 0) +// #define HL_HIGHLIGHT_STRINGS (1 << 1) // Status print indicators #define NO_STATUS false #define STATUS_YES true @@ -81,29 +85,6 @@ typedef struct editor_row { int hl_open_comment; // True if the line is part of a ML comment. } editor_row; -struct editor_syntax { - // file_type field is the name of the filetype that will be displayed - // to the user in the status bar. - char* file_type; - // file_match is an array of strings, where each string contains a - // pattern to match a filename against. If the filename matches, - // then the file will be recognized as having that filetype. - char** file_match; - // This will be a NULL-terminated array of strings, each string containing - // a keyword. To differentiate between the two types of keywords, - // we’ll terminate the second type of keywords with a pipe (|) - // character (also known as a vertical bar). - char** keywords; - // We let each language specify its own single-line comment pattern. - char* singleline_comment_start; - // flags is a bit field that will contain flags for whether to - // highlight numbers and whether to highlight strings for that - // filetype. - char* multiline_comment_start; - char* multiline_comment_end; - int flags; -}; - struct editor_config { int cursor_x; int cursor_y; @@ -147,17 +128,6 @@ enum editor_key { DEL_KEY }; -enum editor_highlight { - HL_NORMAL = 0, - HL_SL_COMMENT, - HL_ML_COMMENT, - HL_KEYWORD_1, - HL_KEYWORD_2, - HL_STRING, - HL_NUMBER, - HL_MATCH -}; - /*** Edit actions ***/ enum ActionType { CutLine, @@ -170,229 +140,6 @@ enum ActionType { }; typedef enum ActionType ActionType; -/*** Filetypes ***/ - -char* C_HL_extensions[] = {".c", ".h", ".cpp", ".hpp", ".cc", NULL}; // Array must be terminated with NULL. -char* JAVA_HL_extensions[] = {".java", NULL}; -char* PYTHON_HL_extensions[] = {".py",".pyw",".py3",".pyc",".pyo", NULL}; -char* BASH_HL_extensions[] = {".sh", ".bash", ".zsh", NULL}; -char* JS_HL_extensions[] = {".js", ".jsx", NULL}; -char* PHP_HL_extensions[] = {".php",".phtml", NULL}; -char* JSON_HL_extensions[] = {".json", ".jsonp", NULL}; -char* XML_HL_extensions[] = {".xml", NULL}; -char* SQL_HL_extensions[] = {".sql", NULL}; -char* RUBY_HL_extensions[] = {".rb", NULL}; - -char* C_HL_keywords[] = { - "switch", "if", "while", "for", "break", "continue", "return", "else", - "struct", "union", "typedef", "static", "enum", "case", "#include", - "volatile", "register", "sizeof", "typedef", "union", "goto", "const", "auto", - "#define", "#if", "#endif", "#error", "#ifdef", "#ifndef", "#undef", - "asm" /* in stdbool.h */ , "bool" , "true" , "fasle" , "inline" , - - // C++ - "class" , "namespace" , "using" , "catch" , "delete" , "explicit" , - "export" , "friend" , "mutable" , "new" , "public" , "protected" , - "private" , "operator" , "this" , "template" , "virtual" , "throw" , - "try" , "typeid" , - - "int|", "long|", "double|", "float|", "char|", "unsigned|", "signed|", - "void|", "bool|", NULL -}; - -char* JAVA_HL_keywords[] = { - "switch", "if", "while", "for", "break", "continue", "return", "else", - "in", "public", "private", "protected", "static", "final", "abstract", - "enum", "class", "case", "try", "catch", "do", "extends", "implements", - "finally", "import", "instanceof", "interface", "new", "package", "super", - "native", "strictfp", - "synchronized", "this", "throw", "throws", "transient", "volatile", - - "byte|", "char|", "double|", "float|", "int|", "long|", "short|", - "boolean|", NULL -}; - -char* PYTHON_HL_keywords[] = { - "and", "as", "assert", "break", "class", "continue", "def", "del", "elif", - "else", "except", "exec", "finally", "for", "from", "global", "if", "import", - "in", "is", "lambda", "not", "or", "pass", "print", "raise", "return", "try", - "while", "with", "yield", - - "buffer|", "bytearray|", "complex|", "False|", "float|", "frozenset|", "int|", - "list|", "long|", "None|", "set|", "str|", "tuple|", "True|", "type|", - "unicode|", "xrange|", NULL -}; - -char* BASH_HL_keywords[] = { - "case", "do", "done", "elif", "else", "esac", "fi", "for", "function", "if", - "in", "select", "then", "time", "until", "while", "alias", "bg", "bind", "break", - "builtin", "cd", "command", "continue", "declare", "dirs", "disown", "echo", - "enable", "eval", "exec", "exit", "export", "fc", "fg", "getopts", "hash", "help", - "history", "jobs", "kill", "let", "local", "logout", "popd", "pushd", "pwd", "read", - "readonly", "return", "set", "shift", "suspend", "test", "times", "trap", "type", - "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 -}; - -char* PHP_HL_keywords[] = { - "__halt_compiler", "break", "clone", "die", "empty", "endswitch", "final", "global", - "include_once", "list", "private", "return", "try", "xor", "abstract", "callable", - "const", "do", "enddeclare", "endwhile", "finally", "goto", "instanceof", "namespace", - "protected", "static", "unset", "yield", "and", "case", "continue", "echo", "endfor", - "eval", "for", "if", "insteadof", "new", "public", "switch", "use", "array", "catch", - "declare", "else", "endforeach", "exit", "foreach", "implements", "interface", "or", - "require", "throw", "var", "as", "class", "default", "elseif", "endif", "extends", - "function", "include", "isset", "print", "require_once", "trait", "while", NULL -}; - -char* JSON_HL_keywords[] = { - NULL -}; - -char* XML_HL_keywords[] = { - NULL -}; - -char* SQL_HL_keywords[] = { - "SELECT", "FROM", "DROP", "CREATE", "TABLE", "DEFAULT", "FOREIGN", "UPDATE", "LOCK", - "INSERT", "INTO", "VALUES", "LOCK", "UNLOCK", "WHERE", "DINSTINCT", "BETWEEN", "NOT", - "NULL", "TO", "ON", "ORDER", "GROUP", "IF", "BY", "HAVING", "USING", "UNION", "UNIQUE", - "AUTO_INCREMENT", "LIKE", "WITH", "INNER", "OUTER", "JOIN", "COLUMN", "DATABASE", "EXISTS", - "NATURAL", "LIMIT", "UNSIGNED", "MAX", "MIN", "PRECISION", "ALTER", "DELETE", "CASCADE", - "PRIMARY", "KEY", "CONSTRAINT", "ENGINE", "CHARSET", "REFERENCES", "WRITE", - - "BIT|", "TINYINT|", "BOOL|", "BOOLEAN|", "SMALLINT|", "MEDIUMINT|", "INT|", "INTEGER|", - "BIGINT|", "DOUBLE|", "DECIMAL|", "DEC|" "FLOAT|", "DATE|", "DATETIME|", "TIMESTAMP|", - "TIME|", "YEAR|", "CHAR|", "VARCHAR|", "TEXT|", "ENUM|", "SET|", "BLOB|", "VARBINARY|", - "TINYBLOB|", "TINYTEXT|", "MEDIUMBLOB|", "MEDIUMTEXT|", "LONGTEXT|", - - "select", "from", "drop", "create", "table", "default", "foreign", "update", "lock", - "insert", "into", "values", "lock", "unlock", "where", "dinstinct", "between", "not", - "null", "to", "on", "order", "group", "if", "by", "having", "using", "union", "unique", - "auto_increment", "like", "with", "inner", "outer", "join", "column", "database", "exists", - "natural", "limit", "unsigned", "max", "min", "precision", "alter", "delete", "cascade", - "primary", "key", "constraint", "engine", "charset", "references", "write", - - "bit|", "tinyint|", "bool|", "boolean|", "smallint|", "mediumint|", "int|", "integer|", - "bigint|", "double|", "decimal|", "dec|" "float|", "date|", "datetime|", "timestamp|", - "time|", "year|", "char|", "varchar|", "text|", "enum|", "set|", "blob|", "varbinary|", - "tinyblob|", "tinytext|", "mediumblob|", "mediumtext|", "longtext|", NULL -}; - -char* RUBY_HL_keywords[] = { - "__ENCODING__", "__LINE__", "__FILE__", "BEGIN", "END", "alias", "and", "begin", "break", - "case", "class", "def", "defined?", "do", "else", "elsif", "end", "ensure", "for", "if", - "in", "module", "next", "not", "or", "redo", "rescue", "retry", "return", "self", "super", - "then", "undef", "unless", "until", "when", "while", "yield", NULL -}; - -struct editor_syntax HL_DB[] = { - { - "c", - C_HL_extensions, - C_HL_keywords, - "//", - "/*", - "*/", - HL_HIGHLIGHT_NUMBERS | HL_HIGHLIGHT_STRINGS - }, - { - "java", - JAVA_HL_extensions, - JAVA_HL_keywords, - "//", - "/*", - "*/", - HL_HIGHLIGHT_NUMBERS | HL_HIGHLIGHT_STRINGS - }, - { - "python", - PYTHON_HL_extensions, - PYTHON_HL_keywords, - "#", - "'''", - "'''", - HL_HIGHLIGHT_NUMBERS | HL_HIGHLIGHT_STRINGS - }, - { - "bash", - BASH_HL_extensions, - BASH_HL_keywords, - "#", - NULL, - NULL, - HL_HIGHLIGHT_NUMBERS | HL_HIGHLIGHT_STRINGS - }, - { - "js", - JS_HL_extensions, - JS_HL_keywords, - "//", - "/*", - "*/", - HL_HIGHLIGHT_NUMBERS | HL_HIGHLIGHT_STRINGS - }, - { - "php", - PHP_HL_extensions, - PHP_HL_keywords, - "//", - "/*", - "*/", - HL_HIGHLIGHT_NUMBERS | HL_HIGHLIGHT_STRINGS - }, - { - "json", - JSON_HL_extensions, - JSON_HL_keywords, - NULL, - NULL, - NULL, - HL_HIGHLIGHT_NUMBERS | HL_HIGHLIGHT_STRINGS - }, - { - "xml", - XML_HL_extensions, - XML_HL_keywords, - NULL, - NULL, - NULL, - HL_HIGHLIGHT_NUMBERS | HL_HIGHLIGHT_STRINGS - }, - { - "sql", - SQL_HL_extensions, - SQL_HL_keywords, - "--", - "/*", - "*/", - HL_HIGHLIGHT_NUMBERS | HL_HIGHLIGHT_STRINGS - }, - { - "ruby", - RUBY_HL_extensions, - RUBY_HL_keywords, - "#", - "=begin", - "=end", - HL_HIGHLIGHT_NUMBERS | HL_HIGHLIGHT_STRINGS - } -}; - // Size of the "Hightlight Database" (HL_DB). #define HL_DB_ENTRIES (sizeof(HL_DB) / sizeof(HL_DB[0]))