diff options
Diffstat (limited to 'ide')
| -rw-r--r-- | ide/coqide.opam | 19 | ||||
| -rw-r--r-- | ide/dune | 21 | ||||
| -rw-r--r-- | ide/dune-project | 3 | ||||
| -rw-r--r-- | ide/ideutils.ml | 17 | ||||
| -rw-r--r-- | ide/protocol/dune | 7 |
5 files changed, 60 insertions, 7 deletions
diff --git a/ide/coqide.opam b/ide/coqide.opam new file mode 100644 index 0000000000..1b46efdee2 --- /dev/null +++ b/ide/coqide.opam @@ -0,0 +1,19 @@ +opam-version: "1.2" +maintainer: "The Coq development team <coqdev@inria.fr>" +authors: "The Coq development team, INRIA, CNRS, and contributors." +homepage: "https://coq.inria.fr/" +bug-reports: "https://github.com/coq/coq/issues" +dev-repo: "https://github.com/coq/coq.git" +license: "LGPL-2.1" + +available: [ocaml-version >= "4.02.3"] + +depends: [ + "dune" { build } + "ocamlfind" { build } + "num" + "camlp5" + "coq" +] + +build: [ [ "dune" "build" "-p" package "-j" jobs ] ] diff --git a/ide/dune b/ide/dune new file mode 100644 index 0000000000..bceb981ed0 --- /dev/null +++ b/ide/dune @@ -0,0 +1,21 @@ +(executable + (name idetop) + (public_name coqidetop.opt) + (package coqide) + (modules idetop) + (libraries coq.toplevel coqide.protocol) + (link_flags -linkall)) + +(rule + (targets coqide_main.ml) + (deps (:ml4-file coqide_main.ml4)) + (action (run coqmlp5 -loc loc -impl %{ml4-file} -o %{targets}))) + +(executable + (name coqide_main) + (public_name coqide) + (package coqide) + (modules (:standard \ idetop)) + (libraries threads str lablgtk2.sourceview2 coq.lib coqide.protocol)) + +(ocamllex utf8_convert config_lexer coq_lex) diff --git a/ide/dune-project b/ide/dune-project new file mode 100644 index 0000000000..948dc59000 --- /dev/null +++ b/ide/dune-project @@ -0,0 +1,3 @@ +(lang dune 1.0) + +(name coqide-devel) diff --git a/ide/ideutils.ml b/ide/ideutils.ml index 960beb8455..7044263b94 100644 --- a/ide/ideutils.ml +++ b/ide/ideutils.ml @@ -71,15 +71,15 @@ let insert_xml ?(mark = `INSERT) ?(tags = []) (buf : #GText.buffer_skel) msg = let rmark = `MARK (buf#create_mark buf#start_iter) in (* insert the string, but don't apply diff highlights to white space at the begin/end of line *) let rec insert_str tags s = + let etags = try List.hd !dtags :: tags with hd -> tags in try - let _ = Str.search_forward nl_white_regex s 0 in + let start = Str.search_forward nl_white_regex s 0 in + insert_with_tags buf mark rmark etags (String.sub s 0 start); insert_with_tags buf mark rmark tags (Str.matched_group 1 s); let mend = Str.match_end () in insert_str tags (String.sub s mend (String.length s - mend)) - with Not_found -> begin - let etags = try List.hd !dtags :: tags with hd -> tags in + with Not_found -> insert_with_tags buf mark rmark etags s - end in let rec insert tags = function | PCData s -> insert_str tags s @@ -328,15 +328,18 @@ let coqtop_path () = | None -> try let new_prog = System.get_toplevel_path "coqidetop" in - if Sys.file_exists new_prog then new_prog + (* The file exists or it is to be found by path *) + if Sys.file_exists new_prog || + CString.equal Filename.(basename new_prog) new_prog + then new_prog else let in_macos_bundle = Filename.concat (Filename.dirname new_prog) (Filename.concat "../Resources/bin" (Filename.basename new_prog)) in if Sys.file_exists in_macos_bundle then in_macos_bundle - else "coqidetop" - with Not_found -> "coqidetop" + else "coqidetop.opt" + with Not_found -> "coqidetop.opt" in file (* In win32, when a command-line is to be executed via cmd.exe diff --git a/ide/protocol/dune b/ide/protocol/dune new file mode 100644 index 0000000000..9ce4559940 --- /dev/null +++ b/ide/protocol/dune @@ -0,0 +1,7 @@ +(library + (name protocol) + (public_name coqide.protocol) + (wrapped false) + (libraries coq.lib)) + +(ocamllex xml_lexer) |
