Commit 3b1b248d authored by Julien Lopez's avatar Julien Lopez

Fix in parser

parent 82c9f052
......@@ -693,8 +693,9 @@ EXTEND Gram
char:
[
[ c = CHAR ->
Chars.V.mk_int (parse_char _loc c) ]
[ c = CHAR -> Chars.V.mk_int (parse_char _loc c)
| c = STRING2 -> Chars.V.mk_int (parse_char _loc c) ]
];
......
exit 0;;
include "list.cd"
let nb_success = ref Int (0)
let nb_tests = ref Int (0)
(* Note: We are using List.iter here *)
(* TODO: Bugfix: it works here if you replace 'a with 'b *)
let run_test_suite (l : [(Latin1, 'a, 'a)*]) : [] =
let run_test_suite (l : [(Latin1, 'a, 'a)*]) : [] =
iter (fun ((Latin1, 'a, 'a) -> []) (_, x, y) -> nb_tests := !nb_tests + 1;
if x = y then nb_success := !nb_success + 1 else []) l
;;
let run_test_suite (l : [(Latin1, 'a, 'a)*]) : [] = match l with
| [] -> []
| [(_, x, y) rest::(Latin1, 'a, 'a)*] -> nb_tests := !nb_tests + 1;
(if x = y then nb_success := !nb_success + 1);
run_test_suite rest
let run_test_suite_debug (l : [(Latin1, 'a, 'a)*]) : [] = match l with
| [] -> []
| [(msg, x, y) rest::(Latin1, 'a, 'a)*] -> nb_tests := !nb_tests + 1;
(if not (x = y) then print msg; print "\nExpected: "; print (string_of y);
print "\nGot:"; print (string_of x); print "\n"
else nb_success := !nb_success + 1); run_test_suite rest
(* Tests *)
......@@ -87,5 +70,3 @@ run_test_suite append_tests;
run_test_suite rev_append_tests;
run_test_suite concat_tests;
print (string_of !nb_success); print " / "; print (string_of !nb_tests)
Tuareg finished at Fri Jul 11 14:24:59
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment