Skip to content

Commit

Permalink
[fix] compiler, database: Import database engine even if no user file…
Browse files Browse the repository at this point in the history
…s. Credt:Bug reported by Owen Gunden <owen () phauna org
  • Loading branch information
BourgerieQuentin committed Feb 27, 2012
1 parent 07aa7c6 commit 109fdf3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
5 changes: 2 additions & 3 deletions opa/pass_DbEngineImportation.ml
@@ -1,5 +1,5 @@
(*
Copyright © 2011 MLstate
Copyright © 2011, 2012 MLstate
This file is part of OPA.
Expand All @@ -22,7 +22,7 @@ module Db = QmlDbGen

let builtinpos = FilePos.nopos "Built in pass DbEngineImportation"

let process_code ~stdlib code =
let process_code ~stdlib =
if stdlib then (
let package = match QmlDbGen.Args.get_engine () with
| `db3 -> "stdlib.database.db3"
Expand All @@ -32,4 +32,3 @@ let process_code ~stdlib code =
ObjectFiles.add_compiler_package package;
)
;
code
4 changes: 2 additions & 2 deletions opa/pass_DbEngineImportation.mli
@@ -1,5 +1,5 @@
(*
Copyright © 2011 MLstate
Copyright © 2011, 2012 MLstate
This file is part of OPA.
Expand All @@ -19,4 +19,4 @@
(**
This pass import the database runtime if needed.
*)
val process_code : stdlib:bool -> ('ident, 'dir) SurfaceAst.code -> ('ident, 'dir) SurfaceAst.code
val process_code : stdlib:bool -> unit
10 changes: 2 additions & 8 deletions opa/s3Passes.ml
Expand Up @@ -510,15 +510,9 @@ let pass_Print =
let pass_DbEngineImportation =
PassHandler.make_pass
(fun e ->
let (a, user_files) = e.PH.env in
let stdlib = e.PH.options.O.stdlib in
let user_files = List.map
(fun pfile ->
{pfile with SurfaceAstPassesTypes.parsedFile_lcode =
Pass_DbEngineImportation.process_code ~stdlib
pfile.SurfaceAstPassesTypes.parsedFile_lcode}
) user_files in
{ e with PH.env = (a, user_files) }
Pass_DbEngineImportation.process_code ~stdlib;
e
)


Expand Down

0 comments on commit 109fdf3

Please sign in to comment.