shithub: MicroHs

Download patch

ref: 53ceb875735e469a1d5328f413e422e9f1eff513
parent: 9005e82ac8c7f26e7e3febd56bc1afb5545920b3
author: Lennart Augustsson <lennart@augustsson.net>
date: Sat Dec 9 08:05:57 EST 2023

Cache flag -s now -C

--- a/README.md
+++ b/README.md
@@ -115,7 +115,7 @@
 * `-oFILE` output file.  If the `FILE` ends in `.comb` it will produce a textual combinator file.  If `FILE` ends in `.c` it will produce a C file with the combinators.  For all other `FILE` it will compiler the combinators together with the runtime system to produce a regular executable.
 * `-r` run directly (does not work if compiled with GHC)
 * `-v` be more verbose, flag can be repeated
-* `-c` use a compilation cache
+* `-C` use a compilation cache
 
 With the `-v` flag the processing time for each module is reported.
 E.g.
@@ -125,12 +125,12 @@
 which means that processing the module `MicroHs.Exp` took 284ms,
 with parsing taking 91ms and typecheck&desugar taking 193ms.
 
-With the `-c` flag the compiler writes out its internal cache of compiled modules to the file `.mhscache`
+With the `-C` flag the compiler writes out its internal cache of compiled modules to the file `.mhscache`
 at the end of compilation.  And a startup it reads this file if it exists, and then validates the contents
 by an MD5 checksum for all the files in the cache.
 This can make compilation much faster since the compiler will not parse and typecheck a module if it is in
 the cache.
-Do **NOT** use `-c` when you are changing the compiler itself; if the cached data types change the compiler will probably just crash.
+Do **NOT** use `-C` when you are changing the compiler itself; if the cached data types change the compiler will probably just crash.
 
 
 ### Environment variables
--- a/generated/mhs.c
+++ b/generated/mhs.c
@@ -7229,7 +7229,7 @@
 109,97,110,100,45,108,105,110,101,34,41,32,35,48,41,32,35,48,41,41,
 41,41,32,40,75,50,32,40,95,50,53,32,34,85,115,97,103,101,58,32,
 109,104,115,32,91,45,118,93,32,91,45,108,93,32,91,45,114,93,32,91,
-45,99,93,32,91,45,105,80,65,84,72,93,32,91,45,111,70,73,76,69,
+45,67,93,32,91,45,105,80,65,84,72,93,32,91,45,111,70,73,76,69,
 93,32,91,77,111,100,117,108,101,78,97,109,101,93,34,41,41,41,41,41,
 41,32,40,40,95,50,55,48,32,95,49,54,50,49,41,32,40,40,95,52,
 56,51,32,34,77,105,99,114,111,72,115,44,32,118,101,114,115,105,111,110,
@@ -7254,7 +7254,7 @@
 46,99,111,109,98,34,41,32,75,41,41,41,41,41,32,40,40,95,52,53,
 49,32,95,49,51,52,41,32,34,45,108,34,41,41,41,32,40,40,40,67,
 39,32,95,49,50,50,41,32,40,40,95,52,53,49,32,95,49,51,52,41,
-32,34,45,99,34,41,41,32,95,49,52,56,49,41,41,41,41,41,32,40,
+32,34,45,67,34,41,41,32,95,49,52,56,49,41,41,41,41,41,32,40,
 95,52,52,51,32,40,40,67,32,40,95,50,49,50,32,95,49,51,52,41,
 41,32,34,45,45,34,41,41,41,41,32,40,95,52,57,52,32,40,40,79,
 32,35,52,54,41,32,75,41,41,41,41,41,41,32,40,40,65,32,58,49,
--- a/src/MicroHs/Main.hs
+++ b/src/MicroHs/Main.hs
@@ -43,7 +43,7 @@
                   ("." : (dir ++ "/lib") : catMaybes (map (stripPrefix "-i") args))
                   (head $ catMaybes (map (stripPrefix "-o") args) ++ ["out.comb"])
                   (elem "-l" args)
-                  (elem "-c" args && usingMhs)
+                  (elem "-C" args && usingMhs)
   if "--version" `elem` args then
     putStrLn $ "MicroHs, version " ++ mhsVersion ++ ", combinator file version " ++ combVersion
    else
@@ -50,7 +50,7 @@
     case ss of
       []  -> mainInteractive flags
       [s] -> mainCompile dir flags (mkIdentSLoc (SLoc "command-line" 0 0) s)
-      _   -> error "Usage: mhs [-v] [-l] [-r] [-c] [-iPATH] [-oFILE] [ModuleName]"
+      _   -> error "Usage: mhs [-v] [-l] [-r] [-C] [-iPATH] [-oFILE] [ModuleName]"
 
 mainCompile :: FilePath -> Flags -> Ident -> IO ()
 mainCompile mhsdir flags mn = do
--