git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #1730 from hdgarrood/rename-psci-main

Rename default 'main' in psci

commitd9dbc9553e967b3b93783e9e8cc70c2c8e2d7376 authorPhil Freeman <paf31@cantab.net> dateSat 19 Dec 2015, 16:51 (11 years ago) parent3fb0e2450b4c6d
1 file changed+2−2
psci/PSCi.hs+2−2
psci/PSCi.hs+2−2
@@ -202,7 +202,7 @@ createTemporaryModule exec PSCiState{psciImportedModules = imports, psciLetBindi
202202 trace = P.Var (P.Qualified (Just supportModuleName) (P.Ident "eval"))
203203 mainValue = P.App trace (P.Var (P.Qualified Nothing (P.Ident "it")))
204204 itDecl = P.ValueDeclaration (P.Ident "it") P.Public [] $ Right val
205− mainDecl = P.ValueDeclaration (P.Ident "main") P.Public [] $ Right mainValue
205+ mainDecl = P.ValueDeclaration (P.Ident "$main") P.Public [] $ Right mainValue
206206 decls = if exec then [itDecl, mainDecl] else [itDecl]
207207 in
208208 P.Module (P.internalModuleSourceSpan "<internal>") [] moduleName ((importDecl `map` imports) ++ lets ++ decls) Nothing
@@ -269,7 +269,7 @@ handleExpression val = do
269269 case e of
270270 Left errs -> printErrors errs
271271 Right _ -> do
272− psciIO $ writeFile indexFile "require('$PSCI').main();"
272+ psciIO $ writeFile indexFile "require('$PSCI')['$main']();"
273273 process <- psciIO findNodeProcess
274274 result <- psciIO $ traverse (\node -> readProcessWithExitCode node nodeArgs "") process
275275 case result of