]> git.eshelyaron.com Git - sweep.git/commitdiff
* (sweeprolog-analyze-fragment-flymake): restrict syntax errors
authorEshel Yaron <me@eshelyaron.com>
Sat, 19 Nov 2022 20:29:17 +0000 (22:29 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sat, 19 Nov 2022 20:29:17 +0000 (22:29 +0200)
sweeprolog.el

index 2ccd786b2775b64360d3ace19fc9d141c9027be7..7ea364a4bf377f6ee8f163aec5fd07055fe0b254 100644 (file)
@@ -1994,7 +1994,22 @@ resulting list even when found in the current clause."
                 ("type_error"
                  (cons :warning "Type error"))
                 (`("syntax_error" ,message . ,_)
-                 (cons :error message))
+                 (and (or (and sweeprolog--analyze-point
+                               (<= (save-excursion
+                                     (goto-char sweeprolog--analyze-point)
+                                     (sweeprolog-beginning-of-top-term)
+                                     (1- (point)))
+                                   (1+ end) sweeprolog--analyze-point))
+                          (< (save-excursion
+                               (goto-char sweeprolog--analyze-point)
+                               (sweeprolog-end-of-top-term)
+                               (point))
+                             (save-excursion
+                               (goto-char sweeprolog--analyze-point)
+                               (sweeprolog-beginning-of-next-top-term)
+                               (point))
+                             (point-max)))
+                      (cons :error message)))
                 ("unused_import"
                  (cons :note "Unused import"))
                 ("undefined_import"