summaryrefslogtreecommitdiff
path: root/ide/gtk_parsing.ml
diff options
context:
space:
mode:
authorGravatar Enrico Tassi <gareuselesinge@debian.org>2015-01-25 14:42:51 +0100
committerGravatar Enrico Tassi <gareuselesinge@debian.org>2015-01-25 14:42:51 +0100
commit7cfc4e5146be5666419451bdd516f1f3f264d24a (patch)
treee4197645da03dc3c7cc84e434cc31d0a0cca7056 /ide/gtk_parsing.ml
parent420f78b2caeaaddc6fe484565b2d0e49c66888e5 (diff)
Imported Upstream version 8.5~beta1+dfsg
Diffstat (limited to 'ide/gtk_parsing.ml')
-rw-r--r--ide/gtk_parsing.ml33
1 files changed, 14 insertions, 19 deletions
diff --git a/ide/gtk_parsing.ml b/ide/gtk_parsing.ml
index 172e4609..abbd7e6d 100644
--- a/ide/gtk_parsing.ml
+++ b/ide/gtk_parsing.ml
@@ -1,13 +1,11 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2014 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2015 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
(************************************************************************)
-open Ideutils
-
let underscore = Glib.Utf8.to_unichar "_" ~pos:(ref 0)
let arobase = Glib.Utf8.to_unichar "@" ~pos:(ref 0)
let prime = Glib.Utf8.to_unichar "'" ~pos:(ref 0)
@@ -22,14 +20,12 @@ let is_word_char c =
let starts_word (it:GText.iter) =
- prerr_endline ("Starts word ? '"^(Glib.Utf8.from_unichar it#char)^"'");
- (not it#copy#nocopy#backward_char ||
- (let c = it#backward_char#char in
- not (is_word_char c)))
-
+ (it#is_start ||
+ (let c = it#backward_char#char in
+ not (is_word_char c)))
let ends_word (it:GText.iter) =
- (not it#copy#nocopy#forward_char ||
+ (it#is_end ||
let c = it#forward_char#char in
not (is_word_char c)
)
@@ -47,26 +43,25 @@ let is_on_word_limit (it:GText.iter) = inside_word it || ends_word it
let find_word_start (it:GText.iter) =
let rec step_to_start it =
- prerr_endline "Find word start";
+ Minilib.log "Find word start";
if not it#nocopy#backward_char then
- (prerr_endline "find_word_start: cannot backward"; it)
+ (Minilib.log "find_word_start: cannot backward"; it)
else if is_word_char it#char
then step_to_start it
else (it#nocopy#forward_char;
- prerr_endline ("Word start at: "^(string_of_int it#offset));it)
+ Minilib.log ("Word start at: "^(string_of_int it#offset));it)
in
step_to_start it#copy
-
let find_word_end (it:GText.iter) =
let rec step_to_end (it:GText.iter) =
- prerr_endline "Find word end";
+ Minilib.log "Find word end";
let c = it#char in
if c<>0 && is_word_char c then (
ignore (it#nocopy#forward_char);
step_to_end it
) else (
- prerr_endline ("Word end at: "^(string_of_int it#offset));
+ Minilib.log ("Word end at: "^(string_of_int it#offset));
it)
in
step_to_end it#copy
@@ -79,11 +74,11 @@ let get_word_around (it:GText.iter) =
let rec complete_backward w (it:GText.iter) =
- prerr_endline "Complete backward...";
+ Minilib.log "Complete backward...";
match it#backward_search w with
- | None -> (prerr_endline "backward_search failed";None)
+ | None -> (Minilib.log "backward_search failed";None)
| Some (start,stop) ->
- prerr_endline ("complete_backward got a match:"^(string_of_int start#offset)^(string_of_int stop#offset));
+ Minilib.log ("complete_backward got a match:"^(string_of_int start#offset)^(string_of_int stop#offset));
if starts_word start then
let ne = find_word_end stop in
if ne#compare stop = 0
@@ -93,7 +88,7 @@ let rec complete_backward w (it:GText.iter) =
let rec complete_forward w (it:GText.iter) =
- prerr_endline "Complete forward...";
+ Minilib.log "Complete forward...";
match it#forward_search w with
| None -> None
| Some (start,stop) ->