@@ -32,8 +32,10 @@ SyntaxHighlighter::SyntaxHighlighter(QTextDocument *parent) : QSyntaxHighlighter
3232 QStringList module_words = {" module" , " endmodule" , " input" , " output" , " inout" };
3333 QStringList pair_words = {" begin" , " end" , " if" , " else" , " case" , " casex" , " endcase" };
3434 QStringList connection_words = {" wire" , " reg" , " posedge" , " negedge" };
35- QStringList compiler_words = {" `include" , " `define" , " `timescale" };
35+ QStringList compiler_words = {" `include" , " `define" , " `timescale" , " `undef " , " `ifdef " , " `else " , " `endif " , " `ifndef " };
3636 QStringList system_words = {" $display" , " $fopen" , " $fclose" };
37+ QStringList behavioural_words = {" initial" , " always" };
38+ QStringList gate_level_words = {" and" ," or" ," not" ," nand" ," nor" ," xor" ," xnor" };
3739
3840 keywordFormat.setFontWeight (QFont::Bold);
3941
@@ -48,6 +50,14 @@ SyntaxHighlighter::SyntaxHighlighter(QTextDocument *parent) : QSyntaxHighlighter
4850 keywordFormat.setForeground (QColor (" #f4d042" ));
4951 for (const QString &word : connection_words)
5052 highlightingRules.append ({QRegularExpression (" \\ b" + word + " \\ b" ), keywordFormat});
53+
54+ keywordFormat.setForeground (QColor (" #ff9646" ));
55+ for (const QString &word : behavioural_words)
56+ highlightingRules.append ({QRegularExpression (" \\ b" + word + " \\ b" ), keywordFormat});
57+
58+ keywordFormat.setForeground (QColor (" #ff4646" ));
59+ for (const QString &word : gate_level_words)
60+ highlightingRules.append ({QRegularExpression (" \\ b" + word + " \\ b" ), keywordFormat});
5161
5262 keywordFormat.setForeground (QColor (" #eb3be8" ));
5363 for (const QString &word : system_words)
0 commit comments