Skip to content

Commit 113d206

Browse files
committed
[Refactor] Replace include guards with #pragma once and change QList to QVector for syntax rules in Syntax.h
1 parent b498028 commit 113d206

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

include/Syntax.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef SYNTAX_H
2-
#define SYNTAX_H
1+
#pragma once
32

43
#include <QTextCharFormat>
54
#include <QRegularExpression>
@@ -22,16 +21,23 @@ class Syntax : public QSyntaxHighlighter
2221
QRegularExpression pattern;
2322
QTextCharFormat format;
2423
};
25-
QList<SyntaxRule> syntaxRules;
24+
QVector<SyntaxRule> syntaxRules;
2625

2726
QTextCharFormat keywordFormat;
2827
QTextCharFormat singleLineCommentFormat;
2928
QTextCharFormat quotationMark;
3029
QTextCharFormat functionFormat;
3130
QTextCharFormat parenthesisFormat;
3231
QTextCharFormat charFormat;
32+
QTextCharFormat iterationFormat;
3333

3434
void addPattern(const QString &pattern, const QTextCharFormat &format);
35-
};
3635

37-
#endif // SYNTAX_H
36+
// Initialization functions for different syntax highlighting rules
37+
void initKeywordRules();
38+
void initCommentRules();
39+
void initFunctionRules();
40+
void initParenthesisRules();
41+
void initCharRules();
42+
void initQuotationRules();
43+
};

0 commit comments

Comments
 (0)