forked from openjdk/jdk
-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathREADME-diffing.el
More file actions
33 lines (28 loc) · 1.17 KB
/
Copy pathREADME-diffing.el
File metadata and controls
33 lines (28 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
;; Given a context diff between the Java JDK and the Checker Framework's
;; annotated JDK, run these commands to reduce the size of the diffs. Most
;; remaining diffs indicate an unintentional edit that should be reverted in the
;; annotated JDK.
(progn
(save-excursion
(goto-char (point-min))
(save-excursion
(delete-matching-lines "^\\+import org.checkerframework.*;$" nil nil t))
(save-excursion
(replace-string "\n \n+\n" "\n \n"))
(save-excursion
(delete-matching-lines (concat "^\\+" annotation-line-regex "$")))
(save-excursion
(query-replace-regexp "@[A-Z][A-Za-z0-9_]* " ""))
(save-excursion
(query-replace-regexp "@[A-Z][A-Za-z0-9_]*([^()\n]*) " ""))
(save-excursion
(query-replace " []" "[]"))
(save-excursion
(query-replace " ..." "..."))
(save-excursion
(query-replace-regexp " \\([A-Za-z0-9_]*(\\)[A-Z][A-Za-z0-9_.]*\\(<[A-Z]\\(, ?[A-Z]\\)*>\\)? this, " " \\1"))
(save-excursion
(query-replace-regexp " \\([A-Za-z0-9_]*(\\)[A-Z][A-Za-z0-9_.]*\\(<[A-Z]\\(, ?[A-Z]\\)*>\\)? this)" " \\1)"))
(save-excursion
(query-replace-regexp " extends Object\\([,>]\\)" "\\1"))
))