Skip to content

Commit 0562ee1

Browse files
committed
Fixed main.lisp
1 parent af02c06 commit 0562ee1

File tree

1 file changed

+23
-17
lines changed

1 file changed

+23
-17
lines changed

DiffBackend/src/main.lisp

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
:init-stats))
1414
(in-package :diff-backend)
1515

16-
(defvar *comment-table-1*)
17-
(defvar *comment-table-2*)
16+
(defparameter *comment-table-1* nil)
17+
(defparameter *comment-table-2* nil)
1818

1919
(defun main ()
2020
(let ((cmd-args (uiop:command-line-arguments)))
@@ -24,15 +24,19 @@
2424

2525
(defun differ-v01 (file1 file2)
2626
(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))))
3032

3133
(defun str-differ-v01 (str1 str2)
3234
(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))))
3640

3741
(defun generate-json-outputs (res1 res2)
3842
(when *comment-table-1*
@@ -55,15 +59,17 @@
5559

5660
(defun simple-differ-str (str1 str2 &optional (out1 t ) (out2 t) (out3 t))
5761
(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))))
6773

6874
(defun compare-two-files (filepath1 filepath2)
6975
(let ((str1 (read-file-into-string filepath1))

0 commit comments

Comments
 (0)