Commit 452ebe6
committed
Merge branch 'develop-remove-parseSExpr'. Close #661.
**Description**
The function `copilot-theorem:Copilot.Theorem.Misc.SExpr.parseSExpr` is
not used anywhere in the implementation. The module is internal and not
exposed to the user, so that function does not have and cannot have any
users.
**Type**
- Bug: unused code included in the implementation.
**Additional context**
None.
**Requester**
- Ivan Perez.
**Method to check presence of bug**
The following search finds mentions of `parseSExpr` in the
implementation, showing only the definition:
```
$ grep -nHre 'parseSExpr' copilot**/src copilot**/tests
copilot-theorem/src/Copilot/Theorem/Misc/SExpr.hs:103:parseSExpr :: String -> Maybe (SExpr String)
copilot-theorem/src/Copilot/Theorem/Misc/SExpr.hs:104:parseSExpr str = case parse parser "" str of
```
**Expected result**
The string should be either empty (the function does not exist) or list
further uses.
The following dockerfile checks that `parseSExpr` is not mentioned
anywhere in the code, after which it prints the message "Success":
```Dockerfile
FROM ubuntu:jammy
RUN apt-get update
RUN apt-get install --yes git
SHELL ["/bin/bash", "-c"]
CMD git clone $REPO \
&& cd $NAME \
&& git checkout $COMMIT \
&& ! grep -nHre '\<parseSExpr\>' --include='*.hs' \
&& echo "Success"
```
Command (substitute variables based on new path after merge):
```
$ docker run -e "REPO=https://github.com/Copilot-Language/copilot" -e "NAME=copilot" -e "COMMIT=<HASH>" -it copilot-verify-661
```
**Solution implemented**
Remove the function `Copilot.Theorem.Misc.SExpr.parseSExpr`, as well as
any auxiliary functions or imports exclusively needed by that function,
if any.
Update Cabal file to remove any dependencies no longer necessary due to
the removal of `parseSExpr` and any auxiliary functions.
**Further notes**
None.File tree
3 files changed
+4
-37
lines changed- copilot-theorem
- src/Copilot/Theorem/Misc
3 files changed
+4
-37
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
1 | 4 | | |
2 | 5 | | |
3 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | 57 | | |
59 | 58 | | |
60 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
70 | 69 | | |
71 | 70 | | |
72 | 71 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
0 commit comments