--- src/gufoExpression.ml.orig 2020-03-29 00:19:15.000000000 +0800 +++ src/gufoExpression.ml 2025-10-18 13:22:24.000000000 +0800 @@ -17,7 +17,6 @@ Author: Pierre Vittet *) -open CamomileLibrary (******************************* EXPR ****************************************) (*expression manipulation: an expression is made from a zed_edit context *) @@ -27,7 +26,7 @@ let count_lines_str str = Zed_utf8.fold (fun achar acc -> - match UChar.uint_code achar with + match Uchar.to_int achar with | 0x000A (* newline *) -> acc + 1 | _ -> acc ) @@ -40,7 +39,7 @@ let count_lines_rope str = Zed_rope.fold (fun achar acc -> - match UChar.uint_code (Zed_char.core achar) with + match Uchar.to_int (Zed_char.core achar) with | 0x000A (* newline *) -> acc + 1 | _ -> acc ) @@ -88,13 +87,13 @@ let get_current_word expr = let row, col = get_coord expr in let curline = Zed_edit.get_line (Zed_edit.edit expr) row in - let curword = Zed_utf8.init 0 (fun i -> UChar.of_char ' ') in + let curword = Zed_utf8.init 0 (fun _ -> Uchar.of_int (Char.code ' ')) in let rec get_word rop pos curword = match pos with | -1 -> curword | _ -> (let curchar = Zed_rope.get rop pos in - match UChar.uint_code (Zed_char.core curchar) with + match Uchar.to_int (Zed_char.core curchar) with | i when ((i > 47 && i < 123) || i = 36 || i = 46 @@ -115,7 +114,7 @@ let (_,_, new_curs_col) = Zed_rope.fold (fun uchar (curs_row, curs_col, new_curs_col) -> - (match UChar.uint_code (Zed_char.core uchar) with + (match Uchar.to_int (Zed_char.core uchar) with | 0x000A | 0x000D (*newline *) -> (curs_row - 1, curs_col, new_curs_col) @@ -203,7 +202,3 @@ | i, j when i > j -> String.sub new_expr (first_fun_scope + 1) (String.length new_expr - first_fun_scope - 1), pos_expr - first_fun_scope | _ -> assert false - - - -