-
-
Notifications
You must be signed in to change notification settings - Fork 196
unified diff parser in unified-diff-parser branch parsing issues #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
from the code i would guess that the same problem happens with lines starting with '--' or '++' since they are parsed as fromfile to tofile. the '---' and '+++' need to be distinguished with their context ... |
My problem is, that there seems to be no complete specification of how such a file should look like. That's why I guessed a lot and now have to adapt to such cases. Help is appreciated. |
hi the closest thing i saw is (https://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html#Detailed-Unified). This doesnt explain whats happening between diffs though. I looked at the code but i didnt see something for a quick fix. I think parsing has to distinguish between non-diff-sections (diff, index etc) ,diff-header (---,+++) and hunks (@@,fragments). I'll revisit this as time permits |
btw an almost good short implementation i found is here https://stackoverflow.com/questions/3560073/how-to-write-parser-for-unified-diff-syntax |
The actual version has a complete rewrite of the parser logic. It is able to parse your problem file. |
hi
a unified diff such as the one below is not parsed properly. i do see that the parse complete however the fromFile gets updated with the content of the line '---' out of the line fragments. essentially the fromFile is "some comment" after the parse.
read the above unified patch into using
The text was updated successfully, but these errors were encountered: