branch: elpa/flycheck
commit 162efb72abdb5a1290fa084e5eaf35aa251e2dcd
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>

    Handle puppet-parser errors without line numbers
    
    Add a fallback error pattern for puppet-parser errors that lack
    line/column information, such as "Syntax error at end of file" or
    "Syntax error at end of input".
    
    Closes #1153
---
 flycheck.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/flycheck.el b/flycheck.el
index 97eff293ca..0c88c5f0a0 100644
--- a/flycheck.el
+++ b/flycheck.el
@@ -10799,7 +10799,11 @@ See URL `https://puppet.com/'."
           (minimal-match (zero-or-more not-newline))
           ": Could not parse for environment " (one-or-more word)
           ": " (message (minimal-match (zero-or-more anything)))
-          " at " (file-name "/" (zero-or-more not-newline)) ":" line line-end))
+          " at " (file-name "/" (zero-or-more not-newline)) ":" line line-end)
+   ;; Errors without line/column (e.g., "end of file" or "end of input")
+   (error line-start "Error: Could not parse for environment "
+          (one-or-more (in "a-z" "0-9" "_")) ":"
+          (message) line-end))
   :modes (puppet-mode puppet-ts-mode)
   :next-checkers ((warning . puppet-lint)))
 

Reply via email to