mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-01 21:17:44 -05:00
fix: imported patterns used for inheritance were not highlighted. (#2356)
The problem was that imported files didn't have token sequences to obtain the UDT variables. The fix was to create maps from the file name to the token sequence and then process each imported file to obtain all the variables needed. Function variables are skipped since they can be part of the code. There are also some minor code style corrections and a fix in the text editor where the last line of a selection was not being deleted.
This commit is contained in:
@@ -74,9 +74,11 @@ namespace hex::plugin::builtin {
|
||||
Scopes m_globalTokenRange;
|
||||
|
||||
VariableMap m_UDTVariables;
|
||||
VariableMap m_ImportedUDTVariables;
|
||||
VariableMap m_functionVariables;
|
||||
Variables m_globalVariables;
|
||||
|
||||
std::map<std::string, std::vector<Token>> m_parsedImports;
|
||||
std::map<std::string,std::string> m_attributeFunctionArgumentType;
|
||||
std::map<std::string,std::string> m_typeDefMap;
|
||||
std::map<std::string,std::string> m_typeDefInvMap;
|
||||
@@ -157,6 +159,8 @@ namespace hex::plugin::builtin {
|
||||
* @brief Entry point to syntax highlighting
|
||||
*/
|
||||
void highlightSourceCode();
|
||||
void processSource();
|
||||
void clearVariables();
|
||||
|
||||
/**
|
||||
* @brief Syntax highlighting from parser
|
||||
|
||||
Reference in New Issue
Block a user