OSDN Git Service

update error report
authormzp <mzpppp@gmail.com>
Sun, 8 Nov 2009 06:30:17 +0000 (15:30 +0900)
committermzp <mzpppp@gmail.com>
Sun, 8 Nov 2009 06:30:17 +0000 (15:30 +0900)
driver/main.ml
scm/filter/binding.ml
scm/main.ml

index 8781f13..b6270c3 100644 (file)
@@ -10,11 +10,9 @@ let m4_opt xs =
 
 
 let rules = [
-  one_to_one "scm" "ho" begin fun {scm = {scm_cmd=scm_cmd; includes=includes; link_std=link_std}} input output ->
-       [Printf.sprintf "%s -c -I %s -o %s %s %s"
-         scm_cmd includes output
-         (if link_std then "std.ho" else "")
-         input ]
+  one_to_one "scm" "ho" begin fun {scm = {scm_cmd=scm_cmd; includes=includes} } input output ->
+       [Printf.sprintf "%s -c -I %s -o %s %s"
+         scm_cmd includes output input ]
   end;
   many_to_one ["scm"] "abc" begin fun {scm = {scm_cmd=scm_cmd; includes=includes;link_std=link_std}} inputs output ->
     [Printf.sprintf "%s -I %s -o %s %s %s"
index 047f91e..8175814 100644 (file)
@@ -7,6 +7,7 @@ open Node
 exception Unbound_var    of (string list * string) Node.t
 exception Forbidden_var  of (string list * string) Node.t
 exception Unbound_method of string Node.t
+exception Unbound_module of string list Node.t
 
 (* ------------------------------
    environments
@@ -160,9 +161,12 @@ let rec bind_stmt exports env  stmt =
          env',`Class {c with
                         super = bind_qname env super;
                         methods   = methods'}
-    | `Open { Node.value = name}->
+    | `Open ({ Node.value = name} as m) ->
        (* fixme *)
-       {env with opened = (bind_module name env)::env.opened}, stmt
+       try
+         {env with opened = (bind_module name env)::env.opened}, stmt
+       with Not_found ->
+         raise @@ Unbound_module m
 
 let bind table program =
   let env = {
index 0aad647..f55b569 100644 (file)
@@ -55,7 +55,8 @@ let to_ast table input =
 let find includes file =
   try
     let inc =
-      List.find (fun inc -> Sys.file_exists @@ Filename.concat inc file)
+      List.find (fun inc ->
+                  Sys.file_exists @@ Filename.concat inc file)
        includes in
       Filename.concat inc file
   with Not_found ->