|
13 | 13 | :init-stats)) |
14 | 14 | (in-package :diff-backend) |
15 | 15 |
|
16 | | -(defvar *comment-table-1*) |
17 | | -(defvar *comment-table-2*) |
| 16 | +(defparameter *comment-table-1* nil) |
| 17 | +(defparameter *comment-table-2* nil) |
18 | 18 |
|
19 | 19 | (defun main () |
20 | 20 | (let ((cmd-args (uiop:command-line-arguments))) |
|
24 | 24 |
|
25 | 25 | (defun differ-v01 (file1 file2) |
26 | 26 | (init-stats) |
27 | | - (multiple-value-bind (res1 res2) |
28 | | - (compare-two-files file1 file2) |
29 | | - (generate-json-outputs res1 res2))) |
| 27 | + (let (*comment-table-1* |
| 28 | + *comment-table-2*) |
| 29 | + (multiple-value-bind (res1 res2) |
| 30 | + (compare-two-files file1 file2) |
| 31 | + (generate-json-outputs res1 res2)))) |
30 | 32 |
|
31 | 33 | (defun str-differ-v01 (str1 str2) |
32 | 34 | (init-stats) |
33 | | - (multiple-value-bind (res1 res2) |
34 | | - (compare-two-str str1 str2) |
35 | | - (generate-json-outputs res1 res2))) |
| 35 | + (let (*comment-table-1* |
| 36 | + *comment-table-2*) |
| 37 | + (multiple-value-bind (res1 res2) |
| 38 | + (compare-two-str str1 str2) |
| 39 | + (generate-json-outputs res1 res2)))) |
36 | 40 |
|
37 | 41 | (defun generate-json-outputs (res1 res2) |
38 | 42 | (when *comment-table-1* |
|
55 | 59 |
|
56 | 60 | (defun simple-differ-str (str1 str2 &optional (out1 t ) (out2 t) (out3 t)) |
57 | 61 | (init-stats) |
58 | | - (multiple-value-bind (res1 res2) |
59 | | - (compare-two-str str1 str2) |
60 | | - (when *comment-table-1* |
61 | | - (get-json-comments *comment-table-1* t)) |
62 | | - (when *comment-table-2* |
63 | | - (get-json-comments *comment-table-2* t)) |
64 | | - (get-json-res res1 out1) |
65 | | - (get-json-res res2 out2) |
66 | | - (get-stats-res out3))) |
| 62 | + (let (*comment-table-1* |
| 63 | + *comment-table-2*) |
| 64 | + (multiple-value-bind (res1 res2) |
| 65 | + (compare-two-str str1 str2) |
| 66 | + (when *comment-table-1* |
| 67 | + (get-json-comments *comment-table-1* t)) |
| 68 | + (when *comment-table-2* |
| 69 | + (get-json-comments *comment-table-2* t)) |
| 70 | + (get-json-res res1 out1) |
| 71 | + (get-json-res res2 out2) |
| 72 | + (get-stats-res out3)))) |
67 | 73 |
|
68 | 74 | (defun compare-two-files (filepath1 filepath2) |
69 | 75 | (let ((str1 (read-file-into-string filepath1)) |
|
0 commit comments