[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"?> <?xml version="1.0" encoding="UTF-8"?>
<EdnLang version="0.1" lang="C++"> <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 --> <pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
<rule name="doxygen multiline"> <rule name="doxygen multiline">
<color>commentDoxygen</color> <color>commentDoxygen</color>
@ -105,6 +105,10 @@
<color>memberClass</color> <color>memberClass</color>
<regex>\@((m|s|p|s|g)_|property|signal)\w+\@</regex> <regex>\@((m|s|p|s|g)_|property|signal)\w+\@</regex>
</rule> </rule>
<rule name="CPP member (bad version)">
<color>memberClass</color>
<regex>\@\w+_\@</regex>
</rule>
<rule name="function input"> <rule name="function input">
<color>inputFunction</color> <color>inputFunction</color>
<regex>\@_\w+\@</regex> <regex>\@_\w+\@</regex>

View File

@ -29,7 +29,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>\@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>
<rule name="numeric constant"> <rule name="numeric constant">
<color>number</color> <color>number</color>

View File

@ -122,7 +122,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_WARNING(" check : " << it << "=?=" << _name);
// TODO: Remove dependency with the std::regex ... // TODO: Remove dependency with the std::regex ...
std::regex expression; std::regex expression;
try { try {
@ -136,7 +136,7 @@ bool appl::Highlight::isCompatible(const std::string& _name) {
if (resultMatch.size() <= 0) { if (resultMatch.size() <= 0) {
continue; 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()) { if (resultMatch[0].first != _name.begin()) {
continue; continue;
} }

View File

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