on master help sign in
Fix bugs with --make flag. Update new to version number. Make sure that all built-in modules are recognized by the compiler.
commiteb748ae6dfc6943131be3b220c8c5b080888ea47 authorevancz <info@elm-lang.org> dateWed 26 Sep 2012, 13:29 (14 years ago) parent9e82c6b
6 files changed+17−12
elm/Elm.cabal+2−2 elm/elm-runtime-0.4.0.1.js → elm/elm-runtime-0.4.0.2.js elm/src/Ast.hs+1 elm/src/Compiler.hs+7−6 elm/src/Gen/CompileToJS.hs+3−2 elm/src/Rename.hs+4−2
elm/Elm.cabal+2−2
@@ -1,6 +1,6 @@
11
22Name: Elm
3−Version: 0.4.0.1
3+Version: 0.4.0.2
44Synopsis: The Elm language module.
55Description: Elm aims to make client-side web-development more pleasant.
66 It is a statically/strongly typed, functional reactive
@@ -22,7 +22,7 @@ Category: Compiler, Language
2222Build-type: Simple
2323
2424Extra-source-files: changelog.txt
25−Data-files: elm-runtime-0.4.0.1.js
25+Data-files: elm-runtime-0.4.0.2.js
2626Cabal-version: >=1.8
2727
2828source-repository head
elm/elm-runtime-0.4.0.1.js → elm/elm-runtime-0.4.0.2.jsrenamed

The content is the same.

elm/src/Ast.hs+1
@@ -101,6 +101,7 @@ instance Show Expr where
101101 show (Fold e1 e2 e3) = concat [ "foldp ", show' e1, " ", show' e2, " ", show' e3 ]
102102 show (Async e) = "async " ++ show' e
103103 show (Input i) = i
104+ show (Markdown _) = "[markdown| ... |]"
104105
105106
106107instance Show Definition where
elm/src/Compiler.hs+7−6
@@ -40,11 +40,11 @@ elm = ELM { make = False &= help "automatically compile dependencies."
4040 , minify = False &= help "Minify generated JavaScript"
4141 } &=
4242 help "Compile Elm programs to HTML, CSS, and JavaScript." &=
43− summary "The Elm Compiler v0.4.0.1, (c) Evan Czaplicki"
43+ summary "The Elm Compiler v0.4.0.2, (c) Evan Czaplicki"
4444
4545main = do
4646 args <- cmdArgs elm
47− mini <- getDataFileName "elm-runtime-0.4.0.1.js"
47+ mini <- getDataFileName "elm-runtime-0.4.0.2.js"
4848 compileArgs mini args
4949
5050compileArgs mini (ELM _ [] _ _ _ _ _ _) =
@@ -100,9 +100,10 @@ toFilePath :: String -> FilePath
100100toFilePath modul = map (\c -> if c == '.' then '/' else c) modul ++ ".elm"
101101
102102builtInModules =
103− concat [ map ("Data."++) [ "List", "Char", "Maybe" ]
104− , map ("Signal."++) [ "Mouse", "Keyboard.Raw"
105− , "Window", "Time", "HTTP", "Input", "Random" ]
106− , [ "Element", "Text", "Color", "Line" ]
103+ concat [ map ("Data."++) [ "List", "Char", "Maybe" ]
104+ , map ("Signal."++) [ "Mouse", "Keyboard.Raw"
105+ , "Window", "Time", "HTTP", "Input", "Random" ]
106+ , map ("Graphics."++) [ "Element", "Text", "Color" ]
107+ , map ("Foreign.JavaScript"++) [ "", "JSON", "Experimental" ]
107108 , [ "Prelude" ]
108109 ]
elm/src/Gen/CompileToJS.hs+3−2
@@ -59,12 +59,13 @@ jsModule (escapees, Module names exports imports stmts) =
5959 modName = intercalate "." modNames
6060 includes = concatMap jsImport $ map (first ("ElmCode."++)) imports
6161 body = stmtsToJS stmts
62− export = getExports exps stmts
62+ export = getExports exports stmts
6363 exps = if null exports then ["main"] else exports
6464
6565getExports names stmts = ret . braces $ intercalate "," pairs
6666 where pairs = mapMaybe pair $ concatMap get stmts
67− pair x = if y `elem` names then Just $ y ++ ":" ++ x else Nothing
67+ pair x = if null names || y `elem` names then
68+ Just $ y ++ ":" ++ x else Nothing
6869 where y = derename x
6970 get s = case s of Def x _ _ -> [x]
7071 Datatype _ _ tcs -> map fst tcs
elm/src/Rename.hs+4−2
@@ -14,7 +14,7 @@ derename var
1414
1515rename :: Module -> Module
1616rename (Module name ex im stmts) =
17− Module name ex im . run $ renameStatements id stmts
17+ Module name ex im . run $ renameStatements deprime stmts
1818
1919renameStatements env stmts = do env' <- extends env $ concatMap getNames stmts
2020 mapM (renameStmt env') stmts
@@ -83,10 +83,12 @@ rename' env expr =
8383
8484 where rnm = rename' env
8585
86+deprime = map (\c -> if c == '\'' then '_' else c)
87+
8688extend :: (String -> String) -> String -> GuidCounter (String, String -> String)
8789extend env x = do
8890 n <- guid
89− let rx = map (\c -> if c == '\'' then '_' else c) $ x ++ "_" ++ show n
91+ let rx = deprime x ++ "_" ++ show n
9092 return (rx, \y -> if y == x then rx else env y)
9193
9294extends :: (String -> String) -> [String] -> GuidCounter (String -> String)