mirror of
https://github.com/Smaug123/agda-utils
synced 2025-10-07 20:48:45 +00:00
24 lines
693 B
Forth
24 lines
693 B
Forth
namespace AgdaUnusedOpens
|
|
|
|
open System.IO
|
|
|
|
type AgdaCompiler =
|
|
{
|
|
Compiler : FileInfo
|
|
/// The directory which your Agda modules are defined relative to
|
|
AgdaRoot : DirectoryInfo
|
|
}
|
|
|
|
[<RequireQualifiedAccess>]
|
|
module AgdaCompiler =
|
|
|
|
let compiles (config : AgdaCompiler) (f : AgdaFile) : bool =
|
|
// Write it out with a different, temporary name, and then run the compiler.
|
|
// Delete the temporary file afterwards.
|
|
let tempName = failwith ""
|
|
let newFile = AgdaFile.rename tempName f
|
|
AgdaFile.flush config.AgdaRoot newFile
|
|
// run the compiler
|
|
(Path.combine config.AgdaRoot newFile.Path).Delete()
|
|
true
|