We also now remove all sections we parse and handle from the stylesheet
prior to handing it over to QApplication, so we can use incompatible extensions.
- // Now we have the stylesheet itself in ss, start parsing
+ // Remove C-style comments /* */ or //
+ QRegExp commentRx("(//.*(\\n|$)|/\\*.*\\*/)");
+ commentRx.setMinimal(true);
+ ss.remove(commentRx);
+
// Palette definitions first, so we can apply roles later on
QRegExp paletterx("(Palette[^{]*)\\{([^}]+)\\}");
int pos = 0;
while((pos = paletterx.indexIn(ss, pos)) >= 0) {
parsePaletteData(paletterx.cap(1).trimmed(), paletterx.cap(2).trimmed());
// Palette definitions first, so we can apply roles later on
QRegExp paletterx("(Palette[^{]*)\\{([^}]+)\\}");
int pos = 0;
while((pos = paletterx.indexIn(ss, pos)) >= 0) {
parsePaletteData(paletterx.cap(1).trimmed(), paletterx.cap(2).trimmed());
- pos += paletterx.matchedLength();
+ ss.remove(pos, paletterx.matchedLength());
}
// Now we can parse the rest of our custom blocks
}
// Now we can parse the rest of our custom blocks
//else
// TODO: add moar here
//else
// TODO: add moar here
- pos += blockrx.matchedLength();
+ ss.remove(pos, blockrx.matchedLength());
}
void QssParser::parseChatLineData(const QString &decl, const QString &contents) {
}
void QssParser::parseChatLineData(const QString &decl, const QString &contents) {