Open
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 2435 2526 +91
=====================================
- Misses 2435 2526 +91
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 32.62%
Performance Changes
Comparing |
Member
Author
|
@sMezaOrellana would be interested in your thoughts on these changes! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #85, partially #142, and will make #86 and #138 a lot easier to implement.
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.