[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] externals/caml 6b7bd5d 073/197: changement .types -> .annot + f
From: |
Stefan Monnier |
Subject: |
[nongnu] externals/caml 6b7bd5d 073/197: changement .types -> .annot + format |
Date: |
Sat, 21 Nov 2020 01:19:41 -0500 (EST) |
branch: externals/caml
commit 6b7bd5dd7a33637cf9452f2b4b4c95f6e2b4011b
Author: Damien Doligez <damien.doligez-inria.fr>
Commit: Damien Doligez <damien.doligez-inria.fr>
changement .types -> .annot + format
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5594
f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
---
caml-types.el | 40 ++++++++++++++++++++++++++++++++++------
1 file changed, 34 insertions(+), 6 deletions(-)
diff --git a/caml-types.el b/caml-types.el
index 3a634e2..bfa99be 100644
--- a/caml-types.el
+++ b/caml-types.el
@@ -19,7 +19,7 @@
; Load this file in your emacs, then C-c C-t will show you the
; type of the expression (or pattern) that contains the cursor.
; The expression is highlighted in the current buffer.
-; The type is highlighted in "foo.types" (if your file is "foo.ml"),
+; The type is highlighted in "foo.annot" (if your file is "foo.ml"),
; which is convenient when the type doesn't fit on a line.
@@ -36,16 +36,43 @@
; in the file, up to where the type checker failed.
; . To get rid of the highlighting, put the cursor in a comment
; and type C-c C-t.
-; . The mark in the .types file is set to the beginning of the
+; . The mark in the foo.annot file is set to the beginning of the
; type, so you can type C-x C-x in that file to view the type.
; TO DO:
-; - make emacs scroll the .types file to show the type
+; - make emacs scroll the foo.annot file to show the type
; - (?) integrate this file into caml.el
-
+
+; Format of the *.annot files:
+
+; file ::= block *
+; block ::= position <SP> position <LF> annotation *
+; position ::= filename <SP> num <SP> num <SP> num
+; annotation ::= keyword open-paren <LF> <SP> <SP> data <LF> close-paren
+
+; <SP> is a space character (ASCII 0x20)
+; <LF> is a line-feed character (ASCII 0x0A)
+; num is a sequence of decimal digits
+; filename is a string with the lexical conventions of O'Caml
+; open-paren is an open parenthesis (ASCII 0x28)
+; close-paren is a closed parenthesis (ASCII 0x29)
+; data is any sequence of characters where <LF> is always followed by
+; at least two space characters.
+
+; in each block, the two positions are respectively the start and the
+; end of the range described by the block.
+; in a position, the filename is the name of the file, the first num
+; is the line number, the second num is the offset of the beginning
+; of the line, the third num is the offset of the position itself.
+; the char number within the line is the difference between the third
+; and second nums.
+
+; For the moment, the only possible keyword is "type".
+
+
; (global-set-key "\C-c\C-t" 'caml-types-show-type)
@@ -75,7 +102,7 @@
(target-bol (line-beginning-position))
(target-cnum (point))
(type-file (concat (file-name-sans-extension (buffer-file-name))
- ".types"))
+ ".annot"))
(type-date (nth 5 (file-attributes type-file)))
(type-buf (caml-types-find-file type-file)))
(if (caml-types-date< type-date target-date)
@@ -94,7 +121,8 @@
(right (caml-types-get-pos target-buf
(nth 2 loc) (nth 3 loc))))
(move-overlay caml-types-expr-ovl left right target-buf))
- (forward-line 2)
+ (re-search-forward "^type(") ;; not strictly correct
+ (forward-line 1)
(re-search-forward " \\(\\([^\n)]\\|.)\\|\n[^)]\\)*\\)\n)")
(move-overlay caml-types-type-ovl (match-beginning 1) (match-end 1)
type-buf)
- [nongnu] externals/caml c0b7050 163/197: caml-types.el: Cosmetic changes., (continued)
- [nongnu] externals/caml c0b7050 163/197: caml-types.el: Cosmetic changes., Stefan Monnier, 2020/11/21
- [nongnu] externals/caml f9a4fd4 177/197: makefiles: turn the 'install' command into a variable, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 2bc0b92 178/197: factorize common makefile definitions in Makefile.common, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 78b3169 182/197: Move config/Makefile to Makefile.config, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 9288416 183/197: Introduce and use ROOTDIR in more makefiles, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 1756296 140/197: PR#5137: caml-types-explore does not work, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 02303ea 147/197: PR#5727: emacs caml-mode indents shebang line in toplevel scripts, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 2c3dbdb 157/197: merge branch 4.02 from 4.02.1 (rev 15540) to a few fixes after 4.02.2 (rev 16205), Stefan Monnier, 2020/11/21
- [nongnu] externals/caml ed94de1 159/197: simplify .gitignore; remove .ignore files and tools/setignore; adjust tools/check-typo, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 66c8274 050/197: run caml directly, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 6b7bd5d 073/197: changement .types -> .annot + format,
Stefan Monnier <=
- [nongnu] externals/caml eb43a39 074/197: - compile-command in caml.le, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 5732aaa 077/197: Changes to caml-types.el:, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml e913a93 090/197: compatibilite emacs 20 + fichiers read-only, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml d17e3c1 094/197: caml-types: mouse track + little things, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml eb696b8 098/197: commentaires, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 2c4bb06 100/197: - Fixes in caml-help:, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 1527d9f 112/197: petit problem de doc, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 0e62e65 123/197: fixes bug 0005016--missing quote, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 70a5593 127/197: Undoing last commit by error., Stefan Monnier, 2020/11/21
- [nongnu] externals/caml d045fae 132/197: correct fontification for strings and comments, Stefan Monnier, 2020/11/21