[DEV] separate c++ & C and add filename in title
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<EdnLang version="0.1" lang="C/C++">
|
||||
<ext>.*\.(c|cpp|cxx|cc|h|hpp|hxx|m|mm)</ext>
|
||||
<EdnLang version="0.1" lang="C">
|
||||
<ext>.*\.(c|m)</ext>
|
||||
<!--might be : <ext>.*\.(c|h|m)</ext>-->
|
||||
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
|
||||
<rule name="doxygen multiline">
|
||||
<color>commentDoxygen</color>
|
||||
@@ -12,7 +13,7 @@
|
||||
<regex>/\*(.|\r|\n)*?(\*/|\0)</regex>
|
||||
<sub>TODO</sub>
|
||||
</rule>
|
||||
<rule name="comment miltiline ERROR">
|
||||
<rule name="comment multiline ERROR">
|
||||
<color>SYNTAX_ERROR</color>
|
||||
<regex>/\*(.|\r|\n)*</regex>
|
||||
</rule>
|
||||
@@ -40,11 +41,11 @@
|
||||
</rule>
|
||||
<rule name="double quote text">
|
||||
<color>doubleQuoteText</color>
|
||||
<regex>"(.|\\[\\"])*?"</regex> <!-- " -->
|
||||
<regex>"(.|\\[\\"])*?"</regex> <!-- " -->
|
||||
</rule>
|
||||
<rule name="simple quote text">
|
||||
<color>doubleQuoteText</color>
|
||||
<regex>'\\?.'</regex>
|
||||
<regex>'\\?.'</regex>
|
||||
</rule>
|
||||
</pass1>
|
||||
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
|
||||
@@ -54,23 +55,19 @@
|
||||
</rule>
|
||||
<rule name="my function keyword">
|
||||
<color>systemFunction</color>
|
||||
<regex>\b(new|delete|try|catch|memset|fopen|fread|fwrite|fgets|fclose|printf|(f|s|diag_)printf|calloc|malloc|realloc|(cyg|sup)_([a-z]|[A-Z]|[0-9]|_)+)\b</regex>
|
||||
<regex>\b(memset|fopen|fread|fwrite|fgets|fclose|printf|(f|s|diag_)printf|calloc|malloc|realloc)\b</regex>
|
||||
</rule>
|
||||
<rule name="my type">
|
||||
<color>type</color>
|
||||
<regex>\b(bool|BOOL|char(16_t|32_t)?|double|float|u?int(8|16|32|64|128)?(_t)?|long|short|signed|size_t|unsigned|void|(I|U)(8|16|32|64|128))\b</regex>
|
||||
</rule>
|
||||
<rule name="std type">
|
||||
<color>type</color>
|
||||
<regex>\bstd::[\w:]*\b</regex>
|
||||
<regex>\b(bool|char(16_t|32_t)?|double|float|u?int(8|16|32|64|128)?(_t)?|long|short|signed|size_t|unsigned|void|(I|U)(8|16|32|64|128))\b</regex>
|
||||
</rule>
|
||||
<rule name="my storage keyword">
|
||||
<color>storageKeyword</color>
|
||||
<regex>\b(inline|const|class|namespace|virtual|private|public|protected|friend|const|extern|auto|register|static|unsigned|signed|volatile|char|double|float|int|long|short|void|typedef|struct|union|enum)\b</regex>
|
||||
<regex>\b(inline|const|const|extern|register|static|unsigned|signed|volatile|char|double|float|int|long|short|void|typedef|struct|union|enum)\b</regex>
|
||||
</rule>
|
||||
<rule name="my common Define">
|
||||
<color>commonDefine</color>
|
||||
<regex>\b(NULL|MAX|MIN|__LINE__|__DATA__|__FILE__|__func__|__TIME__|__STDC__)\b</regex>
|
||||
<regex>\b(NULL|MAX|MIN|__(LINE|DATA|FILE|func|TIME|STDC)__)\b</regex>
|
||||
</rule>
|
||||
<rule name="numeric constant">
|
||||
<color>number</color>
|
||||
@@ -78,16 +75,12 @@
|
||||
</rule>
|
||||
<rule name="my boolean">
|
||||
<color>boolean</color>
|
||||
<regex>\b(true|TRUE|false|FALSE)\b</regex>
|
||||
<regex>\b(TRUE|FALSE)\b</regex>
|
||||
</rule>
|
||||
<rule name="BIG LETTER">
|
||||
<color>macro</color>
|
||||
<regex>\b([A-Z_][A-Z_0-9]{3,500})\b</regex>
|
||||
</rule>
|
||||
<rule name="CPP member">
|
||||
<color>memberClass</color>
|
||||
<regex>\bm_\w+\b</regex>
|
||||
</rule>
|
||||
<rule name="function input">
|
||||
<color>inputFunction</color>
|
||||
<regex>\b_\w+\b</regex>
|
||||
@@ -100,10 +93,6 @@
|
||||
<color>boolean</color>
|
||||
<regex>==|<=|>=|!=|<{1,2}|>{1,2}|&&|\{|\}</regex>
|
||||
</rule>
|
||||
<rule name="BIG LETTER">
|
||||
<color>macro</color>
|
||||
<regex>([A-Z]|_){4,500}</regex>
|
||||
</rule>
|
||||
<rule name="simpleQuteTextError">
|
||||
<color>SYNTAX_ERROR</color>
|
||||
<regex>'|"</regex>
|
||||
|
132
data/languages/cpp/highlight.xml
Normal file
132
data/languages/cpp/highlight.xml
Normal file
@@ -0,0 +1,132 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<EdnLang version="0.1" lang="C++">
|
||||
<ext>.*\.(cpp|cxx|cc|h|hpp|hxx|mm)</ext>
|
||||
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
|
||||
<rule name="doxygen multiline">
|
||||
<color>commentDoxygen</color>
|
||||
<regex>/\*(\*|!)(.|\r|\n)*?\*/</regex>
|
||||
<sub>doxyparse</sub>
|
||||
</rule>
|
||||
<rule name="comment multiline">
|
||||
<color>comment</color>
|
||||
<regex>/\*(.|\r|\n)*?(\*/|\0)</regex>
|
||||
<sub>TODO</sub>
|
||||
</rule>
|
||||
<rule name="comment multiline ERROR">
|
||||
<color>SYNTAX_ERROR</color>
|
||||
<regex>/\*(.|\r|\n)*</regex>
|
||||
</rule>
|
||||
<rule name="#if 0">
|
||||
<color>preprocesseur</color>
|
||||
<regex>#[ \t]*if 0(.|\r|\n)*?#(endif|else)</regex>
|
||||
</rule>
|
||||
<rule name="#if 0 ERROR">
|
||||
<color>SYNTAX_ERROR</color>
|
||||
<regex>#[ \t]*if 0(.|\r|\n)*</regex>
|
||||
</rule>
|
||||
<rule name="#preproc">
|
||||
<color>preprocesseur</color>
|
||||
<regex>#(.|\\[\\\n])*</regex>
|
||||
</rule>
|
||||
<rule name="inline doxygen">
|
||||
<color>commentDoxygen</color>
|
||||
<regex>//!.*</regex>
|
||||
<sub>doxyparse</sub>
|
||||
</rule>
|
||||
<rule name="inline comment">
|
||||
<color>comment</color>
|
||||
<regex>//.*</regex>
|
||||
<sub>TODO</sub>
|
||||
</rule>
|
||||
<rule name="double quote text">
|
||||
<color>doubleQuoteText</color>
|
||||
<regex>"(.|\\[\\"])*?"</regex> <!-- " -->
|
||||
</rule>
|
||||
<rule name="simple quote text">
|
||||
<color>doubleQuoteText</color>
|
||||
<regex>'\\?.'</regex>
|
||||
</rule>
|
||||
</pass1>
|
||||
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
|
||||
<rule name="my keyword">
|
||||
<color>keyword</color>
|
||||
<regex>\b(return|goto|if|else|case|default|switch|break|continue|while|do|for|sizeof)\b</regex>
|
||||
</rule>
|
||||
<rule name="my function keyword">
|
||||
<color>systemFunction</color>
|
||||
<regex>\b(new|delete|try|catch|memset|fopen|fread|fwrite|fgets|fclose|printf|(f|s|diag_)printf)\b</regex>
|
||||
</rule>
|
||||
<rule name="my type">
|
||||
<color>type</color>
|
||||
<regex>\b(bool|char(16_t|32_t)?|double|float|u?int(8|16|32|64|128)?(_t)?|long|short|signed|size_t|unsigned|void|(I|U)(8|16|32|64|128))\b</regex>
|
||||
</rule>
|
||||
<rule name="std type">
|
||||
<color>type</color>
|
||||
<regex>\bstd::[\w:]*\b</regex>
|
||||
</rule>
|
||||
<rule name="my storage keyword">
|
||||
<color>storageKeyword</color>
|
||||
<regex>\b(inline|const|class|namespace|virtual|private|public|protected|friend|const|extern|auto|register|static|unsigned|signed|volatile|char|double|float|int|long|short|void|typedef|struct|union|enum)\b</regex>
|
||||
</rule>
|
||||
<rule name="my common Define">
|
||||
<color>commonDefine</color>
|
||||
<regex>\b(nullptr|__(LINE|DATA|FILE|func|TIME|STDC)__)\b</regex>
|
||||
</rule>
|
||||
<rule name="numeric constant">
|
||||
<color>number</color>
|
||||
<regex>\b(((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?)\b</regex>
|
||||
</rule>
|
||||
<rule name="my boolean">
|
||||
<color>boolean</color>
|
||||
<regex>\b(true|false)\b</regex>
|
||||
</rule>
|
||||
<rule name="BIG LETTER">
|
||||
<color>macro</color>
|
||||
<regex>\b([A-Z_][A-Z_0-9]{3,500})\b</regex>
|
||||
</rule>
|
||||
<rule name="CPP member">
|
||||
<color>memberClass</color>
|
||||
<regex>\bm_\w+\b</regex>
|
||||
</rule>
|
||||
<rule name="function input">
|
||||
<color>inputFunction</color>
|
||||
<regex>\b_\w+\b</regex>
|
||||
</rule>
|
||||
<rule name="Function name">
|
||||
<color>functionName</color>
|
||||
<regex>\b((\w|_)+[ \t]*\()</regex>
|
||||
</rule>
|
||||
<rule name="condition">
|
||||
<color>boolean</color>
|
||||
<regex>==|<=|>=|!=|<{1,2}|>{1,2}|&&|\{|\}</regex>
|
||||
</rule>
|
||||
<rule name="simpleQuteTextError">
|
||||
<color>SYNTAX_ERROR</color>
|
||||
<regex>'|"</regex>
|
||||
</rule>
|
||||
<rule name="old school elements">
|
||||
<color>SYNTAX_ERROR</color>
|
||||
<regex>'|"|NULL|MAX|MIN|TRUE|FALSE|calloc|malloc|realloc|free|BOOL</regex>
|
||||
</rule>
|
||||
</pass2>
|
||||
<pass name="doxyparse">
|
||||
<rule name="key">
|
||||
<color>doxygen-key</color>
|
||||
<regex>(@|\\)[\t ]*\w+</regex>
|
||||
</rule>
|
||||
<rule name="in-out">
|
||||
<color>doxygen-in-out</color>
|
||||
<regex>\[(in|in,out|out)\]</regex>
|
||||
</rule>
|
||||
<rule name="function input">
|
||||
<color>inputFunction</color>
|
||||
<regex>\b_\w+\b</regex>
|
||||
</rule>
|
||||
</pass>
|
||||
<pass name="TODO">
|
||||
<rule name="function input">
|
||||
<color>SYNTAX_ERROR</color>
|
||||
<regex>TODO[ \t]*:.*</regex>
|
||||
</rule>
|
||||
</pass>
|
||||
</EdnLang>
|
Reference in New Issue
Block a user