Skip to content

Commit

Permalink
expand backend definitions: commandLineFlags, scalaPostModule, scalaC…
Browse files Browse the repository at this point in the history
…ompileDef
  • Loading branch information
lemastero committed Nov 22, 2023
1 parent e997d80 commit f99f6a2
Showing 1 changed file with 29 additions and 5 deletions.
34 changes: 29 additions & 5 deletions src/Agda/Compiler/Scala/Backend.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@ module Agda.Compiler.Scala.Backend (
) where

import Agda.Main ( runAgda )
import Agda.Compiler.Backend
import Agda.Compiler.Backend (
Backend(..)
, Backend'(..)
, Definition
, Flag
, IsMain
, Recompile(..)
, TCM
)
import Agda.Interaction.Options ( OptDescr )
import Agda.Syntax.TopLevelModuleName ( TopLevelModuleName )

runScalaBackend :: IO ()
runScalaBackend = runAgda [scalaBackend]
Expand All @@ -21,16 +31,30 @@ type ScalaDefinition = ()

scalaBackend' :: Backend' ScalaFlags ScalaEnv ScalaModuleEnv ScalaModule ScalaDefinition
scalaBackend' = Backend'
{ backendName = "Scala"
{ backendName = "agda2scala"
, backendVersion = Just "0.1"
, options = ()
, commandLineFlags = []
, commandLineFlags = scalaCmdLineFlags
, isEnabled = const True
, preCompile = \ opt -> return opt
, postCompile = \ _ _ _ -> return ()
, preModule = \ _ _ _ _ -> return $ Recompile ()
, postModule = \ _ _ _ _ _ -> return ()
, compileDef = \ _ _ _ _ -> return ()
, postModule = scalaPostModule
, compileDef = scalaCompileDef
, scopeCheckingSuffices = False
, mayEraseType = const $ return True
}

scalaCmdLineFlags :: [OptDescr (Flag ScalaFlags)]
scalaCmdLineFlags = []

scalaPostModule :: ScalaEnv
-> ScalaModuleEnv
-> IsMain
-> TopLevelModuleName
-> [ScalaDefinition]
-> TCM ScalaModule
scalaPostModule = \ _ _ _ _ _ -> return ()

scalaCompileDef :: ScalaEnv -> ScalaModuleEnv -> IsMain -> Definition -> TCM ScalaDefinition
scalaCompileDef = \ _ _ _ _ -> return ()

0 comments on commit f99f6a2

Please sign in to comment.