【问题标题】:How can I make Stack call Happy, Alex and other build tools?如何让 Stack 调用 Happy、Alex 和其他构建工具?
【发布时间】:2015-12-30 04:25:12
【问题描述】:

作为编译器的一部分,我需要 alexhappy 作为构建过程的一部分运行。 Stack 如何支持这种场景?

奖励:如何将 alexhappy 注册为编译时依赖项?

【问题讨论】:

    标签: haskell happy haskell-stack


    【解决方案1】:

    cabal了解alex文件的后缀.x和happy文件的.y,会自动使用alex和happy构建对应的.hs文件。

    采取的步骤:

    1. .x.y 文件添加到您的extra-source-files: 部分
    2. alexhappy 添加到您的build-tools: 部分
    3. 如果您的源文件是Foo.Bar.x,请确保Foo.Barexposed-module:other-modules: 中列出

    使用 alex 和 happy 的包的一个很好的例子是 language-python 包:

    https://github.com/bjpop/language-python/blob/master/language-python.cabal

    更新:这也与堆栈有关。事实上,stack 也会为你构建 alex 并为你高兴。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-24
      • 2013-12-17
      • 2011-03-07
      • 1970-01-01
      • 2023-04-02
      相关资源
      最近更新 更多