//=========================================== // Lumina-DE source code // Copyright (c) 2015, Ken Moore // Available under the 3-clause BSD license // See the LICENSE file for full details //=========================================== #include "syntaxSupport.h" QStringList Custom_Syntax::availableRules(){ QStringList avail; avail << "C++"; return avail; } QString Custom_Syntax::ruleForFile(QString filename){ QString suffix = filename.section(".",-1); if(suffix=="cpp" || suffix=="hpp" || suffix=="c" || suffix=="h"){ return "C++"; } return ""; } void Custom_Syntax::loadRules(QString type){ //NOTE: the "multiLineComment rules.clear(); splitrules.clear(); if(type=="C++"){ //Keywords (standard C/C++/Qt definitions) QStringList keywords; keywords << "char" << "class" << "const" << "double" << "enum" << "explicit" << "friend" << "inline" \ << "int" << "long" << "namespace" << "operator" << "private" << "protected" << "public" \ << "short" << "signals" << "signed" << "slots" << "static" << "struct" << "template" \ << "typedef" << "typename" << "union" << "unsigned" << "virtual" << "void" << "volatile"; SyntaxRule rule; rule.format.setForeground(Qt::darkBlue); rule.format.setFontWeight(QFont::Bold); for(int i=0; i