[DEBUG] Correct highlight of the C++ and lua

This commit is contained in:
Edouard DUPIN 2017-08-04 21:01:01 +02:00
parent d8b43a1f78
commit 34af3f6bb2
4 changed files with 11 additions and 9 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<EdnLang version="0.1" lang="C++">
<ext>.*\.(cpp|CPP|cxx|CXX|cc|CC|hpp|HPP|hxx|HXX|h|H|mm|MM|c++|C++|m++|M++|mpp|MPP)</ext>
<ext>.*\.(cpp|CPP|cxx|CXX|cc|CC|hpp|HPP|hxx|HXX|hh|h|H|mm|MM|c\+\+|C\+\+|m\+\+|M\+\+|mpp|MPP)</ext>
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
<rule name="doxygen multiline">
<color>commentDoxygen</color>
@ -105,6 +105,10 @@
<color>memberClass</color>
<regex>\@((m|s|p|s|g)_|property|signal)\w+\@</regex>
</rule>
<rule name="CPP member (bad version)">
<color>memberClass</color>
<regex>\@\w+_\@</regex>
</rule>
<rule name="function input">
<color>inputFunction</color>
<regex>\@_\w+\@</regex>

View File

@ -29,7 +29,7 @@
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="my keyword">
<color>keyword</color>
<regex>\@and|break|do|else|elseif|end|for|function|if|in|local|nil|not|or|repeat|return|then|until|while\@</regex>
<regex>\@and|break|do|elseif|else|end|for|function|if|in|local|nil|not|or|repeat|return|then|until|while|require\@</regex>
</rule>
<rule name="numeric constant">
<color>number</color>

View File

@ -122,7 +122,7 @@ appl::Highlight::~Highlight() {
bool appl::Highlight::isCompatible(const std::string& _name) {
for (auto &it : m_listExtentions) {
APPL_DEBUG(" check : " << it << "=?=" << _name);
APPL_WARNING(" check : " << it << "=?=" << _name);
// TODO: Remove dependency with the std::regex ...
std::regex expression;
try {
@ -136,7 +136,7 @@ bool appl::Highlight::isCompatible(const std::string& _name) {
if (resultMatch.size() <= 0) {
continue;
}
APPL_DEBUG(" - begin=" << std::distance(_name.begin(), resultMatch[0].first) << " end=" << std::distance(_name.begin(), resultMatch[0].second));
APPL_WARNING(" - begin=" << std::distance(_name.begin(), resultMatch[0].first) << " end=" << std::distance(_name.begin(), resultMatch[0].second));
if (resultMatch[0].first != _name.begin()) {
continue;
}

View File

@ -52,14 +52,12 @@ void appl::highlightManager::init() {
}
}
// display :
/*
for (auto &it : hlList) {
if (it == nullptr) {
continue;
}
it->display();
}
*/
}
void appl::highlightManager::unInit() {
@ -76,15 +74,15 @@ std::string appl::highlightManager::getTypeFile(const std::string& _fileName) {
if (_fileName.size() == 0) {
return "";
}
APPL_DEBUG("Try to find type for extention : '" << _fileName << "' in " << s_list().size() << " types");
APPL_WARNING("Try to find type for extention : '" << _fileName << "' in " << s_list().size() << " types");
std::vector<ememory::SharedPtr<Highlight>>& hlList = s_list();
for (auto &it : hlList) {
if (it == nullptr) {
continue;
}
APPL_DEBUG(" check : " << it->getTypeName());
APPL_WARNING(" check : " << it->getTypeName());
if (it->isCompatible(_fileName) == true) {
APPL_DEBUG("Find type for extention : " << _fileName << " type : " << it->getTypeName());
APPL_WARNING("Find type for extention : " << _fileName << " type : " << it->getTypeName());
return it->getTypeName();
}
}