Skip to content

Interactive mode recognizes some lines as compiler errors incorrectly #635

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

Closed
ikirill opened this issue May 8, 2015 · 1 comment
Closed

Comments

@ikirill
Copy link
Contributor

ikirill commented May 8, 2015

In this error message, haskell-interactive-next-error-function incorrectly picks up the line

     program :: IO () ....

as a "FILE:LINE:COL-COL: ", and then fails to find the corresponding file, causing it to fail when the filename ends up being nil.

Here's an example:

src/EnvelopesGLFW.hs:144:3-18: Couldn't match expected type ‘Program’ with actual type ‘IO ()’ …
    In the pattern: program :: IO ()
    In a stmt of a 'do' block:
      program :: IO () <- makeProgram (ProgramSpec {..})
    In the expression:
      do { program :: IO () <- makeProgram (ProgramSpec {..});
           vao :: VertexArrayObject <- genObjectName;
           programCoords <- uniformCoords program "coords";
           bufPos <- setupBuffer vao ArrayBuffer
                     $ do { locPos <- attribLocation' program "position" FloatVec2;
                            vertexAttribArray locPos $= Enabled;
                            .... };
           .... }
ikirill added a commit to ikirill/haskell-mode that referenced this issue May 8, 2015
Disallow leading spaces in error regexp in interactive mode.
ikirill added a commit to ikirill/haskell-mode that referenced this issue May 9, 2015
Disallow leading spaces in error regexp in interactive mode.
@gracjan
Copy link
Contributor

gracjan commented May 9, 2015

For reference haskell-flycheck uses this specification:

  :error-patterns
  ((warning line-start (file-name) ":" line ":" column ":"
            (or " " "\n    ") "Warning:" (optional "\n")
            (message
             (one-or-more " ") (one-or-more not-newline)
             (zero-or-more "\n"
                           (one-or-more " ")
                           (one-or-more not-newline)))
            line-end)
   (error line-start (file-name) ":" line ":" column ":"
          (or (message (one-or-more not-newline))
              (and "\n"
                   (message
                    (one-or-more " ") (one-or-more not-newline)
                    (zero-or-more "\n"
                                  (one-or-more " ")
                                  (one-or-more not-newline)))))
          line-end))

Here: https://github.com/flycheck/flycheck/blob/master/flycheck.el#L6237

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

2 participants