Sébastien Ferré avatar Sébastien Ferré committed 3d2d2a4

Bug fix about the definition of implicit functors.

Comments (0)

Files changed (3)

   | Is0 (_,c,k') -> Some (AtS (Is (np,c), k'))
   | Role1 (r,_,k') -> Some (AtP1 (Role (r,np), k'))
   | StructN (j,funct,args,k') ->
-      let args' = array_set_nth args (j-1) np in
-      Some (AtP1 (Struct (funct,args'), k'))
+      let args = array_set_nth args (j-1) np in
+      Some (AtP1 (Struct (funct,args), k'))
   | ArgN (j,funct,i,args,st,k') ->
-      let args' = array_set_nth args (j-1) np in
-      Some (AtP1 (Arg (funct,i,args',st), k'))
+      let args = array_set_nth args (j-1) np in
+      Some (AtP1 (Arg (funct,i,args,st), k'))
   | ArgT (funct,i,args,_,k') ->
       Some (AtP1 (Arg (funct,i,args,np), k'))
   | PredN (n,r,pred,args,k') ->
       if j >= Array.length args
       then None
       else
-	let args' = array_set_nth args (j-1) np in
-	Some (AtS1 (args.(j), StructN (j+1,funct,args',k')))
+	let args = array_set_nth args (j-1) np in
+	Some (AtS1 (args.(j), StructN (j+1,funct,args,k')))
   | ArgN (j,funct,i,args,st,k') ->
       let n = Array.length args in
-      let args' = array_set_nth args (j-1) np in
+      let args = array_set_nth args (j-1) np in
       if j >= n || (j = n-1 && i = n)
-      then Some (AtS1 (st, ArgT (funct,i,args',st,k')))
+      then Some (AtS1 (st, ArgT (funct,i,args,st,k')))
       else
 	let j' = if j+1 = i then i+1 else j+1 in
 	Some (AtS1 (args.(j'-1), ArgN (j',funct,i,args,st,k')))
       if j = 1
       then None
       else
-	let args' = array_set_nth args (j-1) np in
-	Some (AtS1 (args.(j-2), StructN (j-1,funct,args',k')))
+	let args = array_set_nth args (j-1) np in
+	Some (AtS1 (args.(j-2), StructN (j-1,funct,args,k')))
   | ArgN (j,funct,i,args,st,k') ->
       let j' = if j-1 = i then i-1 else j-1 in
       if j' < 1
       then None
       else
-	let args' = array_set_nth args (j-1) np in
-	Some (AtS1 (args.(j'-1), ArgN (j',funct,i,args',st,k')))
+	let args = array_set_nth args (j-1) np in
+	Some (AtS1 (args.(j'-1), ArgN (j',funct,i,args,st,k')))
   | ArgT (funct,i,args,_,k') ->
       let n = Array.length args in
       let j = if n = i then n-1 else n in
 let focus_of_s s = AtS (s, default_context_of_s s)
 let focus_of_s1 np = AtS1 (np, default_context_of_s1 np)
 let focus_of_p1 f = AtP1 (f, default_context_of_p1 f)
-(*
-  match focus_first_s NilS s with
-  | Some (AtP1 ((Var _ | Name _ as c1), Qu1 (Exists, _, Is0 (_,c2, NilS)))) -> AtP1 (c2, Is1 (Qu (Exists, c1), c2, NilS))
-  | Some foc -> foc
-  | None -> assert false
-*)
 
 let focus_of_p1 f = focus_of_s (Is (Det (top_s2, f), top_p1))
 

src/lisql_concept.ml

     else [InsertAnd; InsertOr; InsertAndNot; ToggleNot; ToggleMaybe; Select; Delete] in
   match foc with
   | AtS (s0,k) ->
-(*      let ltransf = InsertFeature Feature.Spec_Something :: InsertFeature Feature.Spec_Thing :: ltransf in *)
       let ltransf = ltransf_base (s0 = top_s) in
       let s = intent_s ~obs store gv s0 k in
       new concept_w0 ~obs store gv s ~ltransf ~insert_s1:true ~insert_p1:true
       let s = intent_s2 ~obs store gv det k in
       new concept ~obs store gv s Thing ~ltransf ~insert_s1:false ~insert_p1:false
   | AtP1 (f,k) ->
-(*      let ltransf = InsertFeature Feature.Spec_Something :: InsertFeature Feature.Spec_Thing :: ltransf in *)
       let ltransf = ltransf_base (f = top_p1) in
       let ltransf =
 	match k with

src/lisql_transf.ml

       else Some (AtP2 (Trans r, k))
   | _ -> None
 
-(* TODO: a tester *)
 let focus_define_struct define_functor ~(callback: focus option -> unit) : focus -> unit =
   let split_and l =
     let lt, l' = List.partition (function Type _ -> true | _ -> false) l in
     types, l_args, f_rest
   in
   function
-    | AtP1 (f,k) ->
+    | AtS1 (Det (det,f),k) ->
 	let is_arg, (types, l_args, f_rest) =
 	  match f with
 	  | Role (RAtom (Bwd, p), Det (Qu (An,None), And l)) ->
 		  Arg (funct, 1, args, an f_rest)
 		else
 		  simpl_and (Struct (funct, args)) f_rest in
-	      callback (Some (AtP1 (f',k))))
+	      callback (Some (AtS1 (Det (det,f'),k))))
     | _ -> ()
 
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.