format/format_entries does not work with a template with non-type values (and an @)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Reproduce the error using the supplied test.zip and pattern, focusing on format and format_entries with the templated Entry and @ expressions. Trace the handling of these format attributes and confirm done when both attributes work without error[E0011] for this example.
Written by the indexing model from the issue text.
Description
Originally reported here: https://github.com/WerWolv/ImHex-Patterns/issues/147 - but closed due to wrong repository.
Consider the following file:
10 00 00 00 18 00 00 00 04 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF 74 65 73 74 31 32 33 34 35 6C 6F 6C 31 33 33 37 08 00 00 00 04 00 00 00 0C 00 00 00 05 00 00 00 11 00 00 00 03 00 00 00 14 00 00 00 04 00 00 00
With the following pattern:
fn entryName(auto e) {
return e.name;
};
struct Entry<auto offset> {
u32 nameOffset;
u32 nameSize;
char name[nameSize] @ offset + nameOffset;
}/*[[format("entryName")]]*/;
struct Header {
u32 blockOffset;
u32 nameBlockSize;
u32 numberOfElements;
Entry<blockOffset> entries[numberOfElements]
@ blockOffset + nameBlockSize
//[[format_entries("entryName")]]
;
};
Header header @ 0x0;
Basically, this file requires the entry to know where the lookup table for the strings is located. I've used a template for that. The original issue was about not being to use a template in a format-function, but auto solves that. However, this particular file and pattern causes an error[E0011] when you try to use either of the format attributes.
I'm pretty sure it's related to the @ sign throwing things off.
- 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 ·