-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start migrating to direct GHC API use and ghc-exactprint (#212)
The simplest HsProxy is migrated. For the time being, haskell-src-exts and ghc+ghc-exactprint will coexist and haskell-src-exts will be faded away. * prepare for ghc-exactprint migration. use only Util.HaskellSrcExts functions except types. * explicit export * make proxy-test generatable (for temporary tests for ghc-exactprint codegen) * first try to generate code using ghc-exactprint * finally print as desired. * success in LANGUAGE pragma printing * mkImport implementation * mkFun, mkFunSig * further mkBind1 * correct indentation doE and handling empty list * remove all s1 * con, inapp, op, par, strE * ormolu format fix * ghc945 -> ghc962 in CI
- Loading branch information
Showing
18 changed files
with
1,127 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
packages: | ||
../../fficxx/ | ||
../../fficxx-runtime/ | ||
optional-packages: | ||
./stdcxx/ | ||
./proxy-test/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module Main where | ||
|
||
import Language.Haskell.GHC.ExactPrint | ||
( makeDeltaAst, | ||
parseModule, | ||
showAst, | ||
) | ||
|
||
main :: IO () | ||
main = do | ||
e <- parseModule "/nix/store/1dccaqdx3v2acc4zk5cnln14jf5q7h04-ghc-9.6.2-with-packages/lib/ghc-9.6.2/lib" "./sample.hs" | ||
case e of | ||
Left msg -> print "error" -- print msg | ||
Right parsed -> putStrLn (showAst (makeDeltaAst parsed)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{-# LANGUAGE ForeignFunctionInterface #-} | ||
{-# OPTIONS_GHC -w #-} | ||
|
||
module MyModule where | ||
|
||
data K = K Int | ||
|
||
test :: IO () | ||
test = do | ||
addModFinalizer (addForeignSource LangCxx "\n#include \"test\"") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.