-
Notifications
You must be signed in to change notification settings - Fork 411
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
Haskell/SQL comment parsing failure #89
Comments
Ah, actually I did notice a problem just now. The diff is truncated. |
In case you want to try to reproduce this, please clone https://github.com/masaeedu/automonad.hs, check out commit number |
Thanks! Right, so to narrow it down slightly more I can reproduce with
Looks like delta has a bug affecting languages like Haskell and SQL that use Line 89 in 88e967c
Hm, how to fix this. That state machine parser is a total mess unfortunately -- the worst part of the codebase. |
What it's trying to do of course is parse stuff like this:
|
@dandavison Ah, I see. That is quite a conundrum. Not that making a huge change like this is an easy proposition, but does Rust have any parser combinator libraries? |
Alternatively, is it possible for me to provide the diff to delta in a more structured representation so that it doesn't have to parse things itself? |
Prior to this commit, in a language in which -- at the beginning of a line is valid (e.g. a Haskell or SQL comment), then removal of such a line was being confused with the --- marker used in unified/git diff to introduce the file paths.
I've pushed a quick fix to master. If you are able to build delta (
Yes, it does. When I started writing delta I was too new to rust to try to introduce major abstractions (I'd never have got it to compile :) ). But I think that a proper parser abstraction would be a really helpful improvement to delta.
That's an interesting idea. Not currently. I guess the thing is that unified/git diff is the parseable standard for representing diffs and the issue is that delta should parse it without problems! |
I'm making a release: https://github.com/dandavison/delta/releases/tag/0.0.16 Homebrew bump pending: Homebrew/homebrew-core#49877 |
@dandavison Thanks for the quick turnaround! I'm sorry, I actually don't have any Rust stuff set up locally, I just obtained the binary package through nixpkgs, but I'll try to bump the version in there and pull later on. |
|
Hello there. I have delta configured as my git pager, but occasionally I see error messages indicating the executable panics and crashes:
I don't really know how to go about debugging this, although I did run it with
RUST_BACKTRACE=full
and collected the following output:The code does make heavy use of unicode symbols, I don't know if that might have anything to do with it?
I should mention that I only see this message after I exit the pager. There doesn't seem to be any noticeable issue when it comes to how the program is executing (maybe I'm not looking carefully enough), but I thought I'd let you know.
The text was updated successfully, but these errors were encountered: