1. Sébastien Ferré
  2. Sewelis

Commits

Sébastien Ferré  committed 937f044

Small bug fixes

  • Participants
  • Parent commits 59ceeec
  • Branches master

Comments (0)

Files changed (3)

File src/lisql_concept.ml

View file
  • Ignore whitespace
   match np with
   | Det (det,f) -> Det (det, simpl_and_list (f::lf'))
   | NAnd l -> NAnd (List.map (descr_s1 lf') l)
-  | _ -> np
+  | NOr l -> NOr (List.map (descr_s1 lf') l)
+  | NNot np -> NNot (descr_s1 lf' np)
+  | NMaybe np -> NMaybe (descr_s1 lf' np)
 
 
 (* increments *)

File src/lisql_syntax.ml

View file
  • Ignore whitespace
 and parse_p1_seq = dcg "p1_seq"
     [ lc = LIST1 parse_p1 SEP parse_semicolon -> match lc with [] -> Thing | [c1] -> c1 | _ -> And lc ]
 and parse_p1 = dcg "p1"
-    [ "a"; _ = parse_space; a = parse_uri -> Type a
+    [ "a"; _ = parse_space; ( "thing" -> Thing | a = parse_uri -> Type a )
     | r = parse_p2; _ = parse_space; np = parse_s1 -> Role (r,np)
     | _ = parse_left_round_bracket; c1 = parse_p1;
 	( _ = parse_and; lc1 = LIST1 parse_p1 SEP parse_and; _ = parse_right_round_bracket -> And (c1::lc1)
     | And lc -> LIST0 print_p1 SEP print_semicolon of lc
     | c -> print_p1 of c ]
 and print_p1 = ipp
-    [ Type a -> "a"; print_space; print_uri of a
+    [ Thing -> "a"; print_space; "thing"
+    | Type a -> "a"; print_space; print_uri of a
     | Role (r,np) -> print_p2 of r; print_space; print_s1 of np
     | And lc -> "("; LIST1 print_p1 SEP " and " of lc; ")"
     | Or lc -> "("; LIST1 print_p1 SEP " or " of lc; ")"
 let print_to_string ?(ctx = new context) print_x =
   let p_eof = ipp [ x -> print_x of x; EOF ] in
   fun x -> Common.prof "Lisql.Syntax.print_to_string" (fun () ->
-    let buf_cursor = new Printer.buffer_cursor in
-    Ipp.once p_eof x buf_cursor ctx;
-    buf_cursor#contents)
+    try
+      let buf_cursor = new Printer.buffer_cursor in
+      Ipp.once p_eof x buf_cursor ctx;
+      buf_cursor#contents
+    with _ -> assert false)
 
 let string_of_name ?ctx = print_to_string ?ctx print_name
 let string_of_class ?ctx = print_to_string ?ctx print_block

File src/turtle.ml

View file
  • Ignore whitespace
 and print_dot = ipp [ _ -> " .\n" ]
 
 let output (out : out_channel) (turtle : turtle) = Common.prof "Turtle.output" (fun () ->
-  Ipp.once print_turtle turtle (Printer.cursor_of_formatter (Format.formatter_of_out_channel out)) ())
+  try Ipp.once print_turtle turtle (Printer.cursor_of_formatter (Format.formatter_of_out_channel out)) ()
+  with _ -> assert false)
 
 let print (turtle : turtle) : unit = Common.prof "Turtle.print" (fun () ->
-  Ipp.once print_turtle turtle (Printer.cursor_of_formatter Format.std_formatter) ())
+  try Ipp.once print_turtle turtle (Printer.cursor_of_formatter Format.std_formatter) ()
+  with _ -> assert false)
 
 let to_string turtle : string = Common.prof "Turtle.to_string" (fun () ->
-  let buf_cursor = new Printer.buffer_cursor in
-  Ipp.once print_turtle turtle buf_cursor ();
-  buf_cursor#contents)
+  try
+    let buf_cursor = new Printer.buffer_cursor in
+    Ipp.once print_turtle turtle buf_cursor ();
+    buf_cursor#contents
+  with _ -> assert false)
+