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

wrong parens matching when ( in regex #201

Open
birdspider opened this issue Dec 11, 2019 · 0 comments
Open

wrong parens matching when ( in regex #201

birdspider opened this issue Dec 11, 2019 · 0 comments

Comments

@birdspider
Copy link

Problem

paren detection detects/uses parens in regular expression

Cause

#"reboot\s+system\s+boot\s+\S+\s+([^\(]+)\((.+)\)"
;                                ^
;                                |
; this wrongfully get detected as part of s-expression paren

Example
the following code is balanced/correct but the rebel-readline hints wrongly.
adding a ) hints the first ( giving the impression that a paren is missing - due to (above) missdetection on the opening paren in the re

user=> (require 'clojure.java.shell)
nil
user=> (let [data (re-seq #"reboot\s+system\s+boot\s+\S+\s+([^\(]+)\((.+)\)"
  #_=>                    (:out (clojure.java.shell/sh "/usr/bin/last" "-x" "reboot")))]
  #_=>   (map last data))
;                        ^
;                        |
; add ')' here, you'll see it matches/hints the let '(' 

misc

does not happen with rlwrap clojure nor with lein repl; clojure 1.10.1

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