mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-26 07:22:12 +00:00
Closed beta 1000006001: Built in theme and color palette editor.
This commit is contained in:
@@ -52,8 +52,6 @@ Token invalidToken() {
|
||||
return { Type::Invalid, QString(), ConstUtf8String(nullptr, 0), false };
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace
|
||||
|
||||
BasicTokenizedFile::BasicTokenizedFile(const QString &filepath) : reader_(filepath) {
|
||||
@@ -152,6 +150,22 @@ Type BasicTokenizedFile::uniteLastTokens(Type type) {
|
||||
return type;
|
||||
}
|
||||
|
||||
QString BasicTokenizedFile::getCurrentLineComment() {
|
||||
if (lineNumber_ > singleLineComments_.size()) {
|
||||
reader_.logError(kErrorInternal, lineNumber_) << "internal tokenizer error (line number larger than comments list size).";
|
||||
failed_ = true;
|
||||
return QString();
|
||||
}
|
||||
auto commentBytes = singleLineComments_[lineNumber_ - 1].mid(2); // Skip "//"
|
||||
CheckedUtf8String comment(commentBytes);
|
||||
if (!comment.isValid()) {
|
||||
reader_.logError(kErrorIncorrectUtf8String, lineNumber_) << "incorrect UTF-8 string in the comment.";
|
||||
failed_ = true;
|
||||
return QString();
|
||||
}
|
||||
return comment.toString().trimmed();
|
||||
}
|
||||
|
||||
Type BasicTokenizedFile::readNameOrNumber() {
|
||||
while (!reader_.atEnd()) {
|
||||
if (!isDigitChar(reader_.currentChar())) {
|
||||
|
||||
Reference in New Issue
Block a user