From 944abf1991092144f9a65db63e1917f2f686084b Mon Sep 17 00:00:00 2001 From: PooiaFerdowsi Date: Mon, 31 May 2021 16:09:54 +0430 Subject: [PATCH 1/5] support more extensions support more extensions --- tte.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tte.c b/tte.c index 30821e4..eb37930 100644 --- a/tte.c +++ b/tte.c @@ -174,10 +174,10 @@ typedef enum ActionType ActionType; 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", NULL}; +char* PYTHON_HL_extensions[] = {".py",".pyw",".py3",".pyc",".pyo", NULL}; char* BASH_HL_extensions[] = {".sh", NULL}; char* JS_HL_extensions[] = {".js", ".jsx", NULL}; -char* PHP_HL_extensions[] = {".php", 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}; From 1f416375e7ed6fc4606e9d7bbec5b0def10db793 Mon Sep 17 00:00:00 2001 From: PooiaFerdowsi Date: Mon, 31 May 2021 16:16:41 +0430 Subject: [PATCH 2/5] add `extern` keyword add extern kwd --- tte.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tte.c b/tte.c index 30821e4..cfd2ea1 100644 --- a/tte.c +++ b/tte.c @@ -187,7 +187,7 @@ char* C_HL_keywords[] = { "switch", "if", "while", "for", "break", "continue", "return", "else", "struct", "union", "typedef", "static", "enum", "class", "case", "#include", "volatile", "register", "sizeof", "typedef", "union", "goto", "const", "auto", - "#define", "#if", "#endif", "#error", "#ifdef", "#ifndef", "#undef", + "#define", "#if", "#endif", "#error", "#ifdef", "#ifndef", "#undef", "extern" , "int|", "long|", "double|", "float|", "char|", "unsigned|", "signed|", "void|", "bool|", NULL From a82751f1db8b3429707f7e8f6e5e4a07714effc7 Mon Sep 17 00:00:00 2001 From: PooiaFerdowsi Date: Mon, 31 May 2021 16:16:42 +0430 Subject: [PATCH 3/5] add `extern` keyword add extern kwd --- tte.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tte.c b/tte.c index 30821e4..cfd2ea1 100644 --- a/tte.c +++ b/tte.c @@ -187,7 +187,7 @@ char* C_HL_keywords[] = { "switch", "if", "while", "for", "break", "continue", "return", "else", "struct", "union", "typedef", "static", "enum", "class", "case", "#include", "volatile", "register", "sizeof", "typedef", "union", "goto", "const", "auto", - "#define", "#if", "#endif", "#error", "#ifdef", "#ifndef", "#undef", + "#define", "#if", "#endif", "#error", "#ifdef", "#ifndef", "#undef", "extern" , "int|", "long|", "double|", "float|", "char|", "unsigned|", "signed|", "void|", "bool|", NULL From ecb0ae86df844ea9f7cee3a23aedb52b0181a1a5 Mon Sep 17 00:00:00 2001 From: PooiaFerdowsi Date: Mon, 31 May 2021 16:19:18 +0430 Subject: [PATCH 4/5] PHP supports `#` for comments --- tte.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tte.c b/tte.c index 30821e4..85cf611 100644 --- a/tte.c +++ b/tte.c @@ -346,6 +346,7 @@ struct editor_syntax HL_DB[] = { "//", "/*", "*/", + "#", HL_HIGHLIGHT_NUMBERS | HL_HIGHLIGHT_STRINGS }, { From 85944ac37bd407da951f92b163c7bf0204bbb33c Mon Sep 17 00:00:00 2001 From: PooiaFerdowsi Date: Mon, 31 May 2021 16:29:56 +0430 Subject: [PATCH 5/5] support C++ keywords --- tte.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tte.c b/tte.c index 30821e4..312f97e 100644 --- a/tte.c +++ b/tte.c @@ -185,9 +185,15 @@ char* RUBY_HL_extensions[] = {".rb", NULL}; char* C_HL_keywords[] = { "switch", "if", "while", "for", "break", "continue", "return", "else", - "struct", "union", "typedef", "static", "enum", "class", "case", "#include", + "struct", "union", "typedef", "static", "enum", "case", "#include", "volatile", "register", "sizeof", "typedef", "union", "goto", "const", "auto", "#define", "#if", "#endif", "#error", "#ifdef", "#ifndef", "#undef", + + // 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