[DEV] set back the use of the etk::RegExp and etk::Buffer instead of std::regex and std::string ==> fast edit big files

This commit is contained in:
2017-03-14 21:56:56 +01:00
parent c4f59d8734
commit a42436092b
28 changed files with 238 additions and 280 deletions

View File

@@ -25,29 +25,29 @@
</rule> </rule>
<rule name="my preprocesseur"> <rule name="my preprocesseur">
<color>preprocesseur</color> <color>preprocesseur</color>
<regex>#.*?$</regex> <regex>#.*$</regex>
</rule> </rule>
<rule name="my comment doxygen"> <rule name="my comment doxygen">
<color>commentDoxygen</color> <color>commentDoxygen</color>
<regex>//!.*?$</regex> <regex>//!.*$</regex>
</rule> </rule>
<rule name="my todo comment"> <rule name="my todo comment">
<color>SYNTAX_ERROR</color> <color>SYNTAX_ERROR</color>
<regex>//[ \t]*TODO[ \t]*:.*?$</regex> <regex>//[ \t]*TODO[ \t]*:.*$</regex>
</rule> </rule>
<rule name="my comment"> <rule name="my comment">
<color>comment</color> <color>comment</color>
<regex>//.*?$</regex> <regex>(//|@).*$</regex>
</rule> </rule>
</pass1> </pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear --> <pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="my keyword"> <rule name="my keyword">
<color>keyword</color> <color>keyword</color>
<regex>\b(smull|ldrsh|smlal|stmdb|mul|mla|umull|ldr|add|str|mov|subs|bgt|ldmia|stmia|ldmfd|cmp|sub|strd|stmfd|bne|bhi|ldrd|mvn)\b</regex> <regex>\@smull|ldrsh|smlal|stmdb|mul|mla|umull|ldr|add|str|mov|subs|bgt|ldmia|stmia|ldmfd|cmp|sub|strd|stmfd|bne|bhi|ldrd|mvn\@</regex>
</rule> </rule>
<rule name="register list"> <rule name="register list">
<color>type</color> <color>type</color>
<regex>\b(r(10|11|12|[0-9]?)|sp|lp|lr|pc)\b</regex> <regex>\@r(10|11|12|[0-9]?)|sp|lp|lr|pc\@</regex>
</rule> </rule>
</pass2> </pass2>
</EdnLang> </EdnLang>

View File

@@ -4,11 +4,11 @@
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification --> <pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
<rule name="first line"> <rule name="first line">
<color>commentDoxygen</color> <color>commentDoxygen</color>
<regex>#!(.|\\[\\\n])*?$</regex> <regex>#!(\\[\\\n]|.)*$</regex>
</rule> </rule>
<rule name="comment line"> <rule name="comment line">
<color>comment</color> <color>comment</color>
<regex>#(.|\\[\\\n])*?$</regex> <regex>#(\\[\\\n]|.)*$</regex>
</rule> </rule>
<rule name="doubleQuteText"> <rule name="doubleQuteText">
<color>doubleQuoteText</color> <color>doubleQuoteText</color>
@@ -22,7 +22,7 @@
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear --> <pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="my keyword"> <rule name="my keyword">
<color>keyword</color> <color>keyword</color>
<regex>\b(for|done|do|while|in|if|elif|then|else|fi)\b</regex> <regex>\@for|done|do|while|in|if|elif|then|else|fi\@</regex>
</rule> </rule>
<rule name="my Variable"> <rule name="my Variable">
<color>keyword</color> <color>keyword</color>

View File

@@ -4,23 +4,23 @@
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification --> <pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
<rule name="comment ##"> <rule name="comment ##">
<color>SYNTAX_ERROR</color> <color>SYNTAX_ERROR</color>
<regex>##.*?$</regex> <regex>##.*$</regex>
</rule> </rule>
<rule name="comment #"> <rule name="comment #">
<color>comment</color> <color>comment</color>
<regex>#.*?$</regex> <regex>#.*$</regex>
</rule> </rule>
<rule name="notes ... "> <rule name="notes ... ">
<color>preprocesseur</color> <color>preprocesseur</color>
<regex>(NOTE|TODO) : .*?$</regex> <regex>(NOTE|TODO) : .*$</regex>
</rule> </rule>
<rule name="doubleQuteText"> <rule name="doubleQuteText">
<color>doubleQuoteText</color> <color>doubleQuoteText</color>
<regex>&quot;(.|\\[\\&quot;])*?$</regex> <regex>&quot;(.|\\[\\&quot;])*$</regex>
</rule> </rule>
<rule name="simpleQuteText"> <rule name="simpleQuteText">
<color>doubleQuoteText</color> <color>doubleQuoteText</color>
<regex>\b&apos;(.|\\[\\&apos;])*?$</regex> <regex>\@&apos;(.|\\[\\&apos;])*$</regex>
</rule> </rule>
</pass1> </pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear --> <pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->

View File

@@ -64,43 +64,43 @@
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear --> <pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="my keyword"> <rule name="my keyword">
<color>keyword</color> <color>keyword</color>
<regex>\b(return|goto|if|else|case|default|switch|break|continue|while|do|for|sizeof)\b</regex> <regex>\@return|goto|if|else|case|default|switch|break|continue|while|do|for|sizeof\@</regex>
</rule> </rule>
<rule name="my function keyword"> <rule name="my function keyword">
<color>systemFunction</color> <color>systemFunction</color>
<regex>\b(memset|fopen|fread|fwrite|fgets|fclose|printf|(f|s|diag_)printf|calloc|malloc|realloc)\b</regex> <regex>\@memset|fopen|fread|fwrite|fgets|fclose|printf|(f|s|diag_)printf|calloc|malloc|realloc\@</regex>
</rule> </rule>
<rule name="my type"> <rule name="my type">
<color>type</color> <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> <regex>\@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)\@</regex>
</rule> </rule>
<rule name="my storage keyword"> <rule name="my storage keyword">
<color>storageKeyword</color> <color>storageKeyword</color>
<regex>\b(inline|const|const|extern|register|static|unsigned|signed|volatile|char|double|float|int|long|short|void|typedef|struct|union|enum)\b</regex> <regex>\@inline|const|const|extern|register|static|unsigned|signed|volatile|char|double|float|int|long|short|void|typedef|struct|union|enum\@</regex>
</rule> </rule>
<rule name="my common Define"> <rule name="my common Define">
<color>commonDefine</color> <color>commonDefine</color>
<regex>\b(NULL|MAX|MIN|__(LINE|DATA|FILE|func|TIME|STDC|PRETTY_FUNCTION|FUNCTION)__)\b</regex> <regex>\@NULL|MAX|MIN|__(LINE|DATA|FILE|func|TIME|STDC|PRETTY_FUNCTION|FUNCTION)__\@</regex>
</rule> </rule>
<rule name="numeric constant"> <rule name="numeric constant">
<color>number</color> <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> <regex>\@((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?\@</regex>
</rule> </rule>
<rule name="my boolean"> <rule name="my boolean">
<color>boolean</color> <color>boolean</color>
<regex>\b(TRUE|FALSE)\b</regex> <regex>\@TRUE|FALSE\@</regex>
</rule> </rule>
<rule name="BIG LETTER"> <rule name="BIG LETTER">
<color>macro</color> <color>macro</color>
<regex>\b([A-Z_][A-Z_0-9]{3,500})\b</regex> <regex>\@([A-Z_][A-Z_0-9]{3,500})\@</regex>
</rule> </rule>
<rule name="function input"> <rule name="function input">
<color>inputFunction</color> <color>inputFunction</color>
<regex>\b_\w+\b</regex> <regex>\@_\w+\@</regex>
</rule> </rule>
<rule name="Function name"> <rule name="Function name">
<color>functionName</color> <color>functionName</color>
<regex>\b((\w|_)+[ \t]*\()</regex> <regex>\@((\w|_)+[ \t]*\()</regex>
</rule> </rule>
<rule name="condition"> <rule name="condition">
<color>boolean</color> <color>boolean</color>
@@ -122,7 +122,7 @@
</rule> </rule>
<rule name="function input"> <rule name="function input">
<color>inputFunction</color> <color>inputFunction</color>
<regex>\b_\w+\b</regex> <regex>\@_\w+\@</regex>
</rule> </rule>
</pass> </pass>
<pass name="TODO"> <pass name="TODO">

View File

@@ -5,29 +5,33 @@
<pass1> <pass1>
<rule name="my comment doxygen"> <rule name="my comment doxygen">
<color>commentDoxygen</color> <color>commentDoxygen</color>
<regex>##.*</regex> <regex>##.*$</regex>
</rule> </rule>
<rule name="my todo comment"> <rule name="my todo comment">
<color>SYNTAX_ERROR</color> <color>SYNTAX_ERROR</color>
<regex>#[ \t]TODO[ \t]*:(.|\\[\\\n])*</regex> <regex>#[ \t]TODO[ \t]*:(.|\\[\\\n])*$</regex>
</rule> </rule>
<rule name="my comment"> <rule name="my comment">
<color>comment</color> <color>comment</color>
<regex>#(.|\\[\\\n])*</regex> <regex>#(.|\\[\\\n])*$</regex>
</rule> </rule>
<rule name="doubleQuteText"> <rule name="doubleQuteText">
<color>doubleQuoteText</color> <color>doubleQuoteText</color>
<regex>&quot;(.|\\[\\&quot;])*?&quot;</regex> <regex>&quot;(.|\\[\\&quot;])*?&quot;$</regex>
</rule> </rule>
</pass1> </pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear --> <pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="files path">
<color>memberClass</color>
<regex>\@[0-9a-zA-Z\-\.]+((\.|/)\w)+\@</regex>
</rule>
<rule name="my keyword"> <rule name="my keyword">
<color>keyword</color> <color>keyword</color>
<regex>\b(foreach|message|endforeach|if|else|endif|list|file|string)\b</regex> <regex>\@foreach|message|endforeach|if|else|endif|list|file|string\@</regex>
</rule> </rule>
<rule name="my function keyword"> <rule name="my function keyword">
<color>systemFunction</color> <color>systemFunction</color>
<regex>\b(set|include_directories|add_definitions|add_library|include_directories|target_link_libraries|project|include|check_include_file|enable_testing|option|cmake_minimum_required|add_definitions|check_include_file|configure_file|include_directories|add_custom_command|add_executable|add_test|find_package|pkg_check_modules|set_target_properties|source_group)\b</regex> <regex>\@set|include_directories|add_definitions|add_library|include_directories|target_link_libraries|project|include|check_include_file|enable_testing|option|cmake_minimum_required|add_definitions|check_include_file|configure_file|include_directories|add_custom_command|add_executable|add_test|find_package|pkg_check_modules|set_target_properties|source_group\@</regex>
</rule> </rule>
<rule name="Variable"> <rule name="Variable">
<color>inputFunction</color> <color>inputFunction</color>
@@ -35,19 +39,15 @@
</rule> </rule>
<rule name="numeric constant"> <rule name="numeric constant">
<color>number</color> <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> <regex>\@((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?\@</regex>
</rule> </rule>
<rule name="BIG LETTER"> <rule name="BIG LETTER">
<color>macro</color> <color>macro</color>
<regex>\b([A-Z_][A-Z_0-9]{3,500})\b</regex> <regex>\@[A-Z_][A-Z_0-9]{3,500}\@</regex>
</rule> </rule>
<rule name="Function name"> <rule name="Function name">
<color>functionName</color> <color>functionName</color>
<regex>\b(\w|_)+[ \t]*\(</regex> <regex>\@(\w|_)+[ \t]*\(</regex>
</rule>
<rule name="files path">
<color>memberClass</color>
<regex>[\w-]*(\.|/)\w*</regex>
</rule> </rule>
</pass2> </pass2>
</EdnLang> </EdnLang>

View File

@@ -39,25 +39,25 @@
</rule> </rule>
<rule name="#preproc"> <rule name="#preproc">
<color>preprocesseur</color> <color>preprocesseur</color>
<regex>#(.|\\[\\\n])*</regex> <regex>#(\\[\\\n]|.)*$</regex>
</rule> </rule>
<rule name="inline doxygen"> <rule name="inline doxygen">
<color>commentDoxygen</color> <color>commentDoxygen</color>
<regex>//!.*</regex> <regex>//!.*$</regex>
<sub>doxyparse</sub> <sub>doxyparse</sub>
</rule> </rule>
<rule name="inline comment"> <rule name="inline comment">
<color>comment</color> <color>comment</color>
<regex>//.*</regex> <regex>//.*$</regex>
<sub>TODO</sub> <sub>TODO</sub>
</rule> </rule>
<rule name="double quote text"> <rule name="double quote text">
<color>doubleQuoteText</color> <color>doubleQuoteText</color>
<regex>(U|u|u8)?&quot;(.|\\[\\&quot;])*?&quot;</regex> <!-- " --> <regex>(U|u|u8)?&quot;(\\(n|t|v|b|r|f|a|\\|\?|&quot;|0|o[0-7]{2}|x[0-9a-fA-F]{2}|u[0-9]{4}|U[0-9]{8})|.)*&quot;</regex>
</rule> </rule>
<rule name="simple quote text"> <rule name="simple quote text">
<color>doubleQuoteText</color> <color>doubleQuoteText</color>
<regex>&apos;\\?.&apos;</regex> <regex>&apos;(\\(&apos;|n|t|v|b|r|f|a|\\|\?|0|o[0-7]{2}|x[0-9a-fA-F]{2}|u[0-9]{4}|U[0-9]{8})|[^\n])&apos;</regex>
</rule> </rule>
</pass1> </pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear --> <pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
@@ -67,51 +67,51 @@
</rule> </rule>
<rule name="my keyword"> <rule name="my keyword">
<color>keyword</color> <color>keyword</color>
<regex>\b(return|goto|if|else|case|default|switch|break|continue|while|do|for|sizeof)\b</regex> <regex>\@return|goto|if|else|case|default|switch|break|continue|while|do|for|sizeof\@</regex>
</rule> </rule>
<rule name="my function keyword"> <rule name="my function keyword">
<color>systemFunction</color> <color>systemFunction</color>
<regex>\b(new|delete|try|catch|memset|fopen|fread|fwrite|fgets|fclose|printf|(f|s|diag_)printf|(reinterpret|static|dynamic|const)_cast)\b</regex> <regex>\@new|delete|try|catch|memset|fopen|fread|fwrite|fgets|fclose|printf|(f|s|diag_)printf|(reinterpret|static|dynamic|const)_cast\@</regex>
</rule> </rule>
<rule name="my type"> <rule name="my type">
<color>type</color> <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> <regex>\@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)\@</regex>
</rule> </rule>
<rule name="std type"> <rule name="std type">
<color>type</color> <color>type</color>
<regex>\b(std(11)?|boost)::[\w:]*</regex> <regex>\@std::[a-zA-Z_:][\w:]*\@</regex>
</rule> </rule>
<rule name="my storage keyword"> <rule name="my storage keyword">
<color>storageKeyword</color> <color>storageKeyword</color>
<regex>\b(inline|const|class|namespace|virtual|private|public|protected|friend|const|extern|mutable|auto|register|static|unsigned|signed|volatile|char|double|float|int|long|short|void|typedef|struct|union|enum|override|final)\b</regex> <regex>\@inline|const|class|namespace|virtual|private|public|protected|friend|const|extern|mutable|auto|register|static|unsigned|signed|volatile|char|double|float|int|long|short|void|typedef|struct|union|enum|override|final\@</regex>
</rule> </rule>
<rule name="my common Define"> <rule name="my common Define">
<color>commonDefine</color> <color>commonDefine</color>
<regex>\b(nullptr|__(LINE|DATA|FILE|func|TIME|STDC|PRETTY_FUNCTION|FUNCTION)__)\b</regex> <regex>\@nullptr|__(LINE|DATA|FILE|func|TIME|STDC|PRETTY_FUNCTION|FUNCTION)__\@</regex>
</rule> </rule>
<rule name="numeric constant"> <rule name="numeric constant">
<color>number</color> <color>number</color>
<regex>\b(((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(LL|L|l|UL|ul|u|U|F|f)?)\b</regex> <regex>\@((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(LL|L|l|UL|ul|u|U|F|f)?\@</regex>
</rule> </rule>
<rule name="my boolean"> <rule name="my boolean">
<color>boolean</color> <color>boolean</color>
<regex>\b(true|false)\b</regex> <regex>\@true|false\@</regex>
</rule> </rule>
<rule name="BIG LETTER"> <rule name="BIG LETTER">
<color>macro</color> <color>macro</color>
<regex>\b([A-Z_][A-Z_0-9]{3,500})\b</regex> <regex>\@[A-Z_][A-Z_0-9]{3,500}\@</regex>
</rule> </rule>
<rule name="CPP member"> <rule name="CPP member">
<color>memberClass</color> <color>memberClass</color>
<regex>\b((m|s|p|s|g)_|property|signal)\w+\b</regex> <regex>\@((m|s|p|s|g)_|property|signal)\w+\@</regex>
</rule> </rule>
<rule name="function input"> <rule name="function input">
<color>inputFunction</color> <color>inputFunction</color>
<regex>\b_\w+\b</regex> <regex>\@_\w+\@</regex>
</rule> </rule>
<rule name="Function name"> <rule name="Function name">
<color>functionName</color> <color>functionName</color>
<regex>\b((\w|_)+[ \t]*\()</regex> <regex>\@((\w|_)+[ \t]*\()</regex>
</rule> </rule>
<rule name="condition"> <rule name="condition">
<color>boolean</color> <color>boolean</color>
@@ -125,11 +125,11 @@
<pass name="doxyparse"> <pass name="doxyparse">
<rule name="knownkey"> <rule name="knownkey">
<color>doxygen-key-known</color> <color>doxygen-key-known</color>
<regex>(@|\\)[\t ]*(addindex|addtogroup|anchor|arg|attention|author|authors|a|brief|bug|b|callgraph|category|cite|class|code|cond|copybrief|copydetails|copydoc|copyright|date|def|defgroup|deprecated|details|diafile|dir|docbookonly|dontinclude|dot|dotfile|else|elseif|em|endcode|endcond|enddocbookonly|enddot|endhtmlonly|endif|endinternal|endlatexonly|endlink|endmanonly|endmsc|endparblock|endrtfonly|endsecreflist|endverbatim|enduml|endxmlonly|enum|example|exception|extends|e|file|fn|headerfile|hidecallergraph|hidecallgraph|hideinitializer|htmlinclude|htmlonly|idlexcept|ifnot|if|image|implements|includelineno|include|ingroup|internal|invariant|interface|latexinclude|latexonly|line|link|license|li|mainpage|manonly|memberof|msc|mscfile|name|namespace|nosubgrouping|note|n|overload|package|page|paragraph|param|parblock|par|post|pre|private|privatesection|property|protected|protectedsection|protocol|public|publicsection|pure|p|refitem|ref|related|relates|relatedalso|relatesalso|remark|remarks|result|return|returns|retval|rtfonly|sa|secreflist|section|see|short|showinitializer|since|skip|skipline|snippet|startuml|struct|subpage|subsection|subsubsection|tableofcontents|test|throw|throws|todo|tparam|typedef|union|until|var|verbatim|verbinclude|version|vhdlflow|warning|weakgroup|xmlonly|xrefitem)</regex> <regex>(\@|\\)[\t ]*(addindex|addtogroup|anchor|arg|attention|author|authors|a|brief|bug|b|callgraph|category|cite|class|code|cond|copybrief|copydetails|copydoc|copyright|date|def|defgroup|deprecated|details|diafile|dir|docbookonly|dontinclude|dot|dotfile|else|elseif|em|endcode|endcond|enddocbookonly|enddot|endhtmlonly|endif|endinternal|endlatexonly|endlink|endmanonly|endmsc|endparblock|endrtfonly|endsecreflist|endverbatim|enduml|endxmlonly|enum|example|exception|extends|e|file|fn|headerfile|hidecallergraph|hidecallgraph|hideinitializer|htmlinclude|htmlonly|idlexcept|ifnot|if|image|implements|includelineno|include|ingroup|internal|invariant|interface|latexinclude|latexonly|line|link|license|li|mainpage|manonly|memberof|msc|mscfile|name|namespace|nosubgrouping|note|n|overload|package|page|paragraph|param|parblock|par|post|pre|private|privatesection|property|protected|protectedsection|protocol|public|publicsection|pure|p|refitem|ref|related|relates|relatedalso|relatesalso|remark|remarks|result|return|returns|retval|rtfonly|sa|secreflist|section|see|short|showinitializer|since|skip|skipline|snippet|startuml|struct|subpage|subsection|subsubsection|tableofcontents|test|throw|throws|todo|tparam|typedef|union|until|var|verbatim|verbinclude|version|vhdlflow|warning|weakgroup|xmlonly|xrefitem)</regex>
</rule> </rule>
<rule name="key"> <rule name="key">
<color>doxygen-key</color> <color>doxygen-key</color>
<regex>(@|\\)[\t ]*\w+</regex> <regex>(\@|\\)[\t ]*\w+</regex>
</rule> </rule>
<rule name="in-out"> <rule name="in-out">
<color>doxygen-in-out</color> <color>doxygen-in-out</color>
@@ -137,13 +137,13 @@
</rule> </rule>
<rule name="function input"> <rule name="function input">
<color>inputFunction</color> <color>inputFunction</color>
<regex>\b_\w+\b</regex> <regex>\@_\w+\@</regex>
</rule> </rule>
</pass> </pass>
<pass name="TODO"> <pass name="TODO">
<rule name="function input"> <rule name="function input">
<color>SYNTAX_ERROR</color> <color>SYNTAX_ERROR</color>
<regex>TODO[ \t]*:.*</regex> <regex>TODO[ \t]*:.*$</regex>
</rule> </rule>
</pass> </pass>
</EdnLang> </EdnLang>

View File

@@ -4,15 +4,15 @@
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification --> <pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
<rule name="Not parsed"> <rule name="Not parsed">
<color>normal</color> <color>normal</color>
<regex>( )+-\:.*</regex> <regex>( )+\-:.*</regex>
</rule> </rule>
<rule name="Not executed"> <rule name="Not executed">
<color>SYNTAX_ERROR</color> <color>SYNTAX_ERROR</color>
<regex>( )+(#)+\:.*</regex> <regex>( )+(#)+:.*</regex>
</rule> </rule>
<rule name="Not parsed"> <rule name="Not parsed">
<color>number</color> <color>number</color>
<regex>( )+[0-9]+\:.*</regex> <regex>( )+[0-9]+:.*</regex>
</rule> </rule>
</pass1> </pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear --> <pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->

View File

@@ -43,31 +43,31 @@
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear --> <pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="my keyword"> <rule name="my keyword">
<color>keyword</color> <color>keyword</color>
<regex>\b(return|goto|if|else|case|default|switch|break|continue|while|do|for|sizeof)\b</regex> <regex>\@return|goto|if|else|case|default|switch|break|continue|while|do|for|sizeof\@</regex>
</rule> </rule>
<rule name="my type"> <rule name="my type">
<color>type</color> <color>type</color>
<regex>\b(void|bool|float|int|(vec|mat|ivec|bvec)[2-4])\b</regex> <regex>\@void|bool|float|int|(vec|mat|ivec|bvec)[2-4]\@</regex>
</rule> </rule>
<rule name="my storage keyword"> <rule name="my storage keyword">
<color>storageKeyword</color> <color>storageKeyword</color>
<regex>\b(varying|uniform|attribute|precision|mediump)\b</regex> <regex>\@varying|uniform|attribute|precision|mediump\@</regex>
</rule> </rule>
<rule name="numeric constant"> <rule name="numeric constant">
<color>number</color> <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> <regex>\@((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?\@</regex>
</rule> </rule>
<rule name="my boolean"> <rule name="my boolean">
<color>boolean</color> <color>boolean</color>
<regex>\b(true|false)\b</regex> <regex>\@true|false\@</regex>
</rule> </rule>
<rule name="BIG LETTER"> <rule name="BIG LETTER">
<color>macro</color> <color>macro</color>
<regex>\b([A-Z_][A-Z_0-9]{3,500})\b</regex> <regex>\@[A-Z_][A-Z_0-9]{3,500}\@</regex>
</rule> </rule>
<rule name="Function name"> <rule name="Function name">
<color>functionName</color> <color>functionName</color>
<regex>\b(\w|_)+[ \t]*\(</regex> <regex>\@(\w|_)+[ \t]*\(</regex>
</rule> </rule>
<rule name="condition"> <rule name="condition">
<color>boolean</color> <color>boolean</color>

View File

@@ -4,33 +4,33 @@
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification --> <pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
<rule name="my preprocesseur"> <rule name="my preprocesseur">
<color>preprocesseur</color> <color>preprocesseur</color>
<regex>#(.|\\[\\\n])*?$</regex> <regex>#(.|\\[\\\n])*$</regex>
</rule> </rule>
<rule name="doubleQuteText"> <rule name="doubleQuteText">
<color>doubleQuoteText</color> <color>doubleQuoteText</color>
<regex>&quot;(.|\\[\\&quot;])*?$</regex> <regex>&quot;(.|\\[\\&quot;])*$</regex>
</rule> </rule>
<rule name="simpleQuteText"> <rule name="simpleQuteText">
<color>doubleQuoteText</color> <color>doubleQuoteText</color>
<regex>&apos;(.|\\[\\&apos;])*?$</regex> <regex>&apos;(.|\\[\\&apos;])*$</regex>
</rule> </rule>
</pass1> </pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear --> <pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="my keyword"> <rule name="my keyword">
<color>keyword</color> <color>keyword</color>
<regex>\b(menu|endmenu|comment|if|endif|help|default|choice|endchoice|prompt|depends on|config)\b</regex> <regex>\@menu|endmenu|comment|if|endif|help|default|choice|endchoice|prompt|depends on|config\@</regex>
</rule> </rule>
<rule name="my type"> <rule name="my type">
<color>type</color> <color>type</color>
<regex>\b(int|hex|bool|string)\b</regex> <regex>\@int|hex|bool|string\@</regex>
</rule> </rule>
<rule name="numeric constant"> <rule name="numeric constant">
<color>number</color> <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> <regex>\@((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?\@</regex>
</rule> </rule>
<rule name="BIG LETTER"> <rule name="BIG LETTER">
<color>macro</color> <color>macro</color>
<regex>\b([A-Z_][A-Z_0-9]{3,500})\b</regex> <regex>\@[A-Z_][A-Z_0-9]{3,500}\@</regex>
</rule> </rule>
<rule name="condition"> <rule name="condition">
<color>boolean</color> <color>boolean</color>

View File

@@ -36,7 +36,7 @@
</rule> </rule>
<rule name="double quote text"> <rule name="double quote text">
<color>doubleQuoteText</color> <color>doubleQuoteText</color>
<regex>(U|u|u8)?&quot;(.|\\[\\&quot;])*?&quot;</regex> <!-- " --> <regex>(U|u|u8)?&quot;(.|\\[\\&quot;])*&quot;</regex> <!-- " -->
</rule> </rule>
<rule name="simple quote text"> <rule name="simple quote text">
<color>doubleQuoteText</color> <color>doubleQuoteText</color>
@@ -46,47 +46,47 @@
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear --> <pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="my keyword"> <rule name="my keyword">
<color>keyword</color> <color>keyword</color>
<regex>\b(return|goto|if|else|case|default|switch|break|continue|while|do|for)\b</regex> <regex>\@return|goto|if|else|case|default|switch|break|continue|while|do|for\@</regex>
</rule> </rule>
<rule name="my function keyword"> <rule name="my function keyword">
<color>systemFunction</color> <color>systemFunction</color>
<regex>\b(new|try|catch|print)\b</regex> <regex>\@new|try|catch|print\@</regex>
</rule> </rule>
<rule name="my type"> <rule name="my type">
<color>type</color> <color>type</color>
<regex>\b(boolean|byte|char|double|float|int|long|short|String|Object|Thread|void|enum)\b</regex> <regex>\@boolean|byte|char|double|float|int|long|short|String|Object|Thread|void|enum\@</regex>
</rule> </rule>
<rule name="my storage keyword"> <rule name="my storage keyword">
<color>storageKeyword</color> <color>storageKeyword</color>
<regex>\b(import|package|extends|Override|implements|const|class|abstract|private|public|protected|final|const|static|transiant|volatile|interface)\b</regex> <regex>\@import|package|extends|Override|implements|const|class|abstract|private|public|protected|final|const|static|transiant|volatile|interface@</regex>
</rule> </rule>
<rule name="my common Define"> <rule name="my common Define">
<color>commonDefine</color> <color>commonDefine</color>
<regex>\bnull\b</regex> <regex>\@null\@</regex>
</rule> </rule>
<rule name="numeric constant"> <rule name="numeric constant">
<color>number</color> <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> <regex>\@((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?\@</regex>
</rule> </rule>
<rule name="my boolean"> <rule name="my boolean">
<color>boolean</color> <color>boolean</color>
<regex>\b(true|false)\b</regex> <regex>\@true|false\@</regex>
</rule> </rule>
<rule name="BIG LETTER"> <rule name="BIG LETTER">
<color>macro</color> <color>macro</color>
<regex>\b[A-Z_][A-Z_0-9]{3,500}\b</regex> <regex>\@[A-Z_][A-Z_0-9]{3,500}\@</regex>
</rule> </rule>
<rule name="java member"> <rule name="java member">
<color>memberClass</color> <color>memberClass</color>
<regex>\bm_\w+\b</regex> <regex>\@m_\w+\@</regex>
</rule> </rule>
<rule name="function input"> <rule name="function input">
<color>inputFunction</color> <color>inputFunction</color>
<regex>\b_\w+\b</regex> <regex>\@_\w+\@</regex>
</rule> </rule>
<rule name="Function name"> <rule name="Function name">
<color>functionName</color> <color>functionName</color>
<regex>\b((\w|_)+[ \t]*\()</regex> <regex>\@((\w|_)+[ \t]*\()</regex>
</rule> </rule>
<rule name="condition"> <rule name="condition">
<color>boolean</color> <color>boolean</color>
@@ -96,7 +96,7 @@
<pass name="doxyparse"> <pass name="doxyparse">
<rule name="key"> <rule name="key">
<color>doxygen-key</color> <color>doxygen-key</color>
<regex>(@|\\)[\t ]*\w+</regex> <regex>(\@|\\)[\t ]*\w+</regex>
</rule> </rule>
<rule name="in-out"> <rule name="in-out">
<color>doxygen-in-out</color> <color>doxygen-in-out</color>
@@ -104,7 +104,7 @@
</rule> </rule>
<rule name="function input"> <rule name="function input">
<color>inputFunction</color> <color>inputFunction</color>
<regex>\b_\w+\b</regex> <regex>\@_\w+\@</regex>
</rule> </rule>
</pass> </pass>
<pass name="TODO"> <pass name="TODO">

View File

@@ -22,15 +22,15 @@
</rule> </rule>
<rule name="names"> <rule name="names">
<color>functionName</color> <color>functionName</color>
<regex>([a-zA-Z0-9]|-|_)+</regex> <regex>[a-zA-Z0-9\-_]+</regex>
</rule> </rule>
<rule name="numeric constant"> <rule name="numeric constant">
<color>number</color> <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> <regex>\@((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?\@</regex>
</rule> </rule>
<rule name="my boolean"> <rule name="my boolean">
<color>boolean</color> <color>boolean</color>
<regex>\b(true|false)\b</regex> <regex>\@true|false\@</regex>
</rule> </rule>
</pass2> </pass2>
</EdnLang> </EdnLang>

View File

@@ -11,41 +11,41 @@
</rule> </rule>
<rule name="my todo comment"> <rule name="my todo comment">
<color>SYNTAX_ERROR</color> <color>SYNTAX_ERROR</color>
<regex>\-\-[ \t]*TODO[ \t]*:(.|\\[\\\n])*?$</regex> <regex>\-\-[ \t]*TODO[ \t]*:(.|\\[\\\n])*$</regex>
</rule> </rule>
<rule name="my comment"> <rule name="my comment">
<color>comment</color> <color>comment</color>
<regex>\-\-(.|\\[\\\n])*?$</regex> <regex>\-\-(.|\\[\\\n])*$</regex>
</rule> </rule>
<rule name="doubleQuteText"> <rule name="doubleQuteText">
<color>doubleQuoteText</color> <color>doubleQuoteText</color>
<regex>&quot;(.|\\[\\&quot;])*?&quot;</regex> <regex>&quot;(.|\\[\\&quot;])*&quot;</regex>
</rule> </rule>
<rule name="simpleQuteText"> <rule name="simpleQuteText">
<color>doubleQuoteText</color> <color>doubleQuoteText</color>
<regex>&apos;(.|\\[\\&apos;])*?&apos;</regex> <regex>&apos;(.|\\[\\&apos;])*&apos;</regex>
</rule> </rule>
</pass1> </pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear --> <pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="my keyword"> <rule name="my keyword">
<color>keyword</color> <color>keyword</color>
<regex>\b(and|break|do|else|elseif|end|for|function|if|in|local|nil|not|or|repeat|return|then|until|while)\b</regex> <regex>\@and|break|do|else|elseif|end|for|function|if|in|local|nil|not|or|repeat|return|then|until|while\@</regex>
</rule> </rule>
<rule name="numeric constant"> <rule name="numeric constant">
<color>number</color> <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> <regex>\@((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?\@</regex>
</rule> </rule>
<rule name="my boolean"> <rule name="my boolean">
<color>boolean</color> <color>boolean</color>
<regex>\b(true|false)\b</regex> <regex>\@true|false\@</regex>
</rule> </rule>
<rule name="BIG LETTER"> <rule name="BIG LETTER">
<color>macro</color> <color>macro</color>
<regex>\b([A-Z_][A-Z_0-9]{3,500})\b</regex> <regex>\@[A-Z_][A-Z_0-9]{3,500}\@</regex>
</rule> </rule>
<rule name="Function name"> <rule name="Function name">
<color>functionName</color> <color>functionName</color>
<regex>\b(\w|_)+[ \t]*\(</regex> <regex>\@(\w|_)+[ \t]*\(</regex>
</rule> </rule>
<rule name="condition"> <rule name="condition">
<color>boolean</color> <color>boolean</color>

View File

@@ -5,25 +5,25 @@
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification --> <pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
<rule name="my preprocesseur"> <rule name="my preprocesseur">
<color>preprocesseur</color> <color>preprocesseur</color>
<regex>#(.|\\[\\\n])*?$</regex> <regex>#(.|\\[\\\n])*$</regex>
</rule> </rule>
<rule name="doubleQuteText"> <rule name="doubleQuteText">
<color>doubleQuoteText</color> <color>doubleQuoteText</color>
<regex>&quot;(.|\\[\\&quot;])*?&quot;</regex> <regex>&quot;(.|\\[\\&quot;])*&quot;</regex>
</rule> </rule>
<rule name="simpleQuteText"> <rule name="simpleQuteText">
<color>doubleQuoteText</color> <color>doubleQuoteText</color>
<regex>&apos;(.|\\[\\&apos;])*?&apos;</regex> <regex>&apos;(.|\\[\\&apos;])*&apos;</regex>
</rule> </rule>
</pass1> </pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear --> <pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="confition"> <rule name="confition">
<color>type</color> <color>type</color>
<regex>\b(if|ifeq|ifneq|else|endif|define|endef)\b</regex> <regex>\@if|ifeq|ifneq|else|endif|define|endef\@</regex>
</rule> </rule>
<rule name="my keyword"> <rule name="my keyword">
<color>keyword</color> <color>keyword</color>
<regex>\b\([a-zA-Z_][a-zA-Z0-9_]*\)</regex> <regex>\$\([a-zA-Z_][a-zA-Z0-9_]*\)</regex>
</rule> </rule>
<rule name="function call"> <rule name="function call">
<color>functionName</color> <color>functionName</color>

View File

@@ -4,37 +4,37 @@
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification --> <pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
<rule name="my comment doxygen"> <rule name="my comment doxygen">
<color>commentDoxygen</color> <color>commentDoxygen</color>
<regex>%%(.|\\[\\\n])*?$</regex> <regex>%%(.|\\[\\\n])*$</regex>
</rule> </rule>
<rule name="my comment"> <rule name="my comment">
<color>comment</color> <color>comment</color>
<regex>%(.|\\[\\\n])*?$</regex> <regex>%(.|\\[\\\n])*$</regex>
</rule> </rule>
<rule name="doubleQuteText"> <rule name="doubleQuteText">
<color>doubleQuoteText</color> <color>doubleQuoteText</color>
<regex> &quot;.*?($|&quot;)</regex> <regex> &quot;.*($|&quot;)</regex>
</rule> </rule>
<rule name="simpleQuteText"> <rule name="simpleQuteText">
<color>doubleQuoteText</color> <color>doubleQuoteText</color>
<regex> &apos;.*?($|&apos;)</regex> <regex> &apos;.*($|&apos;)</regex>
</rule> </rule>
<rule name="global inclusion"> <rule name="global inclusion">
<color>preprocesseur</color> <color>preprocesseur</color>
<regex>global( |\t)+(.|\\[\\\n])*?$</regex> <regex>global( |\t)+(.|\\[\\\n])*$</regex>
</rule> </rule>
</pass1> </pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear --> <pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="my keyword"> <rule name="my keyword">
<color>keyword</color> <color>keyword</color>
<regex>\b(return|goto|if|else|case|default|switch|break|continue|while|do|for|otherwise|end)\b</regex> <regex>\@return|goto|if|else|case|default|switch|break|continue|while|do|for|otherwise|end\@</regex>
</rule> </rule>
<rule name="my boolean"> <rule name="my boolean">
<color>boolean</color> <color>boolean</color>
<regex>\b(true|false)\b</regex> <regex>\@true|false\@</regex>
</rule> </rule>
<rule name="Function name"> <rule name="Function name">
<color>functionName</color> <color>functionName</color>
<regex>\b(\w|_)+[ \t]*\(</regex> <regex>\@(\w|_)+[ \t]*\(</regex>
</rule> </rule>
<rule name="condition"> <rule name="condition">
<color>boolean</color> <color>boolean</color>
@@ -42,11 +42,11 @@
</rule> </rule>
<rule name="numeric constant"> <rule name="numeric constant">
<color>number</color> <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> <regex>\@((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?\@</regex>
</rule> </rule>
<rule name="BIG LETTER"> <rule name="BIG LETTER">
<color>macro</color> <color>macro</color>
<regex>\b([A-Z_][A-Z_0-9]{3,500})\b</regex> <regex>\@[A-Z_][A-Z_0-9]{3,500}\@</regex>
</rule> </rule>
</pass2> </pass2>
</EdnLang> </EdnLang>

View File

@@ -36,11 +36,11 @@
</rule> </rule>
<rule name="doubleQuteText"> <rule name="doubleQuteText">
<color>doubleQuoteText</color> <color>doubleQuoteText</color>
<regex>&quot;(.|\\[\\&quot;])*?&quot;</regex> <regex>&quot;(.|\\[\\&quot;])*&quot;</regex>
</rule> </rule>
<rule name="simpleQuteText"> <rule name="simpleQuteText">
<color>doubleQuoteText</color> <color>doubleQuoteText</color>
<regex>&apos;(.|\\[\\&apos;])*?&apos;</regex> <regex>&apos;(.|\\[\\&apos;])*&apos;</regex>
</rule> </rule>
</pass1> </pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear --> <pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
@@ -54,27 +54,27 @@
</rule> </rule>
<rule name="my keyword"> <rule name="my keyword">
<color>keyword</color> <color>keyword</color>
<regex>\$[a-zA-Z_][a-zA-Z0-9_]*\b</regex> <regex>\$[a-zA-Z_][a-zA-Z0-9_]*\@</regex>
</rule> </rule>
<rule name="my type"> <rule name="my type">
<color>type</color> <color>type</color>
<regex>\b(array|bool|boolean|double|float|int|integer|numeric|object|resource|string|unset)\b</regex> <regex>\@array|bool|boolean|double|float|int|integer|numeric|object|resource|string|unset\@</regex>
</rule> </rule>
<rule name="my storage keyword"> <rule name="my storage keyword">
<color>storageKeyword</color> <color>storageKeyword</color>
<regex>\b(abstract|and|as|break|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|interface|isset|list|namespace|new|or|print|private|protected|public|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|xor)\b</regex> <regex>\@abstract|and|as|break|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|interface|isset|list|namespace|new|or|print|private|protected|public|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|xor\@</regex>
</rule> </rule>
<rule name="my common Define"> <rule name="my common Define">
<color>commonDefine</color> <color>commonDefine</color>
<regex>\b(doubleval|floatval|gettype|intval|print_r|serialize|settype|strval|unserialize|var_dump|var_export)\b</regex> <regex>\@doubleval|floatval|gettype|intval|print_r|serialize|settype|strval|unserialize|var_dump|var_export\@</regex>
</rule> </rule>
<rule name="numeric constant"> <rule name="numeric constant">
<color>number</color> <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> <regex>\@((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?\@</regex>
</rule> </rule>
<rule name="my boolean"> <rule name="my boolean">
<color>boolean</color> <color>boolean</color>
<regex>\b(TRUE|FALSE)\b</regex> <regex>\@TRUE|FALSE\@</regex>
</rule> </rule>
<rule name="BIG LETTER"> <rule name="BIG LETTER">
<color>macro</color> <color>macro</color>
@@ -82,7 +82,7 @@
</rule> </rule>
<rule name="Function name"> <rule name="Function name">
<color>functionName</color> <color>functionName</color>
<regex>\b\w+[ \t]*\(</regex> <regex>\@(\w|_)+[ \t]*\(</regex>
</rule> </rule>
<rule name="condition"> <rule name="condition">
<color>boolean</color> <color>boolean</color>
@@ -108,7 +108,7 @@
</rule> </rule>
<rule name="function input"> <rule name="function input">
<color>inputFunction</color> <color>inputFunction</color>
<regex>\b_\w+\b</regex> <regex>\@_\w+\@</regex>
</rule> </rule>
</pass> </pass>
<pass name="TODO"> <pass name="TODO">

View File

@@ -34,11 +34,11 @@
</rule> </rule>
<rule name="doubleQuteText"> <rule name="doubleQuteText">
<color>doubleQuoteText</color> <color>doubleQuoteText</color>
<regex>&quot;(.|\\[\\&quot;])*?&quot;</regex> <regex>&quot;(.|\\[\\&quot;])*&quot;</regex>
</rule> </rule>
<rule name="simpleQuteText"> <rule name="simpleQuteText">
<color>doubleQuoteText</color> <color>doubleQuoteText</color>
<regex>&apos;((\\[\\&apos;])|.)*?&apos;</regex> <regex>&apos;((\\[\\&apos;])|.)*&apos;</regex>
</rule> </rule>
<rule name="internalParameter"> <rule name="internalParameter">
<color>normal</color> <color>normal</color>
@@ -47,48 +47,48 @@
</rule> </rule>
<rule name="Function name private"> <rule name="Function name private">
<color>functionNamePrivate</color> <color>functionNamePrivate</color>
<regex>\b_(\w|_)+[ \t]*\(</regex> <regex>\@_(\w|_)+[ \t]*\(</regex>
<sub>checkCamelCaseError</sub> <sub>checkCamelCaseError</sub>
</rule> </rule>
<rule name="Function name"> <rule name="Function name">
<color>functionName</color> <color>functionName</color>
<regex>\b(\w|_)+[ \t]*\(</regex> <regex>\@(\w|_)+[ \t]*\(</regex>
<sub>checkCamelCaseError</sub> <sub>checkCamelCaseError</sub>
</rule> </rule>
<rule name="function input"> <rule name="function input">
<color>inputFunction</color> <color>inputFunction</color>
<regex>\b_(\w|_)+\b</regex> <regex>\@_(\w|_)+\@</regex>
<sub>checkCamelCaseError</sub> <sub>checkCamelCaseError</sub>
</rule> </rule>
</pass1> </pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear --> <pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="my keyword"> <rule name="my keyword">
<color>keyword</color> <color>keyword</color>
<regex>\b(if|else|elif|break|pass|continue|while|do|for|in|return)\b</regex> <regex>\@if|else|elif|break|pass|continue|while|do|for|in|return\@</regex>
</rule> </rule>
<rule name="my function keyword"> <rule name="my function keyword">
<color>systemFunction</color> <color>systemFunction</color>
<regex>\b(print|len|range|del|__init__|self|os\.|sys\.|path\.)\b</regex> <regex>\@print|len|range|del|__init__|self|os\.|sys\.|path\.\@</regex>
</rule> </rule>
<rule name="my type"> <rule name="my type">
<color>type</color> <color>type</color>
<regex>\b(bool|BOOL|char|double|float)\b</regex> <regex>\@bool|BOOL|char|double|float\@</regex>
</rule> </rule>
<rule name="my storage keyword"> <rule name="my storage keyword">
<color>storageKeyword</color> <color>storageKeyword</color>
<regex>\b(def|class|import|from|as|try|except)\b</regex> <regex>\@def|class|import|from|as|try|except\@</regex>
</rule> </rule>
<rule name="numeric constant"> <rule name="numeric constant">
<color>number</color> <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> <regex>\@((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?\@</regex>
</rule> </rule>
<rule name="my boolean"> <rule name="my boolean">
<color>boolean</color> <color>boolean</color>
<regex>\b(True|False)\b</regex> <regex>\@True|False\@</regex>
</rule> </rule>
<rule name="BIG LETTER"> <rule name="BIG LETTER">
<color>macro</color> <color>macro</color>
<regex>\b([A-Z_][A-Z_0-9]{3,500})\b</regex> <regex>\@[A-Z_][A-Z_0-9]{3,500}\@</regex>
</rule> </rule>
<rule name="condition"> <rule name="condition">
<color>boolean</color> <color>boolean</color>
@@ -102,11 +102,11 @@
<pass name="doxyparse"> <pass name="doxyparse">
<rule name="knownkey"> <rule name="knownkey">
<color>doxygen-key-known</color> <color>doxygen-key-known</color>
<regex>(@|\\)[\t ]*(addindex|addtogroup|anchor|arg|attention|author|authors|a|brief|bug|b|callgraph|category|cite|class|code|cond|copybrief|copydetails|copydoc|copyright|date|def|defgroup|deprecated|details|diafile|dir|docbookonly|dontinclude|dot|dotfile|else|elseif|em|endcode|endcond|enddocbookonly|enddot|endhtmlonly|endif|endinternal|endlatexonly|endlink|endmanonly|endmsc|endparblock|endrtfonly|endsecreflist|endverbatim|enduml|endxmlonly|enum|example|exception|extends|e|file|fn|headerfile|hidecallergraph|hidecallgraph|hideinitializer|htmlinclude|htmlonly|idlexcept|ifnot|if|image|implements|includelineno|include|ingroup|internal|invariant|interface|latexinclude|latexonly|line|link|license|li|mainpage|manonly|memberof|msc|mscfile|name|namespace|nosubgrouping|note|n|overload|package|page|paragraph|param|parblock|par|post|pre|private|privatesection|property|protected|protectedsection|protocol|public|publicsection|pure|p|refitem|ref|related|relates|relatedalso|relatesalso|remark|remarks|result|return|returns|retval|rtfonly|sa|secreflist|section|see|short|showinitializer|since|skip|skipline|snippet|startuml|struct|subpage|subsection|subsubsection|tableofcontents|test|throw|throws|todo|tparam|typedef|union|until|var|verbatim|verbinclude|version|vhdlflow|warning|weakgroup|xmlonly|xrefitem)</regex> <regex>(\@|\\)[\t ]*(addindex|addtogroup|anchor|arg|attention|author|authors|a|brief|bug|b|callgraph|category|cite|class|code|cond|copybrief|copydetails|copydoc|copyright|date|def|defgroup|deprecated|details|diafile|dir|docbookonly|dontinclude|dot|dotfile|else|elseif|em|endcode|endcond|enddocbookonly|enddot|endhtmlonly|endif|endinternal|endlatexonly|endlink|endmanonly|endmsc|endparblock|endrtfonly|endsecreflist|endverbatim|enduml|endxmlonly|enum|example|exception|extends|e|file|fn|headerfile|hidecallergraph|hidecallgraph|hideinitializer|htmlinclude|htmlonly|idlexcept|ifnot|if|image|implements|includelineno|include|ingroup|internal|invariant|interface|latexinclude|latexonly|line|link|license|li|mainpage|manonly|memberof|msc|mscfile|name|namespace|nosubgrouping|note|n|overload|package|page|paragraph|param|parblock|par|post|pre|private|privatesection|property|protected|protectedsection|protocol|public|publicsection|pure|p|refitem|ref|related|relates|relatedalso|relatesalso|remark|remarks|result|return|returns|retval|rtfonly|sa|secreflist|section|see|short|showinitializer|since|skip|skipline|snippet|startuml|struct|subpage|subsection|subsubsection|tableofcontents|test|throw|throws|todo|tparam|typedef|union|until|var|verbatim|verbinclude|version|vhdlflow|warning|weakgroup|xmlonly|xrefitem)</regex>
</rule> </rule>
<rule name="key"> <rule name="key">
<color>doxygen-key</color> <color>doxygen-key</color>
<regex>(@|\\)[\t ]*\w+</regex> <regex>(\@|\\)[\t ]*\w+</regex>
</rule> </rule>
<rule name="in-out"> <rule name="in-out">
<color>doxygen-in-out</color> <color>doxygen-in-out</color>
@@ -114,7 +114,7 @@
</rule> </rule>
<rule name="function input"> <rule name="function input">
<color>inputFunction</color> <color>inputFunction</color>
<regex>\b_\w+\b</regex> <regex>\@_\w+\@</regex>
</rule> </rule>
</pass> </pass>
<pass name="TODO"> <pass name="TODO">

View File

@@ -18,7 +18,7 @@
</rule> </rule>
<rule name="stop balise"> <rule name="stop balise">
<color>functionName</color> <color>functionName</color>
<regex>&lt;/[ \t]*\w+?[ \t]*&gt;</regex> <regex>&lt;/[ \t]*\w+[ \t]*&gt;</regex>
</rule> </rule>
<rule name="stop balise"> <rule name="stop balise">
<color>SYNTAX_ERROR</color> <color>SYNTAX_ERROR</color>
@@ -53,7 +53,7 @@
</rule> </rule>
<rule name="open balise"> <rule name="open balise">
<color>functionName</color> <color>functionName</color>
<regex>&lt;[ \t]*[0-9a-zA-Z_]+</regex> <regex>&lt;[ \t]*[0-9a-zA-Z_]+\@</regex>
</rule> </rule>
<rule name="close balise"> <rule name="close balise">
<color>functionName</color> <color>functionName</color>
@@ -61,11 +61,11 @@
</rule> </rule>
<rule name="doubleQuteText"> <rule name="doubleQuteText">
<color>doubleQuoteText</color> <color>doubleQuoteText</color>
<regex>&quot;(.|\r|\n|\\\\|\\&quot;)*?&quot;</regex> <regex>&quot;(\r|\n|\\\\|\\&quot;|.)*&quot;</regex>
</rule> </rule>
<rule name="simpleQuteText"> <rule name="simpleQuteText">
<color>doubleQuoteText</color> <color>doubleQuoteText</color>
<regex>\b&apos;(.|\r|\n)*?(&apos;|\n)</regex> <regex>\@&apos;(\r|\n)*?(&apos;|\n|.)</regex>
</rule> </rule>
<rule name="condition"> <rule name="condition">
<color>boolean</color> <color>boolean</color>

View File

@@ -30,25 +30,25 @@
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear --> <pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="my type"> <rule name="my type">
<color>type</color> <color>type</color>
<regex>\b(import|void|bool|string|int(8|16|32|64)|uint(8|16|32|64)|float(32|64)|vector\:(bool|string|int(8|16|32|64)|uint(8|16|32|64)|float(32|64))|time|duration|file|stream)\b</regex> <regex>\@import|void|bool|string|int(8|16|32|64)|uint(8|16|32|64)|float(32|64)|vector:(bool|string|int(8|16|32|64)|uint(8|16|32|64)|float(32|64))|time|duration|file|stream\@</regex>
</rule> </rule>
<rule name="numeric constant"> <rule name="numeric constant">
<color>number</color> <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> <regex>\@((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?\@</regex>
</rule> </rule>
<rule name="Function name"> <rule name="Function name">
<color>functionName</color> <color>functionName</color>
<regex>\b((\w|_)+[ \t]*\()</regex> <regex>\@((\w|_)+[ \t]*\()</regex>
</rule> </rule>
</pass2> </pass2>
<pass name="docparse"> <pass name="docparse">
<rule name="knownkey"> <rule name="knownkey">
<color>doxygen-key-known</color> <color>doxygen-key-known</color>
<regex>(srv-brief|srv-version|srv-type|srv-author|brief|param|return|note):</regex> <regex>(srv\-brief|srv\-version|srv\-type|srv\-author|brief|param|return|note):</regex>
</rule> </rule>
<rule name="function input"> <rule name="function input">
<color>inputFunction</color> <color>inputFunction</color>
<regex>\b\w+\:\b</regex> <regex>\@\w+:\@</regex>
</rule> </rule>
</pass> </pass>
<pass name="TODO"> <pass name="TODO">

View File

@@ -145,21 +145,14 @@ bool appl::Buffer::loadFile(const std::string& _name) {
m_cursorPos = 0; m_cursorPos = 0;
setHighlightType(""); setHighlightType("");
m_nbLines = 0; m_nbLines = 0;
if (file.exist() == false) { if (m_data.dumpFrom(m_fileName) == true ) {
APPL_ERROR("File : '" << m_fileName << "' does not exist...");
return false;
}
if (file.fileOpenRead() == false) {
APPL_ERROR("File : '" << m_fileName << "' Fail to open in read mode");
return false;
}
m_data = file.fileReadAllString();
file.fileClose();
countNumberofLine(); countNumberofLine();
tryFindHighlightType(); tryFindHighlightType();
m_isModify = false; m_isModify = false;
return true; return true;
} }
return false;
}
void appl::Buffer::setFileName(const std::string& _name) { void appl::Buffer::setFileName(const std::string& _name) {
APPL_DEBUG("Convert filename :'" << _name << "'"); APPL_DEBUG("Convert filename :'" << _name << "'");
@@ -175,17 +168,13 @@ void appl::Buffer::setFileName(const std::string& _name) {
} }
bool appl::Buffer::storeFile() { bool appl::Buffer::storeFile() {
etk::FSNode file(m_fileName); if (m_data.dumpIn(m_fileName) == true) {
if (file.fileOpenWrite() == false) {
APPL_ERROR("File : '" << m_fileName << "' Fail to open in write mode");
return false;
}
file.fileWriteAll(m_data);
file.fileClose();
APPL_INFO("saving file : " << m_fileName); APPL_INFO("saving file : " << m_fileName);
setModification(false); setModification(false);
return true; return true;
} }
return false;
}
void appl::Buffer::setModification(bool _status) { void appl::Buffer::setModification(bool _status) {
if (m_isModify == _status) { if (m_isModify == _status) {
@@ -642,7 +631,7 @@ bool appl::Buffer::write(const std::string& _data, const appl::Buffer::Iterator&
position = 0; position = 0;
} }
APPL_VERBOSE("write at pos: " << (int64_t)_pos << " ==> " << position << " data : " << _data); APPL_VERBOSE("write at pos: " << (int64_t)_pos << " ==> " << position << " data : " << _data);
m_data.insert((size_t)position, _data); m_data.insert(position, (int8_t*)(_data.c_str()), _data.size());
if (m_cursorPos < 0) { if (m_cursorPos < 0) {
m_cursorPos = 0; m_cursorPos = 0;
} }
@@ -659,7 +648,7 @@ bool appl::Buffer::replace(const std::string& _data, const appl::Buffer::Iterato
if (position < 0){ if (position < 0){
position = 0; position = 0;
} }
m_data.replace(m_data.begin() + position, m_data.begin() + (int64_t)_posEnd, _data.begin(), _data.end()); m_data.replace(position, (int64_t)_posEnd-(int64_t)_pos, (int8_t*)(_data.c_str()), _data.size());
regenerateHighLightAt(position, (int64_t)_posEnd-(int64_t)_pos, _data.size()); regenerateHighLightAt(position, (int64_t)_posEnd-(int64_t)_pos, _data.size());
m_selectMode = false; m_selectMode = false;
moveCursor(position+_data.size()); moveCursor(position+_data.size());
@@ -674,7 +663,7 @@ void appl::Buffer::removeSelection() {
} }
int64_t startPos = getStartSelectionPos(); int64_t startPos = getStartSelectionPos();
int64_t endPos = getStopSelectionPos(); int64_t endPos = getStopSelectionPos();
m_data.erase(startPos, endPos-startPos); m_data.remove(startPos, endPos-startPos);
regenerateHighLightAt(startPos, endPos-startPos, 0); regenerateHighLightAt(startPos, endPos-startPos, 0);
m_selectMode = false; m_selectMode = false;
moveCursor(startPos); moveCursor(startPos);

View File

@@ -8,6 +8,7 @@
#include <etk/types.hpp> #include <etk/types.hpp>
#include <etk/os/FSNode.hpp> #include <etk/os/FSNode.hpp>
#include <ewol/ewol.hpp> #include <ewol/ewol.hpp>
#include <etk/Buffer.hpp>
#include <ewol/object/Object.hpp> #include <ewol/object/Object.hpp>
#include <ewol/widget/Widget.hpp> #include <ewol/widget/Widget.hpp>
#include <ewol/compositing/Text.hpp> #include <ewol/compositing/Text.hpp>
@@ -346,9 +347,9 @@ namespace appl {
*/ */
void setModification(bool _status); void setModification(bool _status);
protected: protected:
std::string m_data; //!< copy of the file buffer etk::Buffer m_data; //!< copy of the file buffer
public: public:
std::string& getData() { etk::Buffer& getData() {
return m_data; return m_data;
}; };
protected: protected:

View File

@@ -123,6 +123,7 @@ appl::Highlight::~Highlight() {
bool appl::Highlight::isCompatible(const std::string& _name) { bool appl::Highlight::isCompatible(const std::string& _name) {
for (auto &it : m_listExtentions) { for (auto &it : m_listExtentions) {
APPL_DEBUG(" check : " << it << "=?=" << _name); APPL_DEBUG(" check : " << it << "=?=" << _name);
// TODO: Remove dependency with the std::regex ...
std::regex expression; std::regex expression;
try { try {
expression.assign(it, std::regex_constants::optimize | std::regex_constants::ECMAScript); expression.assign(it, std::regex_constants::optimize | std::regex_constants::ECMAScript);
@@ -135,7 +136,7 @@ bool appl::Highlight::isCompatible(const std::string& _name) {
if (resultMatch.size() <= 0) { if (resultMatch.size() <= 0) {
continue; continue;
} }
APPL_VERBOSE(" - begin=" << std::distance(_name.begin(), resultMatch[0].first) << " end=" << std::distance(_name.begin(), resultMatch[0].second)); APPL_DEBUG(" - begin=" << std::distance(_name.begin(), resultMatch[0].first) << " end=" << std::distance(_name.begin(), resultMatch[0].second));
if (resultMatch[0].first != _name.begin()) { if (resultMatch[0].first != _name.begin()) {
continue; continue;
} }
@@ -198,7 +199,7 @@ void appl::Highlight::parse(int64_t _start,
int64_t _stop, int64_t _stop,
std::vector<appl::HighlightInfo> & _metaData, std::vector<appl::HighlightInfo> & _metaData,
int64_t _addingPos, int64_t _addingPos,
std::string& _buffer) { etk::Buffer& _buffer) {
if (0 > _addingPos) { if (0 > _addingPos) {
_addingPos = 0; _addingPos = 0;
} }
@@ -278,7 +279,7 @@ void appl::Highlight::parse(int64_t _start,
void appl::Highlight::parse2(int64_t _start, void appl::Highlight::parse2(int64_t _start,
int64_t _stop, int64_t _stop,
std::vector<appl::HighlightInfo>& _metaData, std::vector<appl::HighlightInfo>& _metaData,
std::string& _buffer) { etk::Buffer& _buffer) {
HL2_DEBUG("Parse element 0 => " << m_listHighlightPass2.size() << HL2_DEBUG("Parse element 0 => " << m_listHighlightPass2.size() <<
" == > position search: (" << _start << "," << _stop << ")" ); " == > position search: (" << _start << "," << _stop << ")" );
int64_t elementStart = _start; int64_t elementStart = _start;
@@ -286,21 +287,20 @@ void appl::Highlight::parse2(int64_t _start,
appl::HighlightInfo resultat; appl::HighlightInfo resultat;
while (elementStart < elementStop) { while (elementStart < elementStop) {
if (elementStart == 306) { HL2_DEBUG("Parse element in the buffer pos=" << elementStart << "," << _buffer.size() << ")" );
//elog::setLevel(elog::logLevelVerbose);
}
//HL2_DEBUG("Parse element in the buffer pos=" << elementStart << "," << _buffer.size() << ")" );
//try to fond the HL in ALL of we have //try to fond the HL in ALL of we have
for (int64_t jjj=0; jjj<int64_t(m_listHighlightPass2.size()); jjj++){ for (int64_t jjj=0; jjj<int64_t(m_listHighlightPass2.size()); jjj++){
/*
HL2_DEBUG("Parse HL id=" << jjj << " position search: (" << HL2_DEBUG("Parse HL id=" << jjj << " position search: (" <<
elementStart << "," << elementStop << ") in='" elementStart << "," << elementStop << ") in='"
<< /*_buffer[elementStart]*/ std::string(_buffer.begin()+elementStart,_buffer.begin()+elementStop) << "' " << m_listHighlightPass2[jjj].getPaternString().first << " " << m_listHighlightPass1[jjj].getPaternString().second); << std::string(_buffer.begin()+elementStart,_buffer.begin()+elementStop) << "' " << m_listHighlightPass2[jjj].getPaternString().first << " " << m_listHighlightPass1[jjj].getPaternString().second);
*/
// Stop the search to the end (to get the end of the pattern) // Stop the search to the end (to get the end of the pattern)
bool ret = m_listHighlightPass2[jjj].find(elementStart, elementStop, resultat, _buffer); bool ret = m_listHighlightPass2[jjj].find(elementStart, elementStop, resultat, _buffer);
if (ret == true) { if (ret == true) {
// find an element: // find an element:
_metaData.push_back(resultat); _metaData.push_back(resultat);
HL2_DEBUG("data='" << std::string(_buffer.begin()+elementStart,_buffer.begin()+resultat.stop) << "'"); //HL2_DEBUG("data='" << std::string(_buffer.begin()+elementStart,_buffer.begin()+resultat.stop) << "'");
elementStart = resultat.stop-1; elementStart = resultat.stop-1;
break; break;
} }
@@ -318,7 +318,7 @@ void appl::Highlight::parse2(int64_t _start,
*/ */
void appl::Highlight::parseSubElement(const appl::HighlightInfo& _upper, void appl::Highlight::parseSubElement(const appl::HighlightInfo& _upper,
std::vector<appl::HighlightInfo>& _metaData, std::vector<appl::HighlightInfo>& _metaData,
std::string &_buffer) { etk::Buffer& _buffer) {
if (_upper.patern->getSubPatternName().size() == 0) { if (_upper.patern->getSubPatternName().size() == 0) {
return; return;
} }

View File

@@ -22,6 +22,7 @@ namespace appl {
#include <etk/os/FSNode.hpp> #include <etk/os/FSNode.hpp>
#include <appl/HighlightPattern.hpp> #include <appl/HighlightPattern.hpp>
#include <appl/GlyphPainting.hpp> #include <appl/GlyphPainting.hpp>
#include <etk/Buffer.hpp>
#include <exml/exml.hpp> #include <exml/exml.hpp>
namespace appl { namespace appl {
@@ -53,19 +54,20 @@ namespace appl {
int64_t _stop, int64_t _stop,
std::vector<appl::HighlightInfo>& _metaData, std::vector<appl::HighlightInfo>& _metaData,
int64_t _addingPos, int64_t _addingPos,
std::string& _buffer); etk::Buffer& _buffer);
void parse2(int64_t _start, void parse2(int64_t _start,
int64_t _stop, int64_t _stop,
std::vector<appl::HighlightInfo>& _metaData, std::vector<appl::HighlightInfo>& _metaData,
std::string& _buffer); etk::Buffer& _buffer);
void parseSubElement(const appl::HighlightInfo& _upper, void parseSubElement(const appl::HighlightInfo& _upper,
std::vector<appl::HighlightInfo>& _metaData, std::vector<appl::HighlightInfo>& _metaData,
std::string &_buffer); etk::Buffer& _buffer);
private: private:
std::string m_styleName; //!< curent style name (like "c++" or "c" or "script Bash") std::string m_styleName; //!< curent style name (like "c++" or "c" or "script Bash")
std::vector<std::string> m_listExtentions; //!< List of possible extention for this high-light, like : ".c", ".cpp", ".h" std::vector<std::string> m_listExtentions; //!< List of possible extention for this high-light, like : ".c", ".cpp", ".h"
std::vector<HighlightPattern> m_listHighlightPass1; //!< List of ALL hightlight modules (pass 1 == > when we load and wride data on the buffer) std::vector<HighlightPattern> m_listHighlightPass1; //!< List of ALL hightlight modules (pass 1 == > when we load and wride data on the buffer)
std::vector<HighlightPattern> m_listHighlightPass2; //!< List of ALL hightlight modules (pass 2 == > When we display the buffer( only the display area (100 lines)) ) std::vector<HighlightPattern> m_listHighlightPass2; //!< List of ALL hightlight modules (pass 2 == > When we display the buffer( only the display area (100 lines)) )
// TODO : This is bad ==> the patern ar unordered ...
std::map<std::string, std::vector<HighlightPattern>> m_listHighlightNamed; //!< list of all sub partern to parse... std::map<std::string, std::vector<HighlightPattern>> m_listHighlightNamed; //!< list of all sub partern to parse...
public: // herited function : public: // herited function :
virtual bool updateContext() { virtual bool updateContext() {

View File

@@ -84,8 +84,7 @@ std::string appl::highlightManager::getTypeFile(const std::string& _fileName) {
} }
APPL_DEBUG(" check : " << it->getTypeName()); APPL_DEBUG(" check : " << it->getTypeName());
if (it->isCompatible(_fileName) == true) { if (it->isCompatible(_fileName) == true) {
APPL_DEBUG("Find type for extention : " << _fileName APPL_DEBUG("Find type for extention : " << _fileName << " type : " << it->getTypeName());
<< " type : " << it->getTypeName());
return it->getTypeName(); return it->getTypeName();
} }
} }

View File

@@ -43,16 +43,16 @@ void appl::HighlightPattern::setPatern(const std::string& _regExp, const std::st
m_hasParsingError = false; m_hasParsingError = false;
if (_regExp != "") { if (_regExp != "") {
try { try {
m_regExp[0].assign(_regExp, std::regex_constants::optimize | std::regex_constants::ECMAScript); m_regExp[0].compile(_regExp);
} catch (std::regex_error e) { } catch (std::runtime_error e) {
m_hasParsingError = true; m_hasParsingError = true;
APPL_ERROR("can not parse regex : '" << e.what() << "' for : " << _regExp); APPL_ERROR("can not parse regex : '" << e.what() << "' for : " << _regExp);
} }
} }
if (_regExpStop != "") { if (_regExpStop != "") {
try { try {
m_regExp[1].assign(_regExpStop, std::regex_constants::optimize | std::regex_constants::ECMAScript); m_regExp[1].compile(_regExpStop);
} catch (std::regex_error e) { } catch (std::runtime_error e) {
m_hasParsingError = true; m_hasParsingError = true;
APPL_ERROR("can not parse regex : '" << e.what() << "' for : " << _regExpStop); APPL_ERROR("can not parse regex : '" << e.what() << "' for : " << _regExpStop);
} }
@@ -138,72 +138,10 @@ void appl::HighlightPattern::parseRules(const exml::Element& _child, int32_t _le
} }
} }
static std::pair<int64_t,int64_t> findRegex(int32_t _start,
int32_t _stop,
std::regex& _regex,
const std::string& _buffer) {
std::smatch resultMatch;
std::regex_constants::match_flag_type flags = std::regex_constants::match_continuous; // check only the match at the first character.
//APPL_DEBUG("find data at : start=" << _start << " stop=" << _stop << " regex='" << m_regexValue << "'");
if ((int64_t)_stop <= (int64_t)_buffer.size()) {
char val = _buffer[_stop];
if ( val != '\n'
&& val != '\r') {
//after last char ==> not end of line ($ would not work))
flags |= std::regex_constants::match_not_eol;
}
/*
if (!( ('a' <= val && val <= 'z')
|| ('A' <= val && val <= 'Z')
|| ('0' <= val && val <= '9')
|| val == '_')) {
flags |= std::regex_constants::match_not_eow;
}
*/
}
if (_start>0) {
flags |= std::regex_constants::match_prev_avail;
}
if ( _stop < 0
|| size_t(_stop) > _buffer.size()) {
APPL_ERROR(" error in indexing for regex ... _stop=" << _stop << " >= _buffer.size()=" << _buffer.size());
return std::pair<int64_t,int64_t>(-1,0);
}
if ( _start < 0
|| size_t(_start) > _buffer.size()) {
APPL_ERROR(" error in indexing for regex ... _start=" << _start << " >= _buffer.size()=" << _buffer.size());
return std::pair<int64_t,int64_t>(-1,0);
}
if (_start > _stop) {
APPL_ERROR(" error in indexing for regex ... _start=" << _start << " > _stop=" << _stop);
return std::pair<int64_t,int64_t>(-1,0);
}
std::regex_search(_buffer.begin() + _start, _buffer.begin() + _stop, resultMatch, _regex, flags);
if (resultMatch.size() > 0) {
int64_t start = std::distance(_buffer.begin(), resultMatch[0].first);
int64_t stop = std::distance(_buffer.begin(), resultMatch[0].second);
//APPL_DEBUG("find data at : start=" << _resultat.start << " stop=" << _resultat.stop << " data='" <<std::string(_buffer, _resultat.start, _resultat.stop-_resultat.start) << "'" );
/*
if (true){
//TK_DEBUG("in line : '" << etk::to_string(_buffer) << "'");
APPL_DEBUG(" Find " << resultMatch.size() << " elements");
for (size_t iii=0; iii<resultMatch.size(); ++iii) {
int32_t posStart = std::distance(_buffer.begin(), resultMatch[iii].first);
int32_t posStop = std::distance(_buffer.begin(), resultMatch[iii].second);
APPL_DEBUG(" [" << iii << "] " << posStart << " to " << posStop);
}
}
*/
return std::pair<int64_t,int64_t>(start,stop);
}
return std::pair<int64_t,int64_t>(-1,0);
}
bool appl::HighlightPattern::find(int32_t _start, bool appl::HighlightPattern::find(int32_t _start,
int32_t _stop, int32_t _stop,
appl::HighlightInfo& _resultat, appl::HighlightInfo& _resultat,
const std::string& _buffer) { const etk::Buffer& _buffer) {
//APPL_DEBUG(" try to find the element"); //APPL_DEBUG(" try to find the element");
_resultat.start = -1; _resultat.start = -1;
_resultat.stop = -1; _resultat.stop = -1;
@@ -216,12 +154,12 @@ bool appl::HighlightPattern::find(int32_t _start,
if (m_regexValue[0].size() == 0) { if (m_regexValue[0].size() == 0) {
return false; return false;
} }
std::pair<int64_t,int64_t> ret0 = findRegex(_start, _stop, m_regExp[0], _buffer); // when we have only one element:
if (ret0.first >= 0) { if (m_regExp[0].processOneElement(_buffer, _start, _stop) == true) {
_resultat.start = ret0.first; _resultat.start = m_regExp[0].start();
_resultat.stop = ret0.second; _resultat.stop = m_regExp[0].stop();
//APPL_DEBUG("find data at : start=" << _resultat.start << " stop=" << _resultat.stop << " data='" <<std::string(_buffer, _resultat.start, _resultat.stop-_resultat.start) << "'" ); //APPL_DEBUG("find data at : start=" << _resultat.start << " stop=" << _resultat.stop << " data='" <<std::string(_buffer, _resultat.start, _resultat.stop-_resultat.start) << "'" );
// second step : Complex searching ... //APPL_DEBUG("find data at : start=" << _resultat.start << " stop=" << _resultat.stop );
if (m_hasEndRegEx == true) { if (m_hasEndRegEx == true) {
// when no regex specify ==> get all the buffer ... // when no regex specify ==> get all the buffer ...
if (m_regexValue[1].size() == 0) { if (m_regexValue[1].size() == 0) {
@@ -230,9 +168,8 @@ bool appl::HighlightPattern::find(int32_t _start,
} }
_start = _resultat.stop; _start = _resultat.stop;
while (_start < _stop) { while (_start < _stop) {
std::pair<int64_t,int64_t> ret1 = findRegex(_start, _stop, m_regExp[1], _buffer); if (m_regExp[1].processOneElement(_buffer, _start, _stop) == true) {
if (ret1.first >= 0) { _resultat.stop = m_regExp[1].stop();
_resultat.stop = ret1.second;
return true; return true;
} }
_start++; _start++;

View File

@@ -11,6 +11,8 @@ class HighlightPattern;
#include <appl/GlyphPainting.hpp> #include <appl/GlyphPainting.hpp>
#include <vector> #include <vector>
#include <regex> #include <regex>
#include <etk/RegExp.hpp>
#include <etk/Buffer.hpp>
#include <exml/exml.hpp> #include <exml/exml.hpp>
namespace appl { namespace appl {
@@ -44,7 +46,7 @@ namespace appl {
bool m_hasParsingError; bool m_hasParsingError;
std::string m_regexValue[2]; std::string m_regexValue[2];
bool m_hasEndRegEx; bool m_hasEndRegEx;
std::regex m_regExp[2]; //!< Start of Regular expression etk::RegExp<etk::Buffer> m_regExp[2]; //!< Start of Regular expression
public: public:
void setPatern(const std::string& _regExp, const std::string& _regExpStop="", bool _hasEndRegEx=false); void setPatern(const std::string& _regExp, const std::string& _regExpStop="", bool _hasEndRegEx=false);
std::pair<std::string,std::string> getPaternString(); std::pair<std::string,std::string> getPaternString();
@@ -81,7 +83,7 @@ namespace appl {
bool find(int32_t _start, bool find(int32_t _start,
int32_t _stop, int32_t _stop,
appl::HighlightInfo& _resultat, appl::HighlightInfo& _resultat,
const std::string& _buffer); const etk::Buffer& _buffer);
void parseRules(const exml::Element& _child, int32_t _level); void parseRules(const exml::Element& _child, int32_t _level);
}; };

View File

@@ -102,7 +102,7 @@ class MainApplication : public ewol::context::Application {
std::string tmpppp = _context.getCmd().get(iii); std::string tmpppp = _context.getCmd().get(iii);
if (tmpppp == "-t") { if (tmpppp == "-t") {
ctagDetected = true; ctagDetected = true;
} else if (true == ctagDetected) { } else if (ctagDetected == true) {
etk::FSNode file(tmpppp); etk::FSNode file(tmpppp);
std::string name = file.getName(); std::string name = file.getName();
APPL_INFO("Load ctag file : \"" << name << "\"" ); APPL_INFO("Load ctag file : \"" << name << "\"" );
@@ -117,6 +117,16 @@ class MainApplication : public ewol::context::Application {
std::string name = file.getName(); std::string name = file.getName();
APPL_INFO("need load file : \"" << name << "\"" ); APPL_INFO("need load file : \"" << name << "\"" );
m_bufferManager->open(name); m_bufferManager->open(name);
} else if (file.getNodeType() == etk::typeNode_folder) {
std::vector<std::string> listOfFiles = file.folderGetSub(false, true, ".*");
for (auto &it: listOfFiles) {
etk::FSNode file2(it);
if (file2.getNodeType() == etk::typeNode_file) {
std::string name = file2.getName();
APPL_INFO("need load file : \"" << name << "\"" );
m_bufferManager->open(name);
}
}
} }
} }
} }

View File

@@ -8,17 +8,35 @@
#include <ewol/object/Object.hpp> #include <ewol/object/Object.hpp>
#include <ewol/Dimension.hpp> #include <ewol/Dimension.hpp>
// some are wrong :
'dfgd\'fg' 'dfgd\'fg'
'e' sdfsdf '\e' 'e' sdfsdf '\e'
// default value that work:
aa 'z' aa '\n' aa '\t' aa '\v' aa '\b' aa '\r' aa '\f' aa '\a' aa '\\' aa '\?' aa '\'' aa '\0'
// conplex numbers:
aa '\u4855' aa '\U78965412' aa '\x0F' aa '\o45'
aa "z" aa "\n" aa "\t" aa "\v" aa "\b" aa "\r" aa "\f" aa "\a" aa "\\" aa "\?" aa "\"" aa "\0"
// conplex numbers:
aa "\u4855" aa "\U78965412" aa "\x0F" aa "\o45"
"dqf\"gsdfg" // \\ \n " "dqf\"gsdfg" // \\ \n "
// TODO : sqdkfjsdldkqfj // TODO : sqdkfjsdldkqfj
std::string
std::thread::sleep
/*
* TODO: Todo in a multipleLine interface
*
*/
example_param example_param
=_param =_param
// simple oneLine comment
_ _
_s _s
_3RTDRsdfqsd _3RTDRsdfqsd

View File

@@ -19,12 +19,12 @@ mediump vec4
mediump mat2 mediump mat2
mediump mat3 mediump mat3
mediump mat4 mediump mat4
mediump ivect2 mediump ivec2
mediump ivect3 mediump ivec3
mediump ivect4 mediump ivec4
mediump bvect2 mediump bvec2
mediump bvect3 mediump bvec3
mediump bvect4 mediump bvec4
//! inline doxygen comment //! inline doxygen comment
void emptyFunction() { void emptyFunction() {