Open Naheulf opened 2 months ago
This is not a bug. When the import statement is tokenized each identifier separated by a dot becomes a token. Any token named 'match' must be a keyword token so tools.match cannot be resolved into the file match.pat located in the tools folder.
Note that in most languages (including c and c++) keywords cannot be used as identifiers either and pattern language is no exception. You can't use built-in type names as identifiers either. Valid identifiers must not be any of the keywords or built-in type names or named operators defined in the language and must start with a letter or '_' and can only contain alphanumeric chars and the '_' char.
Also note that
import "tools/match.pat";
is perfectly fine because the file name is a string so it is not broken into identifier tokens as the entire becomes a string token and string tokens can contain any char sequence.
Operating System
Windows 10 x64
What's the issue you encountered?
Doing few refactor : tried to move a "match" related function to a dedicated file. (Note: it's a Y part of a XY Problem, at first I tried to find a sugar way to be warned if an area with an unknown meaning have a new unseen value.
After moving the content to a new file and tried to import it I got that error.
How can the issue be reproduced?
Create a project. Create the
includes
directory along the project file. In that folder create atools
folder. In the tool folder create amatch.pat
file (the file content does not matter, you can keep it empty) In ImHex open any file or create an new one In the pattern writeimport tools.match;
Click on the play button to evaluate the pattern.ImHex Version
1.33.2
ImHex Build Type
Installation type
MSI
Additional context?