From 91f323dac411e4932c9fa45da14acdbfff4af910 Mon Sep 17 00:00:00 2001 From: Joshua Grosso Date: Wed, 28 Dec 2022 19:01:17 -0700 Subject: [PATCH] Add necessary Axel imports to transpiled files (see #81) --- README.org | 8 +++- app/Main.hs | 5 ++- src/Axel.axel | 1 + src/Axel.hs | 38 +++++++++-------- src/Axel/AST.hs | 11 ++--- src/Axel/Haskell/Macros.hs | 5 ++- src/Axel/Macros.hs | 41 +++++++++++++------ src/Axel/Parse.hs | 4 +- src/Axel/Parse/AST.hs | 22 +++++++--- src/Axel/Parse/Args.hs | 5 ++- src/Axel/Sourcemap.hs | 40 ++++++++++++------ .../Haskell/errors/Sourcemap1.error_golden | 5 ++- .../errors/ThroughQuasiquote.error_golden | 11 +++-- .../Test/Transpilation/TranspilationSpec.hs | 3 +- ...golden_ExpandIntoInterdependentMacros.axel | 1 + .../golden_ExpandIntoInterdependentMacros.hs | 22 +++++----- .../Transpilation/macros/golden_Quasiquote.hs | 11 ++--- .../regression/golden_Issue79.hs | 7 ++-- .../Transpilation/syntax/golden_CaseSyntax.hs | 7 ++-- .../syntax/golden_CommentSyntax.hs | 7 ++-- .../syntax/golden_DataDefinitionSyntax.hs | 7 ++-- .../syntax/golden_FunctionDefinitionSyntax.hs | 7 ++-- .../syntax/golden_ImportSyntax.hs | 7 ++-- .../syntax/golden_LambdaSyntax.hs | 7 ++-- .../Transpilation/syntax/golden_LetSyntax.hs | 7 ++-- .../Transpilation/syntax/golden_ListSyntax.hs | 7 ++-- .../syntax/golden_ModuleSyntax.hs | 7 ++-- .../syntax/golden_NewtypeDefinitionSyntax.hs | 7 ++-- .../syntax/golden_OperatorSectionSyntax.hs | 7 ++-- .../syntax/golden_PatternBinding.hs | 7 ++-- .../syntax/golden_PragmaSyntax.hs | 7 ++-- .../Transpilation/syntax/golden_RawSyntax.hs | 7 ++-- .../syntax/golden_RecordSyntax.hs | 7 ++-- .../syntax/golden_StringSyntax.hs | 7 ++-- .../golden_TypeClassDefinitionSyntax.hs | 7 ++-- .../syntax/golden_TypeClassInstanceSyntax.hs | 7 ++-- .../syntax/golden_TypeSignatureSyntax.hs | 7 ++-- .../Transpilation/syntax/golden_TypeSyntax.hs | 7 ++-- .../Transpilation/syntax/golden_UnitSyntax.hs | 7 ++-- 39 files changed, 233 insertions(+), 154 deletions(-) diff --git a/README.org b/README.org index 2969492..d9c00b0 100644 --- a/README.org +++ b/README.org @@ -6,11 +6,15 @@ See [[https://axellang.github.io]]. #+CAPTION: Build Status [[https://travis-ci.org/axellang/axel.svg?branch=master]] - + *CURRENT STATUS:* I'm currently recovering from some academic burnout (much to my chagrin), hence the dearth of recent activity. I promise that Axel is /not/ abandoned, and active development should resume within the next several months. ** Code Style Run ~scripts/format.sh~ to format code and ~scripts/lint.sh~ to run the linter. ** Running - Run ~cabal run -- axel ~ to build and run the project and ~scripts/test.sh~ to test the project. + Run ~cabal run -- axel ~ to build and run the project. +** Testing + Run ~scripts/test.sh~ to test the project. +*** Golden Tests + To prevent issues like #79: Before committing any new (or modified) golden tests, run `cabal exec ghci -- -package axel` (or equivalent) on the corresponding `hs` files to ensure that they actually parse. (It's okay if they don't compile or evaluate, as long as they are valid Haskell.) ** Examples See the ~.axel~ files in this repository for example Axel programs. diff --git a/app/Main.hs b/app/Main.hs index 8b12877..f145971 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -1,7 +1,8 @@ module Main where import Axel -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap import Axel.Eff.App(AppEffs,runApp) import Axel.Eff.Console(putStrLn) import Axel.Eff.Ghci(withGhci) diff --git a/src/Axel.axel b/src/Axel.axel index f7f8dc9..e9f8e75 100644 --- a/src/Axel.axel +++ b/src/Axel.axel @@ -4,6 +4,7 @@ (import Axel.Prelude all) (import Axel.Parse [hygenisizeIdentifier]) +(importq Axel.Parse.AST AST all) (importq Axel.Sourcemap SM all) (import Axel.Utils.FilePath [takeFileName]) (import Data.IORef [IORef modifyIORef newIORef readIORef]) diff --git a/src/Axel.hs b/src/Axel.hs index 3f7dd27..5965616 100644 --- a/src/Axel.hs +++ b/src/Axel.hs @@ -1,9 +1,11 @@ {-# OPTIONS_GHC -Wno-incomplete-patterns #-} module Axel where -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap import Axel.Prelude import Axel.Parse(hygenisizeIdentifier) +import qualified Axel.Parse.AST as AST import qualified Axel.Sourcemap as SM import Axel.Utils.FilePath(takeFileName) import Data.IORef(IORef,modifyIORef,newIORef,readIORef) @@ -13,9 +15,9 @@ aXEL_SYMBOL_IF_ :: () => ((->) Bool ((->) a ((->) a a))) aXEL_SYMBOL_IF_ True x _ = x aXEL_SYMBOL_IF_ False _ x = x expandDo :: () => ((->) ([] SM.Expression) SM.Expression) -expandDo ((:) (AST.SExpression _ [(AST.Symbol _ "<-"),var,val]) rest) = (AST.SExpression (GHCPrelude.Just ((,) "src/Axel.axel" (SM.Position 43 8))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/5670498282835698530/result.axel" (SM.Position 2 156))) ">>=")],[val],[(AST.SExpression (GHCPrelude.Just ((,) "src/Axel.axel" (SM.Position 43 18))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/5670498282835698530/result.axel" (SM.Position 2 254))) "\\")],[(AST.SExpression (GHCPrelude.Just ((,) "src/Axel.axel" (SM.Position 43 21))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/5670498282835698530/result.axel" (SM.Position 2 344))) "list")],[var]]))],[(expandDo rest)]]))]])) -expandDo ((:) (AST.SExpression _ ((:) (AST.Symbol _ "aXEL_SYMBOL_LET_") bindings)) rest) = (AST.SExpression (GHCPrelude.Just ((,) "src/Axel.axel" (SM.Position 45 8))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/5670498282835698530/result.axel" (SM.Position 3 173))) "aXEL_SYMBOL_LET_")],[(AST.SExpression (GHCPrelude.Just ((,) "src/Axel.axel" (SM.Position 45 13))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/5670498282835698530/result.axel" (SM.Position 3 278))) "list")],(AST.toExpressionList bindings)]))],[(expandDo rest)]])) -expandDo ((:) val rest) = (case rest of {[] -> val;_ -> (AST.SExpression (GHCPrelude.Just ((,) "src/Axel.axel" (SM.Position 47 31))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/5670498282835698530/result.axel" (SM.Position 4 137))) ">>")],[val],[(expandDo rest)]]))}) +expandDo ((:) (AST.SExpression _ [(AxelRuntime_AST.Symbol _ "<-"),var,val]) rest) = (AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "src/Axel.axel" (AxelRuntime_Sourcemap.Position 44 8))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/3735029020733611241/result.axel" (AxelRuntime_Sourcemap.Position 2 199))) ">>=")],[val],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "src/Axel.axel" (AxelRuntime_Sourcemap.Position 44 18))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/3735029020733611241/result.axel" (AxelRuntime_Sourcemap.Position 2 340))) "\\")],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "src/Axel.axel" (AxelRuntime_Sourcemap.Position 44 21))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/3735029020733611241/result.axel" (AxelRuntime_Sourcemap.Position 2 473))) "list")],[var]]))],[(expandDo rest)]]))]])) +expandDo ((:) (AST.SExpression _ ((:) (AxelRuntime_AST.Symbol _ "aXEL_SYMBOL_LET_") bindings)) rest) = (AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "src/Axel.axel" (AxelRuntime_Sourcemap.Position 46 8))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/3735029020733611241/result.axel" (AxelRuntime_Sourcemap.Position 3 216))) "aXEL_SYMBOL_LET_")],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "src/Axel.axel" (AxelRuntime_Sourcemap.Position 46 13))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/3735029020733611241/result.axel" (AxelRuntime_Sourcemap.Position 3 364))) "list")],(AxelRuntime_AST.toExpressionList bindings)]))],[(expandDo rest)]])) +expandDo ((:) val rest) = (case rest of {[] -> val;_ -> (AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "src/Axel.axel" (AxelRuntime_Sourcemap.Position 48 31))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/3735029020733611241/result.axel" (AxelRuntime_Sourcemap.Position 4 180))) ">>")],[val],[(expandDo rest)]]))}) gensymCounter :: () => (IORef Int) gensymCounter = (unsafePerformIO (newIORef 0)) {-# NOINLINE gensymCounter #-} @@ -25,18 +27,18 @@ isPrelude :: () => ((->) FilePath Bool) isPrelude = ((.) ((==) (FilePath "Axel.axel")) takeFileName) preludeMacros :: () => ([] Text) preludeMacros = (map ((.) T.pack hygenisizeIdentifier) ["|","applyInfix","defmacro","def","do","\\case","syntaxQuote"]) -applyInfix_AXEL_AUTOGENERATED_MACRO_DEFINITION [op,x] = (pure [(AST.SExpression (GHCPrelude.Just ((,) "src/Axel.axel" (SM.Position 13 35))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "src/Axel.axel" (SM.Position 13 36))) "flip")],[op],[x]]))]) -applyInfix_AXEL_AUTOGENERATED_MACRO_DEFINITION [x,op,y] = (pure [(AST.SExpression (GHCPrelude.Just ((,) "src/Axel.axel" (SM.Position 15 37))) (concat [[op],[x],[y]]))]) -defmacro_AXEL_AUTOGENERATED_MACRO_DEFINITION ((:) name cases) = (pure (map (\(AST.SExpression _ ((:) args body)) -> (AST.SExpression (GHCPrelude.Just ((,) "src/Axel.axel" (SM.Position 19 24))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "src/Axel.axel" (SM.Position 19 25))) "aXEL_VALUE_aXEL_SYMBOL_EQUALS_macro")],[name],[args],(AST.toExpressionList body)]))) cases)) -def_AXEL_AUTOGENERATED_MACRO_DEFINITION ((:) name ((:) typeSig cases)) = (pure ((:) (AST.SExpression (GHCPrelude.Just ((,) "src/Axel.axel" (SM.Position 25 15))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/6491493558012962605/result.axel" (SM.Position 1 164))) "::")],[name],(AST.toExpressionList typeSig)])) (map (\(AST.SExpression _ ((:) (AST.SExpression _ ((:) (AST.Symbol _ "list") args)) xs)) -> (AST.SExpression (GHCPrelude.Just ((,) "src/Axel.axel" (SM.Position 31 17))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/6491493558012962605/result.axel" (SM.Position 1 383))) "=")],[(AST.SExpression (GHCPrelude.Just ((,) "src/Axel.axel" (SM.Position 31 20))) (concat [[name],(AST.toExpressionList args)]))],(AST.toExpressionList xs)]))) cases))) +applyInfix_AXEL_AUTOGENERATED_MACRO_DEFINITION [op,x] = (pure [(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "src/Axel.axel" (AxelRuntime_Sourcemap.Position 14 35))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "src/Axel.axel" (AxelRuntime_Sourcemap.Position 14 36))) "flip")],[op],[x]]))]) +applyInfix_AXEL_AUTOGENERATED_MACRO_DEFINITION [x,op,y] = (pure [(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "src/Axel.axel" (AxelRuntime_Sourcemap.Position 16 37))) (concat [[op],[x],[y]]))]) +defmacro_AXEL_AUTOGENERATED_MACRO_DEFINITION ((:) name cases) = (pure (map (\(AST.SExpression _ ((:) args body)) -> (AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "src/Axel.axel" (AxelRuntime_Sourcemap.Position 20 24))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "src/Axel.axel" (AxelRuntime_Sourcemap.Position 20 25))) "aXEL_VALUE_aXEL_SYMBOL_EQUALS_macro")],[name],[args],(AxelRuntime_AST.toExpressionList body)]))) cases)) +def_AXEL_AUTOGENERATED_MACRO_DEFINITION ((:) name ((:) typeSig cases)) = (pure ((:) (AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "src/Axel.axel" (AxelRuntime_Sourcemap.Position 26 15))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2511363082445148512/result.axel" (AxelRuntime_Sourcemap.Position 1 207))) "::")],[name],(AxelRuntime_AST.toExpressionList typeSig)])) (map (\(AST.SExpression _ ((:) (AST.SExpression _ ((:) (AST.Symbol _ "list") args)) xs)) -> (AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "src/Axel.axel" (AxelRuntime_Sourcemap.Position 32 17))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2511363082445148512/result.axel" (AxelRuntime_Sourcemap.Position 1 481))) "=")],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "src/Axel.axel" (AxelRuntime_Sourcemap.Position 32 20))) (concat [[name],(AxelRuntime_AST.toExpressionList args)]))],(AxelRuntime_AST.toExpressionList xs)]))) cases))) syntaxQuote_AXEL_AUTOGENERATED_MACRO_DEFINITION [x] = (pure [(AST.quoteExpression (const (AST.Symbol Nothing "_")) x)]) aXEL_SYMBOL_DO__AXEL_AUTOGENERATED_MACRO_DEFINITION input = (pure [(expandDo input)]) -aXEL_VALUE_aXEL_SYMBOL_BACKSLASH_case_AXEL_AUTOGENERATED_MACRO_DEFINITION cases = (fmap (\varId -> [(AST.SExpression (GHCPrelude.Just ((,) "src/Axel.axel" (SM.Position 67 28))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "src/Axel.axel" (SM.Position 67 29))) "\\")],[(AST.SExpression (GHCPrelude.Just ((,) "src/Axel.axel" (SM.Position 67 31))) (concat [[(AST.Symbol GHCPrelude.Nothing "list")],[varId]]))],[(AST.SExpression (GHCPrelude.Just ((,) "src/Axel.axel" (SM.Position 67 40))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "src/Axel.axel" (SM.Position 67 41))) "case")],[varId],(AST.toExpressionList cases)]))]]))]) gensym) -(|%%%%%%%%%%) cases = (pure [(foldr (\(AST.SExpression _ [cond,x]) acc -> (AST.SExpression (GHCPrelude.Just ((,) "src/Axel.axel" (SM.Position 73 51))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "src/Axel.axel" (SM.Position 73 52))) "aXEL_SYMBOL_IF_")],[cond],[x],[acc]]))) (AST.Symbol (GHCPrelude.Just ((,) "src/Axel.axel" (SM.Position 74 13))) "undefined") cases)]) -applyInfix_AXEL_AUTOGENERATED_MACRO_DEFINITION :: [AST.Expression SM.SourceMetadata] -> GHCPrelude.IO [AST.Expression SM.SourceMetadata] -defmacro_AXEL_AUTOGENERATED_MACRO_DEFINITION :: [AST.Expression SM.SourceMetadata] -> GHCPrelude.IO [AST.Expression SM.SourceMetadata] -def_AXEL_AUTOGENERATED_MACRO_DEFINITION :: [AST.Expression SM.SourceMetadata] -> GHCPrelude.IO [AST.Expression SM.SourceMetadata] -syntaxQuote_AXEL_AUTOGENERATED_MACRO_DEFINITION :: [AST.Expression SM.SourceMetadata] -> GHCPrelude.IO [AST.Expression SM.SourceMetadata] -aXEL_SYMBOL_DO__AXEL_AUTOGENERATED_MACRO_DEFINITION :: [AST.Expression SM.SourceMetadata] -> GHCPrelude.IO [AST.Expression SM.SourceMetadata] -aXEL_VALUE_aXEL_SYMBOL_BACKSLASH_case_AXEL_AUTOGENERATED_MACRO_DEFINITION :: [AST.Expression SM.SourceMetadata] -> GHCPrelude.IO [AST.Expression SM.SourceMetadata] -(|%%%%%%%%%%) :: [AST.Expression SM.SourceMetadata] -> GHCPrelude.IO [AST.Expression SM.SourceMetadata] \ No newline at end of file +aXEL_VALUE_aXEL_SYMBOL_BACKSLASH_case_AXEL_AUTOGENERATED_MACRO_DEFINITION cases = (fmap (\varId -> [(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "src/Axel.axel" (AxelRuntime_Sourcemap.Position 68 28))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "src/Axel.axel" (AxelRuntime_Sourcemap.Position 68 29))) "\\")],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "src/Axel.axel" (AxelRuntime_Sourcemap.Position 68 31))) (concat [[(AxelRuntime_AST.Symbol AxelRuntime_GHCPrelude.Nothing "list")],[varId]]))],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "src/Axel.axel" (AxelRuntime_Sourcemap.Position 68 40))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "src/Axel.axel" (AxelRuntime_Sourcemap.Position 68 41))) "case")],[varId],(AxelRuntime_AST.toExpressionList cases)]))]]))]) gensym) +(|%%%%%%%%%%) cases = (pure [(foldr (\(AST.SExpression _ [cond,x]) acc -> (AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "src/Axel.axel" (AxelRuntime_Sourcemap.Position 74 51))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "src/Axel.axel" (AxelRuntime_Sourcemap.Position 74 52))) "aXEL_SYMBOL_IF_")],[cond],[x],[acc]]))) (AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "src/Axel.axel" (AxelRuntime_Sourcemap.Position 75 13))) "undefined") cases)]) +applyInfix_AXEL_AUTOGENERATED_MACRO_DEFINITION :: [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata] -> AxelRuntime_GHCPrelude.IO [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata] +defmacro_AXEL_AUTOGENERATED_MACRO_DEFINITION :: [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata] -> AxelRuntime_GHCPrelude.IO [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata] +def_AXEL_AUTOGENERATED_MACRO_DEFINITION :: [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata] -> AxelRuntime_GHCPrelude.IO [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata] +syntaxQuote_AXEL_AUTOGENERATED_MACRO_DEFINITION :: [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata] -> AxelRuntime_GHCPrelude.IO [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata] +aXEL_SYMBOL_DO__AXEL_AUTOGENERATED_MACRO_DEFINITION :: [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata] -> AxelRuntime_GHCPrelude.IO [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata] +aXEL_VALUE_aXEL_SYMBOL_BACKSLASH_case_AXEL_AUTOGENERATED_MACRO_DEFINITION :: [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata] -> AxelRuntime_GHCPrelude.IO [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata] +(|%%%%%%%%%%) :: [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata] -> AxelRuntime_GHCPrelude.IO [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata] \ No newline at end of file diff --git a/src/Axel/AST.hs b/src/Axel/AST.hs index 2dcc12d..4c02501 100644 --- a/src/Axel/AST.hs +++ b/src/Axel/AST.hs @@ -495,17 +495,14 @@ instance ToHaskell (DataDeclaration (Maybe SM.Expression)) where Parentheses (SM.delimit Commas $ map toHaskell $ dataDeclaration ^. derivedConstraints) where + tryRemoveSurroundingParentheses :: SM.Output -> SM.Output tryRemoveSurroundingParentheses xs = if "(" `T.isPrefixOf` (xs ^. _Wrapped . _head . unannotated) - then removeSurroundingParentheses xs + then let removeOpen = _Wrapped . _head . unannotated %~ T.tail + removeClosed = _Wrapped . _last . unannotated %~ T.init + in removeOpen $ removeClosed xs else xs -removeSurroundingParentheses :: SM.Output -> SM.Output -removeSurroundingParentheses = removeOpen . removeClosed - where - removeOpen = _Wrapped . _head . unannotated %~ T.tail - removeClosed = _Wrapped . _last . unannotated %~ T.init - instance ToHaskell (NewtypeDeclaration (Maybe SM.Expression)) where toHaskell :: NewtypeDeclaration (Maybe SM.Expression) -> SM.Output toHaskell newtypeDeclaration = diff --git a/src/Axel/Haskell/Macros.hs b/src/Axel/Haskell/Macros.hs index 7ba369e..71fc65f 100644 --- a/src/Axel/Haskell/Macros.hs +++ b/src/Axel/Haskell/Macros.hs @@ -1,7 +1,8 @@ module Axel.Haskell.Macros where import Axel -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap import Axel.Prelude import Axel.Haskell.Language(isOperator) import qualified Data.Text as T diff --git a/src/Axel/Macros.hs b/src/Axel/Macros.hs index a3d0460..3cdf99b 100644 --- a/src/Axel/Macros.hs +++ b/src/Axel/Macros.hs @@ -373,7 +373,7 @@ mkMacroTypeSignature :: Identifier -> SMStatement mkMacroTypeSignature macroName = SRawStatement Nothing $ SM.raw (toHaskell (EIdentifier (Nothing :: Maybe SM.Expression) macroName)) <> - " :: [AST.Expression SM.SourceMetadata] -> GHCPrelude.IO [AST.Expression SM.SourceMetadata]" + " :: [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata] -> AxelRuntime_GHCPrelude.IO [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata]" newtype ExpansionId = ExpansionId Text @@ -394,9 +394,23 @@ autogeneratedImports filePath | not $ isPrelude filePath ] <> [ SQualifiedImport $ - QualifiedImport Nothing "Prelude" "GHCPrelude" (ImportAll Nothing) -- (in case `-XNoImplicitPrelude` is enabled) + QualifiedImport + Nothing + "Prelude" + "AxelRuntime_GHCPrelude" + (ImportAll Nothing) -- (in case `-XNoImplicitPrelude` is enabled) , SQualifiedImport $ - QualifiedImport Nothing "Axel.Parse.AST" "AST" (ImportAll Nothing) + QualifiedImport + Nothing + "Axel.Parse.AST" + "AxelRuntime_AST" + (ImportAll Nothing) + , SQualifiedImport $ + QualifiedImport + Nothing + "Axel.Sourcemap" + "AxelRuntime_Sourcemap" + (ImportAll Nothing) ] generateMacroProgram :: @@ -436,14 +450,15 @@ generateMacroProgram filePath' oldMacroName args = do mkList xs = mkFnApp (mkId "[") $ intersperse (mkRawExpr ",") xs <> [mkId "]"] -- This is VERY hacky, but it'll work without too much effort for now. in ( autogeneratedImports filePath' <> - [mkQualImport "Axel.Sourcemap" "SM"] + [mkQualImport "Axel.Sourcemap" "AxelRuntime_Sourcemap"] , mkModuleDecl scaffoldModuleName : autogeneratedImports filePath' <> [ mkQualImport macroDefAndEnvModuleName macroDefAndEnvModuleName - , mkQualImport "Axel.Sourcemap" "SM" - , mkTySig "main" $ mkFnApp (mkId "GHCPrelude.IO") [mkId "()"] + , mkQualImport "Axel.Sourcemap" "AxelRuntime_Sourcemap" + , mkTySig "main" $ + mkFnApp (mkId "AxelRuntime_GHCPrelude.IO") [mkId "()"] , mkFnDef "main" [] $ mkFnApp - (mkId "(GHCPrelude.>>=)") + (mkId "(AxelRuntime_GHCPrelude.>>=)") [ mkFnApp (mkQualId macroDefAndEnvModuleName @@ -455,12 +470,14 @@ generateMacroProgram filePath' oldMacroName args = do args) ] , mkFnApp - (mkId "(GHCPrelude..)") - [ mkId "GHCPrelude.putStrLn" + (mkId "(AxelRuntime_GHCPrelude..)") + [ mkId "AxelRuntime_GHCPrelude.putStrLn" , mkFnApp - (mkId "(GHCPrelude..)") - [ mkId "GHCPrelude.unlines" - , mkFnApp (mkId "GHCPrelude.map") [mkId "AST.toAxel'"] + (mkId "(AxelRuntime_GHCPrelude..)") + [ mkId "AxelRuntime_GHCPrelude.unlines" + , mkFnApp + (mkId "AxelRuntime_GHCPrelude.map") + [mkId "AxelRuntime_AST.toAxel'"] ] ] ] diff --git a/src/Axel/Parse.hs b/src/Axel/Parse.hs index 63a468b..808fb12 100644 --- a/src/Axel/Parse.hs +++ b/src/Axel/Parse.hs @@ -161,7 +161,7 @@ expandQuasiquote (SExpression _ [Symbol _ "unquoteSplicing", _]) = expandQuasiquote (SExpression ann' xs) = SExpression ann' - [ Symbol ann' "AST.SExpression" + [ Symbol ann' "AxelRuntime_AST.SExpression" , quoteSourceMetadata ann' , SExpression ann' @@ -176,7 +176,7 @@ expandQuasiquote expr = expandQuasiquoteInList :: SM.Expression -> SM.Expression expandQuasiquoteInList (SExpression _ [Symbol _ "unquoteSplicing", expr]) = let ann' = getAnn expr - in SExpression ann' [Symbol ann' "AST.toExpressionList", expr] + in SExpression ann' [Symbol ann' "AxelRuntime_AST.toExpressionList", expr] expandQuasiquoteInList expr = let ann' = getAnn expr in SExpression ann' [Symbol ann' "list", expandQuasiquote expr] diff --git a/src/Axel/Parse/AST.hs b/src/Axel/Parse/AST.hs index 7940b31..ee6efe9 100644 --- a/src/Axel/Parse/AST.hs +++ b/src/Axel/Parse/AST.hs @@ -155,26 +155,36 @@ quoteExpression :: quoteExpression quoteAnn (LiteralChar ann x) = SExpression ann - [Symbol ann "AST.LiteralChar", quoteAnn ann, LiteralChar ann x] + [Symbol ann "AxelRuntime_AST.LiteralChar", quoteAnn ann, LiteralChar ann x] quoteExpression quoteAnn (LiteralFloat ann x) = SExpression ann - [Symbol ann "AST.LiteralFloat", quoteAnn ann, LiteralFloat ann x] + [ Symbol ann "AxelRuntime_AST.LiteralFloat" + , quoteAnn ann + , LiteralFloat ann x + ] quoteExpression quoteAnn (LiteralInt ann x) = - SExpression ann [Symbol ann "AST.LiteralInt", quoteAnn ann, LiteralInt ann x] + SExpression + ann + [Symbol ann "AxelRuntime_AST.LiteralInt", quoteAnn ann, LiteralInt ann x] quoteExpression quoteAnn (LiteralString ann x) = SExpression ann - [Symbol ann "AST.LiteralString", quoteAnn ann, LiteralString ann x] + [ Symbol ann "AxelRuntime_AST.LiteralString" + , quoteAnn ann + , LiteralString ann x + ] quoteExpression quoteAnn (SExpression ann xs) = SExpression ann - [ Symbol ann "AST.SExpression" + [ Symbol ann "AxelRuntime_AST.SExpression" , quoteAnn ann , SExpression ann (Symbol ann "list" : map (quoteExpression quoteAnn) xs) ] quoteExpression quoteAnn (Symbol ann x) = - SExpression ann [Symbol ann "AST.Symbol", quoteAnn ann, LiteralString ann x] + SExpression + ann + [Symbol ann "AxelRuntime_AST.Symbol", quoteAnn ann, LiteralString ann x] -- | NOTE This is for internal use; you likely don't need to use this directly. -- diff --git a/src/Axel/Parse/Args.hs b/src/Axel/Parse/Args.hs index 6002aa4..3b6d1ed 100644 --- a/src/Axel/Parse/Args.hs +++ b/src/Axel/Parse/Args.hs @@ -1,7 +1,8 @@ module Axel.Parse.Args where import Axel -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap import Axel.Prelude import Control.Applicative((<**>)) import Data.Foldable(asum) diff --git a/src/Axel/Sourcemap.hs b/src/Axel/Sourcemap.hs index 9518caa..1ca66f5 100644 --- a/src/Axel/Sourcemap.hs +++ b/src/Axel/Sourcemap.hs @@ -97,21 +97,35 @@ data Bracket | SingleQuotes | SquareBrackets +openBracket :: Bracket -> Char +openBracket CurlyBraces = '{' +openBracket DoubleQuotes = '"' +openBracket Parentheses = '(' +openBracket SingleQuotes = '\'' +openBracket SquareBrackets = '[' + +closeBracket :: Bracket -> Char +closeBracket CurlyBraces = '}' +closeBracket DoubleQuotes = '"' +closeBracket Parentheses = ')' +closeBracket SingleQuotes = '\'' +closeBracket SquareBrackets = ']' + +tryRemoveBrackets :: Bracket -> Text -> Text +tryRemoveBrackets bracket text = + if T.length text >= 2 && + T.head text == openBracket bracket && T.last text == closeBracket bracket + then T.init $ T.tail text + else text + surround :: Bracket -> Output -> Output surround bracket x = let (startMetadata, endMetadata) = case x of Output [] -> (Nothing, Nothing) Output xs -> (unsafeHead xs ^. annotation, last xs ^. annotation) - (open, closed) = - case bracket of - CurlyBraces -> ("{", "}") - DoubleQuotes -> ("\"", "\"") - Parentheses -> ("(", ")") - SingleQuotes -> ("'", "'") - SquareBrackets -> ("[", "]") - in Output [annotate startMetadata open] <> - x <> Output [annotate endMetadata closed] + in Output [annotate startMetadata (T.singleton $ openBracket bracket)] <> + x <> Output [annotate endMetadata (T.singleton $ closeBracket bracket)] data Delimiter = Commas @@ -176,7 +190,7 @@ quotePosition :: Position -> Expression quotePosition sourcePosition = Parse.SExpression Nothing - [ Parse.Symbol Nothing "SM.Position" + [ Parse.Symbol Nothing "AxelRuntime_Sourcemap.Position" , Parse.LiteralInt Nothing (sourcePosition ^. line) , Parse.LiteralInt Nothing (sourcePosition ^. column) ] @@ -188,9 +202,11 @@ quote2Tuple (quoterA, quoterB) (a, b) = -- TODO Derive this with Template Haskell (it's currently very brittle) quoteMaybe :: (a -> Expression) -> Maybe a -> Expression -quoteMaybe _ Nothing = Parse.Symbol Nothing "GHCPrelude.Nothing" +quoteMaybe _ Nothing = Parse.Symbol Nothing "AxelRuntime_GHCPrelude.Nothing" quoteMaybe quoter (Just x) = - Parse.SExpression Nothing [Parse.Symbol Nothing "GHCPrelude.Just", quoter x] + Parse.SExpression + Nothing + [Parse.Symbol Nothing "AxelRuntime_GHCPrelude.Just", quoter x] quoteSourceMetadata :: Maybe SourcePosition -> Expression quoteSourceMetadata = quoteMaybe $ quote2Tuple (quoteString, quotePosition) diff --git a/test/Axel/Test/Haskell/errors/Sourcemap1.error_golden b/test/Axel/Test/Haskell/errors/Sourcemap1.error_golden index 093a822..5ec8144 100644 --- a/test/Axel/Test/Haskell/errors/Sourcemap1.error_golden +++ b/test/Axel/Test/Haskell/errors/Sourcemap1.error_golden @@ -5,8 +5,9 @@ While expanding (test): [47 of 48] Compiling AutogeneratedAxelMacroDefinitionAndEnvironment8691214048254095332 ( axelTemp/8691214048254095332/AutogeneratedAxelMacroDefinitionAndEnvironment8691214048254095332.hs, interpreted ) Variable not in scope: undefinedFunction - :: GHCPrelude.IO [AST.Expression SM.SourceMetadata] -The above message is in terms of the generated Haskell, at axelTemp/8691214048254095332/AutogeneratedAxelMacroDefinitionAndEnvironment8691214048254095332.hs:8:47. + :: AxelRuntime_GHCPrelude.IO + [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata] +The above message is in terms of the generated Haskell, at axelTemp/8691214048254095332/AutogeneratedAxelMacroDefinitionAndEnvironment8691214048254095332.hs:9:47. Try checking at Sourcemap1:3:17. If the Axel code at that position doesn't seem related, something may have gone wrong during a macro expansion. Failed, 46 modules loaded. \ No newline at end of file diff --git a/test/Axel/Test/Haskell/errors/ThroughQuasiquote.error_golden b/test/Axel/Test/Haskell/errors/ThroughQuasiquote.error_golden index 8b816f3..ac786ca 100644 --- a/test/Axel/Test/Haskell/errors/ThroughQuasiquote.error_golden +++ b/test/Axel/Test/Haskell/errors/ThroughQuasiquote.error_golden @@ -5,18 +5,21 @@ While expanding (test2): [49 of 50] Compiling AutogeneratedAxelMacroDefinitionAndEnvironment2198386876840781157 ( axelTemp/2198386876840781157/AutogeneratedAxelMacroDefinitionAndEnvironment2198386876840781157.hs, interpreted ) Variable not in scope: undefinedFunction - :: t0 -> t1 -> IO [AST.Expression SM.SourceMetadata] -The above message is in terms of the generated Haskell, at axelTemp/2198386876840781157/AutogeneratedAxelMacroDefinitionAndEnvironment2198386876840781157.hs:10:49. + :: t0 + -> t1 + -> IO + [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata] +The above message is in terms of the generated Haskell, at axelTemp/2198386876840781157/AutogeneratedAxelMacroDefinitionAndEnvironment2198386876840781157.hs:11:49. Try checking at axelTemp/6713099704434341978/result.axel:1:2. If the Axel code at that position doesn't seem related, something may have gone wrong during a macro expansion. Variable not in scope: arg1 -The above message is in terms of the generated Haskell, at axelTemp/2198386876840781157/AutogeneratedAxelMacroDefinitionAndEnvironment2198386876840781157.hs:10:67. +The above message is in terms of the generated Haskell, at axelTemp/2198386876840781157/AutogeneratedAxelMacroDefinitionAndEnvironment2198386876840781157.hs:11:67. Try checking at axelTemp/6713099704434341978/result.axel:1:20. If the Axel code at that position doesn't seem related, something may have gone wrong during a macro expansion. Variable not in scope: arg2 -The above message is in terms of the generated Haskell, at axelTemp/2198386876840781157/AutogeneratedAxelMacroDefinitionAndEnvironment2198386876840781157.hs:10:72. +The above message is in terms of the generated Haskell, at axelTemp/2198386876840781157/AutogeneratedAxelMacroDefinitionAndEnvironment2198386876840781157.hs:11:72. Try checking at axelTemp/6713099704434341978/result.axel:1:25. If the Axel code at that position doesn't seem related, something may have gone wrong during a macro expansion. Failed, 48 modules loaded. \ No newline at end of file diff --git a/test/Axel/Test/Transpilation/TranspilationSpec.hs b/test/Axel/Test/Transpilation/TranspilationSpec.hs index 8616bee..964cefc 100644 --- a/test/Axel/Test/Transpilation/TranspilationSpec.hs +++ b/test/Axel/Test/Transpilation/TranspilationSpec.hs @@ -56,8 +56,7 @@ test_transpilation_golden = do runApp $ Eff.evalState (M.empty :: SM.ModuleInfo) $ Ghci.withGhci $ transpileSource (takeBaseName axelFile) axelSource - let newSource = encodeUtf8Lazy $ SM.raw output - pure $ newSource <> "\n" + pure $ encodeUtf8Lazy $ SM.raw output let testName = T.unpack . op FilePath $ takeBaseName axelFile pure $ goldenVsString testName (T.unpack . op FilePath $ hsFile) transpiled diff --git a/test/Axel/Test/Transpilation/macros/golden_ExpandIntoInterdependentMacros.axel b/test/Axel/Test/Transpilation/macros/golden_ExpandIntoInterdependentMacros.axel index ab8b2a3..f49ce8b 100644 --- a/test/Axel/Test/Transpilation/macros/golden_ExpandIntoInterdependentMacros.axel +++ b/test/Axel/Test/Transpilation/macros/golden_ExpandIntoInterdependentMacros.axel @@ -1,6 +1,7 @@ (module ExpandIntoInterdependentMacros) (import Axel.Prelude all) +(importq Axel.Parse.AST AST all) (defmacro generateMacroChain ([(AST.Symbol ann macro)] diff --git a/test/Axel/Test/Transpilation/macros/golden_ExpandIntoInterdependentMacros.hs b/test/Axel/Test/Transpilation/macros/golden_ExpandIntoInterdependentMacros.hs index 7e4416d..5e5fd21 100644 --- a/test/Axel/Test/Transpilation/macros/golden_ExpandIntoInterdependentMacros.hs +++ b/test/Axel/Test/Transpilation/macros/golden_ExpandIntoInterdependentMacros.hs @@ -1,15 +1,17 @@ module ExpandIntoInterdependentMacros where import Axel -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap import Axel.Prelude +import qualified Axel.Parse.AST as AST shouldExist :: () => (IO ()) shouldExist = (pure ()) -generateMacroChain_AXEL_AUTOGENERATED_MACRO_DEFINITION [(AST.Symbol ann macro)] = (pure (let {macro1 = ((<>) macro "1");macro2 = ((<>) macro "2");macro3 = ((<>) macro "3")} in [(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 9 7))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 289))) "defmacro")],[(AST.Symbol ann macro1)],[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 10 8))) (concat [[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 10 9))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 543))) "list")]]))],[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 10 12))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 664))) "pure")],[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 10 18))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 781))) "list")],[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 11 38))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 898))) "quote")],[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 10 20))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 1016))) "def")],[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 1023))) "shouldExist")],[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 10 37))) (concat [[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 10 38))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 1256))) "list")]]))],[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 10 41))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 1377))) "IO")],[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 1383))) "Unit")]]))]]))],[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 11 21))) (concat [[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 11 22))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 1617))) "list")]]))],[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 11 25))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 1738))) "pure")],[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 1746))) "unit")]]))]]))]]))]]))]]))]]))]]))]])),(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 12 7))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 1892))) "defmacro")],[(AST.Symbol ann macro2)],[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 13 8))) (concat [[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 13 9))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 2146))) "list")]]))],[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 13 12))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 2267))) "pure")],[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 13 18))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 2384))) "list")],[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 13 20))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 2501))) "AST.SExpression")],[(AST.SExpression GHCPrelude.Nothing (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 2566))) "GHCPrelude.Just")],[(AST.SExpression GHCPrelude.Nothing (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 2631))) ",")],[(AST.LiteralString (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 2636))) "golden_ExpandIntoInterdependentMacros")],[(AST.SExpression GHCPrelude.Nothing (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 2725))) "SM.Position")],[(AST.LiteralInt (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 2740))) 13)],[(AST.LiteralInt (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 2746))) 20)]]))]]))]]))],[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 13 20))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 2873))) "concat")],[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 13 20))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 2992))) "list")],[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 13 47))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 3109))) "list")],[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 13 47))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 3226))) "quote")],[(AST.Symbol ann macro1)]]))]]))]]))]]))]]))]]))]]))]]))]])),(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 14 7))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 3403))) "defmacro")],[(AST.Symbol ann macro3)],[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 15 8))) (concat [[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 15 9))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 3657))) "list")]]))],[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 15 12))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 3778))) "pure")],[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 15 18))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 3895))) "list")],[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 15 20))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 4012))) "AST.SExpression")],[(AST.SExpression GHCPrelude.Nothing (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 4077))) "GHCPrelude.Just")],[(AST.SExpression GHCPrelude.Nothing (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 4142))) ",")],[(AST.LiteralString (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 4147))) "golden_ExpandIntoInterdependentMacros")],[(AST.SExpression GHCPrelude.Nothing (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 4236))) "SM.Position")],[(AST.LiteralInt (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 4251))) 15)],[(AST.LiteralInt (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 4257))) 20)]]))]]))]]))],[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 15 20))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 4384))) "concat")],[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 15 20))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 4503))) "list")],[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 15 47))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 4620))) "list")],[(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 15 47))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1508974868586227362/result.axel" (SM.Position 1 4737))) "quote")],[(AST.Symbol ann macro2)]]))]]))]]))]]))]]))]]))]]))]]))]]))])) -macros1_AXEL_AUTOGENERATED_MACRO_DEFINITION [] = (pure [(AST.SExpression (GHCPrelude.Just ((,) "axelTemp/8322265170428161891/result.axel" (SM.Position 1 1))) [(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/8322265170428161891/result.axel" (SM.Position 1 2))) "::"),(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/8322265170428161891/result.axel" (SM.Position 1 5))) "shouldExist"),(AST.SExpression (GHCPrelude.Just ((,) "axelTemp/8322265170428161891/result.axel" (SM.Position 1 17))) [(AST.Symbol GHCPrelude.Nothing "list")]),(AST.SExpression (GHCPrelude.Just ((,) "axelTemp/8322265170428161891/result.axel" (SM.Position 1 20))) [(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/8322265170428161891/result.axel" (SM.Position 1 21))) "IO"),(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/8322265170428161891/result.axel" (SM.Position 1 24))) "Unit")])]),(AST.SExpression (GHCPrelude.Just ((,) "axelTemp/8322265170428161891/result.axel" (SM.Position 2 1))) [(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/8322265170428161891/result.axel" (SM.Position 2 2))) "="),(AST.SExpression (GHCPrelude.Just ((,) "axelTemp/8322265170428161891/result.axel" (SM.Position 2 4))) [(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/8322265170428161891/result.axel" (SM.Position 2 5))) "shouldExist")]),(AST.SExpression (GHCPrelude.Just ((,) "axelTemp/8322265170428161891/result.axel" (SM.Position 2 18))) [(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/8322265170428161891/result.axel" (SM.Position 2 19))) "pure"),(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/8322265170428161891/result.axel" (SM.Position 2 24))) "unit")])])]) -macros2_AXEL_AUTOGENERATED_MACRO_DEFINITION [] = (pure [(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 13 20))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/6774190842878730163/result.axel" (SM.Position 1 166))) "macros1")]]))]) -macros3_AXEL_AUTOGENERATED_MACRO_DEFINITION [] = (pure [(AST.SExpression (GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (SM.Position 15 20))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/1643648512022641200/result.axel" (SM.Position 1 166))) "macros2")]]))]) -generateMacroChain_AXEL_AUTOGENERATED_MACRO_DEFINITION :: [AST.Expression SM.SourceMetadata] -> GHCPrelude.IO [AST.Expression SM.SourceMetadata] -macros1_AXEL_AUTOGENERATED_MACRO_DEFINITION :: [AST.Expression SM.SourceMetadata] -> GHCPrelude.IO [AST.Expression SM.SourceMetadata] -macros2_AXEL_AUTOGENERATED_MACRO_DEFINITION :: [AST.Expression SM.SourceMetadata] -> GHCPrelude.IO [AST.Expression SM.SourceMetadata] -macros3_AXEL_AUTOGENERATED_MACRO_DEFINITION :: [AST.Expression SM.SourceMetadata] -> GHCPrelude.IO [AST.Expression SM.SourceMetadata] +generateMacroChain_AXEL_AUTOGENERATED_MACRO_DEFINITION [(AST.Symbol ann macro)] = (pure (let {macro1 = ((<>) macro "1");macro2 = ((<>) macro "2");macro3 = ((<>) macro "3")} in [(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 10 7))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 333))) "defmacro")],[(AST.Symbol ann macro1)],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 11 8))) (concat [[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 11 9))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 673))) "list")]]))],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 11 12))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 837))) "pure")],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 11 18))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 997))) "list")],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 12 38))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 1157))) "quote")],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 11 20))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 1318))) "def")],[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 1325))) "shouldExist")],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 11 37))) (concat [[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 11 38))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 1644))) "list")]]))],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 11 41))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 1808))) "IO")],[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 1814))) "Unit")]]))]]))],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 12 21))) (concat [[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 12 22))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 2134))) "list")]]))],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 12 25))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 2298))) "pure")],[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 2306))) "unit")]]))]]))]]))]]))]]))]]))]]))]])),(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 13 7))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 2495))) "defmacro")],[(AST.Symbol ann macro2)],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 14 8))) (concat [[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 14 9))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 2835))) "list")]]))],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 14 12))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 2999))) "pure")],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 14 18))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 3159))) "list")],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 14 20))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 3319))) "AxelRuntime_AST.SExpression")],[(AxelRuntime_AST.SExpression AxelRuntime_GHCPrelude.Nothing (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 3420))) "AxelRuntime_GHCPrelude.Just")],[(AxelRuntime_AST.SExpression AxelRuntime_GHCPrelude.Nothing (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 3521))) ",")],[(AxelRuntime_AST.LiteralString (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 3526))) "golden_ExpandIntoInterdependentMacros")],[(AxelRuntime_AST.SExpression AxelRuntime_GHCPrelude.Nothing (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 3639))) "AxelRuntime_Sourcemap.Position")],[(AxelRuntime_AST.LiteralInt (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 3673))) 14)],[(AxelRuntime_AST.LiteralInt (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 3679))) 20)]]))]]))]]))],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 14 20))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 3849))) "concat")],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 14 20))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 4011))) "list")],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 14 47))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 4171))) "list")],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 14 47))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 4331))) "quote")],[(AST.Symbol ann macro1)]]))]]))]]))]]))]]))]]))]]))]]))]])),(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 15 7))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 4551))) "defmacro")],[(AST.Symbol ann macro3)],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 16 8))) (concat [[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 16 9))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 4891))) "list")]]))],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 16 12))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 5055))) "pure")],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 16 18))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 5215))) "list")],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 16 20))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 5375))) "AxelRuntime_AST.SExpression")],[(AxelRuntime_AST.SExpression AxelRuntime_GHCPrelude.Nothing (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 5476))) "AxelRuntime_GHCPrelude.Just")],[(AxelRuntime_AST.SExpression AxelRuntime_GHCPrelude.Nothing (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 5577))) ",")],[(AxelRuntime_AST.LiteralString (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 5582))) "golden_ExpandIntoInterdependentMacros")],[(AxelRuntime_AST.SExpression AxelRuntime_GHCPrelude.Nothing (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 5695))) "AxelRuntime_Sourcemap.Position")],[(AxelRuntime_AST.LiteralInt (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 5729))) 16)],[(AxelRuntime_AST.LiteralInt (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 5735))) 20)]]))]]))]]))],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 16 20))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 5905))) "concat")],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 16 20))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 6067))) "list")],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 16 47))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 6227))) "list")],[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 16 47))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2457135286712724799/result.axel" (AxelRuntime_Sourcemap.Position 1 6387))) "quote")],[(AST.Symbol ann macro2)]]))]]))]]))]]))]]))]]))]]))]]))]]))])) +macros1_AXEL_AUTOGENERATED_MACRO_DEFINITION [] = (pure [(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/6398651254902012753/result.axel" (AxelRuntime_Sourcemap.Position 1 1))) [(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/6398651254902012753/result.axel" (AxelRuntime_Sourcemap.Position 1 2))) "::"),(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/6398651254902012753/result.axel" (AxelRuntime_Sourcemap.Position 1 5))) "shouldExist"),(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/6398651254902012753/result.axel" (AxelRuntime_Sourcemap.Position 1 17))) [(AxelRuntime_AST.Symbol AxelRuntime_GHCPrelude.Nothing "list")]),(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/6398651254902012753/result.axel" (AxelRuntime_Sourcemap.Position 1 20))) [(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/6398651254902012753/result.axel" (AxelRuntime_Sourcemap.Position 1 21))) "IO"),(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/6398651254902012753/result.axel" (AxelRuntime_Sourcemap.Position 1 24))) "Unit")])]),(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/6398651254902012753/result.axel" (AxelRuntime_Sourcemap.Position 2 1))) [(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/6398651254902012753/result.axel" (AxelRuntime_Sourcemap.Position 2 2))) "="),(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/6398651254902012753/result.axel" (AxelRuntime_Sourcemap.Position 2 4))) [(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/6398651254902012753/result.axel" (AxelRuntime_Sourcemap.Position 2 5))) "shouldExist")]),(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/6398651254902012753/result.axel" (AxelRuntime_Sourcemap.Position 2 18))) [(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/6398651254902012753/result.axel" (AxelRuntime_Sourcemap.Position 2 19))) "pure"),(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/6398651254902012753/result.axel" (AxelRuntime_Sourcemap.Position 2 24))) "unit")])])]) +macros2_AXEL_AUTOGENERATED_MACRO_DEFINITION [] = (pure [(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 14 20))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/4671015804330746500/result.axel" (AxelRuntime_Sourcemap.Position 1 209))) "macros1")]]))]) +macros3_AXEL_AUTOGENERATED_MACRO_DEFINITION [] = (pure [(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_ExpandIntoInterdependentMacros" (AxelRuntime_Sourcemap.Position 16 20))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2125041503178167715/result.axel" (AxelRuntime_Sourcemap.Position 1 209))) "macros2")]]))]) +generateMacroChain_AXEL_AUTOGENERATED_MACRO_DEFINITION :: [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata] -> AxelRuntime_GHCPrelude.IO [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata] +macros1_AXEL_AUTOGENERATED_MACRO_DEFINITION :: [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata] -> AxelRuntime_GHCPrelude.IO [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata] +macros2_AXEL_AUTOGENERATED_MACRO_DEFINITION :: [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata] -> AxelRuntime_GHCPrelude.IO [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata] +macros3_AXEL_AUTOGENERATED_MACRO_DEFINITION :: [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata] -> AxelRuntime_GHCPrelude.IO [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata] \ No newline at end of file diff --git a/test/Axel/Test/Transpilation/macros/golden_Quasiquote.hs b/test/Axel/Test/Transpilation/macros/golden_Quasiquote.hs index c5dbba7..23de88c 100644 --- a/test/Axel/Test/Transpilation/macros/golden_Quasiquote.hs +++ b/test/Axel/Test/Transpilation/macros/golden_Quasiquote.hs @@ -1,12 +1,13 @@ module Quasiquote where import Axel -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap import Axel.Prelude import qualified Axel.Parse.AST as AST import qualified Axel.Sourcemap as SM assertEq :: () => ((->) (AST.Expression a) ((->) (AST.Expression b) SM.Expression)) -assertEq expr expected = (aXEL_SYMBOL_IF_ ((==) ((<$) () expr) ((<$) () expected)) (AST.SExpression (GHCPrelude.Just ((,) "axelTemp/2948473737463148627/result.axel" (SM.Position 2 86))) [(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/2948473737463148627/result.axel" (SM.Position 2 86))) "raw"),(AST.LiteralString (GHCPrelude.Just ((,) "axelTemp/2948473737463148627/result.axel" (SM.Position 2 86))) "-- Passed!")]) (error ((<>) (AST.toAxel expr) ((<>) " given, but " ((<>) (AST.toAxel expected) " expected!"))))) +assertEq expr expected = (aXEL_SYMBOL_IF_ ((==) ((<$) () expr) ((<$) () expected)) (AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2948473737463148627/result.axel" (AxelRuntime_Sourcemap.Position 2 86))) [(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2948473737463148627/result.axel" (AxelRuntime_Sourcemap.Position 2 86))) "raw"),(AxelRuntime_AST.LiteralString (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/2948473737463148627/result.axel" (AxelRuntime_Sourcemap.Position 2 86))) "-- Passed!")]) (error ((<>) (AST.toAxel expr) ((<>) " given, but " ((<>) (AST.toAxel expected) " expected!"))))) sym :: () => ((->) String SM.Expression) sym x = (AST.Symbol Nothing x) sexp :: () => ((->) ([] SM.Expression) SM.Expression) @@ -15,5 +16,5 @@ sexp xs = (AST.SExpression Nothing xs) -- Passed! -- Passed! -- Passed! -testQuasiquote_AXEL_AUTOGENERATED_MACRO_DEFINITION _ = (pure [(assertEq (AST.Symbol (GHCPrelude.Just ((,) "axelTemp/4388616380899794166/result.axel" (SM.Position 1 73))) "topLevelBasic") (sym "topLevelBasic")),(assertEq (AST.SExpression (GHCPrelude.Just ((,) "golden_Quasiquote" (SM.Position 27 30))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/4388616380899794166/result.axel" (SM.Position 1 210))) "quote")],[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/4388616380899794166/result.axel" (SM.Position 1 219))) "topLevelQuote")]])) (sexp [(sym "quote"),(sym "topLevelQuote")])),(assertEq (AST.SExpression (GHCPrelude.Just ((,) "golden_Quasiquote" (SM.Position 29 16))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/4388616380899794166/result.axel" (SM.Position 1 383))) "\\")],[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/4388616380899794166/result.axel" (SM.Position 1 388))) "inFormBasic")],[(sym "inFormUnquote")],(AST.toExpressionList [(sym "inFormSpliceUnquote1"),(sym "inFormSpliceUnquote2")]),[(AST.SExpression (GHCPrelude.Just ((,) "golden_Quasiquote" (SM.Position 29 128))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/4388616380899794166/result.axel" (SM.Position 1 600))) "quote")],[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/4388616380899794166/result.axel" (SM.Position 1 609))) "inFormQuote")]]))]])) (sexp [(sym "\\"),(sym "inFormBasic"),(sym "inFormUnquote"),(sym "inFormSpliceUnquote1"),(sym "inFormSpliceUnquote2"),(sexp [(sym "quote"),(sym "inFormQuote")])])),(assertEq (AST.SExpression (GHCPrelude.Just ((,) "golden_Quasiquote" (SM.Position 31 16))) (concat [[(AST.SExpression (GHCPrelude.Just ((,) "golden_Quasiquote" (SM.Position 31 17))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/4388616380899794166/result.axel" (SM.Position 1 982))) "inForm2Basic")],[(sym "inForm2Unquote")],(AST.toExpressionList [(sym "inForm2SpliceUnquote1"),(sym "inForm2SpliceUnquote2")]),[(AST.SExpression (GHCPrelude.Just ((,) "golden_Quasiquote" (SM.Position 31 132))) (concat [[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/4388616380899794166/result.axel" (SM.Position 1 1198))) "quote")],[(AST.Symbol (GHCPrelude.Just ((,) "axelTemp/4388616380899794166/result.axel" (SM.Position 1 1207))) "inForm2Quote")]]))]]))]])) (sexp [(sexp [(sym "inForm2Basic"),(sym "inForm2Unquote"),(sym "inForm2SpliceUnquote1"),(sym "inForm2SpliceUnquote2"),(sexp [(sym "quote"),(sym "inForm2Quote")])])]))]) -testQuasiquote_AXEL_AUTOGENERATED_MACRO_DEFINITION :: [AST.Expression SM.SourceMetadata] -> GHCPrelude.IO [AST.Expression SM.SourceMetadata] +testQuasiquote_AXEL_AUTOGENERATED_MACRO_DEFINITION _ = (pure [(assertEq (AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/290224896347276044/result.axel" (AxelRuntime_Sourcemap.Position 1 73))) "topLevelBasic") (sym "topLevelBasic")),(assertEq (AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_Quasiquote" (AxelRuntime_Sourcemap.Position 27 30))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/290224896347276044/result.axel" (AxelRuntime_Sourcemap.Position 1 253))) "quote")],[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/290224896347276044/result.axel" (AxelRuntime_Sourcemap.Position 1 262))) "topLevelQuote")]])) (sexp [(sym "quote"),(sym "topLevelQuote")])),(assertEq (AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_Quasiquote" (AxelRuntime_Sourcemap.Position 29 16))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/290224896347276044/result.axel" (AxelRuntime_Sourcemap.Position 1 469))) "\\")],[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/290224896347276044/result.axel" (AxelRuntime_Sourcemap.Position 1 474))) "inFormBasic")],[(sym "inFormUnquote")],(AxelRuntime_AST.toExpressionList [(sym "inFormSpliceUnquote1"),(sym "inFormSpliceUnquote2")]),[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_Quasiquote" (AxelRuntime_Sourcemap.Position 29 128))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/290224896347276044/result.axel" (AxelRuntime_Sourcemap.Position 1 741))) "quote")],[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/290224896347276044/result.axel" (AxelRuntime_Sourcemap.Position 1 750))) "inFormQuote")]]))]])) (sexp [(sym "\\"),(sym "inFormBasic"),(sym "inFormUnquote"),(sym "inFormSpliceUnquote1"),(sym "inFormSpliceUnquote2"),(sexp [(sym "quote"),(sym "inFormQuote")])])),(assertEq (AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_Quasiquote" (AxelRuntime_Sourcemap.Position 31 16))) (concat [[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_Quasiquote" (AxelRuntime_Sourcemap.Position 31 17))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/290224896347276044/result.axel" (AxelRuntime_Sourcemap.Position 1 1209))) "inForm2Basic")],[(sym "inForm2Unquote")],(AxelRuntime_AST.toExpressionList [(sym "inForm2SpliceUnquote1"),(sym "inForm2SpliceUnquote2")]),[(AxelRuntime_AST.SExpression (AxelRuntime_GHCPrelude.Just ((,) "golden_Quasiquote" (AxelRuntime_Sourcemap.Position 31 132))) (concat [[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/290224896347276044/result.axel" (AxelRuntime_Sourcemap.Position 1 1480))) "quote")],[(AxelRuntime_AST.Symbol (AxelRuntime_GHCPrelude.Just ((,) "axelTemp/290224896347276044/result.axel" (AxelRuntime_Sourcemap.Position 1 1489))) "inForm2Quote")]]))]]))]])) (sexp [(sexp [(sym "inForm2Basic"),(sym "inForm2Unquote"),(sym "inForm2SpliceUnquote1"),(sym "inForm2SpliceUnquote2"),(sexp [(sym "quote"),(sym "inForm2Quote")])])]))]) +testQuasiquote_AXEL_AUTOGENERATED_MACRO_DEFINITION :: [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata] -> AxelRuntime_GHCPrelude.IO [AxelRuntime_AST.Expression AxelRuntime_Sourcemap.SourceMetadata] \ No newline at end of file diff --git a/test/Axel/Test/Transpilation/regression/golden_Issue79.hs b/test/Axel/Test/Transpilation/regression/golden_Issue79.hs index 6f87537..a422c03 100644 --- a/test/Axel/Test/Transpilation/regression/golden_Issue79.hs +++ b/test/Axel/Test/Transpilation/regression/golden_Issue79.hs @@ -1,6 +1,7 @@ module Main where import Axel -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap example = "This should be a quotation mark: \"" -main = (print example) +main = (print example) \ No newline at end of file diff --git a/test/Axel/Test/Transpilation/syntax/golden_CaseSyntax.hs b/test/Axel/Test/Transpilation/syntax/golden_CaseSyntax.hs index 2b5e97b..3e95ebf 100644 --- a/test/Axel/Test/Transpilation/syntax/golden_CaseSyntax.hs +++ b/test/Axel/Test/Transpilation/syntax/golden_CaseSyntax.hs @@ -1,5 +1,6 @@ module CaseSyntax where import Axel -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST -main = (case True of {True -> (putStrLn "Yay!");False -> (error "Impossible!")}) +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap +main = (case True of {True -> (putStrLn "Yay!");False -> (error "Impossible!")}) \ No newline at end of file diff --git a/test/Axel/Test/Transpilation/syntax/golden_CommentSyntax.hs b/test/Axel/Test/Transpilation/syntax/golden_CommentSyntax.hs index 15402ff..46005d1 100644 --- a/test/Axel/Test/Transpilation/syntax/golden_CommentSyntax.hs +++ b/test/Axel/Test/Transpilation/syntax/golden_CommentSyntax.hs @@ -1,5 +1,6 @@ module CommentSyntax where import Axel -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST -data (BaraXEL_SYMBOL_ASTERISK_ a b) = FoaXEL_SYMBOL_HASH_o (a Int)|Bar b String|Baz deriving () +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap +data (BaraXEL_SYMBOL_ASTERISK_ a b) = FoaXEL_SYMBOL_HASH_o (a Int)|Bar b String|Baz deriving () \ No newline at end of file diff --git a/test/Axel/Test/Transpilation/syntax/golden_DataDefinitionSyntax.hs b/test/Axel/Test/Transpilation/syntax/golden_DataDefinitionSyntax.hs index 80d50bd..c76a3cc 100644 --- a/test/Axel/Test/Transpilation/syntax/golden_DataDefinitionSyntax.hs +++ b/test/Axel/Test/Transpilation/syntax/golden_DataDefinitionSyntax.hs @@ -1,9 +1,10 @@ module DataDefinitionSyntax where import Axel -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap data (BaraXEL_SYMBOL_ASTERISK_ a b) = FoaXEL_SYMBOL_HASH_o (a Int)|Bar b String|Baz deriving () data Foo = Foo deriving () data Foo' = Foo' deriving (Eq) data (Foo'' a) = Foo''|a deriving ((Eq a)) -data (Foo''' a) = Foo'''|a deriving ((Eq a),Show) +data (Foo''' a) = Foo'''|a deriving ((Eq a),Show) \ No newline at end of file diff --git a/test/Axel/Test/Transpilation/syntax/golden_FunctionDefinitionSyntax.hs b/test/Axel/Test/Transpilation/syntax/golden_FunctionDefinitionSyntax.hs index b5b5f54..4852deb 100644 --- a/test/Axel/Test/Transpilation/syntax/golden_FunctionDefinitionSyntax.hs +++ b/test/Axel/Test/Transpilation/syntax/golden_FunctionDefinitionSyntax.hs @@ -1,7 +1,8 @@ module FunctionDefinitionSyntax where import Axel -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap foo = 1 b'aaXEL_SYMBOL_DOLLAR_r 1 = 3 -b'aaXEL_SYMBOL_DOLLAR_r xaXEL_SYMBOL_HASH_y = (aXEL_SYMBOL_IF_ ((<) xaXEL_SYMBOL_HASH_y 0) (plus xaXEL_SYMBOL_HASH_y one) (aXEL_SYMBOL_IF_ ((>) xaXEL_SYMBOL_HASH_y 0) (minus xaXEL_SYMBOL_HASH_y one) (aXEL_SYMBOL_IF_ otherwise 0 undefined))) where {plus = (+);one = 1} +b'aaXEL_SYMBOL_DOLLAR_r xaXEL_SYMBOL_HASH_y = (aXEL_SYMBOL_IF_ ((<) xaXEL_SYMBOL_HASH_y 0) (plus xaXEL_SYMBOL_HASH_y one) (aXEL_SYMBOL_IF_ ((>) xaXEL_SYMBOL_HASH_y 0) (minus xaXEL_SYMBOL_HASH_y one) (aXEL_SYMBOL_IF_ otherwise 0 undefined))) where {plus = (+);one = 1} \ No newline at end of file diff --git a/test/Axel/Test/Transpilation/syntax/golden_ImportSyntax.hs b/test/Axel/Test/Transpilation/syntax/golden_ImportSyntax.hs index d5e520a..9aff302 100644 --- a/test/Axel/Test/Transpilation/syntax/golden_ImportSyntax.hs +++ b/test/Axel/Test/Transpilation/syntax/golden_ImportSyntax.hs @@ -1,9 +1,10 @@ module ImportSyntax where import Axel -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap import Foo import Bar(foo,bar,Baz(baz)) import qualified Bar as Baz import qualified Bar as Baz(foo) -import Quux(foo_AXEL_AUTOGENERATED_MACRO_DEFINITION,bar_AXEL_AUTOGENERATED_MACRO_DEFINITION) +import Quux(foo_AXEL_AUTOGENERATED_MACRO_DEFINITION,bar_AXEL_AUTOGENERATED_MACRO_DEFINITION) \ No newline at end of file diff --git a/test/Axel/Test/Transpilation/syntax/golden_LambdaSyntax.hs b/test/Axel/Test/Transpilation/syntax/golden_LambdaSyntax.hs index d2c0997..a726ed4 100644 --- a/test/Axel/Test/Transpilation/syntax/golden_LambdaSyntax.hs +++ b/test/Axel/Test/Transpilation/syntax/golden_LambdaSyntax.hs @@ -1,5 +1,6 @@ module LambdaSyntax where import Axel -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST -main = ((\x aXEL_VALUE_aXEL_SYMBOL_LESSTHAN_y -> ((>>) (print x) (print aXEL_VALUE_aXEL_SYMBOL_LESSTHAN_y))) True False) +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap +main = ((\x aXEL_VALUE_aXEL_SYMBOL_LESSTHAN_y -> ((>>) (print x) (print aXEL_VALUE_aXEL_SYMBOL_LESSTHAN_y))) True False) \ No newline at end of file diff --git a/test/Axel/Test/Transpilation/syntax/golden_LetSyntax.hs b/test/Axel/Test/Transpilation/syntax/golden_LetSyntax.hs index 2402c8b..c05cba2 100644 --- a/test/Axel/Test/Transpilation/syntax/golden_LetSyntax.hs +++ b/test/Axel/Test/Transpilation/syntax/golden_LetSyntax.hs @@ -1,5 +1,6 @@ module LetSyntax where import Axel -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST -main = (let {x = 1;y = 2} in (print ((+) x y))) +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap +main = (let {x = 1;y = 2} in (print ((+) x y))) \ No newline at end of file diff --git a/test/Axel/Test/Transpilation/syntax/golden_ListSyntax.hs b/test/Axel/Test/Transpilation/syntax/golden_ListSyntax.hs index 1091bd4..c3d3eda 100644 --- a/test/Axel/Test/Transpilation/syntax/golden_ListSyntax.hs +++ b/test/Axel/Test/Transpilation/syntax/golden_ListSyntax.hs @@ -1,6 +1,7 @@ module ListSyntax where import Axel -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap foo :: () => ([] String) -foo [1,2,3] = [4,5,6] +foo [1,2,3] = [4,5,6] \ No newline at end of file diff --git a/test/Axel/Test/Transpilation/syntax/golden_ModuleSyntax.hs b/test/Axel/Test/Transpilation/syntax/golden_ModuleSyntax.hs index 63a926d..89c61be 100644 --- a/test/Axel/Test/Transpilation/syntax/golden_ModuleSyntax.hs +++ b/test/Axel/Test/Transpilation/syntax/golden_ModuleSyntax.hs @@ -1,5 +1,6 @@ module Test.Main where import Axel -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST -foo = () +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap +foo = () \ No newline at end of file diff --git a/test/Axel/Test/Transpilation/syntax/golden_NewtypeDefinitionSyntax.hs b/test/Axel/Test/Transpilation/syntax/golden_NewtypeDefinitionSyntax.hs index d997810..430fd05 100644 --- a/test/Axel/Test/Transpilation/syntax/golden_NewtypeDefinitionSyntax.hs +++ b/test/Axel/Test/Transpilation/syntax/golden_NewtypeDefinitionSyntax.hs @@ -1,9 +1,10 @@ module NewtypeDefinitionSyntax where import Axel -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap newtype Foo = Foo Bar deriving () newtype (Bar a) = Bar (Baz (a Int)) deriving () newtype Foo' = Foo' Bar deriving () newtype Foo' = Foo' Bar deriving (Eq) -newtype Foo' = Foo' Bar deriving ((Eq a),Show) +newtype Foo' = Foo' Bar deriving ((Eq a),Show) \ No newline at end of file diff --git a/test/Axel/Test/Transpilation/syntax/golden_OperatorSectionSyntax.hs b/test/Axel/Test/Transpilation/syntax/golden_OperatorSectionSyntax.hs index 547fe50..ffddf75 100644 --- a/test/Axel/Test/Transpilation/syntax/golden_OperatorSectionSyntax.hs +++ b/test/Axel/Test/Transpilation/syntax/golden_OperatorSectionSyntax.hs @@ -1,6 +1,7 @@ module OperatorSectionSyntax where import Axel -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap foo = (flip (+) 1) -quux = ((+) 1 2) +quux = ((+) 1 2) \ No newline at end of file diff --git a/test/Axel/Test/Transpilation/syntax/golden_PatternBinding.hs b/test/Axel/Test/Transpilation/syntax/golden_PatternBinding.hs index 3298b99..4426286 100644 --- a/test/Axel/Test/Transpilation/syntax/golden_PatternBinding.hs +++ b/test/Axel/Test/Transpilation/syntax/golden_PatternBinding.hs @@ -1,6 +1,7 @@ module PatternBinding where import Axel -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap foo (bar@baz) = bar -bar = (case quux of {(bar@(Just _)) -> bar}) +bar = (case quux of {(bar@(Just _)) -> bar}) \ No newline at end of file diff --git a/test/Axel/Test/Transpilation/syntax/golden_PragmaSyntax.hs b/test/Axel/Test/Transpilation/syntax/golden_PragmaSyntax.hs index 5b62439..f68c1a6 100644 --- a/test/Axel/Test/Transpilation/syntax/golden_PragmaSyntax.hs +++ b/test/Axel/Test/Transpilation/syntax/golden_PragmaSyntax.hs @@ -1,6 +1,7 @@ module PragmaSyntax where import Axel -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap {-# LANGUAGE TypeOperators #-} -{-# OPTIONS_GHC -F -pgmF tasty-discover #-} +{-# OPTIONS_GHC -F -pgmF tasty-discover #-} \ No newline at end of file diff --git a/test/Axel/Test/Transpilation/syntax/golden_RawSyntax.hs b/test/Axel/Test/Transpilation/syntax/golden_RawSyntax.hs index 07fb209..51429d0 100644 --- a/test/Axel/Test/Transpilation/syntax/golden_RawSyntax.hs +++ b/test/Axel/Test/Transpilation/syntax/golden_RawSyntax.hs @@ -1,6 +1,7 @@ module RawSyntax where import Axel -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap makeLenses ''Foo -main = putStrLn "Hello, world!" +main = putStrLn "Hello, world!" \ No newline at end of file diff --git a/test/Axel/Test/Transpilation/syntax/golden_RecordSyntax.hs b/test/Axel/Test/Transpilation/syntax/golden_RecordSyntax.hs index 2756484..a214e31 100644 --- a/test/Axel/Test/Transpilation/syntax/golden_RecordSyntax.hs +++ b/test/Axel/Test/Transpilation/syntax/golden_RecordSyntax.hs @@ -1,7 +1,8 @@ module RecordSyntax where import Axel -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap data Foo = Foo {fooaXEL_SYMBOL_CARET_ :: Int,bar :: String} deriving () foo :: () => Foo -foo = (Foo {fooaXEL_SYMBOL_CARET_ = 1,bar = "test"}) +foo = (Foo {fooaXEL_SYMBOL_CARET_ = 1,bar = "test"}) \ No newline at end of file diff --git a/test/Axel/Test/Transpilation/syntax/golden_StringSyntax.hs b/test/Axel/Test/Transpilation/syntax/golden_StringSyntax.hs index 61457ab..9cf074e 100644 --- a/test/Axel/Test/Transpilation/syntax/golden_StringSyntax.hs +++ b/test/Axel/Test/Transpilation/syntax/golden_StringSyntax.hs @@ -1,5 +1,6 @@ module StringSyntax where import Axel -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST -foo = "some\nstring\n multiline\t{- this should be in the string -} -- and this" +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap +foo = "some\nstring\n multiline\t{- this should be in the string -} -- and this" \ No newline at end of file diff --git a/test/Axel/Test/Transpilation/syntax/golden_TypeClassDefinitionSyntax.hs b/test/Axel/Test/Transpilation/syntax/golden_TypeClassDefinitionSyntax.hs index dcdcc7e..90c092b 100644 --- a/test/Axel/Test/Transpilation/syntax/golden_TypeClassDefinitionSyntax.hs +++ b/test/Axel/Test/Transpilation/syntax/golden_TypeClassDefinitionSyntax.hs @@ -1,7 +1,8 @@ module TypeClassDefinitionSyntax where import Axel -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap class () => (FooaXEL_SYMBOL_CARET_ a b) where {foo :: () => ((->) a b)} class (Quux) => (Bar a b) where {bar :: () => ((->) a b)} -class ((SuperFoo a),(SuperBar b)) => (Baz a b) where {baz :: () => ((->) a b)} +class ((SuperFoo a),(SuperBar b)) => (Baz a b) where {baz :: () => ((->) a b)} \ No newline at end of file diff --git a/test/Axel/Test/Transpilation/syntax/golden_TypeClassInstanceSyntax.hs b/test/Axel/Test/Transpilation/syntax/golden_TypeClassInstanceSyntax.hs index 8c04fc9..2bf1a3f 100644 --- a/test/Axel/Test/Transpilation/syntax/golden_TypeClassInstanceSyntax.hs +++ b/test/Axel/Test/Transpilation/syntax/golden_TypeClassInstanceSyntax.hs @@ -1,7 +1,8 @@ module TypeClassInstanceSyntax where import Axel -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap instance () => (FooaXEL_SYMBOL_CARET_ Int String) where {foo = ()} instance (Quux) => (Bar Int String) where {bar = ()} -instance ((SuperFoo a),(SuperFoo b)) => (Baz Int String) where {baz a b c = ()} +instance ((SuperFoo a),(SuperFoo b)) => (Baz Int String) where {baz a b c = ()} \ No newline at end of file diff --git a/test/Axel/Test/Transpilation/syntax/golden_TypeSignatureSyntax.hs b/test/Axel/Test/Transpilation/syntax/golden_TypeSignatureSyntax.hs index 4462e7e..591e1b0 100644 --- a/test/Axel/Test/Transpilation/syntax/golden_TypeSignatureSyntax.hs +++ b/test/Axel/Test/Transpilation/syntax/golden_TypeSignatureSyntax.hs @@ -1,7 +1,8 @@ module TypeSignatureSyntax where import Axel -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap main :: () => (IO ()) foo :: () => Int -bar :: (Quux) => ((->) Int ((->) Char Bool)) +bar :: (Quux) => ((->) Int ((->) Char Bool)) \ No newline at end of file diff --git a/test/Axel/Test/Transpilation/syntax/golden_TypeSyntax.hs b/test/Axel/Test/Transpilation/syntax/golden_TypeSyntax.hs index ca40a67..ae0587c 100644 --- a/test/Axel/Test/Transpilation/syntax/golden_TypeSyntax.hs +++ b/test/Axel/Test/Transpilation/syntax/golden_TypeSyntax.hs @@ -1,6 +1,7 @@ module TypeSyntax where import Axel -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap type BaXEL_SYMBOL_PERCENT_az = String -type (Foo a) = (Either a aXEL_VALUE_aXEL_SYMBOL_PERCENT_Baz) +type (Foo a) = (Either a aXEL_VALUE_aXEL_SYMBOL_PERCENT_Baz) \ No newline at end of file diff --git a/test/Axel/Test/Transpilation/syntax/golden_UnitSyntax.hs b/test/Axel/Test/Transpilation/syntax/golden_UnitSyntax.hs index 10441f1..635bf90 100644 --- a/test/Axel/Test/Transpilation/syntax/golden_UnitSyntax.hs +++ b/test/Axel/Test/Transpilation/syntax/golden_UnitSyntax.hs @@ -1,6 +1,7 @@ module UnitSyntax where import Axel -import qualified Prelude as GHCPrelude -import qualified Axel.Parse.AST as AST +import qualified Prelude as AxelRuntime_GHCPrelude +import qualified Axel.Parse.AST as AxelRuntime_AST +import qualified Axel.Sourcemap as AxelRuntime_Sourcemap main :: () => (IO ()) -main = (pure ()) +main = (pure ()) \ No newline at end of file