Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #146 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 21 22 +1
Lines 2438 2531 +93
=====================================
- Misses 2438 2531 +93
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Merging this PR will degrade performance by 33.27%
Performance Changes
Comparing |
|
@sMezaOrellana would be interested in your thoughts on these changes! |
5f43faa to
16e6b8b
Compare
twiggler
left a comment
There was a problem hiding this comment.
Architecure looks ok, found 2 possible issues TBC
Migrated-from: fox-it/dissect.cstruct#146
Migrated-from: fox-it/dissect.cstruct#146
|
This PR has been migrated to the dissect monorepo: twiggler/dissect-monorepo-test#5 The original diff and commit history have been preserved on the |
|
@twiggler I was a bit sad that your message was just this test, as I thought maybe you left more comments 😉. |
Closes #85, partially #142, and will make #86 and #138 a lot easier to implement. Fixes #149.
This PR will (finally) replace the shoddy C syntax parser I originally wrote many moons ago, when I discovered the existence of
re.Scannerand ran with it. This PR aims to add a somewhat decent lexer and separate parser. I'm still not a compsci 1337coder, so this is just what I came up with (with some help) and definitely not a textbook implementation. All feedback is welcome.sizeofworks in the expression parser, and addedoffsetofThe new parser has made changing parsing behavior a lot easier. As such, this PR already makes the following changes:
The new parser is slightly stricter, requiring proper semicolon endings for example. We'll need to fix this in any dissect code that has this.
An important semantic change is how named nested structures are handled. In my infinite wisdom, I originally figured that named nested structures do not "exist" in the top level scope. That's not true, so now named nested structures get properly registered with the cstruct instance:
struct { ... } name;. We used to parse this first as an anonymous struct, then capturenameas the structure type name. That's not strictly correct,nameis a variable of an anonymous unnamed struct, so we now treat it as such. We don't error on this, but rather we silently ignorenameand skip until we reach a;typedef enum ...is now allowedThis probably warrants a major version bump, so maybe good to pair this with #114, #144 and what we discussed in #142.