Skip to content

Commit 7efebbb

Browse files
committed
enhance TabContent to track parse errors; add markParseError method in TextEditor; update Token class with setType and setValue methods; improve drawTree logic in TreeVisualiser for better rendering
1 parent a6d0e71 commit 7efebbb

File tree

7 files changed

+235
-127
lines changed

7 files changed

+235
-127
lines changed

parser_gui/Data/include/Token.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,20 @@ class Token {
113113

114114
QString toHTMLString(bool includePosition = false) const;
115115

116+
void setType(QString type){
117+
// loop over the token type strings
118+
for (size_t i = 0; i < tokenTypeStrings.size(); i++) {
119+
// check if the type string matches
120+
if (type == tokenTypeStrings[i]) {
121+
// set the type
122+
this->type = static_cast<TokenType>(i);
123+
return;
124+
}
125+
}
126+
}
127+
void setValue(QString value){
128+
this->value = value;
129+
}
116130

117131
// copy constructor
118132
Token(const Token &other) = default;

0 commit comments

Comments
 (0)