[DEV] separate c++ & C and add filename in title

This commit is contained in:
Edouard DUPIN 2014-10-21 21:18:50 +02:00
parent cefe0aacdb
commit 3f4a71065d
5 changed files with 150 additions and 22 deletions

View File

@ -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>&quot;(.|\\[\\&quot;])*?&quot;</regex> <!-- " -->
</rule>
<rule name="simple quote text">
<color>doubleQuoteText</color>
<regex>'\\?.'</regex>
<regex>&apos;\\?.&apos;</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>==|&lt;=|&gt;=|!=|&lt;{1,2}|&gt;{1,2}|&amp;&amp;|\{|\}</regex>
</rule>
<rule name="BIG LETTER">
<color>macro</color>
<regex>([A-Z]|_){4,500}</regex>
</rule>
<rule name="simpleQuteTextError">
<color>SYNTAX_ERROR</color>
<regex>&apos;|&quot;</regex>

View 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>&quot;(.|\\[\\&quot;])*?&quot;</regex> <!-- " -->
</rule>
<rule name="simple quote text">
<color>doubleQuoteText</color>
<regex>&apos;\\?.&apos;</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>==|&lt;=|&gt;=|!=|&lt;{1,2}|&gt;{1,2}|&amp;&amp;|\{|\}</regex>
</rule>
<rule name="simpleQuteTextError">
<color>SYNTAX_ERROR</color>
<regex>&apos;|&quot;</regex>
</rule>
<rule name="old school elements">
<color>SYNTAX_ERROR</color>
<regex>&apos;|&quot;|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>

View File

@ -88,10 +88,12 @@ void appl::BufferManager::setBufferSelected(std::shared_ptr<appl::Buffer> _buffe
m_bufferSelected = _bufferSelected;
if (m_bufferSelected == nullptr) {
APPL_ERROR("select a NULL buffer ...");
//parameterSetOnWidgetNamed("appl-widget-display-name", "value", "---");
return;
}
APPL_INFO("Set buffer selected");
//signalSelectFile.emit(m_bufferSelected->getName());
//parameterSetOnWidgetNamed("appl-widget-display-name", "value", m_bufferSelected->getName());
APPL_INFO("Set buffer selected (done)");
}
@ -122,6 +124,7 @@ void appl::BufferManager::open(const std::string& _fileName) {
if (exist(_fileName) == true) {
APPL_WARNING(" the element '" << _fileName << "' already exist ... just reselect it ...");
signalSelectFile.emit(_fileName);
parameterSetOnWidgetNamed("appl-widget-display-name", "value", etk::FSNodeGetRealName(_fileName));
return;
}
if (get(_fileName, true) == nullptr) {
@ -129,6 +132,7 @@ void appl::BufferManager::open(const std::string& _fileName) {
return;
}
signalSelectFile.emit(_fileName);
parameterSetOnWidgetNamed("appl-widget-display-name", "value", etk::FSNodeGetRealName(_fileName));
}
@ -156,6 +160,7 @@ void appl::BufferManager::requestDestroyFromChild(const std::shared_ptr<Object>&
if (m_bufferSelected == _child) {
APPL_ERROR("is selected");
signalSelectFile.emit("");
parameterSetOnWidgetNamed("appl-widget-display-name", "value", "");
m_bufferSelected = nullptr;
}
}

View File

@ -211,6 +211,7 @@ void MainWindows::init() {
myMenu->add(idMenugDisplay, "Reload openGl Shader", "", "menu:reloadShape");
myMenu->signalSelect.bind(shared_from_this(), &MainWindows::onCallbackMenuEvent);
m_widgetLabelFileName = ewol::widget::Label::create("FileName");
m_widgetLabelFileName->setName("appl-widget-display-name");
m_widgetLabelFileName->setExpand(bvec2(true,false));
m_widgetLabelFileName->setFill(bvec2(true,false));;
mySizerHori->subWidgetAdd(m_widgetLabelFileName);

View File

@ -74,6 +74,7 @@ def create(target):
myModule.copy_folder('../data/languages/asm/*.xml','languages/asm/')
myModule.copy_folder('../data/languages/bash/*.xml','languages/bash/')
myModule.copy_folder('../data/languages/boo/*.xml','languages/boo/')
myModule.copy_folder('../data/languages/cpp/*.xml','languages/cpp/')
myModule.copy_folder('../data/languages/c/*.xml','languages/c/')
myModule.copy_folder('../data/languages/cmake/*.xml','languages/cmake/')
myModule.copy_folder('../data/languages/glsl/*.xml','languages/glsl/')