diff -cr ocamlweb-1.37/main.ml ocamlweb-1.37-rml/main.ml *** ocamlweb-1.37/main.ml 2005-11-04 14:30:08.000000000 +0100 --- ocamlweb-1.37-rml/main.ml 2009-05-14 14:42:03.000000000 +0200 *************** *** 53,58 **** --- 53,59 ---- prerr_endline " -p insert something in LaTeX preamble"; prerr_endline " --files read file names to process in "; prerr_endline " --quiet quiet mode"; + prerr_endline " --rml ReactiveML mode"; prerr_endline " --no-greek disable use of greek letters for type variables"; prerr_endline ""; prerr_endline *************** *** 108,113 **** --- 109,118 ---- check_if_file_exists f; if check_suffix f ".ml" then File_impl (make_caml_file f) + else if check_suffix f ".rml" && !do_rml then + File_intf (make_caml_file f) + else if check_suffix f ".rmli" && !do_rml then + File_intf (make_caml_file f) else if check_suffix f ".mli" then File_intf (make_caml_file f) else if check_suffix f ".mll" then *************** *** 205,210 **** --- 210,218 ---- | ("-q" | "-quiet" | "--quiet") :: rem -> quiet := true; parse_rec rem + | ("--rml") :: rem -> + do_rml := true; parse_rec rem + | ("--nogreek" | "--no-greek") :: rem -> use_greek_letters := false; parse_rec rem diff -cr ocamlweb-1.37/output.ml ocamlweb-1.37-rml/output.ml *** ocamlweb-1.37/output.ml 2005-11-04 14:30:08.000000000 +0100 --- ocamlweb-1.37-rml/output.ml 2009-05-14 15:10:11.000000000 +0200 *************** *** 188,193 **** --- 188,201 ---- "mod"; "land"; "lor"; "lxor"; "lsl"; "lsr"; "asr" ] + let do_rml = ref false + + let is_rml_keyword = + build_table + [ "await"; "control"; "default"; "dopar"; "emit"; "gather"; + "immediate"; "last"; "loop"; "nothing"; "one"; "pause"; "pre"; + "present"; "process"; "run"; "signal"; "until" ] + let is_base_type = build_table [ "string"; "int"; "array"; "unit"; "bool"; "char"; "list"; "option"; *************** *** 204,209 **** --- 212,218 ---- let is_keyword s = is_base_type s || is_caml_keyword s + || (if !do_rml then is_rml_keyword s else false) let output_keyword s = *************** *** 353,360 **** enter_math (); output_string s | "&" | "&&" -> enter_math (); output_string "\\land{}" ! | "or" | "||" -> enter_math (); output_string "\\lor{}" | "not" -> enter_math (); output_string "\\lnot{}" | "[]" -> enter_math (); output_string "[\\,]" | "|" -> enter_math (); output_string "\\mid{}" --- 362,370 ---- enter_math (); output_string s | "&" | "&&" -> enter_math (); output_string "\\land{}" ! | "or" -> enter_math (); output_string "\\lor{}" + | "||" -> output_string (if !do_rml then "\ensuremath{||}" else "\\lor{}") | "not" -> enter_math (); output_string "\\lnot{}" | "[]" -> enter_math (); output_string "[\\,]" | "|" -> enter_math (); output_string "\\mid{}" diff -cr ocamlweb-1.37/output.mli ocamlweb-1.37-rml/output.mli *** ocamlweb-1.37/output.mli 2005-11-04 14:30:08.000000000 +0100 --- ocamlweb-1.37-rml/output.mli 2009-05-14 14:34:21.000000000 +0200 *************** *** 81,86 **** --- 81,88 ---- [output_ascii_char n] outputs the character of ASCII code [n]. *) + val do_rml : bool ref + type char_type = Upper | Lower | Symbol val what_is_first_char : string -> char_type