Skip to content

Commit

Permalink
enhance TabContent to track parse errors; add markParseError method i…
Browse files Browse the repository at this point in the history
…n TextEditor; update Token class with setType and setValue methods; improve drawTree logic in TreeVisualiser for better rendering
  • Loading branch information
SemoMoh committed Dec 15, 2024
1 parent a6d0e71 commit 7efebbb
Show file tree
Hide file tree
Showing 7 changed files with 235 additions and 127 deletions.
14 changes: 14 additions & 0 deletions parser_gui/Data/include/Token.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,20 @@ class Token {

QString toHTMLString(bool includePosition = false) const;

void setType(QString type){
// loop over the token type strings
for (size_t i = 0; i < tokenTypeStrings.size(); i++) {
// check if the type string matches
if (type == tokenTypeStrings[i]) {
// set the type
this->type = static_cast<TokenType>(i);
return;
}
}
}
void setValue(QString value){
this->value = value;
}

// copy constructor
Token(const Token &other) = default;
Expand Down
Loading

0 comments on commit 7efebbb

Please sign in to comment.