packages feed

Elm 0.1.1.1 → 0.1.1.2

raw patch · 2 files changed

+49/−4 lines, 2 files

Files

Elm.cabal view
@@ -1,6 +1,6 @@  Name:                Elm-Version:             0.1.1.1+Version:             0.1.1.2 Synopsis:            The Elm compiler and server. Description:         Elm aims to make client-side web-development more pleasant.                      It is a statically/strongly typed, functional reactive@@ -29,7 +29,7 @@  Executable elm   -- .hs or .lhs file containing the Main module.-  Main-is:             Elm.hs+  Main-is:             Compiler.hs   Hs-Source-Dirs:      src, src/Parse, src/Types, src/Language   other-modules:       Ast, CompileToJS, GenerateHtml, Guid, Initialize,                        Rename, Language.Elm, Binop, Combinators, Lexer,@@ -37,7 +37,7 @@                        Types, Constrain, Hints, Types, Unify      -- Packages needed in order to build this package.-  ghc-options:	       -O3 -rtsopts -auto-all -caf-all -fforce-recomp+  ghc-options:	       -O3 -rtsopts -auto-all -caf-all   Build-depends:       base >=4.2 && <5, containers >= 0.3,                        transformers >= 0.2, mtl >= 2, parsec >= 3.1.1,                        blaze-html == 0.5.0.*, blaze-markup == 0.5.1.*, deepseq@@ -56,7 +56,7 @@                        Rename, Language.Elm, Binop, Combinators, Lexer,                        ParsePatterns, Parser, ParserLib, ParseTypes, Tokens,                        Types, Constrain, Hints, Types, Unify-  ghc-options:	       -O3 -rtsopts -auto-all -caf-all -fforce-recomp+  ghc-options:	       -O3 -rtsopts -auto-all -caf-all   Build-depends:       base >=4.2 && <5, containers >= 0.3, transformers >= 0.2,                        mtl >= 2, parsec >= 3.1.1, blaze-html == 0.5.0.*,                        HTTP >= 4000, happstack-server == 7.0.2
+ src/Compiler.hs view
@@ -0,0 +1,45 @@++module Main where++import System.Environment+import CompileToJS+import Data.List (isPrefixOf)+import GenerateHtml+import Text.Blaze.Html.Renderer.String (renderHtml)++main = getArgs >>= parse++parse ("--help":_) = putStrLn usage+parse ("--version":_) = putStrLn "The Elm Compiler 0.1.1.1"+parse [loc,file]+  | "--runtime-location=" `isPrefixOf` loc =+      produceHtml (tail $ dropWhile (/='=') loc) file+  | otherwise = putStrLn usageMini+parse [file] = produceHtml "elm-mini.js" file+parse _ = putStrLn usageMini++produceHtml libLoc file = do+  code <- readFile file+  let name = takeWhile (/='.') file+  case compile code of+    Left err -> putStrLn err+    Right jsCode -> writeFile (name ++ ".html") . renderHtml $+                    generateHtml libLoc name jsCode++usageMini =+  "Usage: elm [OPTIONS] FILE\n\+  \Try `elm --help' for more information."++usage =+  "Usage: elm [OPTIONS] FILE\n\+  \Compile .elm files to .html files.\n\+  \Example: elm --runtime-location=../elm-mini.js main.elm\n\+  \\n\+  \Resource Locations:\n\+  \  --runtime-location   set the location of the Elm runtime (elm-mini.js)\n\+  \\n\+  \Compiler Information:\n\+  \  --version            print the version information and exit\n\+  \  --help               display this help and exit\n\+  \\n\+  \Elm home page: <http://elm-lang.org>"