Skip to content
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

Parse error for Haskell sections #1838

Open
fredefox opened this issue Feb 12, 2024 · 0 comments
Open

Parse error for Haskell sections #1838

fredefox opened this issue Feb 12, 2024 · 0 comments

Comments

@fredefox
Copy link

Consider the program:

main = print $ (`div` 2) 3

If you put the cursor inside the brackets anywhere except on the first back-tick character and hit C-M-u (backward-up-list) the cursor is placed at the beginning of the current buffer and a scan error is echoed to the *Messages* buffer:

up-list: Scan error: "Unbalanced parentheses", 1, 1

I tried to debug this, but I'm not great with lisp. I think it has to do with the fact that "plain" backward-sexp and haskell-backward-sexp don't agree on where to go when cursor is on the d in div. There is a comment in haskell-forward-sexp saying that:

Navigate backwards using plain `backward-sexp', assume that it skipped over at least one Haskell expression

If I switch to fundamental-mode I can see that this assumption doesn't hold if you call backward-sexp with the cursor on the d in div.

I would love to provide the patch, but I'm afraid I need help digging to locate the bug.

The bug is present in at least versions 20231115.1812 and 20240116.1718.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant