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

Unmatched close-paren when inside strings #68

Closed
Patryk27 opened this issue Jun 23, 2023 · 7 comments
Closed

Unmatched close-paren when inside strings #68

Patryk27 opened this issue Jun 23, 2023 · 7 comments

Comments

@Patryk27
Copy link

Patryk27 commented Jun 23, 2023

Hi,

It looks like parinfer-rust / parinfer-rust-mode doesn't correctly track the context and e.g. writing something like this:

(map! :n "] E" 'next-error-in-different-file)

... will not parse, saying Unmatched close-paren. due to ] being treated as if it was written outside of a string 👀

@justinbarclay
Copy link
Owner

I can't recreate this. If you run this with emacs -Q, do you still run in this issue?

2023-06-26.10-14-08.mp4

@Patryk27
Copy link
Author

Yes, same with emacs -Q:

image image

For reference, I'm using:

/Users/pwy/.cache/.doom.local/straight/repos/parinfer-rust-mode
; git log
commit 332c7f47426f0519dc5c24dda82afdb1aa8b61ee (grafted, HEAD -> main, replaced, origin/main)
Author: Justin <[email protected]>
Date:   Sat Feb 4 11:15:47 2023 -0800

    Add treat-command-as hints for Evil

... and parinfer-rust built from 3c769707ad3b18d530f696fe42a9d495139149ab (built manually since they don't provide binaries for aarch64-darwin).

I think parinfer-rust is able to parse this file correctly, because adding a simple test there:

diff --git a/tests/cases/paren-mode.json b/tests/cases/paren-mode.json
index 777fa85..ada217f 100644
--- a/tests/cases/paren-mode.json
+++ b/tests/cases/paren-mode.json
@@ -14,6 +14,21 @@
       "out": "(let [foo 1]\n foo)"
     }
   },
+  {
+    "text": "(map! \"] E\")",
+    "options": {},
+    "result": {
+      "text": "(map! \"] E\")",
+      "success": true
+    },
+    "source": {
+      "lineNo": 6,
+      "in": [
+        ""
+      ],
+      "out": ""
+    }
+  },
   {
     "text": "(let [foo 1]\n      foo)",
     "options": {},

... passes 👀

@vlnn
Copy link

vlnn commented Jul 8, 2023

I have same problem, using doom emacs in macos

@Patryk27
Copy link
Author

Patryk27 commented Sep 22, 2023

Might be caused by parinfer-rust, after all - eraserhd/parinfer-rust#139, eraserhd/parinfer-rust#133.

@justinbarclay
Copy link
Owner

Is this still an issue for anyone? I still can't recreate it, but with v0.9.0 there should be better support for comment chars

@Patryk27
Copy link
Author

I think it works correctly now 🙂

@justinbarclay
Copy link
Owner

Awesome, thanks for confirming 😄

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

3 participants