Skip to content

Implement support for Cabal CPP pragmas #255

Closed
@lykahb

Description

@lykahb

When a file has a pragma with Cabal macros like

#if MIN_VERSION_template_haskell(2, 7, 0)

it would not loaded by the inferior haskell process because of

error: missing binary operator before token "("
phase `C pre-processor' failed (exitcode = 1)

I suggest detecting this error message and issuing a command :set -optP-include -optPdist/build/autogen/cabal_macros.h as pointed out at http://stackoverflow.com/questions/12546757/how-do-i-use-cabals-min-version-and-other-macros-with-ghci

If the header file is absent, haskell-mode can run a cabal build.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions