fixed some things

This commit is contained in:
Alexandre 2024-11-01 18:24:07 +01:00
parent 65a8580522
commit bce11572ef
9 changed files with 496 additions and 496 deletions

BIN
a.out

Binary file not shown.

BIN
main

Binary file not shown.

BIN
main.cmi

Binary file not shown.

BIN
main.cmo

Binary file not shown.

10
main.ml
View File

@ -1,5 +1,6 @@
let __prefixes__ = [|"let"; "rec"; "and"|] ;;
let __keywords__ = [|"let"; "while"; "do"; "done"; "for"; "to"; "begin"; "end"; "try"; "with"; "raise"; "in"|]
let __prefixes__ = [|"let"; "rec"; "and"; "for"; "mutable"|] ;;
let __keywords__ = [|"let"; "while"; "do"; "done"; "for"; "to"; "begin"; "end"; "try"; "with"; "raise"; "in"|] ;;
let fbd = [|' '; '\n'; '('; ')'; '['; ']'; '{'; '}'; ';'; ','; '.'; ':'; '*'; '|'; '-'; '+'; '*'; '/'; '='; '<'; '>'; '!'|] ;;
let concat_str (str : string ref) nstr =
let n = String.length nstr in
@ -30,7 +31,6 @@ let parse_the_whole_thing filename =
let is_an_integer ch =
Char.code ch >= 48 && Char.code ch <= 57 ;;
let fbd = [|' '; '\n'; '('; ')'; '['; ']'; '{'; '}'; ';'; ','; '.'; ':'; '*'; '|'; '-'; '+'; '='; '<'; '>'; '!'|] ;;
let to_list str =
let n = String.length str in
let rec aux acc i = match i with
@ -146,11 +146,11 @@ let convert filename ext =
let whole = parse_the_whole_thing (filename^"."^ext) in
(*Printf.printf "%s" whole ;*)
let words = to_list whole in
(*print_to_list words ;*)
print_to_list words ;
let fnames = detect_names words in
(*print_to_list fnames ;*)
let conversion_hash = generate_conversion_hash fnames in
Hashtbl.iter (fun k v -> Printf.printf "%s ----> %s\n" k v) conversion_hash ;
(*Hashtbl.iter (fun k v -> Printf.printf "%s ----> %s\n" k v) conversion_hash ;*)
write_out filename whole ext fnames conversion_hash ;;

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.