Elm 0.1.1.5 → 0.1.1.6
raw patch · 4 files changed
+33/−7 lines, 4 files
Files
- Elm.cabal +4/−4
- src/Compiler.hs +1/−1
- src/ExtractNoscript.hs +26/−0
- src/Server.hs +2/−2
Elm.cabal view
@@ -1,6 +1,6 @@ Name: Elm-Version: 0.1.1.5+Version: 0.1.1.6 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@@ -34,7 +34,7 @@ other-modules: Ast, CompileToJS, GenerateHtml, Guid, Initialize, Rename, Language.Elm, Binop, Combinators, Lexer, ParsePatterns, Parser, ParserLib, ParseTypes, Tokens,- Types, Constrain, Hints, Types, Unify+ Types, Constrain, Hints, Types, Unify, ExtractNoscript -- Packages needed in order to build this package. ghc-options: -O3@@ -56,7 +56,7 @@ other-modules: Ast, CompileToJS, GenerateHtml, Guid, Initialize, Rename, Language.Elm, Binop, Combinators, Lexer, ParsePatterns, Parser, ParserLib, ParseTypes, Tokens,- Types, Constrain, Hints, Types, Unify+ Types, Constrain, Hints, Types, Unify, ExtractNoscript ghc-options: -O3 Build-depends: base >=4.2 && <5, containers >= 0.3, transformers >= 0.2, mtl >= 2, parsec >= 3.1.1, blaze-html == 0.5.0.*,@@ -69,4 +69,4 @@ other-modules: Ast, CompileToJS, GenerateHtml, Guid, Initialize, Rename, Binop, Combinators, Lexer, ParsePatterns, Parser, ParserLib, ParseTypes, Tokens,- Types, Constrain, Hints, Types, Unify+ Types, Constrain, Hints, Types, Unify, ExtractNoscript
src/Compiler.hs view
@@ -10,7 +10,7 @@ main = getArgs >>= parse parse ("--help":_) = putStrLn usage-parse ("--version":_) = putStrLn "The Elm Compiler 0.1.1.5"+parse ("--version":_) = putStrLn "The Elm Compiler 0.1.1.6" parse [loc,file] | "--runtime-location=" `isPrefixOf` loc = produceHtml (tail $ dropWhile (/='=') loc) file
+ src/ExtractNoscript.hs view
@@ -0,0 +1,26 @@++module ExtractNoscript (extract) where++import Ast++extract = concatMap (\s -> "<p>" ++ s ++ "</p>") . extract'++extract' expr = + let f = extract' in+ case expr of+ Str s -> [s]+ Binop op e1 e2 -> case (op, f e1, f e2) of+ ("++", [s1], [s2]) -> [s1 ++ s2]+ (_ , ss1 , ss2 ) -> ss1 ++ ss2+ Lambda v e -> f e+ App (App (Var "link") src) txt ->+ case (f src, f txt) of+ ([s1],[s2]) -> [ "<a href=\"" ++ s1 ++ "\">" ++ s2 ++ "</a>" ]+ ( ss1, ss2) -> ss1 ++ ss2+ App e1 e2 -> f e1 ++ f e2+ If eb et ef -> f et ++ f ef+ Let defs e -> concatMap (f . snd) defs ++ f e+ Var _ -> []+ Case e cases -> concatMap (f . snd) cases+ Data _ es -> concatMap f es+ _ -> []
src/Server.hs view
@@ -11,7 +11,7 @@ serve :: String -> IO () serve libLoc = do- putStrLn "Elm Server 0.1.1.5: running at <http://localhost:8000>"+ putStrLn "Elm Server 0.1.1.6: running at <http://localhost:8000>" simpleHTTP nullConf $ do compressedResponseFilter msum [ uriRest (serveElm libLoc)@@ -31,7 +31,7 @@ main = getArgs >>= parse parse ("--help":_) = putStrLn usage-parse ("--version":_) = putStrLn "The Elm Server 0.1.1.5"+parse ("--version":_) = putStrLn "The Elm Server 0.1.1.6" parse [] = serve "/elm-mini.js" parse [arg] | "--runtime-location=" `isPrefixOf` arg =