File inclusion and import from current directory
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start in lib/source/pl/core/resolvers.cpp, which the issue identifies as the include resolver, and trace how an included file is located when code is loaded from the pattern editor. Define how relative paths such as "./player.hexpat" should resolve from the including file, then verify that split pattern files can be shared without user-specific absolute paths.
Written by the indexing model from the issue text.
Description
Hi,
First of all, thanks for imHex. I'm using imHex to reverse-engineer savegame data formats, but the in-app pattern editor isn't really geared towards writing a lot of code. So far, I solved this by having the pattern editor just contain #include "/Users/red/MyProject/base.hexpat", and doing my editing in my editor of choice.
When even that file began to get too large, I started splitting it into sub-modules, so base.hexpat now also contains #include "/users/red/MyProject/items.hexpat" and I guess I'll do the same soon for other parts of the savegame. However, it's not suited for future sharing of those files, especially if users all need to rewrite the path.
I was hoping I could use C-like #include "./player.hexpat" but to no avail. I checked into the source, and from what I see, the resolver doesn't have a concept of __FILE__ from where to check, and I'd guess that since the pattern language is mostly ran from inside the imHex pattern editor, that notion doesn't really exist.
Therefore, I'm not entirely sure of the breadth of changes this would require, I was hoping a quick "check if path starts with a dot" (or even just "add current directory to include paths") would suffice, but I guess this goes beyond a quick one-liner.
Totally understandable if that’s out of scope for now, just felt this would be useful to point out.
And again, thanks for imHex, it's awesome!
- Dominant language
- C++
- Stars
- 275
- Forks
- 75
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 10
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from WerWolv/PatternLanguage
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
WerWolv/PatternLanguage#236 · 12 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
WerWolv/PatternLanguage#226 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
WerWolv/PatternLanguage#221 · 4 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
WerWolv/PatternLanguage#219 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
WerWolv/PatternLanguage#218 ·
All issues in WerWolv/PatternLanguage
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·