@@ -561,54 +561,56 @@ It delegates the actual error content to the eval or op handler."
561
561
(cider-default-err-eval-handler))
562
562
(t (cider-default-err-eval-print-handler))))
563
563
564
-
565
- (defconst cider-clojure-1.10--location `((or " at ("
566
- (sequence " at "
567
- (minimal-match (one-or-more anything)) ; ; the fully-qualified name of the function that triggered the error
568
- " (" ))
569
- (group-n 2 (minimal-match (zero-or-more anything)))
570
- " :"
571
- (group-n 3 (one-or-more digit))
572
- (optional " :" (group-n 4 (one-or-more digit)))
573
- " )." ))
574
-
575
- (defconst cider-clojure-1.10-error (append `(sequence
576
- " Syntax error "
577
- (minimal-match (zero-or-more anything))
578
- (or " compiling "
579
- " macroexpanding "
580
- " reading source " )
581
- (minimal-match (zero-or-more anything)))
582
- cider-clojure-1.10--location))
583
-
584
- (defconst cider-clojure-unexpected-error (append `(sequence
585
- " Unexpected error ("
586
- (minimal-match (one-or-more anything))
587
- " ) "
588
- (or " compiling "
589
- " macroexpanding "
590
- " reading source " )
591
- (minimal-match (one-or-more anything)))
592
- cider-clojure-1.10--location))
593
-
594
- (defconst cider-clojure-warning `(sequence
595
- (minimal-match (zero-or-more anything))
596
- (group-n 1 " warning" )
597
- " , "
598
- (group-n 2 (minimal-match (zero-or-more anything)))
599
- " :"
600
- (group-n 3 (one-or-more digit))
601
- (optional " :" (group-n 4 (one-or-more digit)))
602
- " - " ))
564
+ ; ; Reference:
565
+ ; ; https://github.com/clojure/clojure/blob/clojure-1.10.0/src/clj/clojure/main.clj#L251
566
+ ; ; See `cider-compilation-regexp' for interpretation of match groups.
567
+ (defconst cider-clojure-1.10--location
568
+ '(sequence
569
+ " at " (minimal-match (zero-or-more anything)) ; ; the fully-qualified name of the function that triggered the error
570
+ " ("
571
+ (group-n 2 (minimal-match (zero-or-more anything))) ; source file
572
+ " :" (group-n 3 (one-or-more (any " -" digit))) ; line number, may be negative (#3687)
573
+ (optional
574
+ " :" (group-n 4 (one-or-more (any " -" digit)))) ; column number
575
+ " )." ))
576
+
577
+ (defconst cider-clojure-1.10-error
578
+ `(sequence
579
+ " Syntax error "
580
+ (minimal-match (zero-or-more anything))
581
+ (or " compiling "
582
+ " macroexpanding "
583
+ " reading source " )
584
+ (minimal-match (zero-or-more anything))
585
+ , cider-clojure-1 .10--location))
586
+
587
+ (defconst cider-clojure-unexpected-error
588
+ `(sequence
589
+ " Unexpected error (" (minimal-match (one-or-more anything)) " ) "
590
+ (or " compiling "
591
+ " macroexpanding "
592
+ " reading source " )
593
+ (minimal-match (one-or-more anything))
594
+ , cider-clojure-1 .10--location))
595
+
596
+ (defconst cider-clojure-warning
597
+ `(sequence
598
+ (minimal-match (zero-or-more anything))
599
+ (group-n 1 " warning" )
600
+ " , " (group-n 2 (minimal-match (zero-or-more anything)))
601
+ " :" (group-n 3 (one-or-more (any " -" digit)))
602
+ (optional
603
+ " :" (group-n 4 (one-or-more (any " -" digit))))
604
+ " - " ))
603
605
604
606
; ; Please keep this in sync with `cider-clojure-compilation-error-regexp' ,
605
607
; ; which is a subset of these regexes.
606
608
(defconst cider-clojure-compilation-regexp
607
- (eval
608
- `(rx bol (or , cider-clojure-warning
609
- , cider-clojure-1 .10-error
610
- , cider-clojure-unexpected-error ))
611
- t )
609
+ (rx-to-string
610
+ `(seq bol (or , cider-clojure-warning
611
+ , cider-clojure-1 .10-error
612
+ , cider-clojure-unexpected-error ))
613
+ 'nogroup )
612
614
" A few example values that will match:
613
615
\" Reflection warning, /tmp/foo/src/foo/core.clj:14:1 - \"
614
616
\" CompilerException java.lang.RuntimeException: Unable to resolve symbol: \\
@@ -617,10 +619,10 @@ lol in this context, compiling:(/foo/core.clj:10:1)\"
617
619
\" Unexpected error (ClassCastException) macroexpanding defmulti at (src/haystack/parser.cljc:21:1).\" " )
618
620
619
621
(defconst cider-clojure-compilation-error-regexp
620
- (eval
621
- `(rx bol (or , cider-clojure-1 .10-error
622
- , cider-clojure-unexpected-error ))
623
- t )
622
+ (rx-to-string
623
+ `(seq bol (or , cider-clojure-1 .10-error
624
+ , cider-clojure-unexpected-error ))
625
+ 'nogroup )
624
626
" Like `cider-clojure-compilation-regexp' ,
625
627
but excluding warnings such as reflection warnings.
626
628
@@ -631,26 +633,23 @@ lol in this context, compiling:(/foo/core.clj:10:1)\"
631
633
\" Unexpected error (ClassCastException) macroexpanding defmulti at (src/haystack/parser.cljc:21:1).\" " )
632
634
633
635
(defconst cider--clojure-execution-error-regexp
634
- (append `(sequence
635
- " Execution error "
636
- (or (sequence " ("
637
- (minimal-match (one-or-more anything))
638
- " )" )
639
- (minimal-match (zero-or-more anything))))
640
- cider-clojure-1.10--location))
636
+ `(sequence
637
+ " Execution error "
638
+ (minimal-match (zero-or-more anything))
639
+ , cider-clojure-1 .10--location))
641
640
642
641
(defconst cider--clojure-spec-execution-error-regexp
643
- ( append `(sequence
644
- " Execution error - invalid arguments to "
645
- (minimal-match (one-or-more anything))
646
- " " )
647
- cider-clojure-1.10--location))
642
+ `(sequence
643
+ " Execution error - invalid arguments to "
644
+ (minimal-match (one-or-more anything))
645
+ " "
646
+ , cider-clojure-1 .10--location))
648
647
649
648
(defconst cider-clojure-runtime-error-regexp
650
- (eval
651
- `(rx bol (or , cider--clojure-execution-error-regexp
652
- , cider--clojure-spec-execution-error-regexp ))
653
- t )
649
+ (rx-to-string
650
+ `(seq bol (or , cider--clojure-execution-error-regexp
651
+ , cider--clojure-spec-execution-error-regexp ))
652
+ 'nogroup )
654
653
" Matches runtime errors, as oppsed to compile-time/macroexpansion-time errors.
655
654
656
655
A few example values that will match:
@@ -674,7 +673,11 @@ A few example values that will match:
674
673
" )" ))
675
674
676
675
(defvar cider-compilation-regexp
677
- (list cider-clojure-compilation-regexp 2 3 4 '(1 ))
676
+ (list cider-clojure-compilation-regexp
677
+ 2 ; FILE
678
+ 3 ; LINE
679
+ 4 ; COLUMN
680
+ '(1 )) ; TYPE = (WARNING . INFO)
678
681
" Specifications for matching errors and warnings in Clojure stacktraces.
679
682
See `compilation-error-regexp-alist' for help on their format." )
680
683
0 commit comments